diff --git a/tasks/format-code-task-000102/environment/Dockerfile b/tasks/format-code-task-000102/environment/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..eaf1942fb866df5220583f357116ddcc7b30131a --- /dev/null +++ b/tasks/format-code-task-000102/environment/Dockerfile @@ -0,0 +1,3 @@ +# The task's image, pinned by digest (the same as [environment].docker_image). +# Setup runs at start from [environment.healthcheck]; environment/setup/ is its readable copy. +FROM docker.io/xiaomimimo/mimo-v2.6-rl-oss@sha256:4fd7f890d78d050c5505fed18089f91a9e48610085b8883956a4a2fac0fe9826 diff --git a/tasks/format-code-task-000102/environment/setup/files/blocklist b/tasks/format-code-task-000102/environment/setup/files/blocklist new file mode 100644 index 0000000000000000000000000000000000000000..a8e4bdc4c7d9b739c047a3cb58ea72a1bb05bcbc --- /dev/null +++ b/tasks/format-code-task-000102/environment/setup/files/blocklist @@ -0,0 +1,33 @@ +# mimo answer-leak blocklist (mimoagent) +0.0.0.0 github.com +0.0.0.0 www.github.com +0.0.0.0 api.github.com +0.0.0.0 raw.githubusercontent.com +0.0.0.0 codeload.github.com +0.0.0.0 objects.githubusercontent.com +0.0.0.0 gist.github.com +0.0.0.0 gist.githubusercontent.com +0.0.0.0 gitlab.com +0.0.0.0 bitbucket.org +0.0.0.0 sourceforge.net +0.0.0.0 git.kernel.org +0.0.0.0 chromium.googlesource.com +0.0.0.0 android.googlesource.com +0.0.0.0 sourcegraph.com +0.0.0.0 bugs.chromium.org +0.0.0.0 issues.oss-fuzz.com +0.0.0.0 oss-fuzz.com +0.0.0.0 osv.dev +0.0.0.0 api.osv.dev +0.0.0.0 bugzilla.mozilla.org +0.0.0.0 proxy.golang.org +0.0.0.0 sum.golang.org +0.0.0.0 pkg.go.dev +0.0.0.0 google.com +0.0.0.0 www.google.com +0.0.0.0 bing.com +0.0.0.0 www.bing.com +0.0.0.0 duckduckgo.com +0.0.0.0 html.duckduckgo.com +0.0.0.0 search.brave.com +0.0.0.0 stackoverflow.com diff --git a/tasks/format-code-task-000102/environment/setup/setup.sh b/tasks/format-code-task-000102/environment/setup/setup.sh new file mode 100644 index 0000000000000000000000000000000000000000..d883db90cfcfb48f7a139861bbe9f6b5d95cad6f --- /dev/null +++ b/tasks/format-code-task-000102/environment/setup/setup.sh @@ -0,0 +1,34 @@ +#!/bin/bash +# Runs once, as root, before the agent starts: Harbor's [environment.healthcheck] unpacks this folder into +# /var/lib/mimo and runs it. Generated by mimo_harbor; see its README for how each step maps to Xiaomi's harness. +M=/var/lib/mimo +[ -f "$M/ready" ] && exit 0 +chmod 700 "$M" +fail() { echo "setup: $*" >&2; exit 1; } +# the answer-leak blocklist (mimoagent), applied to /etc/hosts by the agent right after it installs +write_blocklist() { cp "$M/files/blocklist" "$M/blocklist"; } + +# Code: mimoagent environments/datasets/opensource_code.py + base.py, as the explorer runs it (app/runner/domains.py Code). +CWD=/testbed +git config --global --add safe.directory "$CWD" +cd "$CWD" || fail "no working directory $CWD" +if ! git rev-parse --git-dir >/dev/null 2>&1; then # a bare source tree: give it a baseline commit + git init -q && git add -A && git -c user.name=mimo -c user.email=mimo@localhost commit -q -m baseline --allow-empty +fi +BASE=$(git rev-parse HEAD 2>/dev/null) +[ ${#BASE} -eq 40 ] || fail "could not resolve the base commit in $CWD" +echo "$BASE" > "$M/base" +# Images are built with history truncated at the base. If one is not, the fix could be read out of git log, +# so .git is hidden while the agent works and put back for grading. +LATER=$(git rev-list --all --not "$BASE" 2>/dev/null | head -n 5 | grep -c . || true) +rm -f /tmp/fail.log /tmp/pass.log /tmp/patch.diff /tmp/test_patch.diff /tmp/*.log 2>/dev/null; rm -rf /tmp/claude-0 /tmp/claude-* /tmp/testem-* /tmp/puppeteer_dev_chrome_profile-* 2>/dev/null; rm -f /tmp/test_files.json 2>/dev/null; rm -rf /tmp/jest_* /tmp/jest-* /tmp/build /tmp/build_env 2>/dev/null; rm -rf /tmp/pytest-of-root /tmp/pytest-* /tmp/.pytest_cache /tmp/__pycache__ 2>/dev/null; rm -rf /tmp/go-build* /tmp/standards /tmp/wordpress /tmp/zig-* /tmp/testbase /tmp/testbed 2>/dev/null; rm -f /tmp/tmp*.tmp /tmp/*.bak /tmp/expect* /tmp/butwas* 2>/dev/null; rm -rf /root/.cache/go-build 2>/dev/null; rm -rf /tests 2>/dev/null; find /logs -mindepth 1 -delete 2>/dev/null; mkdir -p /logs/agent /logs/verifier /logs/artifacts; chmod 777 /logs/agent /logs/verifier /logs/artifacts; find /var/log -type f -delete 2>/dev/null || true; rm -rf /var/lib/postgresql/*/*/log /var/lib/postgresql/*/*/pg_log 2>/dev/null || true; find /var/lib/mysql /var/lib/mongodb -type f -name '*.log' -delete 2>/dev/null || true; rm -rf /root/.npm/_logs /root/.babel.json /root/.pytest_cache 2>/dev/null || true; find / -maxdepth 4 -xdev -name task_description.md -path '*/.build_env/*' -delete 2>/dev/null || true; true +git clean -fdx --exclude=node_modules --exclude=bower_components --exclude=.husky --exclude=vendor --exclude=third_party --exclude=_deps --exclude=vcpkg_installed --exclude=.venv --exclude=venv --exclude=.gradle --exclude=target --exclude=.build --exclude=lib --exclude=.bundle --exclude=Manifest.toml --exclude=_build --exclude=.stack-work --exclude=dist-newstyle >/dev/null 2>&1 +find /root/.m2 -type f \( -name '*-SNAPSHOT.jar' -o -name '*-SNAPSHOT-sources.jar' -o -name '*-SNAPSHOT-tests.jar' -o -name '*-SNAPSHOT-test-sources.jar' \) -delete 2>/dev/null; rm -rf /root/.julia/compiled 2>/dev/null; rm -rf /root/.gradle/caches/build-cache-* /root/.gradle/daemon 2>/dev/null; rm -rf /root/.gradle/caches/*/scripts /root/.gradle/caches/jars-* 2>/dev/null; rm -rf /root/.cache/bazel 2>/dev/null; true +if [ "$LATER" -gt 0 ]; then + mv "$CWD/.git" "$M/git-hidden" + echo "history not truncated at ${BASE:0:12}: .git hidden while the agent works" +fi +write_blocklist + +touch "$M/ready" +echo "setup done" diff --git a/tasks/format-code-task-000102/tests/test.patch b/tasks/format-code-task-000102/tests/test.patch new file mode 100644 index 0000000000000000000000000000000000000000..933a881846edd969e06f07f989fd65c1ef8ba341 --- /dev/null +++ b/tasks/format-code-task-000102/tests/test.patch @@ -0,0 +1,263 @@ +diff --git a/test_commands.json b/test_commands.json +new file mode 100644 +index 0000000..b4edd94 +--- /dev/null ++++ b/test_commands.json +@@ -0,0 +1,3 @@ ++{ ++ "test_commands": ["python -m pytest tests/unit/test_iam_user_format.py -v"] ++} +diff --git a/tests/unit/test_iam_user_format.py b/tests/unit/test_iam_user_format.py +new file mode 100644 +index 0000000..ddd723d +--- /dev/null ++++ b/tests/unit/test_iam_user_format.py +@@ -0,0 +1,235 @@ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++""" ++Tests for automatic IAM database username formatting. ++ ++These tests exercise the user-facing entry point Connector.connect(...) ++with enable_iam_auth=True and verify that the `user` kwarg passed down ++to the underlying driver is correctly formatted based on the Cloud SQL ++database engine version (Postgres vs. MySQL). ++""" ++import datetime ++from typing import Any, Dict ++ ++import pytest # noqa F401 Needed to run the tests ++from mock import patch ++ ++from google.cloud.sql.connector import Connector ++ ++ ++class _FakeMetadata: ++ ++ ++ def __init__(self, database_version: str) -> None: ++ self.database_version = database_version ++ self.context = None ++ self.ip_addrs = {"PRIMARY": "127.0.0.1"} ++ self.expiration = datetime.datetime.now() + datetime.timedelta(minutes=10) ++ ++ ++class _FakeInstance: ++ ++ ++ def __init__(self, database_version: str, enable_iam_auth: bool) -> None: ++ self._enable_iam_auth = enable_iam_auth ++ self._database_version = database_version ++ ++ async def connect_info(self, ip_type: Any) -> Any: ++ return _FakeMetadata(self._database_version), "127.0.0.1" ++ ++ async def close(self) -> None: ++ return None ++ ++ def force_refresh(self) -> None: ++ return None ++ ++ ++def _capture_driver_kwargs( ++ database_version: str, ++ driver: str, ++ user: str, ++ enable_iam_auth: bool = True, ++) -> Dict[str, Any]: ++ ++ ++ ++ ++ ++ ++ captured: Dict[str, Any] = {} ++ ++ def _fake_sync_connect(ip_address: str, ctx: Any, **kwargs: Any) -> Any: ++ captured.update(kwargs) ++ return "fake_connection" ++ ++ async def _fake_async_connect(ip_address: str, ctx: Any, **kwargs: Any) -> Any: ++ captured.update(kwargs) ++ return "fake_connection" ++ ++ connector = Connector(enable_iam_auth=enable_iam_auth) ++ try: ++ connect_string = "test-project:test-region:test-instance" ++ connector._instances[connect_string] = _FakeInstance( # type: ignore[assignment] ++ database_version, enable_iam_auth=enable_iam_auth ++ ) ++ with patch( ++ "google.cloud.sql.connector.pg8000.connect", ++ side_effect=_fake_sync_connect, ++ ), patch( ++ "google.cloud.sql.connector.pymysql.connect", ++ side_effect=_fake_sync_connect, ++ ), patch( ++ "google.cloud.sql.connector.asyncpg.connect", ++ side_effect=_fake_async_connect, ++ ): ++ connector.connect( ++ connect_string, ++ driver, ++ user=user, ++ password="my-pass", ++ db="my-db", ++ ) ++ finally: ++ ++ try: ++ connector.close() ++ except Exception: ++ pass ++ return captured ++ ++ ++ ++ ++ ++ ++ ++def test_postgres_iam_user_with_gserviceaccount_suffix_is_truncated() -> None: ++ ++ ++ ++ ++ ++ kwargs = _capture_driver_kwargs( ++ database_version="POSTGRES_14", ++ driver="pg8000", ++ user="test-user@my-project.iam.gserviceaccount.com", ++ ) ++ assert kwargs["user"] == "test-user@my-project.iam" ++ ++ ++def test_postgres_iam_user_without_suffix_is_unchanged() -> None: ++ ++ ++ ++ ++ kwargs = _capture_driver_kwargs( ++ database_version="POSTGRES_14", ++ driver="pg8000", ++ user="test-user@example.com", ++ ) ++ assert kwargs["user"] == "test-user@example.com" ++ ++ ++def test_postgres_iam_bare_username_is_unchanged() -> None: ++ ++ ++ ++ ++ kwargs = _capture_driver_kwargs( ++ database_version="POSTGRES_14", ++ driver="pg8000", ++ user="test-user", ++ ) ++ assert kwargs["user"] == "test-user" ++ ++ ++ ++ ++ ++ ++ ++def test_mysql_iam_user_with_at_sign_is_truncated() -> None: ++ ++ ++ ++ ++ kwargs = _capture_driver_kwargs( ++ database_version="MYSQL_8_0", ++ driver="pymysql", ++ user="test-user@gmail.com", ++ ) ++ assert kwargs["user"] == "test-user" ++ ++ ++def test_mysql_iam_service_account_user_is_truncated() -> None: ++ ++ ++ ++ ++ ++ kwargs = _capture_driver_kwargs( ++ database_version="MYSQL_8_0", ++ driver="pymysql", ++ user="my-sa@my-project.iam.gserviceaccount.com", ++ ) ++ assert kwargs["user"] == "my-sa" ++ ++ ++def test_mysql_iam_bare_username_is_unchanged() -> None: ++ ++ ++ ++ ++ kwargs = _capture_driver_kwargs( ++ database_version="MYSQL_8_0", ++ driver="pymysql", ++ user="test-user", ++ ) ++ assert kwargs["user"] == "test-user" ++ ++ ++ ++ ++ ++ ++ ++def test_postgres_no_iam_auth_user_is_unchanged() -> None: ++ ++ ++ ++ ++ ++ kwargs = _capture_driver_kwargs( ++ database_version="POSTGRES_14", ++ driver="pg8000", ++ user="test-user@my-project.iam.gserviceaccount.com", ++ enable_iam_auth=False, ++ ) ++ assert kwargs["user"] == "test-user@my-project.iam.gserviceaccount.com" ++ ++ ++def test_mysql_no_iam_auth_user_is_unchanged() -> None: ++ ++ ++ ++ ++ kwargs = _capture_driver_kwargs( ++ database_version="MYSQL_8_0", ++ driver="pymysql", ++ user="test-user@gmail.com", ++ enable_iam_auth=False, ++ ) ++ assert kwargs["user"] == "test-user@gmail.com" +diff --git a/mimo_test_command.sh b/mimo_test_command.sh +new file mode 100755 +--- /dev/null ++++ b/mimo_test_command.sh +@@ -0,0 +1,8 @@ ++#!/usr/bin/env bash ++ ++set -uo pipefail ++cd /testbed ++rc=0 ++python -m pytest -v -rA tests/unit/test_iam_user_format.py::test_postgres_iam_user_with_gserviceaccount_suffix_is_truncated tests/unit/test_iam_user_format.py::test_postgres_iam_user_without_suffix_is_unchanged tests/unit/test_iam_user_format.py::test_postgres_iam_bare_username_is_unchanged tests/unit/test_iam_user_format.py::test_mysql_iam_user_with_at_sign_is_truncated tests/unit/test_iam_user_format.py::test_mysql_iam_service_account_user_is_truncated tests/unit/test_iam_user_format.py::test_mysql_iam_bare_username_is_unchanged tests/unit/test_iam_user_format.py::test_postgres_no_iam_auth_user_is_unchanged tests/unit/test_iam_user_format.py::test_mysql_no_iam_auth_user_is_unchanged ++rc=$(( rc | $? )) ++exit $rc diff --git a/tasks/format-code-task-000102/tests/test.sh b/tasks/format-code-task-000102/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..b26ef92ebf9dad9577462e6b54a389fcb8d44b19 --- /dev/null +++ b/tasks/format-code-task-000102/tests/test.sh @@ -0,0 +1,39 @@ +#!/bin/bash +# Code grading, mimoagent opensource_code.py: reset the files the hidden test patch touches, apply it, run the +# task's test command; reward 1 when it exits 0. A testbed failure (reset or apply) writes no reward: not scored. +M=/var/lib/mimo +CWD=/testbed +V=/logs/verifier +mkdir -p "$V" +BASE=$(cat "$M/base" 2>/dev/null) || { echo "setup never ran (no $M/base)" >&2; exit 1; } +cd "$CWD" || exit 1 +if [ -d "$M/git-hidden" ]; then rm -rf "$CWD/.git"; mv "$M/git-hidden" "$CWD/.git"; fi +# the agent's change against the base, so its own commits count too +git add -A >/dev/null 2>&1 && git -c core.fileMode=false diff --cached "$BASE" > "$V/agent.diff" +git reset -q +if ! ( +while IFS= read -r tf; do + [ -z "$tf" ] && continue + if git cat-file -e $BASE:"$tf" 2>/dev/null; then + git checkout $BASE -- "$tf" 2>/dev/null || true + else + git rm -f --cached "$tf" >/dev/null 2>&1 || true + rm -f "$tf" + fi +done <<'EOF_RESET_TEST_FILES' +test_commands.json +tests/unit/test_iam_user_format.py +mimo_test_command.sh +EOF_RESET_TEST_FILES + +); then echo "could not reset the test files (testbed problem, not scored)" >&2; exit 1; fi +if ! git apply --verbose /tests/test.patch > "$V/apply.log" 2>&1; then + cat "$V/apply.log" >&2 + echo "the hidden tests could not be applied (testbed problem, not scored)" >&2 + exit 1 +fi +timeout 1800 sh -c "$(cat /tests/test_command.sh)" > "$V/test_output.log" 2>&1 +RC=$? +tail -c 12000 "$V/test_output.log" +if [ $RC -eq 0 ]; then echo 1 > "$V/reward.txt"; else echo 0 > "$V/reward.txt"; fi +echo "test command exited $RC" diff --git a/tasks/format-code-task-000102/tests/test_command.sh b/tasks/format-code-task-000102/tests/test_command.sh new file mode 100644 index 0000000000000000000000000000000000000000..7cb23076694ad17d72e8296d62b2b240083e36db --- /dev/null +++ b/tasks/format-code-task-000102/tests/test_command.sh @@ -0,0 +1 @@ +bash /testbed/mimo_test_command.sh \ No newline at end of file diff --git a/tasks/format-code-task-000111/environment/Dockerfile b/tasks/format-code-task-000111/environment/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..7e40de13147fd6c5c1110d26bf1110abcfe13849 --- /dev/null +++ b/tasks/format-code-task-000111/environment/Dockerfile @@ -0,0 +1,3 @@ +# The task's image, pinned by digest (the same as [environment].docker_image). +# Setup runs at start from [environment.healthcheck]; environment/setup/ is its readable copy. +FROM docker.io/xiaomimimo/mimo-v2.6-rl-oss@sha256:91fc2eabe54156d7e7ffeb84baffd9f4fd82ec4776b09b3c8aa029fc89023bfe diff --git a/tasks/format-code-task-000111/environment/setup/files/blocklist b/tasks/format-code-task-000111/environment/setup/files/blocklist new file mode 100644 index 0000000000000000000000000000000000000000..a8e4bdc4c7d9b739c047a3cb58ea72a1bb05bcbc --- /dev/null +++ b/tasks/format-code-task-000111/environment/setup/files/blocklist @@ -0,0 +1,33 @@ +# mimo answer-leak blocklist (mimoagent) +0.0.0.0 github.com +0.0.0.0 www.github.com +0.0.0.0 api.github.com +0.0.0.0 raw.githubusercontent.com +0.0.0.0 codeload.github.com +0.0.0.0 objects.githubusercontent.com +0.0.0.0 gist.github.com +0.0.0.0 gist.githubusercontent.com +0.0.0.0 gitlab.com +0.0.0.0 bitbucket.org +0.0.0.0 sourceforge.net +0.0.0.0 git.kernel.org +0.0.0.0 chromium.googlesource.com +0.0.0.0 android.googlesource.com +0.0.0.0 sourcegraph.com +0.0.0.0 bugs.chromium.org +0.0.0.0 issues.oss-fuzz.com +0.0.0.0 oss-fuzz.com +0.0.0.0 osv.dev +0.0.0.0 api.osv.dev +0.0.0.0 bugzilla.mozilla.org +0.0.0.0 proxy.golang.org +0.0.0.0 sum.golang.org +0.0.0.0 pkg.go.dev +0.0.0.0 google.com +0.0.0.0 www.google.com +0.0.0.0 bing.com +0.0.0.0 www.bing.com +0.0.0.0 duckduckgo.com +0.0.0.0 html.duckduckgo.com +0.0.0.0 search.brave.com +0.0.0.0 stackoverflow.com diff --git a/tasks/format-code-task-000111/environment/setup/setup.sh b/tasks/format-code-task-000111/environment/setup/setup.sh new file mode 100644 index 0000000000000000000000000000000000000000..d883db90cfcfb48f7a139861bbe9f6b5d95cad6f --- /dev/null +++ b/tasks/format-code-task-000111/environment/setup/setup.sh @@ -0,0 +1,34 @@ +#!/bin/bash +# Runs once, as root, before the agent starts: Harbor's [environment.healthcheck] unpacks this folder into +# /var/lib/mimo and runs it. Generated by mimo_harbor; see its README for how each step maps to Xiaomi's harness. +M=/var/lib/mimo +[ -f "$M/ready" ] && exit 0 +chmod 700 "$M" +fail() { echo "setup: $*" >&2; exit 1; } +# the answer-leak blocklist (mimoagent), applied to /etc/hosts by the agent right after it installs +write_blocklist() { cp "$M/files/blocklist" "$M/blocklist"; } + +# Code: mimoagent environments/datasets/opensource_code.py + base.py, as the explorer runs it (app/runner/domains.py Code). +CWD=/testbed +git config --global --add safe.directory "$CWD" +cd "$CWD" || fail "no working directory $CWD" +if ! git rev-parse --git-dir >/dev/null 2>&1; then # a bare source tree: give it a baseline commit + git init -q && git add -A && git -c user.name=mimo -c user.email=mimo@localhost commit -q -m baseline --allow-empty +fi +BASE=$(git rev-parse HEAD 2>/dev/null) +[ ${#BASE} -eq 40 ] || fail "could not resolve the base commit in $CWD" +echo "$BASE" > "$M/base" +# Images are built with history truncated at the base. If one is not, the fix could be read out of git log, +# so .git is hidden while the agent works and put back for grading. +LATER=$(git rev-list --all --not "$BASE" 2>/dev/null | head -n 5 | grep -c . || true) +rm -f /tmp/fail.log /tmp/pass.log /tmp/patch.diff /tmp/test_patch.diff /tmp/*.log 2>/dev/null; rm -rf /tmp/claude-0 /tmp/claude-* /tmp/testem-* /tmp/puppeteer_dev_chrome_profile-* 2>/dev/null; rm -f /tmp/test_files.json 2>/dev/null; rm -rf /tmp/jest_* /tmp/jest-* /tmp/build /tmp/build_env 2>/dev/null; rm -rf /tmp/pytest-of-root /tmp/pytest-* /tmp/.pytest_cache /tmp/__pycache__ 2>/dev/null; rm -rf /tmp/go-build* /tmp/standards /tmp/wordpress /tmp/zig-* /tmp/testbase /tmp/testbed 2>/dev/null; rm -f /tmp/tmp*.tmp /tmp/*.bak /tmp/expect* /tmp/butwas* 2>/dev/null; rm -rf /root/.cache/go-build 2>/dev/null; rm -rf /tests 2>/dev/null; find /logs -mindepth 1 -delete 2>/dev/null; mkdir -p /logs/agent /logs/verifier /logs/artifacts; chmod 777 /logs/agent /logs/verifier /logs/artifacts; find /var/log -type f -delete 2>/dev/null || true; rm -rf /var/lib/postgresql/*/*/log /var/lib/postgresql/*/*/pg_log 2>/dev/null || true; find /var/lib/mysql /var/lib/mongodb -type f -name '*.log' -delete 2>/dev/null || true; rm -rf /root/.npm/_logs /root/.babel.json /root/.pytest_cache 2>/dev/null || true; find / -maxdepth 4 -xdev -name task_description.md -path '*/.build_env/*' -delete 2>/dev/null || true; true +git clean -fdx --exclude=node_modules --exclude=bower_components --exclude=.husky --exclude=vendor --exclude=third_party --exclude=_deps --exclude=vcpkg_installed --exclude=.venv --exclude=venv --exclude=.gradle --exclude=target --exclude=.build --exclude=lib --exclude=.bundle --exclude=Manifest.toml --exclude=_build --exclude=.stack-work --exclude=dist-newstyle >/dev/null 2>&1 +find /root/.m2 -type f \( -name '*-SNAPSHOT.jar' -o -name '*-SNAPSHOT-sources.jar' -o -name '*-SNAPSHOT-tests.jar' -o -name '*-SNAPSHOT-test-sources.jar' \) -delete 2>/dev/null; rm -rf /root/.julia/compiled 2>/dev/null; rm -rf /root/.gradle/caches/build-cache-* /root/.gradle/daemon 2>/dev/null; rm -rf /root/.gradle/caches/*/scripts /root/.gradle/caches/jars-* 2>/dev/null; rm -rf /root/.cache/bazel 2>/dev/null; true +if [ "$LATER" -gt 0 ]; then + mv "$CWD/.git" "$M/git-hidden" + echo "history not truncated at ${BASE:0:12}: .git hidden while the agent works" +fi +write_blocklist + +touch "$M/ready" +echo "setup done" diff --git a/tasks/format-code-task-000111/tests/test.patch b/tasks/format-code-task-000111/tests/test.patch new file mode 100644 index 0000000000000000000000000000000000000000..6468ab8952095cef31631442828843799be15118 --- /dev/null +++ b/tasks/format-code-task-000111/tests/test.patch @@ -0,0 +1,111 @@ +diff --git a/test/datepicker_test.js b/test/datepicker_test.js +index cb89f1103a..0dbed586a0 100644 +--- a/test/datepicker_test.js ++++ b/test/datepicker_test.js +@@ -8,6 +8,7 @@ import Day from "../src/day"; + import TestWrapper from "./test_wrapper.jsx"; + import PopperComponent from "../src/popper_component.jsx"; + import TimezoneDatePicker from "./timezone_date_picker.jsx"; ++import CustomInput from "./helper_components/custom_input.jsx"; + import * as utils from "../src/date_utils"; + + function getKey(key) { +@@ -791,7 +792,44 @@ describe("DatePicker", () => { + datePicker.update(); + expect(datePicker.find("input").prop("value")).to.equal("1"); + }); +- ++ it("should call onChangeRaw with all arguments", () => { ++ const inputValue = "test"; ++ const onChangeRawSpy = sandbox.spy(); ++ const datePicker = TestUtils.renderIntoDocument( ++ } ++ onChangeRaw={onChangeRawSpy} ++ /> ++ ); ++ expect(onChangeRawSpy.called).to.be.false; ++ const input = ReactDOM.findDOMNode(datePicker.input); ++ input.value = inputValue; ++ TestUtils.Simulate.change(input); ++ expect(onChangeRawSpy.calledOnce).to.be.true; ++ expect(onChangeRawSpy.args[0][0].target.value).to.equal(inputValue); ++ expect(onChangeRawSpy.args[0][1]).to.equal("test"); ++ }); ++ it("should handle the lack of an 'event' object as the first argument to handleChange analogously to 'preventDefault' being called", () => { ++ const inputValue = "test"; ++ const onChangeRawSpy = sandbox.spy(); ++ let customInput = [e.target.value]} />; ++ const datePicker = TestUtils.renderIntoDocument( ++ ++ ); ++ expect(onChangeRawSpy.called).to.be.false; ++ const input = ReactDOM.findDOMNode(datePicker.input); ++ input.value = inputValue; ++ TestUtils.Simulate.change(input); ++ expect(onChangeRawSpy.calledOnce).to.be.true; ++ expect(onChangeRawSpy.args[0][0]).to.equal("test"); ++ }); + it("should handle a click outside of the calendar", () => { + const datePicker = mount( + +diff --git a/test/helper_components/custom_input.jsx b/test/helper_components/custom_input.jsx +new file mode 100644 +index 0000000000..4064b35d03 +--- /dev/null ++++ b/test/helper_components/custom_input.jsx +@@ -0,0 +1,25 @@ ++import React from "react"; ++import PropTypes from "prop-types"; ++ ++class CustomInput extends React.Component { ++ onChange(e) { ++ var args = [e, e.target.value]; ++ if (this.props.onChangeArgs) { ++ args = this.props.onChangeArgs(e); ++ } ++ this.props.onChange.apply(this, args); ++ } ++ ++ render() { ++ let { ...props } = this.props; ++ delete props.onChangeArgs; ++ return ++ } ++} ++ ++CustomInput.propTypes = { ++ onChange: PropTypes.func, ++ onChangeArgs: PropTypes.func ++}; ++ ++export default CustomInput; +\ No newline at end of file +diff --git a/mimo_build_env.tar.gz.b64 b/mimo_build_env.tar.gz.b64 +new file mode 100644 +--- /dev/null ++++ b/mimo_build_env.tar.gz.b64 +@@ -0,0 +1,5 @@ ++H4sIAAAAAAAAA+3SQU/DIBQH8J77KTCeSwGlO3lz1+22awMtc50rLECXfnxpTdSY6C5bjPr/Xd7L ++g4QHD6qH7tDWxp7K7FpYspByjsnnOOdcCiYW4q5iImOcV6lE5NU6+mAIUXlCMu9c/G7fufVfir7P ++P5oQ68b1vbItDbvLnXFu/vyev81fpjwVKi4ywi7Xwtf++fxvb0rd2VKrsMublsyfQJs2N+PR+UhW ++68dlvVxtHqZ6Pp62uvCDJfY4kmfle0Wm14uvOW2c3dJ9IEUROvt0MNPW/KcvCAAAAAAAAAAAAAAA ++AAAAAADwh70AVONooQAoAAA= +diff --git a/mimo_test_command.sh b/mimo_test_command.sh +new file mode 100755 +--- /dev/null ++++ b/mimo_test_command.sh +@@ -0,0 +1,6 @@ ++#!/usr/bin/env bash ++ ++set -uo pipefail ++cd /testbed || exit 1 ++base64 -d mimo_build_env.tar.gz.b64 | tar -xzf - -C /testbed || exit 1 ++exec bash -lc 'cd /testbed && bash -eo pipefail /testbed/.build_env/test_command.sh' diff --git a/tasks/format-code-task-000111/tests/test.sh b/tasks/format-code-task-000111/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..fdd5fbe0076d389b8aacabf435069a813b64387f --- /dev/null +++ b/tasks/format-code-task-000111/tests/test.sh @@ -0,0 +1,40 @@ +#!/bin/bash +# Code grading, mimoagent opensource_code.py: reset the files the hidden test patch touches, apply it, run the +# task's test command; reward 1 when it exits 0. A testbed failure (reset or apply) writes no reward: not scored. +M=/var/lib/mimo +CWD=/testbed +V=/logs/verifier +mkdir -p "$V" +BASE=$(cat "$M/base" 2>/dev/null) || { echo "setup never ran (no $M/base)" >&2; exit 1; } +cd "$CWD" || exit 1 +if [ -d "$M/git-hidden" ]; then rm -rf "$CWD/.git"; mv "$M/git-hidden" "$CWD/.git"; fi +# the agent's change against the base, so its own commits count too +git add -A >/dev/null 2>&1 && git -c core.fileMode=false diff --cached "$BASE" > "$V/agent.diff" +git reset -q +if ! ( +while IFS= read -r tf; do + [ -z "$tf" ] && continue + if git cat-file -e $BASE:"$tf" 2>/dev/null; then + git checkout $BASE -- "$tf" 2>/dev/null || true + else + git rm -f --cached "$tf" >/dev/null 2>&1 || true + rm -f "$tf" + fi +done <<'EOF_RESET_TEST_FILES' +test/datepicker_test.js +test/helper_components/custom_input.jsx +mimo_build_env.tar.gz.b64 +mimo_test_command.sh +EOF_RESET_TEST_FILES + +); then echo "could not reset the test files (testbed problem, not scored)" >&2; exit 1; fi +if ! git apply --verbose /tests/test.patch > "$V/apply.log" 2>&1; then + cat "$V/apply.log" >&2 + echo "the hidden tests could not be applied (testbed problem, not scored)" >&2 + exit 1 +fi +timeout 1800 sh -c "$(cat /tests/test_command.sh)" > "$V/test_output.log" 2>&1 +RC=$? +tail -c 12000 "$V/test_output.log" +if [ $RC -eq 0 ]; then echo 1 > "$V/reward.txt"; else echo 0 > "$V/reward.txt"; fi +echo "test command exited $RC" diff --git a/tasks/format-code-task-000111/tests/test_command.sh b/tasks/format-code-task-000111/tests/test_command.sh new file mode 100644 index 0000000000000000000000000000000000000000..7cb23076694ad17d72e8296d62b2b240083e36db --- /dev/null +++ b/tasks/format-code-task-000111/tests/test_command.sh @@ -0,0 +1 @@ +bash /testbed/mimo_test_command.sh \ No newline at end of file diff --git a/tasks/format-code-task-000116/environment/Dockerfile b/tasks/format-code-task-000116/environment/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..39a2bd9f166681b16a880cb64feb81d40e46d389 --- /dev/null +++ b/tasks/format-code-task-000116/environment/Dockerfile @@ -0,0 +1,3 @@ +# The task's image, pinned by digest (the same as [environment].docker_image). +# Setup runs at start from [environment.healthcheck]; environment/setup/ is its readable copy. +FROM docker.io/xiaomimimo/mimo-v2.6-rl-oss@sha256:5191cba7cf2ae83979e1f2b4460656d03341fb022b6147bb02072ab355d3a457 diff --git a/tasks/format-code-task-000116/environment/setup/files/blocklist b/tasks/format-code-task-000116/environment/setup/files/blocklist new file mode 100644 index 0000000000000000000000000000000000000000..a8e4bdc4c7d9b739c047a3cb58ea72a1bb05bcbc --- /dev/null +++ b/tasks/format-code-task-000116/environment/setup/files/blocklist @@ -0,0 +1,33 @@ +# mimo answer-leak blocklist (mimoagent) +0.0.0.0 github.com +0.0.0.0 www.github.com +0.0.0.0 api.github.com +0.0.0.0 raw.githubusercontent.com +0.0.0.0 codeload.github.com +0.0.0.0 objects.githubusercontent.com +0.0.0.0 gist.github.com +0.0.0.0 gist.githubusercontent.com +0.0.0.0 gitlab.com +0.0.0.0 bitbucket.org +0.0.0.0 sourceforge.net +0.0.0.0 git.kernel.org +0.0.0.0 chromium.googlesource.com +0.0.0.0 android.googlesource.com +0.0.0.0 sourcegraph.com +0.0.0.0 bugs.chromium.org +0.0.0.0 issues.oss-fuzz.com +0.0.0.0 oss-fuzz.com +0.0.0.0 osv.dev +0.0.0.0 api.osv.dev +0.0.0.0 bugzilla.mozilla.org +0.0.0.0 proxy.golang.org +0.0.0.0 sum.golang.org +0.0.0.0 pkg.go.dev +0.0.0.0 google.com +0.0.0.0 www.google.com +0.0.0.0 bing.com +0.0.0.0 www.bing.com +0.0.0.0 duckduckgo.com +0.0.0.0 html.duckduckgo.com +0.0.0.0 search.brave.com +0.0.0.0 stackoverflow.com diff --git a/tasks/format-code-task-000116/environment/setup/setup.sh b/tasks/format-code-task-000116/environment/setup/setup.sh new file mode 100644 index 0000000000000000000000000000000000000000..d883db90cfcfb48f7a139861bbe9f6b5d95cad6f --- /dev/null +++ b/tasks/format-code-task-000116/environment/setup/setup.sh @@ -0,0 +1,34 @@ +#!/bin/bash +# Runs once, as root, before the agent starts: Harbor's [environment.healthcheck] unpacks this folder into +# /var/lib/mimo and runs it. Generated by mimo_harbor; see its README for how each step maps to Xiaomi's harness. +M=/var/lib/mimo +[ -f "$M/ready" ] && exit 0 +chmod 700 "$M" +fail() { echo "setup: $*" >&2; exit 1; } +# the answer-leak blocklist (mimoagent), applied to /etc/hosts by the agent right after it installs +write_blocklist() { cp "$M/files/blocklist" "$M/blocklist"; } + +# Code: mimoagent environments/datasets/opensource_code.py + base.py, as the explorer runs it (app/runner/domains.py Code). +CWD=/testbed +git config --global --add safe.directory "$CWD" +cd "$CWD" || fail "no working directory $CWD" +if ! git rev-parse --git-dir >/dev/null 2>&1; then # a bare source tree: give it a baseline commit + git init -q && git add -A && git -c user.name=mimo -c user.email=mimo@localhost commit -q -m baseline --allow-empty +fi +BASE=$(git rev-parse HEAD 2>/dev/null) +[ ${#BASE} -eq 40 ] || fail "could not resolve the base commit in $CWD" +echo "$BASE" > "$M/base" +# Images are built with history truncated at the base. If one is not, the fix could be read out of git log, +# so .git is hidden while the agent works and put back for grading. +LATER=$(git rev-list --all --not "$BASE" 2>/dev/null | head -n 5 | grep -c . || true) +rm -f /tmp/fail.log /tmp/pass.log /tmp/patch.diff /tmp/test_patch.diff /tmp/*.log 2>/dev/null; rm -rf /tmp/claude-0 /tmp/claude-* /tmp/testem-* /tmp/puppeteer_dev_chrome_profile-* 2>/dev/null; rm -f /tmp/test_files.json 2>/dev/null; rm -rf /tmp/jest_* /tmp/jest-* /tmp/build /tmp/build_env 2>/dev/null; rm -rf /tmp/pytest-of-root /tmp/pytest-* /tmp/.pytest_cache /tmp/__pycache__ 2>/dev/null; rm -rf /tmp/go-build* /tmp/standards /tmp/wordpress /tmp/zig-* /tmp/testbase /tmp/testbed 2>/dev/null; rm -f /tmp/tmp*.tmp /tmp/*.bak /tmp/expect* /tmp/butwas* 2>/dev/null; rm -rf /root/.cache/go-build 2>/dev/null; rm -rf /tests 2>/dev/null; find /logs -mindepth 1 -delete 2>/dev/null; mkdir -p /logs/agent /logs/verifier /logs/artifacts; chmod 777 /logs/agent /logs/verifier /logs/artifacts; find /var/log -type f -delete 2>/dev/null || true; rm -rf /var/lib/postgresql/*/*/log /var/lib/postgresql/*/*/pg_log 2>/dev/null || true; find /var/lib/mysql /var/lib/mongodb -type f -name '*.log' -delete 2>/dev/null || true; rm -rf /root/.npm/_logs /root/.babel.json /root/.pytest_cache 2>/dev/null || true; find / -maxdepth 4 -xdev -name task_description.md -path '*/.build_env/*' -delete 2>/dev/null || true; true +git clean -fdx --exclude=node_modules --exclude=bower_components --exclude=.husky --exclude=vendor --exclude=third_party --exclude=_deps --exclude=vcpkg_installed --exclude=.venv --exclude=venv --exclude=.gradle --exclude=target --exclude=.build --exclude=lib --exclude=.bundle --exclude=Manifest.toml --exclude=_build --exclude=.stack-work --exclude=dist-newstyle >/dev/null 2>&1 +find /root/.m2 -type f \( -name '*-SNAPSHOT.jar' -o -name '*-SNAPSHOT-sources.jar' -o -name '*-SNAPSHOT-tests.jar' -o -name '*-SNAPSHOT-test-sources.jar' \) -delete 2>/dev/null; rm -rf /root/.julia/compiled 2>/dev/null; rm -rf /root/.gradle/caches/build-cache-* /root/.gradle/daemon 2>/dev/null; rm -rf /root/.gradle/caches/*/scripts /root/.gradle/caches/jars-* 2>/dev/null; rm -rf /root/.cache/bazel 2>/dev/null; true +if [ "$LATER" -gt 0 ]; then + mv "$CWD/.git" "$M/git-hidden" + echo "history not truncated at ${BASE:0:12}: .git hidden while the agent works" +fi +write_blocklist + +touch "$M/ready" +echo "setup done" diff --git a/tasks/format-code-task-000116/tests/test.patch b/tasks/format-code-task-000116/tests/test.patch new file mode 100644 index 0000000000000000000000000000000000000000..140bbd4280bb225c1cfd1858e4309dcf78c58df8 --- /dev/null +++ b/tasks/format-code-task-000116/tests/test.patch @@ -0,0 +1,36 @@ +diff --git a/hypothesis-python/tests/cover/test_lookup_py39.py b/hypothesis-python/tests/cover/test_lookup_py39.py +index c860cd3bce..0cd538289b 100644 +--- a/hypothesis-python/tests/cover/test_lookup_py39.py ++++ b/hypothesis-python/tests/cover/test_lookup_py39.py +@@ -149,3 +149,11 @@ def test_only_tuple_subclasses_in_typing_type(): + with temp_registered(FooableConcrete, st.builds(FooableConcrete)): + s = st.from_type(Fooable[int]) + assert_all_examples(s, lambda x: type(x) is FooableConcrete) ++ ++ ++def test_lookup_registered_tuple(): ++ sentinel = object() ++ typ = tuple[int] ++ with temp_registered(tuple, st.just(sentinel)): ++ assert st.from_type(typ).example() is sentinel ++ assert st.from_type(typ).example() is not sentinel +diff --git a/mimo_build_env.tar.gz.b64 b/mimo_build_env.tar.gz.b64 +new file mode 100644 +--- /dev/null ++++ b/mimo_build_env.tar.gz.b64 +@@ -0,0 +1,4 @@ ++H4sIAAAAAAAAA+3SUYrCMBSF4T67imygNWmMMqsp2gYqY5vQpIXufkKFUQT1RRkG/+8ll+RCbjgp ++DuPx1FS2n9bZu8hkZ8yyJrfrUitTKrU1Sssyk0qZncmEedtEV8YQ94MQ2eBcfNT37PyfKi75Rxti ++Vbuu2/dNEdrX3fEsf1Xq3/yVVin/zVam/OXrRrjvw/OvG7EEf7DNys+xdb0WeSdSmTZFO3sXWxuO ++IT8fLr1hXbvJDucPc3Lue/SVn/VX4WeRT6u/fhIAAAAAAAAAAAAAAADwMX4AzZsw0wAoAAA= +diff --git a/mimo_test_command.sh b/mimo_test_command.sh +new file mode 100755 +--- /dev/null ++++ b/mimo_test_command.sh +@@ -0,0 +1,6 @@ ++#!/usr/bin/env bash ++ ++set -uo pipefail ++cd /testbed || exit 1 ++base64 -d mimo_build_env.tar.gz.b64 | tar -xzf - -C /testbed || exit 1 ++exec bash -lc 'cd /testbed && bash -eo pipefail /testbed/.build_env/test_command.sh' diff --git a/tasks/format-code-task-000116/tests/test.sh b/tasks/format-code-task-000116/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..b469ed7a87e8f1d8349cc8054ba3f556c774c5d8 --- /dev/null +++ b/tasks/format-code-task-000116/tests/test.sh @@ -0,0 +1,39 @@ +#!/bin/bash +# Code grading, mimoagent opensource_code.py: reset the files the hidden test patch touches, apply it, run the +# task's test command; reward 1 when it exits 0. A testbed failure (reset or apply) writes no reward: not scored. +M=/var/lib/mimo +CWD=/testbed +V=/logs/verifier +mkdir -p "$V" +BASE=$(cat "$M/base" 2>/dev/null) || { echo "setup never ran (no $M/base)" >&2; exit 1; } +cd "$CWD" || exit 1 +if [ -d "$M/git-hidden" ]; then rm -rf "$CWD/.git"; mv "$M/git-hidden" "$CWD/.git"; fi +# the agent's change against the base, so its own commits count too +git add -A >/dev/null 2>&1 && git -c core.fileMode=false diff --cached "$BASE" > "$V/agent.diff" +git reset -q +if ! ( +while IFS= read -r tf; do + [ -z "$tf" ] && continue + if git cat-file -e $BASE:"$tf" 2>/dev/null; then + git checkout $BASE -- "$tf" 2>/dev/null || true + else + git rm -f --cached "$tf" >/dev/null 2>&1 || true + rm -f "$tf" + fi +done <<'EOF_RESET_TEST_FILES' +hypothesis-python/tests/cover/test_lookup_py39.py +mimo_build_env.tar.gz.b64 +mimo_test_command.sh +EOF_RESET_TEST_FILES + +); then echo "could not reset the test files (testbed problem, not scored)" >&2; exit 1; fi +if ! git apply --verbose /tests/test.patch > "$V/apply.log" 2>&1; then + cat "$V/apply.log" >&2 + echo "the hidden tests could not be applied (testbed problem, not scored)" >&2 + exit 1 +fi +timeout 1800 sh -c "$(cat /tests/test_command.sh)" > "$V/test_output.log" 2>&1 +RC=$? +tail -c 12000 "$V/test_output.log" +if [ $RC -eq 0 ]; then echo 1 > "$V/reward.txt"; else echo 0 > "$V/reward.txt"; fi +echo "test command exited $RC" diff --git a/tasks/format-code-task-000116/tests/test_command.sh b/tasks/format-code-task-000116/tests/test_command.sh new file mode 100644 index 0000000000000000000000000000000000000000..7cb23076694ad17d72e8296d62b2b240083e36db --- /dev/null +++ b/tasks/format-code-task-000116/tests/test_command.sh @@ -0,0 +1 @@ +bash /testbed/mimo_test_command.sh \ No newline at end of file diff --git a/tasks/format-code-task-000118/environment/Dockerfile b/tasks/format-code-task-000118/environment/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..230c8d382138bd5088bd2702ce7a34cf78ec8b07 --- /dev/null +++ b/tasks/format-code-task-000118/environment/Dockerfile @@ -0,0 +1,3 @@ +# The task's image, pinned by digest (the same as [environment].docker_image). +# Setup runs at start from [environment.healthcheck]; environment/setup/ is its readable copy. +FROM docker.io/xiaomimimo/mimo-v2.6-rl-oss@sha256:8a9c417e8edbb35e8fce0b69d414a66f65f9dcf2e590aad579725a52f39263d0 diff --git a/tasks/format-code-task-000118/environment/setup/files/blocklist b/tasks/format-code-task-000118/environment/setup/files/blocklist new file mode 100644 index 0000000000000000000000000000000000000000..a8e4bdc4c7d9b739c047a3cb58ea72a1bb05bcbc --- /dev/null +++ b/tasks/format-code-task-000118/environment/setup/files/blocklist @@ -0,0 +1,33 @@ +# mimo answer-leak blocklist (mimoagent) +0.0.0.0 github.com +0.0.0.0 www.github.com +0.0.0.0 api.github.com +0.0.0.0 raw.githubusercontent.com +0.0.0.0 codeload.github.com +0.0.0.0 objects.githubusercontent.com +0.0.0.0 gist.github.com +0.0.0.0 gist.githubusercontent.com +0.0.0.0 gitlab.com +0.0.0.0 bitbucket.org +0.0.0.0 sourceforge.net +0.0.0.0 git.kernel.org +0.0.0.0 chromium.googlesource.com +0.0.0.0 android.googlesource.com +0.0.0.0 sourcegraph.com +0.0.0.0 bugs.chromium.org +0.0.0.0 issues.oss-fuzz.com +0.0.0.0 oss-fuzz.com +0.0.0.0 osv.dev +0.0.0.0 api.osv.dev +0.0.0.0 bugzilla.mozilla.org +0.0.0.0 proxy.golang.org +0.0.0.0 sum.golang.org +0.0.0.0 pkg.go.dev +0.0.0.0 google.com +0.0.0.0 www.google.com +0.0.0.0 bing.com +0.0.0.0 www.bing.com +0.0.0.0 duckduckgo.com +0.0.0.0 html.duckduckgo.com +0.0.0.0 search.brave.com +0.0.0.0 stackoverflow.com diff --git a/tasks/format-code-task-000118/environment/setup/setup.sh b/tasks/format-code-task-000118/environment/setup/setup.sh new file mode 100644 index 0000000000000000000000000000000000000000..d883db90cfcfb48f7a139861bbe9f6b5d95cad6f --- /dev/null +++ b/tasks/format-code-task-000118/environment/setup/setup.sh @@ -0,0 +1,34 @@ +#!/bin/bash +# Runs once, as root, before the agent starts: Harbor's [environment.healthcheck] unpacks this folder into +# /var/lib/mimo and runs it. Generated by mimo_harbor; see its README for how each step maps to Xiaomi's harness. +M=/var/lib/mimo +[ -f "$M/ready" ] && exit 0 +chmod 700 "$M" +fail() { echo "setup: $*" >&2; exit 1; } +# the answer-leak blocklist (mimoagent), applied to /etc/hosts by the agent right after it installs +write_blocklist() { cp "$M/files/blocklist" "$M/blocklist"; } + +# Code: mimoagent environments/datasets/opensource_code.py + base.py, as the explorer runs it (app/runner/domains.py Code). +CWD=/testbed +git config --global --add safe.directory "$CWD" +cd "$CWD" || fail "no working directory $CWD" +if ! git rev-parse --git-dir >/dev/null 2>&1; then # a bare source tree: give it a baseline commit + git init -q && git add -A && git -c user.name=mimo -c user.email=mimo@localhost commit -q -m baseline --allow-empty +fi +BASE=$(git rev-parse HEAD 2>/dev/null) +[ ${#BASE} -eq 40 ] || fail "could not resolve the base commit in $CWD" +echo "$BASE" > "$M/base" +# Images are built with history truncated at the base. If one is not, the fix could be read out of git log, +# so .git is hidden while the agent works and put back for grading. +LATER=$(git rev-list --all --not "$BASE" 2>/dev/null | head -n 5 | grep -c . || true) +rm -f /tmp/fail.log /tmp/pass.log /tmp/patch.diff /tmp/test_patch.diff /tmp/*.log 2>/dev/null; rm -rf /tmp/claude-0 /tmp/claude-* /tmp/testem-* /tmp/puppeteer_dev_chrome_profile-* 2>/dev/null; rm -f /tmp/test_files.json 2>/dev/null; rm -rf /tmp/jest_* /tmp/jest-* /tmp/build /tmp/build_env 2>/dev/null; rm -rf /tmp/pytest-of-root /tmp/pytest-* /tmp/.pytest_cache /tmp/__pycache__ 2>/dev/null; rm -rf /tmp/go-build* /tmp/standards /tmp/wordpress /tmp/zig-* /tmp/testbase /tmp/testbed 2>/dev/null; rm -f /tmp/tmp*.tmp /tmp/*.bak /tmp/expect* /tmp/butwas* 2>/dev/null; rm -rf /root/.cache/go-build 2>/dev/null; rm -rf /tests 2>/dev/null; find /logs -mindepth 1 -delete 2>/dev/null; mkdir -p /logs/agent /logs/verifier /logs/artifacts; chmod 777 /logs/agent /logs/verifier /logs/artifacts; find /var/log -type f -delete 2>/dev/null || true; rm -rf /var/lib/postgresql/*/*/log /var/lib/postgresql/*/*/pg_log 2>/dev/null || true; find /var/lib/mysql /var/lib/mongodb -type f -name '*.log' -delete 2>/dev/null || true; rm -rf /root/.npm/_logs /root/.babel.json /root/.pytest_cache 2>/dev/null || true; find / -maxdepth 4 -xdev -name task_description.md -path '*/.build_env/*' -delete 2>/dev/null || true; true +git clean -fdx --exclude=node_modules --exclude=bower_components --exclude=.husky --exclude=vendor --exclude=third_party --exclude=_deps --exclude=vcpkg_installed --exclude=.venv --exclude=venv --exclude=.gradle --exclude=target --exclude=.build --exclude=lib --exclude=.bundle --exclude=Manifest.toml --exclude=_build --exclude=.stack-work --exclude=dist-newstyle >/dev/null 2>&1 +find /root/.m2 -type f \( -name '*-SNAPSHOT.jar' -o -name '*-SNAPSHOT-sources.jar' -o -name '*-SNAPSHOT-tests.jar' -o -name '*-SNAPSHOT-test-sources.jar' \) -delete 2>/dev/null; rm -rf /root/.julia/compiled 2>/dev/null; rm -rf /root/.gradle/caches/build-cache-* /root/.gradle/daemon 2>/dev/null; rm -rf /root/.gradle/caches/*/scripts /root/.gradle/caches/jars-* 2>/dev/null; rm -rf /root/.cache/bazel 2>/dev/null; true +if [ "$LATER" -gt 0 ]; then + mv "$CWD/.git" "$M/git-hidden" + echo "history not truncated at ${BASE:0:12}: .git hidden while the agent works" +fi +write_blocklist + +touch "$M/ready" +echo "setup done" diff --git a/tasks/format-code-task-000118/tests/test.patch b/tasks/format-code-task-000118/tests/test.patch new file mode 100644 index 0000000000000000000000000000000000000000..f7a6c7697c527cd1bd0d7d63cc33fd48b6cbfcf8 --- /dev/null +++ b/tasks/format-code-task-000118/tests/test.patch @@ -0,0 +1,584 @@ +diff --git a/ibm/acctest/acctest_policy_assignment_env_test.go b/ibm/acctest/acctest_policy_assignment_env_test.go +new file mode 100644 +index 000000000..a9d0319c0 +--- /dev/null ++++ b/ibm/acctest/acctest_policy_assignment_env_test.go +@@ -0,0 +1,62 @@ ++package acctest ++ ++import ( ++ "os" ++ "os/exec" ++ "strings" ++ "testing" ++) ++ ++const policyAssignmentEnvHelper = "IBM_POLICY_ASSIGNMENT_ENV_HELPER" ++ ++func runAcctestHelper(t *testing.T, name string, env ...string) (string, error) { ++ t.Helper() ++ cmd := exec.Command(os.Args[0], "-test.run=^"+name+"$", "-test.v") ++ cmd.Env = append(os.Environ(), policyAssignmentEnvHelper+"=1") ++ cmd.Env = append(cmd.Env, env...) ++ out, err := cmd.CombinedOutput() ++ return string(out), err ++} ++ ++func TestAcctestPolicyAssignmentTargetAccountEnv(t *testing.T) { ++ out, err := runAcctestHelper( ++ t, ++ "TestHelperAcctestPolicyAssignmentTargetAccountEnv", ++ "IBM_POLICY_ASSIGNMENT_TARGET_ACCOUNT_ID=target-account-from-env", ++ ) ++ if err != nil { ++ t.Fatalf("helper failed: %v\n%s", err, out) ++ } ++ if strings.Contains(out, "IBM_POLICY_ASSIGNMENT_TARGET_ACCOUNT_ID") { ++ t.Fatalf("set-env output should not ask for IBM_POLICY_ASSIGNMENT_TARGET_ACCOUNT_ID; output:\n%s", out) ++ } ++} ++ ++func TestHelperAcctestPolicyAssignmentTargetAccountEnv(t *testing.T) { ++ if os.Getenv(policyAssignmentEnvHelper) != "1" { ++ t.Skip("helper test") ++ } ++} ++ ++func TestAcctestPolicyAssignmentTargetAccountEnvMissingNotice(t *testing.T) { ++ out, err := runAcctestHelper( ++ t, ++ "TestHelperAcctestPolicyAssignmentTargetAccountEnvMissingNotice", ++ "IBM_POLICY_ASSIGNMENT_TARGET_ACCOUNT_ID=", ++ ) ++ if err != nil { ++ t.Fatalf("helper failed: %v\n%s", err, out) ++ } ++ if !strings.Contains(out, "IBM_POLICY_ASSIGNMENT_TARGET_ACCOUNT_ID") { ++ t.Fatalf("missing-env output should mention IBM_POLICY_ASSIGNMENT_TARGET_ACCOUNT_ID; output:\n%s", out) ++ } ++ if !strings.Contains(out, "ibm_iam_policy_assignment") { ++ t.Fatalf("missing-env output should mention ibm_iam_policy_assignment; output:\n%s", out) ++ } ++} ++ ++func TestHelperAcctestPolicyAssignmentTargetAccountEnvMissingNotice(t *testing.T) { ++ if os.Getenv(policyAssignmentEnvHelper) != "1" { ++ t.Skip("helper test") ++ } ++} +diff --git a/ibm/service/iampolicy/resource_ibm_iam_policy_assignment_schema_test.go b/ibm/service/iampolicy/resource_ibm_iam_policy_assignment_schema_test.go +new file mode 100644 +index 000000000..928f23955 +--- /dev/null ++++ b/ibm/service/iampolicy/resource_ibm_iam_policy_assignment_schema_test.go +@@ -0,0 +1,267 @@ ++package iampolicy_test ++ ++import ( ++ "go/ast" ++ "go/parser" ++ "go/token" ++ "path/filepath" ++ "testing" ++ ++ "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ++ ++ "github.com/IBM-Cloud/terraform-provider-ibm/ibm/provider" ++) ++ ++func iamPolicyAssignmentResource(t *testing.T) *schema.Resource { ++ t.Helper() ++ p := provider.Provider() ++ r, ok := p.ResourcesMap["ibm_iam_policy_assignment"] ++ if !ok { ++ t.Fatalf("provider does not register ibm_iam_policy_assignment") ++ } ++ return r ++} ++ ++func TestIBMIAMPolicyAssignmentResourceRegistered(t *testing.T) { ++ p := provider.Provider() ++ if _, ok := p.ResourcesMap["ibm_iam_policy_assignment"]; !ok { ++ t.Fatalf("expected provider to register ibm_iam_policy_assignment") ++ } ++} ++ ++func TestIBMIAMPolicyAssignmentLifecycleHandlersWired(t *testing.T) { ++ r := iamPolicyAssignmentResource(t) ++ ++ if r.CreateContext == nil { ++ t.Fatalf("ibm_iam_policy_assignment should have a create handler") ++ } ++ if r.ReadContext == nil { ++ t.Fatalf("ibm_iam_policy_assignment should have a read handler") ++ } ++ if r.UpdateContext == nil { ++ t.Fatalf("ibm_iam_policy_assignment should have an update handler") ++ } ++ if r.DeleteContext == nil { ++ t.Fatalf("ibm_iam_policy_assignment should have a delete handler") ++ } ++} ++ ++func TestIBMIAMPolicyAssignmentRequiredTopLevelSchema(t *testing.T) { ++ r := iamPolicyAssignmentResource(t) ++ ++ cases := []struct { ++ name string ++ field string ++ schemaType schema.ValueType ++ }{ ++ {name: "version", field: "version", schemaType: schema.TypeString}, ++ {name: "target", field: "target", schemaType: schema.TypeMap}, ++ {name: "templates", field: "templates", schemaType: schema.TypeList}, ++ {name: "options", field: "options", schemaType: schema.TypeList}, ++ } ++ ++ for _, tc := range cases { ++ t.Run(tc.name, func(t *testing.T) { ++ s, ok := r.Schema[tc.field] ++ if !ok { ++ t.Fatalf("schema missing %q", tc.field) ++ } ++ if !s.Required { ++ t.Fatalf("%q should be required", tc.field) ++ } ++ if s.Type != tc.schemaType { ++ t.Fatalf("%q type = %v, want %v", tc.field, s.Type, tc.schemaType) ++ } ++ }) ++ } ++} ++ ++func TestIBMIAMPolicyAssignmentNestedRequiredSchema(t *testing.T) { ++ r := iamPolicyAssignmentResource(t) ++ ++ templates, ok := r.Schema["templates"] ++ if !ok { ++ t.Fatalf("schema missing templates") ++ } ++ templateResource, ok := templates.Elem.(*schema.Resource) ++ if !ok { ++ t.Fatalf("templates element should be a nested resource") ++ } ++ for _, field := range []string{"id", "version"} { ++ s, ok := templateResource.Schema[field] ++ if !ok { ++ t.Fatalf("templates element missing %q", field) ++ } ++ if !s.Required || s.Type != schema.TypeString { ++ t.Fatalf("templates.%s should be a required string", field) ++ } ++ } ++ ++ options, ok := r.Schema["options"] ++ if !ok { ++ t.Fatalf("schema missing options") ++ } ++ optionsResource, ok := options.Elem.(*schema.Resource) ++ if !ok { ++ t.Fatalf("options element should be a nested resource") ++ } ++ root, ok := optionsResource.Schema["root"] ++ if !ok { ++ t.Fatalf("options element missing root") ++ } ++ if !root.Required || root.Type != schema.TypeList { ++ t.Fatalf("options.root should be a required list block") ++ } ++ rootResource, ok := root.Elem.(*schema.Resource) ++ if !ok { ++ t.Fatalf("options.root element should be a nested resource") ++ } ++ requesterID, ok := rootResource.Schema["requester_id"] ++ if !ok { ++ t.Fatalf("options.root missing requester_id") ++ } ++ if !requesterID.Required || requesterID.Type != schema.TypeString { ++ t.Fatalf("options.root.requester_id should be a required string") ++ } ++} ++ ++func TestIBMIAMPolicyAssignmentCardinalityAndDefault(t *testing.T) { ++ r := iamPolicyAssignmentResource(t) ++ ++ for _, field := range []string{"templates", "options"} { ++ s, ok := r.Schema[field] ++ if !ok { ++ t.Fatalf("schema missing %q", field) ++ } ++ if s.MinItems != 1 || s.MaxItems != 1 { ++ t.Fatalf("%q should accept exactly one item, got MinItems=%d MaxItems=%d", field, s.MinItems, s.MaxItems) ++ } ++ } ++ ++ acceptLanguage, ok := r.Schema["accept_language"] ++ if !ok { ++ t.Fatalf("schema missing accept_language") ++ } ++ if !acceptLanguage.Optional { ++ t.Fatalf("accept_language should be optional") ++ } ++ if got := acceptLanguage.Default; got != "default" { ++ t.Fatalf("accept_language default = %#v, want %q", got, "default") ++ } ++} ++ ++func TestIBMIAMPolicyAssignmentComputedMetadataSchema(t *testing.T) { ++ r := iamPolicyAssignmentResource(t) ++ ++ for _, field := range []string{ ++ "account_id", ++ "href", ++ "created_at", ++ "created_by_id", ++ "last_modified_at", ++ "last_modified_by_id", ++ } { ++ s, ok := r.Schema[field] ++ if !ok { ++ t.Fatalf("schema missing computed metadata field %q", field) ++ } ++ if !s.Computed || s.Type != schema.TypeString { ++ t.Fatalf("%q should be a computed string", field) ++ } ++ } ++ ++ resources, ok := r.Schema["resources"] ++ if !ok { ++ t.Fatalf("schema missing resources") ++ } ++ if !resources.Computed || resources.Type != schema.TypeList { ++ t.Fatalf("resources should be a computed list") ++ } ++ resourceElem, ok := resources.Elem.(*schema.Resource) ++ if !ok { ++ t.Fatalf("resources element should be a nested resource") ++ } ++ target, ok := resourceElem.Schema["target"] ++ if !ok { ++ t.Fatalf("resources element missing target") ++ } ++ if target.Type != schema.TypeMap { ++ t.Fatalf("resources.target should be a map") ++ } ++ ++ if !schemaTreeHasComputedString(resourceElem, "id") { ++ t.Fatalf("resources should expose a computed policy id somewhere in the nested result schema") ++ } ++ if !schemaTreeHasComputedString(resourceElem, "status") { ++ t.Fatalf("resources should expose a computed status somewhere in the nested result schema") ++ } ++ if computedCollectionCount(resourceElem) < 2 { ++ t.Fatalf("resources should expose nested computed policy result details, got fewer than two computed nested collections") ++ } ++} ++ ++func TestIBMIAMPolicyAssignmentAccountIDIsNotHardCoded(t *testing.T) { ++ fileSet := token.NewFileSet() ++ files, err := filepath.Glob("*.go") ++ if err != nil { ++ t.Fatalf("failed to enumerate policy assignment source files: %v", err) ++ } ++ for _, file := range files { ++ parsed, err := parser.ParseFile(fileSet, file, nil, 0) ++ if err != nil { ++ continue ++ } ++ ast.Inspect(parsed, func(n ast.Node) bool { ++ call, ok := n.(*ast.CallExpr) ++ if !ok || !isDataSetCall(call, "account_id") || len(call.Args) < 2 { ++ return true ++ } ++ if _, ok := call.Args[1].(*ast.BasicLit); ok { ++ t.Fatalf("account_id should be populated from assignment data, not from a literal") ++ } ++ return true ++ }) ++ } ++} ++ ++func schemaTreeHasComputedString(r *schema.Resource, field string) bool { ++ found := false ++ walkSchemaResource(r, func(name string, s *schema.Schema) { ++ if name == field && s.Computed && s.Type == schema.TypeString { ++ found = true ++ } ++ }) ++ return found ++} ++ ++func computedCollectionCount(r *schema.Resource) int { ++ count := 0 ++ walkSchemaResource(r, func(_ string, s *schema.Schema) { ++ if s.Computed && (s.Type == schema.TypeList || s.Type == schema.TypeSet || s.Type == schema.TypeMap) { ++ count++ ++ } ++ }) ++ return count ++} ++ ++func walkSchemaResource(r *schema.Resource, visit func(string, *schema.Schema)) { ++ for name, s := range r.Schema { ++ visit(name, s) ++ if nested, ok := s.Elem.(*schema.Resource); ok { ++ walkSchemaResource(nested, visit) ++ } ++ } ++} ++ ++func isDataSetCall(call *ast.CallExpr, field string) bool { ++ selector, ok := call.Fun.(*ast.SelectorExpr) ++ if !ok || selector.Sel.Name != "Set" || len(call.Args) == 0 { ++ return false ++ } ++ receiver, ok := selector.X.(*ast.Ident) ++ if !ok || receiver.Name != "d" { ++ return false ++ } ++ lit, ok := call.Args[0].(*ast.BasicLit) ++ return ok && lit.Value == `"`+field+`"` ++} +diff --git a/ibm/service/iampolicy/resource_ibm_iam_policy_assignment_test.go b/ibm/service/iampolicy/resource_ibm_iam_policy_assignment_test.go +new file mode 100644 +index 000000000..9cd43ed47 +--- /dev/null ++++ b/ibm/service/iampolicy/resource_ibm_iam_policy_assignment_test.go +@@ -0,0 +1,211 @@ ++ ++ ++ ++package iampolicy_test ++ ++import ( ++ "fmt" ++ "os" ++ "testing" ++ ++ "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" ++ "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" ++ "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" ++ ++ acc "github.com/IBM-Cloud/terraform-provider-ibm/ibm/acctest" ++ "github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns" ++ "github.com/IBM/platform-services-go-sdk/iampolicymanagementv1" ++) ++ ++func TestAccIBMPolicyAssignmentBasic(t *testing.T) { ++ var conf iampolicymanagementv1.GetPolicyAssignmentResponse ++ var name string = fmt.Sprintf("TerraformTemplateTest%d", acctest.RandIntRange(10, 100)) ++ ++ resource.Test(t, resource.TestCase{ ++ PreCheck: func() { acc.TestAccPreCheck(t) }, ++ Providers: acc.TestAccProviders, ++ CheckDestroy: testAccCheckIBMPolicyAssignmentDestroy, ++ Steps: []resource.TestStep{ ++ { ++ Config: testAccCheckIBMPolicyAssignmentConfigBasic(name, os.Getenv("IBM_POLICY_ASSIGNMENT_TARGET_ACCOUNT_ID")), ++ Check: resource.ComposeAggregateTestCheckFunc( ++ testAccCheckIBMPolicyAssignmentExists("ibm_iam_policy_assignment.policy_assignment", conf), ++ resource.TestCheckResourceAttrSet("ibm_iam_policy_assignment.policy_assignment", "account_id"), ++ resource.TestCheckResourceAttrSet("ibm_iam_policy_assignment.policy_assignment", "href"), ++ resource.TestCheckResourceAttrSet("ibm_iam_policy_assignment.policy_assignment", "created_at"), ++ resource.TestCheckResourceAttrSet("ibm_iam_policy_assignment.policy_assignment", "created_by_id"), ++ resource.TestCheckResourceAttrSet("ibm_iam_policy_assignment.policy_assignment", "last_modified_at"), ++ resource.TestCheckResourceAttrSet("ibm_iam_policy_assignment.policy_assignment", "last_modified_by_id"), ++ resource.TestCheckResourceAttrSet("ibm_iam_policy_assignment.policy_assignment", "resources.#"), ++ resource.TestCheckResourceAttrSet("ibm_iam_policy_assignment.policy_assignment", "resources.0.target.%"), ++ ), ++ }, ++ { ++ Config: testAccCheckIBMPolicyAssignmentConfigUpdate(name, os.Getenv("IBM_POLICY_ASSIGNMENT_TARGET_ACCOUNT_ID")), ++ Check: resource.ComposeAggregateTestCheckFunc( ++ testAccCheckIBMPolicyAssignmentExists("ibm_iam_policy_assignment.policy_assignment", conf), ++ resource.TestCheckResourceAttrSet("ibm_iam_policy_assignment.policy_assignment", "account_id"), ++ resource.TestCheckResourceAttrSet("ibm_iam_policy_assignment.policy_assignment", "href"), ++ resource.TestCheckResourceAttrSet("ibm_iam_policy_assignment.policy_assignment", "created_at"), ++ resource.TestCheckResourceAttrSet("ibm_iam_policy_assignment.policy_assignment", "created_by_id"), ++ resource.TestCheckResourceAttrSet("ibm_iam_policy_assignment.policy_assignment", "last_modified_at"), ++ resource.TestCheckResourceAttrSet("ibm_iam_policy_assignment.policy_assignment", "last_modified_by_id"), ++ resource.TestCheckResourceAttrSet("ibm_iam_policy_assignment.policy_assignment", "resources.#"), ++ resource.TestCheckResourceAttrSet("ibm_iam_policy_assignment.policy_assignment", "resources.0.target.%"), ++ ), ++ }, ++ }, ++ }) ++} ++ ++func testAccCheckIBMPolicyAssignmentConfigBasic(name string, targetId string) string { ++ return fmt.Sprintf(` ++ resource "ibm_iam_policy_template" "policy_s2s_template" { ++ name = "%s" ++ policy { ++ type = "authorization" ++ description = "description" ++ resource { ++ attributes { ++ key = "serviceName" ++ operator = "stringEquals" ++ value = "kms" ++ } ++ } ++ roles = ["Reader"] ++ } ++ committed=true ++ } ++ resource "ibm_iam_policy_assignment" "policy_assignment" { ++ version = "1.0" ++ target ={ ++ type = "Account" ++ id = "%s" ++ } ++ ++ options { ++ root { ++ requester_id = "orchestrator" ++ assignment_id = "test" ++ } ++ } ++ templates{ ++ id = ibm_iam_policy_template.policy_s2s_template.template_id ++ version = ibm_iam_policy_template.policy_s2s_template.version ++ } ++ }`, name, targetId) ++} ++ ++func testAccCheckIBMPolicyAssignmentConfigUpdate(name string, targetId string) string { ++ return fmt.Sprintf(` ++ resource "ibm_iam_policy_template" "policy_s2s_template" { ++ name = "%s" ++ policy { ++ type = "authorization" ++ description = "description" ++ resource { ++ attributes { ++ key = "serviceName" ++ operator = "stringEquals" ++ value = "kms" ++ } ++ } ++ roles = ["Reader"] ++ } ++ committed=true ++ } ++ resource "ibm_iam_policy_template_version" "template_version" { ++ template_id = ibm_iam_policy_template.policy_s2s_template.template_id ++ policy { ++ type = "authorization" ++ description = "description" ++ resource { ++ attributes { ++ key = "serviceName" ++ operator = "stringEquals" ++ value = "appid" ++ } ++ } ++ roles = ["Reader"] ++ } ++ committed=true ++ } ++ ++ resource "ibm_iam_policy_assignment" "policy_assignment" { ++ version = "1.0" ++ target ={ ++ type = "Account" ++ id = "%s" ++ } ++ ++ options { ++ root { ++ requester_id = "orchestrator" ++ assignment_id = "test" ++ } ++ } ++ templates{ ++ id = ibm_iam_policy_template.policy_s2s_template.template_id ++ version = ibm_iam_policy_template.policy_s2s_template.version ++ } ++ template_version=ibm_iam_policy_template_version.template_version.version ++ }`, name, targetId) ++} ++ ++func testAccCheckIBMPolicyAssignmentExists(n string, obj iampolicymanagementv1.GetPolicyAssignmentResponse) resource.TestCheckFunc { ++ ++ return func(s *terraform.State) error { ++ rs, ok := s.RootModule().Resources[n] ++ if !ok { ++ return fmt.Errorf("Not found: %s", n) ++ } ++ ++ iamPolicyManagementClient, err := acc.TestAccProvider.Meta().(conns.ClientSession).IAMPolicyManagementV1API() ++ if err != nil { ++ return err ++ } ++ ++ getPolicyAssignmentsOptions := &iampolicymanagementv1.GetPolicyAssignmentOptions{} ++ ++ getPolicyAssignmentsOptions.SetAssignmentID(rs.Primary.ID) ++ getPolicyAssignmentsOptions.SetVersion("1.0") ++ ++ policyAssignmentV1, _, err := iamPolicyManagementClient.GetPolicyAssignment(getPolicyAssignmentsOptions) ++ if err != nil { ++ return err ++ } ++ ++ assignmentDetails := policyAssignmentV1.(*iampolicymanagementv1.GetPolicyAssignmentResponse) ++ ++ obj = *assignmentDetails ++ return nil ++ } ++} ++ ++func testAccCheckIBMPolicyAssignmentDestroy(s *terraform.State) error { ++ iamPolicyManagementClient, err := acc.TestAccProvider.Meta().(conns.ClientSession).IAMPolicyManagementV1API() ++ if err != nil { ++ return err ++ } ++ for _, rs := range s.RootModule().Resources { ++ if rs.Type != "ibm_iam_policy_assignment" { ++ continue ++ } ++ ++ getPolicyAssignmentsOptions := &iampolicymanagementv1.GetPolicyAssignmentOptions{} ++ ++ getPolicyAssignmentsOptions.SetAssignmentID(rs.Primary.ID) ++ getPolicyAssignmentsOptions.SetVersion("1.0") ++ ++ ++ _, response, err := iamPolicyManagementClient.GetPolicyAssignment(getPolicyAssignmentsOptions) ++ ++ if err == nil { ++ return fmt.Errorf("policy_assignment still exists: %s", rs.Primary.ID) ++ } else if response.StatusCode != 404 { ++ return fmt.Errorf("Error checking for policy_assignment (%s) has been destroyed: %s", rs.Primary.ID, err) ++ } ++ } ++ ++ return nil ++} +diff --git a/mimo_test_command.sh b/mimo_test_command.sh +new file mode 100755 +--- /dev/null ++++ b/mimo_test_command.sh +@@ -0,0 +1,21 @@ ++#!/bin/bash ++set -euo pipefail ++cd /testbed ++ ++ ++ ++go mod download ++ ++case "${1:-}" in ++ base) ++ go test -count=1 -run '^$' ./ibm/service/iampolicy ./ibm/acctest ++ ;; ++ new) ++ go test -count=1 -run 'TestIBMIAMPolicyAssignment' ./ibm/service/iampolicy ++ go test -count=1 -run 'TestAcctestPolicyAssignment(TargetAccountEnv|TargetAccountEnvMissingNotice)$' ./ibm/acctest ++ ;; ++ *) ++ echo "usage: $0 base|new" ++ exit 2 ++ ;; ++esac diff --git a/tasks/format-code-task-000118/tests/test.sh b/tasks/format-code-task-000118/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..21bb7619ec2075aee712ec390ceff38aa978e104 --- /dev/null +++ b/tasks/format-code-task-000118/tests/test.sh @@ -0,0 +1,40 @@ +#!/bin/bash +# Code grading, mimoagent opensource_code.py: reset the files the hidden test patch touches, apply it, run the +# task's test command; reward 1 when it exits 0. A testbed failure (reset or apply) writes no reward: not scored. +M=/var/lib/mimo +CWD=/testbed +V=/logs/verifier +mkdir -p "$V" +BASE=$(cat "$M/base" 2>/dev/null) || { echo "setup never ran (no $M/base)" >&2; exit 1; } +cd "$CWD" || exit 1 +if [ -d "$M/git-hidden" ]; then rm -rf "$CWD/.git"; mv "$M/git-hidden" "$CWD/.git"; fi +# the agent's change against the base, so its own commits count too +git add -A >/dev/null 2>&1 && git -c core.fileMode=false diff --cached "$BASE" > "$V/agent.diff" +git reset -q +if ! ( +while IFS= read -r tf; do + [ -z "$tf" ] && continue + if git cat-file -e $BASE:"$tf" 2>/dev/null; then + git checkout $BASE -- "$tf" 2>/dev/null || true + else + git rm -f --cached "$tf" >/dev/null 2>&1 || true + rm -f "$tf" + fi +done <<'EOF_RESET_TEST_FILES' +ibm/acctest/acctest_policy_assignment_env_test.go +ibm/service/iampolicy/resource_ibm_iam_policy_assignment_schema_test.go +ibm/service/iampolicy/resource_ibm_iam_policy_assignment_test.go +mimo_test_command.sh +EOF_RESET_TEST_FILES + +); then echo "could not reset the test files (testbed problem, not scored)" >&2; exit 1; fi +if ! git apply --verbose /tests/test.patch > "$V/apply.log" 2>&1; then + cat "$V/apply.log" >&2 + echo "the hidden tests could not be applied (testbed problem, not scored)" >&2 + exit 1 +fi +timeout 1800 sh -c "$(cat /tests/test_command.sh)" > "$V/test_output.log" 2>&1 +RC=$? +tail -c 12000 "$V/test_output.log" +if [ $RC -eq 0 ]; then echo 1 > "$V/reward.txt"; else echo 0 > "$V/reward.txt"; fi +echo "test command exited $RC" diff --git a/tasks/format-code-task-000118/tests/test_command.sh b/tasks/format-code-task-000118/tests/test_command.sh new file mode 100644 index 0000000000000000000000000000000000000000..e8d2f32b64045b5a5a56e0ad5667da87d8e0bc2a --- /dev/null +++ b/tasks/format-code-task-000118/tests/test_command.sh @@ -0,0 +1 @@ +bash /testbed/mimo_test_command.sh base && bash /testbed/mimo_test_command.sh new \ No newline at end of file diff --git a/tasks/format-code-task-000127/environment/Dockerfile b/tasks/format-code-task-000127/environment/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..bd81cc1ef2592c0f09a2ee048ca8e9eea909c07c --- /dev/null +++ b/tasks/format-code-task-000127/environment/Dockerfile @@ -0,0 +1,3 @@ +# The task's image, pinned by digest (the same as [environment].docker_image). +# Setup runs at start from [environment.healthcheck]; environment/setup/ is its readable copy. +FROM docker.io/xiaomimimo/mimo-v2.6-rl-oss@sha256:c880bca682f9acb39abc0c86edce758978214cb874c21a323e68f592a4e540d4 diff --git a/tasks/format-code-task-000127/environment/setup/files/blocklist b/tasks/format-code-task-000127/environment/setup/files/blocklist new file mode 100644 index 0000000000000000000000000000000000000000..a8e4bdc4c7d9b739c047a3cb58ea72a1bb05bcbc --- /dev/null +++ b/tasks/format-code-task-000127/environment/setup/files/blocklist @@ -0,0 +1,33 @@ +# mimo answer-leak blocklist (mimoagent) +0.0.0.0 github.com +0.0.0.0 www.github.com +0.0.0.0 api.github.com +0.0.0.0 raw.githubusercontent.com +0.0.0.0 codeload.github.com +0.0.0.0 objects.githubusercontent.com +0.0.0.0 gist.github.com +0.0.0.0 gist.githubusercontent.com +0.0.0.0 gitlab.com +0.0.0.0 bitbucket.org +0.0.0.0 sourceforge.net +0.0.0.0 git.kernel.org +0.0.0.0 chromium.googlesource.com +0.0.0.0 android.googlesource.com +0.0.0.0 sourcegraph.com +0.0.0.0 bugs.chromium.org +0.0.0.0 issues.oss-fuzz.com +0.0.0.0 oss-fuzz.com +0.0.0.0 osv.dev +0.0.0.0 api.osv.dev +0.0.0.0 bugzilla.mozilla.org +0.0.0.0 proxy.golang.org +0.0.0.0 sum.golang.org +0.0.0.0 pkg.go.dev +0.0.0.0 google.com +0.0.0.0 www.google.com +0.0.0.0 bing.com +0.0.0.0 www.bing.com +0.0.0.0 duckduckgo.com +0.0.0.0 html.duckduckgo.com +0.0.0.0 search.brave.com +0.0.0.0 stackoverflow.com diff --git a/tasks/format-code-task-000127/environment/setup/setup.sh b/tasks/format-code-task-000127/environment/setup/setup.sh new file mode 100644 index 0000000000000000000000000000000000000000..d883db90cfcfb48f7a139861bbe9f6b5d95cad6f --- /dev/null +++ b/tasks/format-code-task-000127/environment/setup/setup.sh @@ -0,0 +1,34 @@ +#!/bin/bash +# Runs once, as root, before the agent starts: Harbor's [environment.healthcheck] unpacks this folder into +# /var/lib/mimo and runs it. Generated by mimo_harbor; see its README for how each step maps to Xiaomi's harness. +M=/var/lib/mimo +[ -f "$M/ready" ] && exit 0 +chmod 700 "$M" +fail() { echo "setup: $*" >&2; exit 1; } +# the answer-leak blocklist (mimoagent), applied to /etc/hosts by the agent right after it installs +write_blocklist() { cp "$M/files/blocklist" "$M/blocklist"; } + +# Code: mimoagent environments/datasets/opensource_code.py + base.py, as the explorer runs it (app/runner/domains.py Code). +CWD=/testbed +git config --global --add safe.directory "$CWD" +cd "$CWD" || fail "no working directory $CWD" +if ! git rev-parse --git-dir >/dev/null 2>&1; then # a bare source tree: give it a baseline commit + git init -q && git add -A && git -c user.name=mimo -c user.email=mimo@localhost commit -q -m baseline --allow-empty +fi +BASE=$(git rev-parse HEAD 2>/dev/null) +[ ${#BASE} -eq 40 ] || fail "could not resolve the base commit in $CWD" +echo "$BASE" > "$M/base" +# Images are built with history truncated at the base. If one is not, the fix could be read out of git log, +# so .git is hidden while the agent works and put back for grading. +LATER=$(git rev-list --all --not "$BASE" 2>/dev/null | head -n 5 | grep -c . || true) +rm -f /tmp/fail.log /tmp/pass.log /tmp/patch.diff /tmp/test_patch.diff /tmp/*.log 2>/dev/null; rm -rf /tmp/claude-0 /tmp/claude-* /tmp/testem-* /tmp/puppeteer_dev_chrome_profile-* 2>/dev/null; rm -f /tmp/test_files.json 2>/dev/null; rm -rf /tmp/jest_* /tmp/jest-* /tmp/build /tmp/build_env 2>/dev/null; rm -rf /tmp/pytest-of-root /tmp/pytest-* /tmp/.pytest_cache /tmp/__pycache__ 2>/dev/null; rm -rf /tmp/go-build* /tmp/standards /tmp/wordpress /tmp/zig-* /tmp/testbase /tmp/testbed 2>/dev/null; rm -f /tmp/tmp*.tmp /tmp/*.bak /tmp/expect* /tmp/butwas* 2>/dev/null; rm -rf /root/.cache/go-build 2>/dev/null; rm -rf /tests 2>/dev/null; find /logs -mindepth 1 -delete 2>/dev/null; mkdir -p /logs/agent /logs/verifier /logs/artifacts; chmod 777 /logs/agent /logs/verifier /logs/artifacts; find /var/log -type f -delete 2>/dev/null || true; rm -rf /var/lib/postgresql/*/*/log /var/lib/postgresql/*/*/pg_log 2>/dev/null || true; find /var/lib/mysql /var/lib/mongodb -type f -name '*.log' -delete 2>/dev/null || true; rm -rf /root/.npm/_logs /root/.babel.json /root/.pytest_cache 2>/dev/null || true; find / -maxdepth 4 -xdev -name task_description.md -path '*/.build_env/*' -delete 2>/dev/null || true; true +git clean -fdx --exclude=node_modules --exclude=bower_components --exclude=.husky --exclude=vendor --exclude=third_party --exclude=_deps --exclude=vcpkg_installed --exclude=.venv --exclude=venv --exclude=.gradle --exclude=target --exclude=.build --exclude=lib --exclude=.bundle --exclude=Manifest.toml --exclude=_build --exclude=.stack-work --exclude=dist-newstyle >/dev/null 2>&1 +find /root/.m2 -type f \( -name '*-SNAPSHOT.jar' -o -name '*-SNAPSHOT-sources.jar' -o -name '*-SNAPSHOT-tests.jar' -o -name '*-SNAPSHOT-test-sources.jar' \) -delete 2>/dev/null; rm -rf /root/.julia/compiled 2>/dev/null; rm -rf /root/.gradle/caches/build-cache-* /root/.gradle/daemon 2>/dev/null; rm -rf /root/.gradle/caches/*/scripts /root/.gradle/caches/jars-* 2>/dev/null; rm -rf /root/.cache/bazel 2>/dev/null; true +if [ "$LATER" -gt 0 ]; then + mv "$CWD/.git" "$M/git-hidden" + echo "history not truncated at ${BASE:0:12}: .git hidden while the agent works" +fi +write_blocklist + +touch "$M/ready" +echo "setup done" diff --git a/tasks/format-code-task-000127/tests/test.patch b/tasks/format-code-task-000127/tests/test.patch new file mode 100644 index 0000000000000000000000000000000000000000..de863d58b761ed1d3390d8439860175aca34fcfa --- /dev/null +++ b/tasks/format-code-task-000127/tests/test.patch @@ -0,0 +1,38 @@ +diff --git a/python/jittor/test/test_misc_op.py b/python/jittor/test/test_misc_op.py +index 65663e53..1d2bee6d 100644 +--- a/python/jittor/test/test_misc_op.py ++++ b/python/jittor/test/test_misc_op.py +@@ -115,7 +115,10 @@ def check(shape): + check((4,3,100,200)) + check((10,3,100,200)) + +- ++ def test_make_grid3(self): ++ arr=np.random.randn(3,10,10) ++ check_equal(torchvision.utils.make_grid(torch.Tensor(arr)), jt.make_grid(jt.array(arr))) ++ check_equal(torchvision.utils.make_grid(torch.Tensor(arr), normalize=True), jt.make_grid(jt.array(arr), normalize=True)) + + def test_save_image(self): + arr = jt.array(np.random.randn(16,3,10,10)) +diff --git a/mimo_build_env.tar.gz.b64 b/mimo_build_env.tar.gz.b64 +new file mode 100644 +--- /dev/null ++++ b/mimo_build_env.tar.gz.b64 +@@ -0,0 +1,6 @@ ++H4sIAAAAAAAAA+3SQU+DMBQHcM58ihfCQQ8rFFZISDx4MNnFuMPuBFayVYES6Ih+eztI1JjoLlvU +++P9xaHmP8Br+sPKgaplX7Rg4lxJaqRDTan1epz0XEbfXMo0SJ+Q8CWOHxMVO9MFhMEVP5PRam++e ++O9X/o9h7/qYaTL7VTVO0kg378804lX8k0rf8Rcxt/suEC4fC8x3ha/88/62kKfiykm713One0Pp2 ++s7rx/NXD/V3Aupfjr1GqNvOPdc+txqImz7+aGqRaZWhx7bnz7a7WpW3HjIeMJ7Zo9rqNadGQ3dop ++NFeCR2WM7qfB82/XqGGb686Oy7KNLawLmWVzp3iq8l2vpH3N6P705wIAAAAAAAAAAAAAAAAAAAAA +++FVeAaDigyIAKAAA +diff --git a/mimo_test_command.sh b/mimo_test_command.sh +new file mode 100755 +--- /dev/null ++++ b/mimo_test_command.sh +@@ -0,0 +1,6 @@ ++#!/usr/bin/env bash ++ ++set -uo pipefail ++cd /testbed || exit 1 ++base64 -d mimo_build_env.tar.gz.b64 | tar -xzf - -C /testbed || exit 1 ++exec bash -lc 'cd /testbed && bash -eo pipefail /testbed/.build_env/test_command.sh' diff --git a/tasks/format-code-task-000127/tests/test.sh b/tasks/format-code-task-000127/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..a6e676e797a51f134e3822767e7b5ff3c7190e34 --- /dev/null +++ b/tasks/format-code-task-000127/tests/test.sh @@ -0,0 +1,39 @@ +#!/bin/bash +# Code grading, mimoagent opensource_code.py: reset the files the hidden test patch touches, apply it, run the +# task's test command; reward 1 when it exits 0. A testbed failure (reset or apply) writes no reward: not scored. +M=/var/lib/mimo +CWD=/testbed +V=/logs/verifier +mkdir -p "$V" +BASE=$(cat "$M/base" 2>/dev/null) || { echo "setup never ran (no $M/base)" >&2; exit 1; } +cd "$CWD" || exit 1 +if [ -d "$M/git-hidden" ]; then rm -rf "$CWD/.git"; mv "$M/git-hidden" "$CWD/.git"; fi +# the agent's change against the base, so its own commits count too +git add -A >/dev/null 2>&1 && git -c core.fileMode=false diff --cached "$BASE" > "$V/agent.diff" +git reset -q +if ! ( +while IFS= read -r tf; do + [ -z "$tf" ] && continue + if git cat-file -e $BASE:"$tf" 2>/dev/null; then + git checkout $BASE -- "$tf" 2>/dev/null || true + else + git rm -f --cached "$tf" >/dev/null 2>&1 || true + rm -f "$tf" + fi +done <<'EOF_RESET_TEST_FILES' +python/jittor/test/test_misc_op.py +mimo_build_env.tar.gz.b64 +mimo_test_command.sh +EOF_RESET_TEST_FILES + +); then echo "could not reset the test files (testbed problem, not scored)" >&2; exit 1; fi +if ! git apply --verbose /tests/test.patch > "$V/apply.log" 2>&1; then + cat "$V/apply.log" >&2 + echo "the hidden tests could not be applied (testbed problem, not scored)" >&2 + exit 1 +fi +timeout 1800 sh -c "$(cat /tests/test_command.sh)" > "$V/test_output.log" 2>&1 +RC=$? +tail -c 12000 "$V/test_output.log" +if [ $RC -eq 0 ]; then echo 1 > "$V/reward.txt"; else echo 0 > "$V/reward.txt"; fi +echo "test command exited $RC" diff --git a/tasks/format-code-task-000127/tests/test_command.sh b/tasks/format-code-task-000127/tests/test_command.sh new file mode 100644 index 0000000000000000000000000000000000000000..7cb23076694ad17d72e8296d62b2b240083e36db --- /dev/null +++ b/tasks/format-code-task-000127/tests/test_command.sh @@ -0,0 +1 @@ +bash /testbed/mimo_test_command.sh \ No newline at end of file diff --git a/tasks/format-code-task-000133/environment/Dockerfile b/tasks/format-code-task-000133/environment/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..a204c0b483e0737f4c6488f93bc00f41f7ac7a6b --- /dev/null +++ b/tasks/format-code-task-000133/environment/Dockerfile @@ -0,0 +1,3 @@ +# The task's image, pinned by digest (the same as [environment].docker_image). +# Setup runs at start from [environment.healthcheck]; environment/setup/ is its readable copy. +FROM docker.io/xiaomimimo/mimo-v2.6-rl-oss@sha256:acf709816be05b54743e259d3b01c082aaa99c2623953f47f5fc2e292df0c0d8 diff --git a/tasks/format-code-task-000133/environment/setup/files/blocklist b/tasks/format-code-task-000133/environment/setup/files/blocklist new file mode 100644 index 0000000000000000000000000000000000000000..a8e4bdc4c7d9b739c047a3cb58ea72a1bb05bcbc --- /dev/null +++ b/tasks/format-code-task-000133/environment/setup/files/blocklist @@ -0,0 +1,33 @@ +# mimo answer-leak blocklist (mimoagent) +0.0.0.0 github.com +0.0.0.0 www.github.com +0.0.0.0 api.github.com +0.0.0.0 raw.githubusercontent.com +0.0.0.0 codeload.github.com +0.0.0.0 objects.githubusercontent.com +0.0.0.0 gist.github.com +0.0.0.0 gist.githubusercontent.com +0.0.0.0 gitlab.com +0.0.0.0 bitbucket.org +0.0.0.0 sourceforge.net +0.0.0.0 git.kernel.org +0.0.0.0 chromium.googlesource.com +0.0.0.0 android.googlesource.com +0.0.0.0 sourcegraph.com +0.0.0.0 bugs.chromium.org +0.0.0.0 issues.oss-fuzz.com +0.0.0.0 oss-fuzz.com +0.0.0.0 osv.dev +0.0.0.0 api.osv.dev +0.0.0.0 bugzilla.mozilla.org +0.0.0.0 proxy.golang.org +0.0.0.0 sum.golang.org +0.0.0.0 pkg.go.dev +0.0.0.0 google.com +0.0.0.0 www.google.com +0.0.0.0 bing.com +0.0.0.0 www.bing.com +0.0.0.0 duckduckgo.com +0.0.0.0 html.duckduckgo.com +0.0.0.0 search.brave.com +0.0.0.0 stackoverflow.com diff --git a/tasks/format-code-task-000133/environment/setup/setup.sh b/tasks/format-code-task-000133/environment/setup/setup.sh new file mode 100644 index 0000000000000000000000000000000000000000..d883db90cfcfb48f7a139861bbe9f6b5d95cad6f --- /dev/null +++ b/tasks/format-code-task-000133/environment/setup/setup.sh @@ -0,0 +1,34 @@ +#!/bin/bash +# Runs once, as root, before the agent starts: Harbor's [environment.healthcheck] unpacks this folder into +# /var/lib/mimo and runs it. Generated by mimo_harbor; see its README for how each step maps to Xiaomi's harness. +M=/var/lib/mimo +[ -f "$M/ready" ] && exit 0 +chmod 700 "$M" +fail() { echo "setup: $*" >&2; exit 1; } +# the answer-leak blocklist (mimoagent), applied to /etc/hosts by the agent right after it installs +write_blocklist() { cp "$M/files/blocklist" "$M/blocklist"; } + +# Code: mimoagent environments/datasets/opensource_code.py + base.py, as the explorer runs it (app/runner/domains.py Code). +CWD=/testbed +git config --global --add safe.directory "$CWD" +cd "$CWD" || fail "no working directory $CWD" +if ! git rev-parse --git-dir >/dev/null 2>&1; then # a bare source tree: give it a baseline commit + git init -q && git add -A && git -c user.name=mimo -c user.email=mimo@localhost commit -q -m baseline --allow-empty +fi +BASE=$(git rev-parse HEAD 2>/dev/null) +[ ${#BASE} -eq 40 ] || fail "could not resolve the base commit in $CWD" +echo "$BASE" > "$M/base" +# Images are built with history truncated at the base. If one is not, the fix could be read out of git log, +# so .git is hidden while the agent works and put back for grading. +LATER=$(git rev-list --all --not "$BASE" 2>/dev/null | head -n 5 | grep -c . || true) +rm -f /tmp/fail.log /tmp/pass.log /tmp/patch.diff /tmp/test_patch.diff /tmp/*.log 2>/dev/null; rm -rf /tmp/claude-0 /tmp/claude-* /tmp/testem-* /tmp/puppeteer_dev_chrome_profile-* 2>/dev/null; rm -f /tmp/test_files.json 2>/dev/null; rm -rf /tmp/jest_* /tmp/jest-* /tmp/build /tmp/build_env 2>/dev/null; rm -rf /tmp/pytest-of-root /tmp/pytest-* /tmp/.pytest_cache /tmp/__pycache__ 2>/dev/null; rm -rf /tmp/go-build* /tmp/standards /tmp/wordpress /tmp/zig-* /tmp/testbase /tmp/testbed 2>/dev/null; rm -f /tmp/tmp*.tmp /tmp/*.bak /tmp/expect* /tmp/butwas* 2>/dev/null; rm -rf /root/.cache/go-build 2>/dev/null; rm -rf /tests 2>/dev/null; find /logs -mindepth 1 -delete 2>/dev/null; mkdir -p /logs/agent /logs/verifier /logs/artifacts; chmod 777 /logs/agent /logs/verifier /logs/artifacts; find /var/log -type f -delete 2>/dev/null || true; rm -rf /var/lib/postgresql/*/*/log /var/lib/postgresql/*/*/pg_log 2>/dev/null || true; find /var/lib/mysql /var/lib/mongodb -type f -name '*.log' -delete 2>/dev/null || true; rm -rf /root/.npm/_logs /root/.babel.json /root/.pytest_cache 2>/dev/null || true; find / -maxdepth 4 -xdev -name task_description.md -path '*/.build_env/*' -delete 2>/dev/null || true; true +git clean -fdx --exclude=node_modules --exclude=bower_components --exclude=.husky --exclude=vendor --exclude=third_party --exclude=_deps --exclude=vcpkg_installed --exclude=.venv --exclude=venv --exclude=.gradle --exclude=target --exclude=.build --exclude=lib --exclude=.bundle --exclude=Manifest.toml --exclude=_build --exclude=.stack-work --exclude=dist-newstyle >/dev/null 2>&1 +find /root/.m2 -type f \( -name '*-SNAPSHOT.jar' -o -name '*-SNAPSHOT-sources.jar' -o -name '*-SNAPSHOT-tests.jar' -o -name '*-SNAPSHOT-test-sources.jar' \) -delete 2>/dev/null; rm -rf /root/.julia/compiled 2>/dev/null; rm -rf /root/.gradle/caches/build-cache-* /root/.gradle/daemon 2>/dev/null; rm -rf /root/.gradle/caches/*/scripts /root/.gradle/caches/jars-* 2>/dev/null; rm -rf /root/.cache/bazel 2>/dev/null; true +if [ "$LATER" -gt 0 ]; then + mv "$CWD/.git" "$M/git-hidden" + echo "history not truncated at ${BASE:0:12}: .git hidden while the agent works" +fi +write_blocklist + +touch "$M/ready" +echo "setup done" diff --git a/tasks/format-code-task-000133/tests/test.patch b/tasks/format-code-task-000133/tests/test.patch new file mode 100644 index 0000000000000000000000000000000000000000..327934011e46513345398a1bb04631862a45d215 --- /dev/null +++ b/tasks/format-code-task-000133/tests/test.patch @@ -0,0 +1,421 @@ +diff --git a/app/common/__tests__/network.test.js b/app/common/__tests__/network.test.js +index f3bde7a5c..ac19db890 100644 +--- a/app/common/__tests__/network.test.js ++++ b/app/common/__tests__/network.test.js +@@ -1,6 +1,10 @@ + import * as networkUtils from '../network'; + import * as db from '../database'; + import nock from 'nock'; ++import dns from 'dns'; ++import fs from 'fs'; ++import http from 'http'; ++import https from 'https'; + import {resolve as pathResolve, join as pathJoin} from 'path'; + import {getRenderedRequest} from '../render'; + import * as models from '../../models'; +@@ -127,7 +131,7 @@ describe('actuallySend()', () => { + cookies + }); + +- mock = nock('http://[::1]:80') ++ mock = nock('http://localhost') + .matchHeader('Content-Type', 'application/json') + .matchHeader('Authorization', 'Basic dXNlcjpwYXNz') + .matchHeader('Cookie', 'foo=barrrrr') +@@ -160,7 +164,7 @@ describe('actuallySend()', () => { + settings + ); + +- expect(mock.basePath).toBe('http://::1:80'); ++ expect(mock.basePath).toBe('http://localhost:80'); + expect(response.error).toBe(''); + expect(response.url).toBe('http://localhost/?foo%20bar=hello%26world'); + expect(response.body).toBe(new Buffer('response body').toString('base64')); +@@ -174,7 +178,7 @@ describe('actuallySend()', () => { + const settings = await models.settings.create(); + await models.cookieJar.create({parentId: workspace._id}); + +- mock = nock('http://[::1]:80') ++ mock = nock('http://localhost') + .matchHeader('Content-Type', 'application/octet-stream') + .post('/', 'Hello World!') + .reply(200, 'response body') +@@ -199,7 +203,7 @@ describe('actuallySend()', () => { + settings + ); + +- expect(mock.basePath).toBe('http://::1:80'); ++ expect(mock.basePath).toBe('http://localhost:80'); + expect(response.error).toBe(''); + expect(response.url).toBe('http://localhost/'); + expect(response.body).toBe(new Buffer('response body').toString('base64')); +@@ -214,7 +218,7 @@ describe('actuallySend()', () => { + await models.cookieJar.create({parentId: workspace._id}); + const fileName = pathResolve(pathJoin(__dirname, './testfile.txt')); + let requestBody = 'n/a'; +- mock = nock('http://[::1]:80') ++ mock = nock('http://localhost') + .matchHeader('Content-Type', /^multipart\/form-data/) + .post('/', body => { + requestBody = body; +@@ -249,7 +253,7 @@ describe('actuallySend()', () => { + settings + ); + +- expect(mock.basePath).toBe('http://::1:80'); ++ expect(mock.basePath).toBe('http://localhost:80'); + expect(response.error).toBe(''); + expect(response.url).toBe('http://localhost/'); + expect(response.body).toBe(new Buffer('response body').toString('base64')); +@@ -269,4 +273,272 @@ describe('actuallySend()', () => { + expect(lines[9]).toMatch(/^----------------------------\d{24}--/); + expect(lines[10]).toBe(''); + }); ++ ++ it('preserves the requested hostname for virtual-host routing', async () => { ++ const originalLookup = dns.lookup; ++ let server; ++ const loopback = await new Promise((resolve, reject) => { ++ originalLookup('127.0.0.1', (err, address, family) => err ? reject(err) : resolve({address, family})); ++ }); ++ dns.lookup = (hostname, options, callback) => { ++ const cb = typeof options === 'function' ? options : callback; ++ const wantsAll = options && options.all; ++ const result = {address: '127.0.0.1', family: loopback.family}; ++ ++ if (wantsAll) { ++ cb(null, [result]); ++ } else { ++ cb(null, result.address, result.family); ++ } ++ }; ++ ++ try { ++ const workspace = await models.workspace.create(); ++ const settings = await models.settings.create(); ++ await models.cookieJar.create({parentId: workspace._id}); ++ ++ server = await new Promise(resolve => { ++ const s = http.createServer((req, res) => { ++ const host = req.headers.host || ''; ++ ++ if (req.url === '/virtual-host-check' && /^alpha\.insomnia\.test:/.test(host)) { ++ res.writeHead(200); ++ res.end('alpha-vhost-response'); ++ } else if (req.url === '/virtual-host-check' && /^beta\.insomnia\.test:/.test(host)) { ++ res.writeHead(200); ++ res.end('beta-vhost-response'); ++ } else { ++ res.writeHead(421); ++ res.end(`wrong-vhost:${host}`); ++ } ++ }); ++ ++ s.listen(0, '127.0.0.1', () => resolve(s)); ++ }); ++ ++ const port = server.address().port; ++ ++ const alphaRequest = await models.request.create({ ++ parentId: workspace._id, ++ method: 'GET', ++ url: `http://alpha.insomnia.test:${port}/virtual-host-check`, ++ }); ++ ++ const betaRequest = await models.request.create({ ++ parentId: workspace._id, ++ method: 'GET', ++ url: `http://beta.insomnia.test:${port}/virtual-host-check`, ++ }); ++ ++ const alphaResponse = await networkUtils._actuallySend( ++ await getRenderedRequest(alphaRequest), ++ workspace, ++ settings ++ ); ++ ++ const betaResponse = await networkUtils._actuallySend( ++ await getRenderedRequest(betaRequest), ++ workspace, ++ settings ++ ); ++ ++ expect(alphaResponse.error).toBe(''); ++ expect(betaResponse.error).toBe(''); ++ expect(alphaResponse.body).toBe(new Buffer('alpha-vhost-response').toString('base64')); ++ expect(betaResponse.body).toBe(new Buffer('beta-vhost-response').toString('base64')); ++ } finally { ++ dns.lookup = originalLookup; ++ if (server) { ++ server.close(); ++ } ++ } ++ }); ++ ++ it('preserves the requested hostname for HTTPS virtual-host routing', async () => { ++ const originalLookup = dns.lookup; ++ let server; ++ const loopback = await new Promise((resolve, reject) => { ++ originalLookup('127.0.0.1', (err, address, family) => err ? reject(err) : resolve({address, family})); ++ }); ++ dns.lookup = (hostname, options, callback) => { ++ const cb = typeof options === 'function' ? options : callback; ++ const wantsAll = options && options.all; ++ const result = {address: '127.0.0.1', family: loopback.family}; ++ ++ if (wantsAll) { ++ cb(null, [result]); ++ } else { ++ cb(null, result.address, result.family); ++ } ++ }; ++ ++ try { ++ const workspace = await models.workspace.create(); ++ const settings = await models.settings.create({validateSSL: false}); ++ await models.cookieJar.create({parentId: workspace._id}); ++ ++ const key = fs.readFileSync(pathResolve(pathJoin( ++ __dirname, ++ '../../../node_modules/webpack-dev-server/ssl/server.key' ++ ))); ++ const cert = fs.readFileSync(pathResolve(pathJoin( ++ __dirname, ++ '../../../node_modules/webpack-dev-server/ssl/server.crt' ++ ))); ++ ++ server = await new Promise(resolve => { ++ const s = https.createServer({key, cert}, (req, res) => { ++ const host = req.headers.host || ''; ++ const servername = req.socket.servername || ''; ++ ++ if ( ++ req.url === '/secure-host-check' && ++ /^tls\.insomnia\.test:/.test(host) && ++ servername === 'tls.insomnia.test' ++ ) { ++ res.writeHead(200); ++ res.end('tls-vhost-response'); ++ } else { ++ res.writeHead(421); ++ res.end(`wrong-tls-vhost:${host}:${servername}`); ++ } ++ }); ++ ++ s.listen(0, '127.0.0.1', () => resolve(s)); ++ }); ++ ++ const port = server.address().port; ++ const request = await models.request.create({ ++ parentId: workspace._id, ++ method: 'GET', ++ url: `https://tls.insomnia.test:${port}/secure-host-check`, ++ }); ++ ++ const response = await networkUtils._actuallySend( ++ await getRenderedRequest(request), ++ workspace, ++ settings ++ ); ++ ++ expect(response.error).toBe(''); ++ expect(response.body).toBe(new Buffer('tls-vhost-response').toString('base64')); ++ } finally { ++ dns.lookup = originalLookup; ++ if (server) { ++ server.close(); ++ } ++ } ++ }); ++ ++ it('keeps cookie jar state across redirects and writes response cookies back', async () => { ++ const originalLookup = dns.lookup; ++ let server; ++ const loopback = await new Promise((resolve, reject) => { ++ originalLookup('127.0.0.1', (err, address, family) => err ? reject(err) : resolve({address, family})); ++ }); ++ dns.lookup = (hostname, options, callback) => { ++ const cb = typeof options === 'function' ? options : callback; ++ const wantsAll = options && options.all; ++ const result = {address: '127.0.0.1', family: loopback.family}; ++ ++ if (wantsAll) { ++ cb(null, [result]); ++ } else { ++ cb(null, result.address, result.family); ++ } ++ }; ++ ++ try { ++ const workspace = await models.workspace.create(); ++ const settings = await models.settings.create(); ++ const nonce = `${Date.now()}${Math.floor(Math.random() * 100000)}`; ++ const seedName = `seed_${nonce}`; ++ const seedValue = `seed-value-${nonce}`; ++ const redirectName = `redirect_${nonce}`; ++ const redirectValue = `redirect-value-${nonce}`; ++ ++ const cookieJar = await models.cookieJar.create({ ++ parentId: workspace._id, ++ cookies: [ ++ { ++ key: seedName, ++ value: seedValue, ++ domain: 'cookie-flow.insomnia.test', ++ path: '/', ++ secure: false, ++ httpOnly: false, ++ expires: new Date('2096-10-12T04:40:49.000Z'), ++ }, ++ ], ++ }); ++ ++ let firstHopCookie = ''; ++ let secondHopCookie = ''; ++ server = await new Promise(resolve => { ++ const s = http.createServer((req, res) => { ++ if (req.url === '/start') { ++ firstHopCookie = req.headers.cookie || ''; ++ if (!firstHopCookie.includes(`${seedName}=${seedValue}`)) { ++ res.writeHead(400); ++ res.end('missing-seed-cookie'); ++ return; ++ } ++ ++ res.writeHead(302, { ++ Location: '/after-redirect', ++ 'Set-Cookie': `${redirectName}=${redirectValue}; Path=/`, ++ }); ++ res.end(); ++ } else if (req.url === '/after-redirect') { ++ secondHopCookie = req.headers.cookie || ''; ++ if ( ++ secondHopCookie.includes(`${seedName}=${seedValue}`) && ++ secondHopCookie.includes(`${redirectName}=${redirectValue}`) ++ ) { ++ res.writeHead(200); ++ res.end('redirected-cookie-ok'); ++ } else { ++ res.writeHead(400); ++ res.end('missing-redirect-cookie'); ++ } ++ } else { ++ res.writeHead(404); ++ res.end('not-found'); ++ } ++ }); ++ ++ s.listen(0, '127.0.0.1', () => resolve(s)); ++ }); ++ ++ const port = server.address().port; ++ ++ const request = await models.request.create({ ++ parentId: workspace._id, ++ method: 'GET', ++ url: `http://cookie-flow.insomnia.test:${port}/start`, ++ }); ++ ++ const response = await networkUtils._actuallySend( ++ await getRenderedRequest(request), ++ workspace, ++ settings ++ ); ++ ++ const updatedJar = await models.cookieJar.getById(cookieJar._id); ++ const storedCookie = updatedJar.cookies.find(cookie => cookie.key === redirectName); ++ ++ expect(firstHopCookie).toContain(`${seedName}=${seedValue}`); ++ expect(secondHopCookie).toContain(`${seedName}=${seedValue}`); ++ expect(secondHopCookie).toContain(`${redirectName}=${redirectValue}`); ++ expect(response.error).toBe(''); ++ expect(response.body).toBe(new Buffer('redirected-cookie-ok').toString('base64')); ++ expect(storedCookie).toBeTruthy(); ++ expect(storedCookie.value).toBe(redirectValue); ++ } finally { ++ dns.lookup = originalLookup; ++ if (server) { ++ server.close(); ++ } ++ } ++ }); + }); +diff --git a/app/models/__mocks__/uuid.js b/app/models/__mocks__/uuid.js +index 87359ac75..5a50fc8b2 100644 +--- a/app/models/__mocks__/uuid.js ++++ b/app/models/__mocks__/uuid.js +@@ -24,7 +24,37 @@ const uuids = [ + '884b5a86-5e6d-49ef-8bea-b5dcb7564cdc', + '2fea36e5-4e92-4da6-8088-2821f580cf20', + '1e310193-7209-430d-9ed2-f8d73ec932b5', +- '9996a7f7-ff6a-414e-9a75-2adadbde88a9' ++ '9996a7f7-ff6a-414e-9a75-2adadbde88a9', ++ '50b9c66c-5359-4ef1-a4cf-a4efc75c4e40', ++ 'cd80dc20-25b6-45b9-8cf4-ad3616632194', ++ '4f4d6cbd-72eb-4af8-bf48-61748c8f3ded', ++ '2cf858b1-38ee-4066-96d3-784efbcd8749', ++ '0f160c37-6da9-468d-9f6e-2237d20ce645', ++ 'c02e3a38-19c1-4fce-9747-745c9aa5c6d4', ++ '29fdc38d-d8c3-43a6-b3bb-ad1ac533d9fe', ++ '7add3a5c-c66f-41c4-a15b-92718b16d08a', ++ 'f6d132ac-276e-44fc-93a9-4f4ff9103645', ++ 'c6f08e09-c598-441b-ac67-ce446b33460c', ++ '0b187758-a5f8-44e0-a3ce-8d32d2e2d731', ++ 'f7c23854-e202-48ac-80fc-8f2cd6e69cdf', ++ '422cb833-02cf-492f-a96c-61a9d7e98c50', ++ '23e61f2d-6bc5-4d53-91b4-5a50c3019100', ++ '5d4c56f8-c9f6-4a3d-ae19-3654df7c24a9', ++ 'd5a31c7b-9f61-47e5-bca3-65f5b98d14db', ++ 'c2a9de66-3385-41bc-bd26-b3bc260841b5', ++ 'be353d88-03d9-43d1-a021-f6bed08da499', ++ '7c5f6382-892b-48f0-a287-2d27d4f8577b', ++ '426b8c1b-7d1e-43ef-a0eb-491221a5d90d', ++ '131d4bde-1a52-476c-9efc-37661346c833', ++ '704c7201-e2a8-4b77-9f64-f826d8ddaf56', ++ '83f1086b-a010-44b0-890f-1d2243efec90', ++ 'f43218dd-6c3c-43b6-a676-ee43902f61e7', ++ '01f76472-b6a0-4f71-a412-a648cf254fc7', ++ '6c39b723-6a21-40e2-a608-290856d1d901', ++ '1d078a0c-8780-45d0-94f3-c35229f620ab', ++ '51bc2a2c-73da-4f8e-a40b-974ebd1e6d3e', ++ '51e3d820-fc56-45d3-bc13-35acaad958d4', ++ '52ca9bd7-f98d-49d0-b536-9d4aab57444e' + ]; + + function v4 () { +diff --git a/mimo_test_command.sh b/mimo_test_command.sh +new file mode 100755 +--- /dev/null ++++ b/mimo_test_command.sh +@@ -0,0 +1,31 @@ ++#!/bin/bash ++set -uo pipefail ++cd /testbed ++ ++ ++dev-switch node 20 2>/dev/null || true ++ ++if [ ! -d node_modules ]; then ++ cp package.json /tmp/package.json.orig ++ sed -i 's|"httpsnippet": "git@github.com:getinsomnia/httpsnippet.git#a3a2c0a0167fa844bf92df52a1442fa1d68a9053"|"httpsnippet": "2.0.0"|' package.json ++ sed -i 's|"srp": "git@github.com:getinsomnia/srp-js.git#6ebd8c3acfbcf69645e4c6e6f8f6b55138ff22c3"|"srp": "0.2.0"|' package.json ++ git config --global url."https://github.com/".insteadOf "git@github.com:" 2>/dev/null || true ++ npm install --legacy-peer-deps --ignore-scripts ++ cp /tmp/package.json.orig package.json ++fi ++ ++ ++case "${1:-}" in ++ base) ++ npx jest --silent --testPathPattern="app/common/__tests__/network\\.test\\.js" \ ++ --testNamePattern="builds a default config|builds a complex config" ++ ;; ++ new) ++ npx jest --silent --testPathPattern="app/common/__tests__/network\\.test\\.js" \ ++ --testNamePattern="does something|sends a file|sends multipart form data|preserves the requested hostname for virtual-host routing|preserves the requested hostname for HTTPS virtual-host routing|keeps cookie jar state across redirects and writes response cookies back" ++ ;; ++ *) ++ echo "usage: $0 base|new" ++ exit 2 ++ ;; ++esac diff --git a/tasks/format-code-task-000133/tests/test.sh b/tasks/format-code-task-000133/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..a0bca91d6cbb3fa3597ea48277d9ceb9d7e5bde8 --- /dev/null +++ b/tasks/format-code-task-000133/tests/test.sh @@ -0,0 +1,39 @@ +#!/bin/bash +# Code grading, mimoagent opensource_code.py: reset the files the hidden test patch touches, apply it, run the +# task's test command; reward 1 when it exits 0. A testbed failure (reset or apply) writes no reward: not scored. +M=/var/lib/mimo +CWD=/testbed +V=/logs/verifier +mkdir -p "$V" +BASE=$(cat "$M/base" 2>/dev/null) || { echo "setup never ran (no $M/base)" >&2; exit 1; } +cd "$CWD" || exit 1 +if [ -d "$M/git-hidden" ]; then rm -rf "$CWD/.git"; mv "$M/git-hidden" "$CWD/.git"; fi +# the agent's change against the base, so its own commits count too +git add -A >/dev/null 2>&1 && git -c core.fileMode=false diff --cached "$BASE" > "$V/agent.diff" +git reset -q +if ! ( +while IFS= read -r tf; do + [ -z "$tf" ] && continue + if git cat-file -e $BASE:"$tf" 2>/dev/null; then + git checkout $BASE -- "$tf" 2>/dev/null || true + else + git rm -f --cached "$tf" >/dev/null 2>&1 || true + rm -f "$tf" + fi +done <<'EOF_RESET_TEST_FILES' +app/common/__tests__/network.test.js +app/models/__mocks__/uuid.js +mimo_test_command.sh +EOF_RESET_TEST_FILES + +); then echo "could not reset the test files (testbed problem, not scored)" >&2; exit 1; fi +if ! git apply --verbose /tests/test.patch > "$V/apply.log" 2>&1; then + cat "$V/apply.log" >&2 + echo "the hidden tests could not be applied (testbed problem, not scored)" >&2 + exit 1 +fi +timeout 1800 sh -c "$(cat /tests/test_command.sh)" > "$V/test_output.log" 2>&1 +RC=$? +tail -c 12000 "$V/test_output.log" +if [ $RC -eq 0 ]; then echo 1 > "$V/reward.txt"; else echo 0 > "$V/reward.txt"; fi +echo "test command exited $RC" diff --git a/tasks/format-code-task-000133/tests/test_command.sh b/tasks/format-code-task-000133/tests/test_command.sh new file mode 100644 index 0000000000000000000000000000000000000000..e8d2f32b64045b5a5a56e0ad5667da87d8e0bc2a --- /dev/null +++ b/tasks/format-code-task-000133/tests/test_command.sh @@ -0,0 +1 @@ +bash /testbed/mimo_test_command.sh base && bash /testbed/mimo_test_command.sh new \ No newline at end of file diff --git a/tasks/format-code-task-000134/environment/Dockerfile b/tasks/format-code-task-000134/environment/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..f1073afd69406f0957a051ddff30b20326f11b30 --- /dev/null +++ b/tasks/format-code-task-000134/environment/Dockerfile @@ -0,0 +1,3 @@ +# The task's image, pinned by digest (the same as [environment].docker_image). +# Setup runs at start from [environment.healthcheck]; environment/setup/ is its readable copy. +FROM docker.io/xiaomimimo/mimo-v2.6-rl-oss@sha256:6c8119a9d8de92737e23edbe1a41cb3b23dcedd0d847458e2d8cf16a98af7610 diff --git a/tasks/format-code-task-000134/environment/setup/files/blocklist b/tasks/format-code-task-000134/environment/setup/files/blocklist new file mode 100644 index 0000000000000000000000000000000000000000..a8e4bdc4c7d9b739c047a3cb58ea72a1bb05bcbc --- /dev/null +++ b/tasks/format-code-task-000134/environment/setup/files/blocklist @@ -0,0 +1,33 @@ +# mimo answer-leak blocklist (mimoagent) +0.0.0.0 github.com +0.0.0.0 www.github.com +0.0.0.0 api.github.com +0.0.0.0 raw.githubusercontent.com +0.0.0.0 codeload.github.com +0.0.0.0 objects.githubusercontent.com +0.0.0.0 gist.github.com +0.0.0.0 gist.githubusercontent.com +0.0.0.0 gitlab.com +0.0.0.0 bitbucket.org +0.0.0.0 sourceforge.net +0.0.0.0 git.kernel.org +0.0.0.0 chromium.googlesource.com +0.0.0.0 android.googlesource.com +0.0.0.0 sourcegraph.com +0.0.0.0 bugs.chromium.org +0.0.0.0 issues.oss-fuzz.com +0.0.0.0 oss-fuzz.com +0.0.0.0 osv.dev +0.0.0.0 api.osv.dev +0.0.0.0 bugzilla.mozilla.org +0.0.0.0 proxy.golang.org +0.0.0.0 sum.golang.org +0.0.0.0 pkg.go.dev +0.0.0.0 google.com +0.0.0.0 www.google.com +0.0.0.0 bing.com +0.0.0.0 www.bing.com +0.0.0.0 duckduckgo.com +0.0.0.0 html.duckduckgo.com +0.0.0.0 search.brave.com +0.0.0.0 stackoverflow.com diff --git a/tasks/format-code-task-000134/environment/setup/setup.sh b/tasks/format-code-task-000134/environment/setup/setup.sh new file mode 100644 index 0000000000000000000000000000000000000000..d883db90cfcfb48f7a139861bbe9f6b5d95cad6f --- /dev/null +++ b/tasks/format-code-task-000134/environment/setup/setup.sh @@ -0,0 +1,34 @@ +#!/bin/bash +# Runs once, as root, before the agent starts: Harbor's [environment.healthcheck] unpacks this folder into +# /var/lib/mimo and runs it. Generated by mimo_harbor; see its README for how each step maps to Xiaomi's harness. +M=/var/lib/mimo +[ -f "$M/ready" ] && exit 0 +chmod 700 "$M" +fail() { echo "setup: $*" >&2; exit 1; } +# the answer-leak blocklist (mimoagent), applied to /etc/hosts by the agent right after it installs +write_blocklist() { cp "$M/files/blocklist" "$M/blocklist"; } + +# Code: mimoagent environments/datasets/opensource_code.py + base.py, as the explorer runs it (app/runner/domains.py Code). +CWD=/testbed +git config --global --add safe.directory "$CWD" +cd "$CWD" || fail "no working directory $CWD" +if ! git rev-parse --git-dir >/dev/null 2>&1; then # a bare source tree: give it a baseline commit + git init -q && git add -A && git -c user.name=mimo -c user.email=mimo@localhost commit -q -m baseline --allow-empty +fi +BASE=$(git rev-parse HEAD 2>/dev/null) +[ ${#BASE} -eq 40 ] || fail "could not resolve the base commit in $CWD" +echo "$BASE" > "$M/base" +# Images are built with history truncated at the base. If one is not, the fix could be read out of git log, +# so .git is hidden while the agent works and put back for grading. +LATER=$(git rev-list --all --not "$BASE" 2>/dev/null | head -n 5 | grep -c . || true) +rm -f /tmp/fail.log /tmp/pass.log /tmp/patch.diff /tmp/test_patch.diff /tmp/*.log 2>/dev/null; rm -rf /tmp/claude-0 /tmp/claude-* /tmp/testem-* /tmp/puppeteer_dev_chrome_profile-* 2>/dev/null; rm -f /tmp/test_files.json 2>/dev/null; rm -rf /tmp/jest_* /tmp/jest-* /tmp/build /tmp/build_env 2>/dev/null; rm -rf /tmp/pytest-of-root /tmp/pytest-* /tmp/.pytest_cache /tmp/__pycache__ 2>/dev/null; rm -rf /tmp/go-build* /tmp/standards /tmp/wordpress /tmp/zig-* /tmp/testbase /tmp/testbed 2>/dev/null; rm -f /tmp/tmp*.tmp /tmp/*.bak /tmp/expect* /tmp/butwas* 2>/dev/null; rm -rf /root/.cache/go-build 2>/dev/null; rm -rf /tests 2>/dev/null; find /logs -mindepth 1 -delete 2>/dev/null; mkdir -p /logs/agent /logs/verifier /logs/artifacts; chmod 777 /logs/agent /logs/verifier /logs/artifacts; find /var/log -type f -delete 2>/dev/null || true; rm -rf /var/lib/postgresql/*/*/log /var/lib/postgresql/*/*/pg_log 2>/dev/null || true; find /var/lib/mysql /var/lib/mongodb -type f -name '*.log' -delete 2>/dev/null || true; rm -rf /root/.npm/_logs /root/.babel.json /root/.pytest_cache 2>/dev/null || true; find / -maxdepth 4 -xdev -name task_description.md -path '*/.build_env/*' -delete 2>/dev/null || true; true +git clean -fdx --exclude=node_modules --exclude=bower_components --exclude=.husky --exclude=vendor --exclude=third_party --exclude=_deps --exclude=vcpkg_installed --exclude=.venv --exclude=venv --exclude=.gradle --exclude=target --exclude=.build --exclude=lib --exclude=.bundle --exclude=Manifest.toml --exclude=_build --exclude=.stack-work --exclude=dist-newstyle >/dev/null 2>&1 +find /root/.m2 -type f \( -name '*-SNAPSHOT.jar' -o -name '*-SNAPSHOT-sources.jar' -o -name '*-SNAPSHOT-tests.jar' -o -name '*-SNAPSHOT-test-sources.jar' \) -delete 2>/dev/null; rm -rf /root/.julia/compiled 2>/dev/null; rm -rf /root/.gradle/caches/build-cache-* /root/.gradle/daemon 2>/dev/null; rm -rf /root/.gradle/caches/*/scripts /root/.gradle/caches/jars-* 2>/dev/null; rm -rf /root/.cache/bazel 2>/dev/null; true +if [ "$LATER" -gt 0 ]; then + mv "$CWD/.git" "$M/git-hidden" + echo "history not truncated at ${BASE:0:12}: .git hidden while the agent works" +fi +write_blocklist + +touch "$M/ready" +echo "setup done" diff --git a/tasks/format-code-task-000134/tests/test.patch b/tasks/format-code-task-000134/tests/test.patch new file mode 100644 index 0000000000000000000000000000000000000000..0acc7649996e5d41d595a3429636d4db1996987d --- /dev/null +++ b/tasks/format-code-task-000134/tests/test.patch @@ -0,0 +1,184 @@ +diff --git a/spec/01-unit/01-db/01-schema/06-routes_spec.lua b/spec/01-unit/01-db/01-schema/06-routes_spec.lua +index 5a693fc67..488f20f3b 100644 +--- a/spec/01-unit/01-db/01-schema/06-routes_spec.lua ++++ b/spec/01-unit/01-db/01-schema/06-routes_spec.lua +@@ -6,7 +6,7 @@ local certificates = require "kong.db.schema.entities.certificates" + local Entity = require "kong.db.schema.entity" + + assert(Schema.new(certificates)) +-assert(Schema.new(services)) ++local Services = assert(Schema.new(services)) + local Routes = assert(Entity.new(routes)) + + for name, subschema in pairs(routes_subschemas) do +@@ -268,6 +268,133 @@ describe("routes schema", function() + end + end) + ++ ++ it("accepts RFC 3986 reserved characters in route paths", function() ++ local valid_paths = { ++ "/users:list", ++ "/path/with@sign", ++ "/items;v=2", ++ "/api/+something", ++ "/hello/path$with$!&'()*+,;=stuff", ++ "/accounts/42:archive", ++ } ++ ++ for i = 1, #valid_paths do ++ local route = Routes:process_auto_fields({ ++ protocols = { "http" }, ++ service = { id = a_valid_uuid }, ++ methods = {}, ++ hosts = {}, ++ paths = { valid_paths[i] }, ++ }, "insert") ++ ++ local ok, err = Routes:validate(route) ++ assert.is_nil(err) ++ assert.is_true(ok) ++ end ++ end) ++ ++ it("accepts RFC 3986 reserved characters in shared service paths", function() ++ local valid_paths = { ++ "/search,filter", ++ "/resources/id:doSomething", ++ } ++ ++ for i = 1, #valid_paths do ++ local service = { ++ host = "example.com", ++ port = 80, ++ protocol = "http", ++ path = valid_paths[i], ++ } ++ ++ local ok, err = Services:validate(service) ++ assert.is_nil(err) ++ assert.is_true(ok) ++ end ++ end) ++ ++ it("keeps regex-style route path syntax validation", function() ++ local valid_regex_paths = { ++ "/users/(foo)/profile", ++ "/files/.+suffix", ++ } ++ ++ for i = 1, #valid_regex_paths do ++ local route = Routes:process_auto_fields({ ++ protocols = { "http" }, ++ service = { id = a_valid_uuid }, ++ methods = {}, ++ hosts = {}, ++ paths = { valid_regex_paths[i] }, ++ }, "insert") ++ ++ local ok, err = Routes:validate(route) ++ assert.is_nil(err) ++ assert.is_true(ok) ++ end ++ ++ local invalid_regex_paths = { ++ "/users/(foo/profile", ++ "/files/(.+suffix", ++ "/routes/[unterminated", ++ "/users/(profile|settings", ++ } ++ ++ for i = 1, #invalid_regex_paths do ++ local route = Routes:process_auto_fields({ ++ protocols = { "http" }, ++ service = { id = a_valid_uuid }, ++ methods = {}, ++ hosts = {}, ++ paths = { invalid_regex_paths[i] }, ++ }, "insert") ++ ++ local ok, err = Routes:validate(route) ++ assert.falsy(ok) ++ assert.truthy(err.paths[1]) ++ end ++ end) ++ ++ it("still rejects route paths with genuinely invalid characters", function() ++ local invalid_paths = { ++ "/users/[bad", ++ } ++ ++ for i = 1, #invalid_paths do ++ local route = Routes:process_auto_fields({ ++ protocols = { "http" }, ++ service = { id = a_valid_uuid }, ++ methods = {}, ++ hosts = {}, ++ paths = { invalid_paths[i] }, ++ }, "insert") ++ ++ local ok, err = Routes:validate(route) ++ assert.falsy(ok) ++ assert.truthy(err.paths[1]) ++ end ++ end) ++ ++ it("rejects malformed percent encoding without accepting it as a route path", function() ++ local invalid_paths = { ++ "/percent/%", ++ "/percent/%2", ++ "/percent/%zz", ++ } ++ ++ for i = 1, #invalid_paths do ++ local route = { ++ protocols = { "http" }, ++ paths = { invalid_paths[i] }, ++ } ++ ++ local ok, err = Routes:validate(route) ++ assert.falsy(ok) ++ assert.truthy(err.paths[1]) ++ end ++ end) ++ + it("rejects badly percent-encoded values", function() + local invalid_paths = { + "/some%2words", +diff --git a/mimo_test_command.sh b/mimo_test_command.sh +new file mode 100755 +--- /dev/null ++++ b/mimo_test_command.sh +@@ -0,0 +1,32 @@ ++#!/bin/bash ++set -uo pipefail ++ ++cd /testbed ++ ++ ++export PATH="/usr/local/openresty/bin:/usr/local/openresty/luajit/bin:/usr/local/bin:$PATH" ++ ++run_new_tests() { ++ bin/busted spec/01-unit/01-db/01-schema/06-routes_spec.lua \ ++ --filter="RFC 3986 reserved" && ++ bin/busted spec/01-unit/01-db/01-schema/06-routes_spec.lua \ ++ --filter="keeps" && ++ bin/busted spec/01-unit/01-db/01-schema/06-routes_spec.lua \ ++ --filter="genuinely" && ++ bin/busted spec/01-unit/01-db/01-schema/06-routes_spec.lua \ ++ --filter="malformed" ++} ++ ++case "${1:-}" in ++ base) ++ bin/busted spec/01-unit/01-db/01-schema/06-routes_spec.lua \ ++ --filter="validates a valid route" ++ ;; ++ new) ++ run_new_tests ++ ;; ++ *) ++ echo "usage: $0 base|new" ++ exit 2 ++ ;; ++esac diff --git a/tasks/format-code-task-000134/tests/test.sh b/tasks/format-code-task-000134/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..e9ef91078b0d4aed2216259a2e76a636c001f742 --- /dev/null +++ b/tasks/format-code-task-000134/tests/test.sh @@ -0,0 +1,38 @@ +#!/bin/bash +# Code grading, mimoagent opensource_code.py: reset the files the hidden test patch touches, apply it, run the +# task's test command; reward 1 when it exits 0. A testbed failure (reset or apply) writes no reward: not scored. +M=/var/lib/mimo +CWD=/testbed +V=/logs/verifier +mkdir -p "$V" +BASE=$(cat "$M/base" 2>/dev/null) || { echo "setup never ran (no $M/base)" >&2; exit 1; } +cd "$CWD" || exit 1 +if [ -d "$M/git-hidden" ]; then rm -rf "$CWD/.git"; mv "$M/git-hidden" "$CWD/.git"; fi +# the agent's change against the base, so its own commits count too +git add -A >/dev/null 2>&1 && git -c core.fileMode=false diff --cached "$BASE" > "$V/agent.diff" +git reset -q +if ! ( +while IFS= read -r tf; do + [ -z "$tf" ] && continue + if git cat-file -e $BASE:"$tf" 2>/dev/null; then + git checkout $BASE -- "$tf" 2>/dev/null || true + else + git rm -f --cached "$tf" >/dev/null 2>&1 || true + rm -f "$tf" + fi +done <<'EOF_RESET_TEST_FILES' +spec/01-unit/01-db/01-schema/06-routes_spec.lua +mimo_test_command.sh +EOF_RESET_TEST_FILES + +); then echo "could not reset the test files (testbed problem, not scored)" >&2; exit 1; fi +if ! git apply --verbose /tests/test.patch > "$V/apply.log" 2>&1; then + cat "$V/apply.log" >&2 + echo "the hidden tests could not be applied (testbed problem, not scored)" >&2 + exit 1 +fi +timeout 1800 sh -c "$(cat /tests/test_command.sh)" > "$V/test_output.log" 2>&1 +RC=$? +tail -c 12000 "$V/test_output.log" +if [ $RC -eq 0 ]; then echo 1 > "$V/reward.txt"; else echo 0 > "$V/reward.txt"; fi +echo "test command exited $RC" diff --git a/tasks/format-code-task-000134/tests/test_command.sh b/tasks/format-code-task-000134/tests/test_command.sh new file mode 100644 index 0000000000000000000000000000000000000000..e8d2f32b64045b5a5a56e0ad5667da87d8e0bc2a --- /dev/null +++ b/tasks/format-code-task-000134/tests/test_command.sh @@ -0,0 +1 @@ +bash /testbed/mimo_test_command.sh base && bash /testbed/mimo_test_command.sh new \ No newline at end of file diff --git a/tasks/format-code-task-000173/environment/Dockerfile b/tasks/format-code-task-000173/environment/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..28fcc9ae614c6908c63391bc7f7fbe0d2ff97649 --- /dev/null +++ b/tasks/format-code-task-000173/environment/Dockerfile @@ -0,0 +1,3 @@ +# The task's image, pinned by digest (the same as [environment].docker_image). +# Setup runs at start from [environment.healthcheck]; environment/setup/ is its readable copy. +FROM docker.io/xiaomimimo/mimo-v2.6-rl-oss@sha256:645e1f2394bbd71f74b1b83fe2907d5a7d0a0d556f7e63384022446adc0f72fe diff --git a/tasks/format-code-task-000173/environment/setup/files/blocklist b/tasks/format-code-task-000173/environment/setup/files/blocklist new file mode 100644 index 0000000000000000000000000000000000000000..a8e4bdc4c7d9b739c047a3cb58ea72a1bb05bcbc --- /dev/null +++ b/tasks/format-code-task-000173/environment/setup/files/blocklist @@ -0,0 +1,33 @@ +# mimo answer-leak blocklist (mimoagent) +0.0.0.0 github.com +0.0.0.0 www.github.com +0.0.0.0 api.github.com +0.0.0.0 raw.githubusercontent.com +0.0.0.0 codeload.github.com +0.0.0.0 objects.githubusercontent.com +0.0.0.0 gist.github.com +0.0.0.0 gist.githubusercontent.com +0.0.0.0 gitlab.com +0.0.0.0 bitbucket.org +0.0.0.0 sourceforge.net +0.0.0.0 git.kernel.org +0.0.0.0 chromium.googlesource.com +0.0.0.0 android.googlesource.com +0.0.0.0 sourcegraph.com +0.0.0.0 bugs.chromium.org +0.0.0.0 issues.oss-fuzz.com +0.0.0.0 oss-fuzz.com +0.0.0.0 osv.dev +0.0.0.0 api.osv.dev +0.0.0.0 bugzilla.mozilla.org +0.0.0.0 proxy.golang.org +0.0.0.0 sum.golang.org +0.0.0.0 pkg.go.dev +0.0.0.0 google.com +0.0.0.0 www.google.com +0.0.0.0 bing.com +0.0.0.0 www.bing.com +0.0.0.0 duckduckgo.com +0.0.0.0 html.duckduckgo.com +0.0.0.0 search.brave.com +0.0.0.0 stackoverflow.com diff --git a/tasks/format-code-task-000173/environment/setup/setup.sh b/tasks/format-code-task-000173/environment/setup/setup.sh new file mode 100644 index 0000000000000000000000000000000000000000..d883db90cfcfb48f7a139861bbe9f6b5d95cad6f --- /dev/null +++ b/tasks/format-code-task-000173/environment/setup/setup.sh @@ -0,0 +1,34 @@ +#!/bin/bash +# Runs once, as root, before the agent starts: Harbor's [environment.healthcheck] unpacks this folder into +# /var/lib/mimo and runs it. Generated by mimo_harbor; see its README for how each step maps to Xiaomi's harness. +M=/var/lib/mimo +[ -f "$M/ready" ] && exit 0 +chmod 700 "$M" +fail() { echo "setup: $*" >&2; exit 1; } +# the answer-leak blocklist (mimoagent), applied to /etc/hosts by the agent right after it installs +write_blocklist() { cp "$M/files/blocklist" "$M/blocklist"; } + +# Code: mimoagent environments/datasets/opensource_code.py + base.py, as the explorer runs it (app/runner/domains.py Code). +CWD=/testbed +git config --global --add safe.directory "$CWD" +cd "$CWD" || fail "no working directory $CWD" +if ! git rev-parse --git-dir >/dev/null 2>&1; then # a bare source tree: give it a baseline commit + git init -q && git add -A && git -c user.name=mimo -c user.email=mimo@localhost commit -q -m baseline --allow-empty +fi +BASE=$(git rev-parse HEAD 2>/dev/null) +[ ${#BASE} -eq 40 ] || fail "could not resolve the base commit in $CWD" +echo "$BASE" > "$M/base" +# Images are built with history truncated at the base. If one is not, the fix could be read out of git log, +# so .git is hidden while the agent works and put back for grading. +LATER=$(git rev-list --all --not "$BASE" 2>/dev/null | head -n 5 | grep -c . || true) +rm -f /tmp/fail.log /tmp/pass.log /tmp/patch.diff /tmp/test_patch.diff /tmp/*.log 2>/dev/null; rm -rf /tmp/claude-0 /tmp/claude-* /tmp/testem-* /tmp/puppeteer_dev_chrome_profile-* 2>/dev/null; rm -f /tmp/test_files.json 2>/dev/null; rm -rf /tmp/jest_* /tmp/jest-* /tmp/build /tmp/build_env 2>/dev/null; rm -rf /tmp/pytest-of-root /tmp/pytest-* /tmp/.pytest_cache /tmp/__pycache__ 2>/dev/null; rm -rf /tmp/go-build* /tmp/standards /tmp/wordpress /tmp/zig-* /tmp/testbase /tmp/testbed 2>/dev/null; rm -f /tmp/tmp*.tmp /tmp/*.bak /tmp/expect* /tmp/butwas* 2>/dev/null; rm -rf /root/.cache/go-build 2>/dev/null; rm -rf /tests 2>/dev/null; find /logs -mindepth 1 -delete 2>/dev/null; mkdir -p /logs/agent /logs/verifier /logs/artifacts; chmod 777 /logs/agent /logs/verifier /logs/artifacts; find /var/log -type f -delete 2>/dev/null || true; rm -rf /var/lib/postgresql/*/*/log /var/lib/postgresql/*/*/pg_log 2>/dev/null || true; find /var/lib/mysql /var/lib/mongodb -type f -name '*.log' -delete 2>/dev/null || true; rm -rf /root/.npm/_logs /root/.babel.json /root/.pytest_cache 2>/dev/null || true; find / -maxdepth 4 -xdev -name task_description.md -path '*/.build_env/*' -delete 2>/dev/null || true; true +git clean -fdx --exclude=node_modules --exclude=bower_components --exclude=.husky --exclude=vendor --exclude=third_party --exclude=_deps --exclude=vcpkg_installed --exclude=.venv --exclude=venv --exclude=.gradle --exclude=target --exclude=.build --exclude=lib --exclude=.bundle --exclude=Manifest.toml --exclude=_build --exclude=.stack-work --exclude=dist-newstyle >/dev/null 2>&1 +find /root/.m2 -type f \( -name '*-SNAPSHOT.jar' -o -name '*-SNAPSHOT-sources.jar' -o -name '*-SNAPSHOT-tests.jar' -o -name '*-SNAPSHOT-test-sources.jar' \) -delete 2>/dev/null; rm -rf /root/.julia/compiled 2>/dev/null; rm -rf /root/.gradle/caches/build-cache-* /root/.gradle/daemon 2>/dev/null; rm -rf /root/.gradle/caches/*/scripts /root/.gradle/caches/jars-* 2>/dev/null; rm -rf /root/.cache/bazel 2>/dev/null; true +if [ "$LATER" -gt 0 ]; then + mv "$CWD/.git" "$M/git-hidden" + echo "history not truncated at ${BASE:0:12}: .git hidden while the agent works" +fi +write_blocklist + +touch "$M/ready" +echo "setup done" diff --git a/tasks/format-code-task-000173/tests/test.patch b/tasks/format-code-task-000173/tests/test.patch new file mode 100644 index 0000000000000000000000000000000000000000..2f0491b5eece97f09a9f0e9eb9b8c777f16d7832 --- /dev/null +++ b/tasks/format-code-task-000173/tests/test.patch @@ -0,0 +1,57 @@ +diff --git a/graphql-dgs-spring-webflux-autoconfigure/src/test/kotlin/com/netflix/graphql/dgs/webflux/autoconfiguration/GraphiQlCustomEndpoint.kt b/graphql-dgs-spring-webflux-autoconfigure/src/test/kotlin/com/netflix/graphql/dgs/webflux/autoconfiguration/GraphiQlCustomEndpoint.kt +index eafdeef51..259bfb73a 100644 +--- a/graphql-dgs-spring-webflux-autoconfigure/src/test/kotlin/com/netflix/graphql/dgs/webflux/autoconfiguration/GraphiQlCustomEndpoint.kt ++++ b/graphql-dgs-spring-webflux-autoconfigure/src/test/kotlin/com/netflix/graphql/dgs/webflux/autoconfiguration/GraphiQlCustomEndpoint.kt +@@ -17,11 +17,13 @@ + package com.netflix.graphql.dgs.webflux.autoconfiguration + + import com.netflix.graphql.dgs.autoconfig.DgsAutoConfiguration ++import graphql.Assert + import org.junit.jupiter.api.Test + import org.springframework.beans.factory.annotation.Autowired + import org.springframework.boot.test.autoconfigure.web.reactive.AutoConfigureWebTestClient + import org.springframework.boot.test.context.SpringBootTest + import org.springframework.test.web.reactive.server.WebTestClient ++import org.springframework.test.web.reactive.server.expectBody + import org.springframework.web.reactive.config.EnableWebFlux + + @AutoConfigureWebTestClient +@@ -48,5 +50,7 @@ class GraphiQlCustomEndpoint { + .exchange() + .expectStatus() + .is2xxSuccessful ++ .expectBody() ++ .consumeWith { it -> Assert.assertTrue(it.responseBody!!.contains("fetch('/graphql")) } + } + } +diff --git a/mimo_build_env.tar.gz.b64 b/mimo_build_env.tar.gz.b64 +new file mode 100644 +--- /dev/null ++++ b/mimo_build_env.tar.gz.b64 +@@ -0,0 +1,15 @@ ++H4sIAAAAAAAAA+2Vb2/bNhDG/Vqf4qoWdTuApOXYaZC0A4Y2K7qmzdbu3TAElEjJdCRSJSknRebv ++PpJSEqdo/qBouw3jD7AkUHePHvLIM847UbMjLldk9K2YOJ7M5+Hu+PQenrP5NJtO3G8rG02ybL69 ++PYL5N3O0QWcs1QAjrZS9Ke629/9R8GX9LTf2qFBNQyXDZvH1vnFL/bemsycX9c9mW67+s+1sOoLJ ++17NwPf/z+t+/R3IhSU7NIikYhE2Qc5Yk9+H9ibDFAqyCX168hiyDR5p/6ITmDEql4bWytZCQ4Tme ++ZuD2TUutyEUt7MfHCeMrZPr8JV1Rlx0UufVaR9lOUHALX7mRK6lObyfhp63S56HPSGc0qUVOlqvG +++Ws6LSTaQUt2jGjDtmfnyl0LLzVlNQchhQVTaNFab78Up1DpSlhUKM2B8ZZLxmXxETQ3qu6sUDJp ++jpnQgFogvtIEV0GKeCnMkoJa+PGzr4hTR0F9GIenT2H86u2r3/cPfx4ntK5brZa8sAbOEnCEAzeY ++60c8mrfKCKu04GZj2NPQFZdwBp2uYTxYaKaoVgWtx7C+PnZhbWt2CWnrrhLSDP6w0hVppmQztX/q ++r9c4uauLL3CwTtbJsGAbtQzK8CbIeU/gttNis44zPMFTeGS63FhhO8v7iBnOcPY4OTh8/tPB0bv9 ++Xw+fpZ/YJf77dKlyrv3hJ0GTXCqToJwmooQ/4B6gEtIHl3IbgSgE4iXVKfy5B3bBZZjQxV7azEvD ++q8KvCzIHkN68NrdbdLO8asUN9FaQuoPh7+GmVU0Kf4FxHWNshqDggFRjd5xuNumTv4fJRrGu5l/u ++c8jvrbKrJYeHD0OnK11Lgh/8ururm5i79ml7wBQ0bG66xmWW3gU9OYbxWeuanIUH2bo3cFausQtL ++98AsaHaXaB+XennJz61dNPdS+HP2rpN+y563Yf8ywaRf0xPYdQ/t4kONWGWQ8R+o0AnPy7o7RbSz ++qlCyFFWn+a5PBIT8zUDqujmW3Ja1OMWDBHYSeMjFm7nUd1780keJ3+rn7q9YNfuStcrNxm1jJBVi ++lDeuO//Tf5ORSCQSiUQikUgkEolEIpFIJBKJRCKRSCTyr+dv1jbbkgAoAAA= +diff --git a/mimo_test_command.sh b/mimo_test_command.sh +new file mode 100755 +--- /dev/null ++++ b/mimo_test_command.sh +@@ -0,0 +1,6 @@ ++#!/usr/bin/env bash ++ ++set -uo pipefail ++cd /testbed || exit 1 ++base64 -d mimo_build_env.tar.gz.b64 | tar -xzf - -C /testbed || exit 1 ++exec bash -lc 'cd /testbed && bash -eo pipefail /testbed/.build_env/test_command.sh' diff --git a/tasks/format-code-task-000173/tests/test.sh b/tasks/format-code-task-000173/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..ddb6c669507892b63fec89f48425ad93521fd3fd --- /dev/null +++ b/tasks/format-code-task-000173/tests/test.sh @@ -0,0 +1,39 @@ +#!/bin/bash +# Code grading, mimoagent opensource_code.py: reset the files the hidden test patch touches, apply it, run the +# task's test command; reward 1 when it exits 0. A testbed failure (reset or apply) writes no reward: not scored. +M=/var/lib/mimo +CWD=/testbed +V=/logs/verifier +mkdir -p "$V" +BASE=$(cat "$M/base" 2>/dev/null) || { echo "setup never ran (no $M/base)" >&2; exit 1; } +cd "$CWD" || exit 1 +if [ -d "$M/git-hidden" ]; then rm -rf "$CWD/.git"; mv "$M/git-hidden" "$CWD/.git"; fi +# the agent's change against the base, so its own commits count too +git add -A >/dev/null 2>&1 && git -c core.fileMode=false diff --cached "$BASE" > "$V/agent.diff" +git reset -q +if ! ( +while IFS= read -r tf; do + [ -z "$tf" ] && continue + if git cat-file -e $BASE:"$tf" 2>/dev/null; then + git checkout $BASE -- "$tf" 2>/dev/null || true + else + git rm -f --cached "$tf" >/dev/null 2>&1 || true + rm -f "$tf" + fi +done <<'EOF_RESET_TEST_FILES' +graphql-dgs-spring-webflux-autoconfigure/src/test/kotlin/com/netflix/graphql/dgs/webflux/autoconfiguration/GraphiQlCustomEndpoint.kt +mimo_build_env.tar.gz.b64 +mimo_test_command.sh +EOF_RESET_TEST_FILES + +); then echo "could not reset the test files (testbed problem, not scored)" >&2; exit 1; fi +if ! git apply --verbose /tests/test.patch > "$V/apply.log" 2>&1; then + cat "$V/apply.log" >&2 + echo "the hidden tests could not be applied (testbed problem, not scored)" >&2 + exit 1 +fi +timeout 1800 sh -c "$(cat /tests/test_command.sh)" > "$V/test_output.log" 2>&1 +RC=$? +tail -c 12000 "$V/test_output.log" +if [ $RC -eq 0 ]; then echo 1 > "$V/reward.txt"; else echo 0 > "$V/reward.txt"; fi +echo "test command exited $RC" diff --git a/tasks/format-code-task-000173/tests/test_command.sh b/tasks/format-code-task-000173/tests/test_command.sh new file mode 100644 index 0000000000000000000000000000000000000000..7cb23076694ad17d72e8296d62b2b240083e36db --- /dev/null +++ b/tasks/format-code-task-000173/tests/test_command.sh @@ -0,0 +1 @@ +bash /testbed/mimo_test_command.sh \ No newline at end of file diff --git a/tasks/format-code-task-000174/environment/Dockerfile b/tasks/format-code-task-000174/environment/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..4b5d79cbbecff5e7f27339e000d450ae233a6cf8 --- /dev/null +++ b/tasks/format-code-task-000174/environment/Dockerfile @@ -0,0 +1,3 @@ +# The task's image, pinned by digest (the same as [environment].docker_image). +# Setup runs at start from [environment.healthcheck]; environment/setup/ is its readable copy. +FROM docker.io/xiaomimimo/mimo-v2.6-rl-oss@sha256:639cbf576f1313841fc5ed3017da3afa72246c6ca1e7d605f16f9e896653bb63 diff --git a/tasks/format-code-task-000174/environment/setup/files/blocklist b/tasks/format-code-task-000174/environment/setup/files/blocklist new file mode 100644 index 0000000000000000000000000000000000000000..a8e4bdc4c7d9b739c047a3cb58ea72a1bb05bcbc --- /dev/null +++ b/tasks/format-code-task-000174/environment/setup/files/blocklist @@ -0,0 +1,33 @@ +# mimo answer-leak blocklist (mimoagent) +0.0.0.0 github.com +0.0.0.0 www.github.com +0.0.0.0 api.github.com +0.0.0.0 raw.githubusercontent.com +0.0.0.0 codeload.github.com +0.0.0.0 objects.githubusercontent.com +0.0.0.0 gist.github.com +0.0.0.0 gist.githubusercontent.com +0.0.0.0 gitlab.com +0.0.0.0 bitbucket.org +0.0.0.0 sourceforge.net +0.0.0.0 git.kernel.org +0.0.0.0 chromium.googlesource.com +0.0.0.0 android.googlesource.com +0.0.0.0 sourcegraph.com +0.0.0.0 bugs.chromium.org +0.0.0.0 issues.oss-fuzz.com +0.0.0.0 oss-fuzz.com +0.0.0.0 osv.dev +0.0.0.0 api.osv.dev +0.0.0.0 bugzilla.mozilla.org +0.0.0.0 proxy.golang.org +0.0.0.0 sum.golang.org +0.0.0.0 pkg.go.dev +0.0.0.0 google.com +0.0.0.0 www.google.com +0.0.0.0 bing.com +0.0.0.0 www.bing.com +0.0.0.0 duckduckgo.com +0.0.0.0 html.duckduckgo.com +0.0.0.0 search.brave.com +0.0.0.0 stackoverflow.com diff --git a/tasks/format-code-task-000174/environment/setup/setup.sh b/tasks/format-code-task-000174/environment/setup/setup.sh new file mode 100644 index 0000000000000000000000000000000000000000..d883db90cfcfb48f7a139861bbe9f6b5d95cad6f --- /dev/null +++ b/tasks/format-code-task-000174/environment/setup/setup.sh @@ -0,0 +1,34 @@ +#!/bin/bash +# Runs once, as root, before the agent starts: Harbor's [environment.healthcheck] unpacks this folder into +# /var/lib/mimo and runs it. Generated by mimo_harbor; see its README for how each step maps to Xiaomi's harness. +M=/var/lib/mimo +[ -f "$M/ready" ] && exit 0 +chmod 700 "$M" +fail() { echo "setup: $*" >&2; exit 1; } +# the answer-leak blocklist (mimoagent), applied to /etc/hosts by the agent right after it installs +write_blocklist() { cp "$M/files/blocklist" "$M/blocklist"; } + +# Code: mimoagent environments/datasets/opensource_code.py + base.py, as the explorer runs it (app/runner/domains.py Code). +CWD=/testbed +git config --global --add safe.directory "$CWD" +cd "$CWD" || fail "no working directory $CWD" +if ! git rev-parse --git-dir >/dev/null 2>&1; then # a bare source tree: give it a baseline commit + git init -q && git add -A && git -c user.name=mimo -c user.email=mimo@localhost commit -q -m baseline --allow-empty +fi +BASE=$(git rev-parse HEAD 2>/dev/null) +[ ${#BASE} -eq 40 ] || fail "could not resolve the base commit in $CWD" +echo "$BASE" > "$M/base" +# Images are built with history truncated at the base. If one is not, the fix could be read out of git log, +# so .git is hidden while the agent works and put back for grading. +LATER=$(git rev-list --all --not "$BASE" 2>/dev/null | head -n 5 | grep -c . || true) +rm -f /tmp/fail.log /tmp/pass.log /tmp/patch.diff /tmp/test_patch.diff /tmp/*.log 2>/dev/null; rm -rf /tmp/claude-0 /tmp/claude-* /tmp/testem-* /tmp/puppeteer_dev_chrome_profile-* 2>/dev/null; rm -f /tmp/test_files.json 2>/dev/null; rm -rf /tmp/jest_* /tmp/jest-* /tmp/build /tmp/build_env 2>/dev/null; rm -rf /tmp/pytest-of-root /tmp/pytest-* /tmp/.pytest_cache /tmp/__pycache__ 2>/dev/null; rm -rf /tmp/go-build* /tmp/standards /tmp/wordpress /tmp/zig-* /tmp/testbase /tmp/testbed 2>/dev/null; rm -f /tmp/tmp*.tmp /tmp/*.bak /tmp/expect* /tmp/butwas* 2>/dev/null; rm -rf /root/.cache/go-build 2>/dev/null; rm -rf /tests 2>/dev/null; find /logs -mindepth 1 -delete 2>/dev/null; mkdir -p /logs/agent /logs/verifier /logs/artifacts; chmod 777 /logs/agent /logs/verifier /logs/artifacts; find /var/log -type f -delete 2>/dev/null || true; rm -rf /var/lib/postgresql/*/*/log /var/lib/postgresql/*/*/pg_log 2>/dev/null || true; find /var/lib/mysql /var/lib/mongodb -type f -name '*.log' -delete 2>/dev/null || true; rm -rf /root/.npm/_logs /root/.babel.json /root/.pytest_cache 2>/dev/null || true; find / -maxdepth 4 -xdev -name task_description.md -path '*/.build_env/*' -delete 2>/dev/null || true; true +git clean -fdx --exclude=node_modules --exclude=bower_components --exclude=.husky --exclude=vendor --exclude=third_party --exclude=_deps --exclude=vcpkg_installed --exclude=.venv --exclude=venv --exclude=.gradle --exclude=target --exclude=.build --exclude=lib --exclude=.bundle --exclude=Manifest.toml --exclude=_build --exclude=.stack-work --exclude=dist-newstyle >/dev/null 2>&1 +find /root/.m2 -type f \( -name '*-SNAPSHOT.jar' -o -name '*-SNAPSHOT-sources.jar' -o -name '*-SNAPSHOT-tests.jar' -o -name '*-SNAPSHOT-test-sources.jar' \) -delete 2>/dev/null; rm -rf /root/.julia/compiled 2>/dev/null; rm -rf /root/.gradle/caches/build-cache-* /root/.gradle/daemon 2>/dev/null; rm -rf /root/.gradle/caches/*/scripts /root/.gradle/caches/jars-* 2>/dev/null; rm -rf /root/.cache/bazel 2>/dev/null; true +if [ "$LATER" -gt 0 ]; then + mv "$CWD/.git" "$M/git-hidden" + echo "history not truncated at ${BASE:0:12}: .git hidden while the agent works" +fi +write_blocklist + +touch "$M/ready" +echo "setup done" diff --git a/tasks/format-code-task-000174/tests/test.patch b/tasks/format-code-task-000174/tests/test.patch new file mode 100644 index 0000000000000000000000000000000000000000..00bb1e125cab66d2cd700f8501514a23f4c75965 --- /dev/null +++ b/tasks/format-code-task-000174/tests/test.patch @@ -0,0 +1,312 @@ +diff --git a/jsonrpc/server_test.go b/jsonrpc/server_test.go +index 1b612b87e..35407139f 100644 +--- a/jsonrpc/server_test.go ++++ b/jsonrpc/server_test.go +@@ -505,3 +505,27 @@ func BenchmarkHandle(b *testing.B) { + require.NoError(b, err) + } + } ++ ++func TestConnFromContextAbsentForNonWebsocketHandle(t *testing.T) { ++ server := jsonrpc.NewServer(1, utils.NewNopZapLogger()) ++ require.NoError(t, server.RegisterMethods(jsonrpc.Method{ ++ Name: "test_no_conn", ++ Handler: func(ctx context.Context) (int, *jsonrpc.Error) { ++ w, ok := jsonrpc.ConnFromContext(ctx) ++ require.False(t, ok) ++ require.Nil(t, w) ++ return 7, nil ++ }, ++ })) ++ ++ res, err := server.Handle(context.Background(), []byte(`{"jsonrpc":"2.0","id":1,"method":"test_no_conn"}`)) ++ require.NoError(t, err) ++ ++ var got struct { ++ Result int `json:"result"` ++ ID int `json:"id"` ++ } ++ require.NoError(t, json.Unmarshal(res, &got)) ++ require.Equal(t, 7, got.Result) ++ require.Equal(t, 1, got.ID) ++} +diff --git a/jsonrpc/websocket_test.go b/jsonrpc/websocket_test.go +index c51a3961f..f18da8538 100644 +--- a/jsonrpc/websocket_test.go ++++ b/jsonrpc/websocket_test.go +@@ -2,9 +2,12 @@ package jsonrpc_test + + import ( + "context" ++ "encoding/json" ++ "fmt" + "net/http" + "net/http/httptest" + "testing" ++ "time" + + "github.com/NethermindEth/juno/jsonrpc" + "github.com/NethermindEth/juno/utils" +@@ -13,16 +16,14 @@ import ( + "nhooyr.io/websocket" + ) + +-// The caller is responsible for closing the connection. +-func testConnection(t *testing.T, ctx context.Context, listener jsonrpc.EventListener) *websocket.Conn { +- method := jsonrpc.Method{ +- Name: "test_echo", +- Params: []jsonrpc.Parameter{{Name: "msg"}}, +- Handler: func(msg string) (string, *jsonrpc.Error) { +- return msg, nil +- }, +- } ++type handlerWriteObservation struct { ++ ok bool ++ n int ++ err error ++} + ++ ++func testConnection(t *testing.T, ctx context.Context, method jsonrpc.Method, listener jsonrpc.EventListener) *websocket.Conn { + rpc := jsonrpc.NewServer(1, utils.NewNopZapLogger()).WithListener(listener) + require.NoError(t, rpc.RegisterMethods(method)) + +@@ -41,8 +42,15 @@ func TestHandler(t *testing.T) { + ctx, cancel := context.WithCancel(context.Background()) + defer cancel() + ++ method := jsonrpc.Method{ ++ Name: "test_echo", ++ Params: []jsonrpc.Parameter{{Name: "msg"}}, ++ Handler: func(msg string) (string, *jsonrpc.Error) { ++ return msg, nil ++ }, ++ } + listener := CountingEventListener{} +- conn := testConnection(t, ctx, &listener) ++ conn := testConnection(t, ctx, method, &listener) + + msg := `{"jsonrpc" : "2.0", "method" : "test_echo", "params" : [ "abc123" ], "id" : 1}` + err := conn.Write(context.Background(), websocket.MessageText, []byte(msg)) +@@ -56,3 +64,79 @@ func TestHandler(t *testing.T) { + + require.NoError(t, conn.Close(websocket.StatusNormalClosure, "")) + } ++ ++func TestWebsocketHandlerCanWriteAdditionalMessage(t *testing.T) { ++ ctx, cancel := context.WithCancel(context.Background()) ++ defer cancel() ++ ++ observations := make(chan handlerWriteObservation, 2) ++ method := jsonrpc.Method{ ++ Name: "test_push", ++ Params: []jsonrpc.Parameter{{Name: "msg"}}, ++ Handler: func(ctx context.Context, msg string) (string, *jsonrpc.Error) { ++ conn, ok := jsonrpc.ConnFromContext(ctx) ++ obs := handlerWriteObservation{ok: ok} ++ if ok { ++ obs.n, obs.err = conn.Write([]byte("ws-event:" + msg)) ++ } ++ observations <- obs ++ return "handled:" + msg, nil ++ }, ++ } ++ conn := testConnection(t, ctx, method, &CountingEventListener{}) ++ ++ requests := []struct { ++ id int ++ msg string ++ }{ ++ {id: 1, msg: "alpha-1"}, ++ {id: 2, msg: "beta-2"}, ++ } ++ for _, tc := range requests { ++ req := fmt.Sprintf(`{"jsonrpc":"2.0","method":"test_push","params":["%s"],"id":%d}`, tc.msg, tc.id) ++ err := conn.Write(context.Background(), websocket.MessageText, []byte(req)) ++ require.NoError(t, err) ++ ++ pushed := readWebsocketMessage(t, ctx, conn) ++ require.Equal(t, "ws-event:"+tc.msg, string(pushed)) ++ ++ obs := readHandlerWriteObservation(t, observations) ++ require.True(t, obs.ok) ++ require.NoError(t, obs.err) ++ require.Equal(t, len("ws-event:"+tc.msg), obs.n) ++ ++ response := readWebsocketMessage(t, ctx, conn) ++ var got struct { ++ Result string `json:"result"` ++ ID int `json:"id"` ++ } ++ require.NoError(t, json.Unmarshal(response, &got)) ++ require.Equal(t, "handled:"+tc.msg, got.Result) ++ require.Equal(t, tc.id, got.ID) ++ } ++ ++ require.NoError(t, conn.Close(websocket.StatusNormalClosure, "")) ++} ++ ++func readWebsocketMessage(t *testing.T, ctx context.Context, conn *websocket.Conn) []byte { ++ t.Helper() ++ ++ readCtx, cancel := context.WithTimeout(ctx, time.Second) ++ defer cancel() ++ ++ _, msg, err := conn.Read(readCtx) ++ require.NoError(t, err) ++ return msg ++} ++ ++func readHandlerWriteObservation(t *testing.T, observations <-chan handlerWriteObservation) handlerWriteObservation { ++ t.Helper() ++ ++ select { ++ case obs := <-observations: ++ return obs ++ case <-time.After(time.Second): ++ t.Fatal("handler did not report websocket write result") ++ return handlerWriteObservation{} ++ } ++} +diff --git a/pubsub/registry_test.go b/pubsub/registry_test.go +new file mode 100644 +index 000000000..b3a56eab4 +--- /dev/null ++++ b/pubsub/registry_test.go +@@ -0,0 +1,110 @@ ++package pubsub_test ++ ++import ( ++ "context" ++ "errors" ++ "sync" ++ "testing" ++ ++ "github.com/NethermindEth/juno/pubsub" ++ "github.com/NethermindEth/juno/utils" ++ "github.com/stretchr/testify/require" ++) ++ ++type fakeSubscription struct { ++ mu sync.Mutex ++ count int ++ errs chan error ++} ++ ++func newFakeSubscription() *fakeSubscription { ++ return &fakeSubscription{errs: make(chan error)} ++} ++ ++func (s *fakeSubscription) Unsubscribe() { ++ s.mu.Lock() ++ defer s.mu.Unlock() ++ s.count++ ++} ++ ++func (s *fakeSubscription) Err() <-chan error { ++ return s.errs ++} ++ ++func (s *fakeSubscription) unsubscribeCount() int { ++ s.mu.Lock() ++ defer s.mu.Unlock() ++ return s.count ++} ++ ++func TestRegistryAddDeleteSubscription(t *testing.T) { ++ registry := pubsub.New(utils.NewNopZapLogger()) ++ sub := newFakeSubscription() ++ ++ var id uint64 = registry.Add(context.Background(), sub) ++ ++ require.NoError(t, registry.Delete(id)) ++ require.Equal(t, 1, sub.unsubscribeCount()) ++} ++ ++func TestRegistryDeleteMissingReturnsErrNotFound(t *testing.T) { ++ registry := pubsub.New(utils.NewNopZapLogger()) ++ ++ for _, id := range []uint64{0, 12345} { ++ err := registry.Delete(id) ++ require.Error(t, err) ++ require.True(t, errors.Is(err, pubsub.ErrNotFound), "id %d returned %v", id, err) ++ } ++} ++ ++func TestRegistryDeleteTwiceReportsNotFound(t *testing.T) { ++ registry := pubsub.New(utils.NewNopZapLogger()) ++ sub := newFakeSubscription() ++ id := registry.Add(context.Background(), sub) ++ ++ require.NoError(t, registry.Delete(id)) ++ err := registry.Delete(id) ++ ++ require.Error(t, err) ++ require.True(t, errors.Is(err, pubsub.ErrNotFound), "got %v", err) ++ require.Equal(t, 1, sub.unsubscribeCount()) ++} ++ ++func TestRegistryConcurrentAddDelete(t *testing.T) { ++ registry := pubsub.New(utils.NewNopZapLogger()) ++ const n = 64 ++ ++ subs := make([]*fakeSubscription, n) ++ ids := make([]uint64, n) ++ ++ var addWG sync.WaitGroup ++ addWG.Add(n) ++ for i := 0; i < n; i++ { ++ i := i ++ subs[i] = newFakeSubscription() ++ go func() { ++ defer addWG.Done() ++ ids[i] = registry.Add(context.Background(), subs[i]) ++ }() ++ } ++ addWG.Wait() ++ ++ var deleteWG sync.WaitGroup ++ deleteWG.Add(n) ++ errs := make([]error, n) ++ for i := 0; i < n; i++ { ++ i := i ++ go func() { ++ defer deleteWG.Done() ++ errs[i] = registry.Delete(ids[i]) ++ }() ++ } ++ deleteWG.Wait() ++ ++ for i, err := range errs { ++ require.NoError(t, err, "delete %d for id %d", i, ids[i]) ++ } ++ for i, sub := range subs { ++ require.Equal(t, 1, sub.unsubscribeCount(), "subscription %d", i) ++ } ++} +diff --git a/mimo_test_command.sh b/mimo_test_command.sh +new file mode 100755 +--- /dev/null ++++ b/mimo_test_command.sh +@@ -0,0 +1,21 @@ ++#!/bin/bash ++set -uo pipefail ++cd /testbed ++ ++ ++export GOPROXY='https://goproxy.cn,https://proxy.golang.org,direct' ++export GOFLAGS='-mod=mod' ++ ++ ++case "${1:-}" in ++ base) ++ go test -v -count=1 -timeout=10s ./jsonrpc/ -run '^(TestHTTP|TestServer_RegisterMethod|TestHandle|TestHandler)$' ++ ;; ++ new) ++ go test -v -count=1 -timeout=10s ./jsonrpc/ ./pubsub/ -run '^(TestConnFromContextAbsentForNonWebsocketHandle|TestWebsocketHandlerCanWriteAdditionalMessage|TestRegistryAddDeleteSubscription|TestRegistryDeleteMissingReturnsErrNotFound|TestRegistryDeleteTwiceReportsNotFound|TestRegistryConcurrentAddDelete)$' ++ ;; ++ *) ++ echo "usage: $0 base|new" ++ exit 2 ++ ;; ++esac diff --git a/tasks/format-code-task-000174/tests/test.sh b/tasks/format-code-task-000174/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..10552fc454a7baefbdb7395ea1b012ef8859de8e --- /dev/null +++ b/tasks/format-code-task-000174/tests/test.sh @@ -0,0 +1,40 @@ +#!/bin/bash +# Code grading, mimoagent opensource_code.py: reset the files the hidden test patch touches, apply it, run the +# task's test command; reward 1 when it exits 0. A testbed failure (reset or apply) writes no reward: not scored. +M=/var/lib/mimo +CWD=/testbed +V=/logs/verifier +mkdir -p "$V" +BASE=$(cat "$M/base" 2>/dev/null) || { echo "setup never ran (no $M/base)" >&2; exit 1; } +cd "$CWD" || exit 1 +if [ -d "$M/git-hidden" ]; then rm -rf "$CWD/.git"; mv "$M/git-hidden" "$CWD/.git"; fi +# the agent's change against the base, so its own commits count too +git add -A >/dev/null 2>&1 && git -c core.fileMode=false diff --cached "$BASE" > "$V/agent.diff" +git reset -q +if ! ( +while IFS= read -r tf; do + [ -z "$tf" ] && continue + if git cat-file -e $BASE:"$tf" 2>/dev/null; then + git checkout $BASE -- "$tf" 2>/dev/null || true + else + git rm -f --cached "$tf" >/dev/null 2>&1 || true + rm -f "$tf" + fi +done <<'EOF_RESET_TEST_FILES' +jsonrpc/server_test.go +jsonrpc/websocket_test.go +pubsub/registry_test.go +mimo_test_command.sh +EOF_RESET_TEST_FILES + +); then echo "could not reset the test files (testbed problem, not scored)" >&2; exit 1; fi +if ! git apply --verbose /tests/test.patch > "$V/apply.log" 2>&1; then + cat "$V/apply.log" >&2 + echo "the hidden tests could not be applied (testbed problem, not scored)" >&2 + exit 1 +fi +timeout 1800 sh -c "$(cat /tests/test_command.sh)" > "$V/test_output.log" 2>&1 +RC=$? +tail -c 12000 "$V/test_output.log" +if [ $RC -eq 0 ]; then echo 1 > "$V/reward.txt"; else echo 0 > "$V/reward.txt"; fi +echo "test command exited $RC" diff --git a/tasks/format-code-task-000174/tests/test_command.sh b/tasks/format-code-task-000174/tests/test_command.sh new file mode 100644 index 0000000000000000000000000000000000000000..e8d2f32b64045b5a5a56e0ad5667da87d8e0bc2a --- /dev/null +++ b/tasks/format-code-task-000174/tests/test_command.sh @@ -0,0 +1 @@ +bash /testbed/mimo_test_command.sh base && bash /testbed/mimo_test_command.sh new \ No newline at end of file diff --git a/tasks/format-code-task-000301/environment/Dockerfile b/tasks/format-code-task-000301/environment/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..f93dbef4af780a08e50a710498b887c8fa149db1 --- /dev/null +++ b/tasks/format-code-task-000301/environment/Dockerfile @@ -0,0 +1,3 @@ +# The task's image, pinned by digest (the same as [environment].docker_image). +# Setup runs at start from [environment.healthcheck]; environment/setup/ is its readable copy. +FROM docker.io/xiaomimimo/mimo-v2.6-rl-oss@sha256:84095ff24ea337f9c8edc96f5498f56fd204216db69007a2e08c2eaca3ebf914 diff --git a/tasks/format-code-task-000301/environment/setup/files/blocklist b/tasks/format-code-task-000301/environment/setup/files/blocklist new file mode 100644 index 0000000000000000000000000000000000000000..a8e4bdc4c7d9b739c047a3cb58ea72a1bb05bcbc --- /dev/null +++ b/tasks/format-code-task-000301/environment/setup/files/blocklist @@ -0,0 +1,33 @@ +# mimo answer-leak blocklist (mimoagent) +0.0.0.0 github.com +0.0.0.0 www.github.com +0.0.0.0 api.github.com +0.0.0.0 raw.githubusercontent.com +0.0.0.0 codeload.github.com +0.0.0.0 objects.githubusercontent.com +0.0.0.0 gist.github.com +0.0.0.0 gist.githubusercontent.com +0.0.0.0 gitlab.com +0.0.0.0 bitbucket.org +0.0.0.0 sourceforge.net +0.0.0.0 git.kernel.org +0.0.0.0 chromium.googlesource.com +0.0.0.0 android.googlesource.com +0.0.0.0 sourcegraph.com +0.0.0.0 bugs.chromium.org +0.0.0.0 issues.oss-fuzz.com +0.0.0.0 oss-fuzz.com +0.0.0.0 osv.dev +0.0.0.0 api.osv.dev +0.0.0.0 bugzilla.mozilla.org +0.0.0.0 proxy.golang.org +0.0.0.0 sum.golang.org +0.0.0.0 pkg.go.dev +0.0.0.0 google.com +0.0.0.0 www.google.com +0.0.0.0 bing.com +0.0.0.0 www.bing.com +0.0.0.0 duckduckgo.com +0.0.0.0 html.duckduckgo.com +0.0.0.0 search.brave.com +0.0.0.0 stackoverflow.com diff --git a/tasks/format-code-task-000301/environment/setup/setup.sh b/tasks/format-code-task-000301/environment/setup/setup.sh new file mode 100644 index 0000000000000000000000000000000000000000..e9eb7daf39f9542bd095367feee457f3da77e492 --- /dev/null +++ b/tasks/format-code-task-000301/environment/setup/setup.sh @@ -0,0 +1,34 @@ +#!/bin/bash +# Runs once, as root, before the agent starts: Harbor's [environment.healthcheck] unpacks this folder into +# /var/lib/mimo and runs it. Generated by mimo_harbor; see its README for how each step maps to Xiaomi's harness. +M=/var/lib/mimo +[ -f "$M/ready" ] && exit 0 +chmod 700 "$M" +fail() { echo "setup: $*" >&2; exit 1; } +# the answer-leak blocklist (mimoagent), applied to /etc/hosts by the agent right after it installs +write_blocklist() { cp "$M/files/blocklist" "$M/blocklist"; } + +# Code: mimoagent environments/datasets/opensource_code.py + base.py, as the explorer runs it (app/runner/domains.py Code). +CWD=/workspace/repo +git config --global --add safe.directory "$CWD" +cd "$CWD" || fail "no working directory $CWD" +if ! git rev-parse --git-dir >/dev/null 2>&1; then # a bare source tree: give it a baseline commit + git init -q && git add -A && git -c user.name=mimo -c user.email=mimo@localhost commit -q -m baseline --allow-empty +fi +BASE=$(git rev-parse HEAD 2>/dev/null) +[ ${#BASE} -eq 40 ] || fail "could not resolve the base commit in $CWD" +echo "$BASE" > "$M/base" +# Images are built with history truncated at the base. If one is not, the fix could be read out of git log, +# so .git is hidden while the agent works and put back for grading. +LATER=$(git rev-list --all --not "$BASE" 2>/dev/null | head -n 5 | grep -c . || true) +rm -f /tmp/fail.log /tmp/pass.log /tmp/patch.diff /tmp/test_patch.diff /tmp/*.log 2>/dev/null; rm -rf /tmp/claude-0 /tmp/claude-* /tmp/testem-* /tmp/puppeteer_dev_chrome_profile-* 2>/dev/null; rm -f /tmp/test_files.json 2>/dev/null; rm -rf /tmp/jest_* /tmp/jest-* /tmp/build /tmp/build_env 2>/dev/null; rm -rf /tmp/pytest-of-root /tmp/pytest-* /tmp/.pytest_cache /tmp/__pycache__ 2>/dev/null; rm -rf /tmp/go-build* /tmp/standards /tmp/wordpress /tmp/zig-* /tmp/testbase /tmp/testbed 2>/dev/null; rm -f /tmp/tmp*.tmp /tmp/*.bak /tmp/expect* /tmp/butwas* 2>/dev/null; rm -rf /root/.cache/go-build 2>/dev/null; rm -rf /tests 2>/dev/null; find /logs -mindepth 1 -delete 2>/dev/null; mkdir -p /logs/agent /logs/verifier /logs/artifacts; chmod 777 /logs/agent /logs/verifier /logs/artifacts; find /var/log -type f -delete 2>/dev/null || true; rm -rf /var/lib/postgresql/*/*/log /var/lib/postgresql/*/*/pg_log 2>/dev/null || true; find /var/lib/mysql /var/lib/mongodb -type f -name '*.log' -delete 2>/dev/null || true; rm -rf /root/.npm/_logs /root/.babel.json /root/.pytest_cache 2>/dev/null || true; find / -maxdepth 4 -xdev -name task_description.md -path '*/.build_env/*' -delete 2>/dev/null || true; true +git clean -fdx --exclude=node_modules --exclude=bower_components --exclude=.husky --exclude=vendor --exclude=third_party --exclude=_deps --exclude=vcpkg_installed --exclude=.venv --exclude=venv --exclude=.gradle --exclude=target --exclude=.build --exclude=lib --exclude=.bundle --exclude=Manifest.toml --exclude=_build --exclude=.stack-work --exclude=dist-newstyle >/dev/null 2>&1 +find /root/.m2 -type f \( -name '*-SNAPSHOT.jar' -o -name '*-SNAPSHOT-sources.jar' -o -name '*-SNAPSHOT-tests.jar' -o -name '*-SNAPSHOT-test-sources.jar' \) -delete 2>/dev/null; rm -rf /root/.julia/compiled 2>/dev/null; rm -rf /root/.gradle/caches/build-cache-* /root/.gradle/daemon 2>/dev/null; rm -rf /root/.gradle/caches/*/scripts /root/.gradle/caches/jars-* 2>/dev/null; rm -rf /root/.cache/bazel 2>/dev/null; true +if [ "$LATER" -gt 0 ]; then + mv "$CWD/.git" "$M/git-hidden" + echo "history not truncated at ${BASE:0:12}: .git hidden while the agent works" +fi +write_blocklist + +touch "$M/ready" +echo "setup done" diff --git a/tasks/format-code-task-000301/tests/test.patch b/tasks/format-code-task-000301/tests/test.patch new file mode 100644 index 0000000000000000000000000000000000000000..b0f8f3a2f2916bbf6e3109a65675961c74191e0c --- /dev/null +++ b/tasks/format-code-task-000301/tests/test.patch @@ -0,0 +1,259 @@ +diff --git a/usercase-test-coderl/overlap_lifecycle_test.go b/usercase-test-coderl/overlap_lifecycle_test.go +new file mode 100644 +--- /dev/null ++++ b/usercase-test-coderl/overlap_lifecycle_test.go +@@ -0,0 +1,227 @@ ++package usercase_test_coderl ++ ++import ( ++ "context" ++ "log" ++ "sync/atomic" ++ "testing" ++ "time" ++ ++ "github.com/adhocore/gronx/pkg/tasker" ++) ++ ++type discardWriter struct{} ++ ++func (discardWriter) Write(p []byte) (int, error) { ++ return len(p), nil ++} ++ ++func observeMax(max *int32, value int32) { ++ for { ++ current := atomic.LoadInt32(max) ++ if value <= current || atomic.CompareAndSwapInt32(max, current, value) { ++ return ++ } ++ } ++} ++ ++func newQuietTasker() *tasker.Tasker { ++ t := tasker.New(tasker.Option{}) ++ t.Log = log.New(discardWriter{}, "", 0) ++ return t ++} ++ ++func runTaskerWithTimeout(t *testing.T, taskr *tasker.Tasker, limit time.Duration) { ++ t.Helper() ++ ++ done := make(chan struct{}) ++ go func() { ++ taskr.Run() ++ close(done) ++ }() ++ ++ select { ++ case <-done: ++ case <-time.After(limit): ++ t.Fatalf("tasker.Run did not return within %s", limit) ++ } ++} ++ ++func TestNonOverlappingRegistrationSkipsDueTicksWhileConcurrentRegistrationsContinue(t *testing.T) { ++ ++ ++ taskr := newQuietTasker() ++ ++ var single int32 ++ var omitted int32 ++ var explicitTrue int32 ++ ++ taskr.Task("* * * * * *", func(context.Context) (int, error) { ++ atomic.AddInt32(&single, 1) ++ time.Sleep(2500 * time.Millisecond) ++ return 0, nil ++ }, false) ++ taskr.Task("* * * * * *", func(context.Context) (int, error) { ++ atomic.AddInt32(&omitted, 1) ++ time.Sleep(100 * time.Millisecond) ++ return 0, nil ++ }) ++ taskr.Task("* * * * * *", func(context.Context) (int, error) { ++ atomic.AddInt32(&explicitTrue, 1) ++ time.Sleep(100 * time.Millisecond) ++ return 0, nil ++ }, true) ++ ++ taskr.Until(3 * time.Second) ++ runTaskerWithTimeout(t, taskr, 6*time.Second) ++ ++ if atomic.LoadInt32(&single) != 1 { ++ t.Fatalf("non-overlapping callback invocations = %d, want 1", atomic.LoadInt32(&single)) ++ } ++ ++ if atomic.LoadInt32(&omitted) < 2 { ++ t.Fatalf("omitted concurrent callback invocations = %d, want at least 2", atomic.LoadInt32(&omitted)) ++ } ++ ++ if atomic.LoadInt32(&explicitTrue) < 2 { ++ t.Fatalf("explicit true callback invocations = %d, want at least 2", atomic.LoadInt32(&explicitTrue)) ++ } ++} ++ ++func TestNonOverlappingRegistrationRunsAgainAfterPriorInvocationReturns(t *testing.T) { ++ ++ ++ taskr := newQuietTasker() ++ var starts int32 ++ var active int32 ++ var maxActive int32 ++ ++ taskr.Task("* * * * * *", func(context.Context) (int, error) { ++ nowActive := atomic.AddInt32(&active, 1) ++ observeMax(&maxActive, nowActive) ++ defer atomic.AddInt32(&active, -1) ++ atomic.AddInt32(&starts, 1) ++ time.Sleep(2500 * time.Millisecond) ++ return 0, nil ++ }, false) ++ ++ taskr.Until(5 * time.Second) ++ runTaskerWithTimeout(t, taskr, 8*time.Second) ++ ++ ++ if atomic.LoadInt32(&starts) < 2 { ++ t.Fatalf("non-overlapping callback starts after a longer run = %d, want at least 2", atomic.LoadInt32(&starts)) ++ } ++ if atomic.LoadInt32(&maxActive) > 1 { ++ t.Fatalf("non-overlapping callback max active invocations = %d, want at most 1", atomic.LoadInt32(&maxActive)) ++ } ++} ++ ++func TestNonOverlappingRegistrationsKeepOverlapStateIndependent(t *testing.T) { ++ ++ ++ taskr := newQuietTasker() ++ ++ var aStarts int32 ++ var bStarts int32 ++ ++ taskr.Task("* * * * * *", func(context.Context) (int, error) { ++ atomic.AddInt32(&aStarts, 1) ++ time.Sleep(2500 * time.Millisecond) ++ return 0, nil ++ }, false) ++ taskr.Task("* * * * * *", func(context.Context) (int, error) { ++ atomic.AddInt32(&bStarts, 1) ++ time.Sleep(100 * time.Millisecond) ++ return 0, nil ++ }, false) ++ ++ taskr.Until(3 * time.Second) ++ runTaskerWithTimeout(t, taskr, 6*time.Second) ++ ++ if atomic.LoadInt32(&aStarts) != 1 { ++ t.Fatalf("first non-overlapping registration callback starts = %d, want 1", atomic.LoadInt32(&aStarts)) ++ } ++ ++ if atomic.LoadInt32(&bStarts) < 2 { ++ t.Fatalf("second non-overlapping registration callback starts = %d, want at least 2", atomic.LoadInt32(&bStarts)) ++ } ++} ++ ++func TestTaskRegistrationBeforeRunStartsCallback(t *testing.T) { ++ ++ ++ ++ taskr := newQuietTasker() ++ var starts int32 ++ ++ taskr.Task("* * * * * *", func(context.Context) (int, error) { ++ atomic.AddInt32(&starts, 1) ++ return 0, nil ++ }, false) ++ ++ taskr.Until(1500 * time.Millisecond) ++ runTaskerWithTimeout(t, taskr, 4*time.Second) ++ ++ if atomic.LoadInt32(&starts) < 1 { ++ t.Fatalf("registered callback starts = %d, want at least 1", atomic.LoadInt32(&starts)) ++ } ++} ++ ++func TestOmittedConcurrentArgumentAllowsOverlap(t *testing.T) { ++ ++ ++ ++ taskr := newQuietTasker() ++ var starts int32 ++ var active int32 ++ var maxActive int32 ++ ++ taskr.Task("* * * * * *", func(context.Context) (int, error) { ++ nowActive := atomic.AddInt32(&active, 1) ++ observeMax(&maxActive, nowActive) ++ defer atomic.AddInt32(&active, -1) ++ atomic.AddInt32(&starts, 1) ++ time.Sleep(1500 * time.Millisecond) ++ return 0, nil ++ }) ++ ++ taskr.Until(3 * time.Second) ++ runTaskerWithTimeout(t, taskr, 6*time.Second) ++ ++ if atomic.LoadInt32(&starts) < 2 { ++ t.Fatalf("omitted concurrent callback starts = %d, want at least 2", atomic.LoadInt32(&starts)) ++ } ++ if atomic.LoadInt32(&maxActive) < 2 { ++ t.Fatalf("omitted concurrent callback max active invocations = %d, want at least 2", atomic.LoadInt32(&maxActive)) ++ } ++} ++ ++func TestExplicitTrueConcurrentArgumentAllowsOverlap(t *testing.T) { ++ ++ ++ ++ taskr := newQuietTasker() ++ var starts int32 ++ var active int32 ++ var maxActive int32 ++ ++ taskr.Task("* * * * * *", func(context.Context) (int, error) { ++ nowActive := atomic.AddInt32(&active, 1) ++ observeMax(&maxActive, nowActive) ++ defer atomic.AddInt32(&active, -1) ++ atomic.AddInt32(&starts, 1) ++ time.Sleep(1500 * time.Millisecond) ++ return 0, nil ++ }, true) ++ ++ taskr.Until(3 * time.Second) ++ runTaskerWithTimeout(t, taskr, 6*time.Second) ++ ++ if atomic.LoadInt32(&starts) < 2 { ++ t.Fatalf("explicit true callback starts = %d, want at least 2", atomic.LoadInt32(&starts)) ++ } ++ if atomic.LoadInt32(&maxActive) < 2 { ++ t.Fatalf("explicit true callback max active invocations = %d, want at least 2", atomic.LoadInt32(&maxActive)) ++ } ++} +diff --git a/mimo_test_command.sh b/mimo_test_command.sh +new file mode 100755 +--- /dev/null ++++ b/mimo_test_command.sh +@@ -0,0 +1,22 @@ ++#!/usr/bin/env bash ++ ++ ++ ++ ++export NODE_OPTIONS="${NODE_OPTIONS:-} --max-old-space-size=4096" ++export MAVEN_OPTS="${MAVEN_OPTS:-} -Xmx3g -XX:+UseG1GC" ++export GRADLE_OPTS="${GRADLE_OPTS:-} -Xmx3g -XX:+UseG1GC" ++export TEST_JVM_OPTS="${TEST_JVM_OPTS:-} -Xmx3g" ++set -e ++cd /workspace/repo ++set -euo pipefail ++ ++cd /workspace/repo ++ ++export GOPROXY=off ++export GOSUMDB=off ++export GOVCS=*:off ++export GOTOOLCHAIN=local ++export GOFLAGS="${GOFLAGS:-} -mod=readonly" ++ ++exec go test -v -count=1 ./usercase-test-coderl/... diff --git a/tasks/format-code-task-000301/tests/test.sh b/tasks/format-code-task-000301/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..a267bf015193fcda4319aac2dd11387ee3113044 --- /dev/null +++ b/tasks/format-code-task-000301/tests/test.sh @@ -0,0 +1,38 @@ +#!/bin/bash +# Code grading, mimoagent opensource_code.py: reset the files the hidden test patch touches, apply it, run the +# task's test command; reward 1 when it exits 0. A testbed failure (reset or apply) writes no reward: not scored. +M=/var/lib/mimo +CWD=/workspace/repo +V=/logs/verifier +mkdir -p "$V" +BASE=$(cat "$M/base" 2>/dev/null) || { echo "setup never ran (no $M/base)" >&2; exit 1; } +cd "$CWD" || exit 1 +if [ -d "$M/git-hidden" ]; then rm -rf "$CWD/.git"; mv "$M/git-hidden" "$CWD/.git"; fi +# the agent's change against the base, so its own commits count too +git add -A >/dev/null 2>&1 && git -c core.fileMode=false diff --cached "$BASE" > "$V/agent.diff" +git reset -q +if ! ( +while IFS= read -r tf; do + [ -z "$tf" ] && continue + if git cat-file -e $BASE:"$tf" 2>/dev/null; then + git checkout $BASE -- "$tf" 2>/dev/null || true + else + git rm -f --cached "$tf" >/dev/null 2>&1 || true + rm -f "$tf" + fi +done <<'EOF_RESET_TEST_FILES' +usercase-test-coderl/overlap_lifecycle_test.go +mimo_test_command.sh +EOF_RESET_TEST_FILES + +); then echo "could not reset the test files (testbed problem, not scored)" >&2; exit 1; fi +if ! git apply --verbose /tests/test.patch > "$V/apply.log" 2>&1; then + cat "$V/apply.log" >&2 + echo "the hidden tests could not be applied (testbed problem, not scored)" >&2 + exit 1 +fi +timeout 1800 sh -c "$(cat /tests/test_command.sh)" > "$V/test_output.log" 2>&1 +RC=$? +tail -c 12000 "$V/test_output.log" +if [ $RC -eq 0 ]; then echo 1 > "$V/reward.txt"; else echo 0 > "$V/reward.txt"; fi +echo "test command exited $RC" diff --git a/tasks/format-code-task-000301/tests/test_command.sh b/tasks/format-code-task-000301/tests/test_command.sh new file mode 100644 index 0000000000000000000000000000000000000000..88cb7810b836396c4869db31aeac7d4d4b189685 --- /dev/null +++ b/tasks/format-code-task-000301/tests/test_command.sh @@ -0,0 +1 @@ +bash /workspace/repo/mimo_test_command.sh \ No newline at end of file diff --git a/tasks/format-code-task-000306/environment/Dockerfile b/tasks/format-code-task-000306/environment/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..e8799a03fbf9e20aacf0d383a9903fe9b156bc2d --- /dev/null +++ b/tasks/format-code-task-000306/environment/Dockerfile @@ -0,0 +1,3 @@ +# The task's image, pinned by digest (the same as [environment].docker_image). +# Setup runs at start from [environment.healthcheck]; environment/setup/ is its readable copy. +FROM docker.io/xiaomimimo/mimo-v2.6-rl-oss@sha256:e91a1bbffa1543e2858beb369c9822ec6139a755af6fab56c6b3c1265de373ec diff --git a/tasks/format-code-task-000306/environment/setup/files/blocklist b/tasks/format-code-task-000306/environment/setup/files/blocklist new file mode 100644 index 0000000000000000000000000000000000000000..a8e4bdc4c7d9b739c047a3cb58ea72a1bb05bcbc --- /dev/null +++ b/tasks/format-code-task-000306/environment/setup/files/blocklist @@ -0,0 +1,33 @@ +# mimo answer-leak blocklist (mimoagent) +0.0.0.0 github.com +0.0.0.0 www.github.com +0.0.0.0 api.github.com +0.0.0.0 raw.githubusercontent.com +0.0.0.0 codeload.github.com +0.0.0.0 objects.githubusercontent.com +0.0.0.0 gist.github.com +0.0.0.0 gist.githubusercontent.com +0.0.0.0 gitlab.com +0.0.0.0 bitbucket.org +0.0.0.0 sourceforge.net +0.0.0.0 git.kernel.org +0.0.0.0 chromium.googlesource.com +0.0.0.0 android.googlesource.com +0.0.0.0 sourcegraph.com +0.0.0.0 bugs.chromium.org +0.0.0.0 issues.oss-fuzz.com +0.0.0.0 oss-fuzz.com +0.0.0.0 osv.dev +0.0.0.0 api.osv.dev +0.0.0.0 bugzilla.mozilla.org +0.0.0.0 proxy.golang.org +0.0.0.0 sum.golang.org +0.0.0.0 pkg.go.dev +0.0.0.0 google.com +0.0.0.0 www.google.com +0.0.0.0 bing.com +0.0.0.0 www.bing.com +0.0.0.0 duckduckgo.com +0.0.0.0 html.duckduckgo.com +0.0.0.0 search.brave.com +0.0.0.0 stackoverflow.com diff --git a/tasks/format-code-task-000306/environment/setup/setup.sh b/tasks/format-code-task-000306/environment/setup/setup.sh new file mode 100644 index 0000000000000000000000000000000000000000..d883db90cfcfb48f7a139861bbe9f6b5d95cad6f --- /dev/null +++ b/tasks/format-code-task-000306/environment/setup/setup.sh @@ -0,0 +1,34 @@ +#!/bin/bash +# Runs once, as root, before the agent starts: Harbor's [environment.healthcheck] unpacks this folder into +# /var/lib/mimo and runs it. Generated by mimo_harbor; see its README for how each step maps to Xiaomi's harness. +M=/var/lib/mimo +[ -f "$M/ready" ] && exit 0 +chmod 700 "$M" +fail() { echo "setup: $*" >&2; exit 1; } +# the answer-leak blocklist (mimoagent), applied to /etc/hosts by the agent right after it installs +write_blocklist() { cp "$M/files/blocklist" "$M/blocklist"; } + +# Code: mimoagent environments/datasets/opensource_code.py + base.py, as the explorer runs it (app/runner/domains.py Code). +CWD=/testbed +git config --global --add safe.directory "$CWD" +cd "$CWD" || fail "no working directory $CWD" +if ! git rev-parse --git-dir >/dev/null 2>&1; then # a bare source tree: give it a baseline commit + git init -q && git add -A && git -c user.name=mimo -c user.email=mimo@localhost commit -q -m baseline --allow-empty +fi +BASE=$(git rev-parse HEAD 2>/dev/null) +[ ${#BASE} -eq 40 ] || fail "could not resolve the base commit in $CWD" +echo "$BASE" > "$M/base" +# Images are built with history truncated at the base. If one is not, the fix could be read out of git log, +# so .git is hidden while the agent works and put back for grading. +LATER=$(git rev-list --all --not "$BASE" 2>/dev/null | head -n 5 | grep -c . || true) +rm -f /tmp/fail.log /tmp/pass.log /tmp/patch.diff /tmp/test_patch.diff /tmp/*.log 2>/dev/null; rm -rf /tmp/claude-0 /tmp/claude-* /tmp/testem-* /tmp/puppeteer_dev_chrome_profile-* 2>/dev/null; rm -f /tmp/test_files.json 2>/dev/null; rm -rf /tmp/jest_* /tmp/jest-* /tmp/build /tmp/build_env 2>/dev/null; rm -rf /tmp/pytest-of-root /tmp/pytest-* /tmp/.pytest_cache /tmp/__pycache__ 2>/dev/null; rm -rf /tmp/go-build* /tmp/standards /tmp/wordpress /tmp/zig-* /tmp/testbase /tmp/testbed 2>/dev/null; rm -f /tmp/tmp*.tmp /tmp/*.bak /tmp/expect* /tmp/butwas* 2>/dev/null; rm -rf /root/.cache/go-build 2>/dev/null; rm -rf /tests 2>/dev/null; find /logs -mindepth 1 -delete 2>/dev/null; mkdir -p /logs/agent /logs/verifier /logs/artifacts; chmod 777 /logs/agent /logs/verifier /logs/artifacts; find /var/log -type f -delete 2>/dev/null || true; rm -rf /var/lib/postgresql/*/*/log /var/lib/postgresql/*/*/pg_log 2>/dev/null || true; find /var/lib/mysql /var/lib/mongodb -type f -name '*.log' -delete 2>/dev/null || true; rm -rf /root/.npm/_logs /root/.babel.json /root/.pytest_cache 2>/dev/null || true; find / -maxdepth 4 -xdev -name task_description.md -path '*/.build_env/*' -delete 2>/dev/null || true; true +git clean -fdx --exclude=node_modules --exclude=bower_components --exclude=.husky --exclude=vendor --exclude=third_party --exclude=_deps --exclude=vcpkg_installed --exclude=.venv --exclude=venv --exclude=.gradle --exclude=target --exclude=.build --exclude=lib --exclude=.bundle --exclude=Manifest.toml --exclude=_build --exclude=.stack-work --exclude=dist-newstyle >/dev/null 2>&1 +find /root/.m2 -type f \( -name '*-SNAPSHOT.jar' -o -name '*-SNAPSHOT-sources.jar' -o -name '*-SNAPSHOT-tests.jar' -o -name '*-SNAPSHOT-test-sources.jar' \) -delete 2>/dev/null; rm -rf /root/.julia/compiled 2>/dev/null; rm -rf /root/.gradle/caches/build-cache-* /root/.gradle/daemon 2>/dev/null; rm -rf /root/.gradle/caches/*/scripts /root/.gradle/caches/jars-* 2>/dev/null; rm -rf /root/.cache/bazel 2>/dev/null; true +if [ "$LATER" -gt 0 ]; then + mv "$CWD/.git" "$M/git-hidden" + echo "history not truncated at ${BASE:0:12}: .git hidden while the agent works" +fi +write_blocklist + +touch "$M/ready" +echo "setup done" diff --git a/tasks/format-code-task-000306/tests/test.patch b/tasks/format-code-task-000306/tests/test.patch new file mode 100644 index 0000000000000000000000000000000000000000..a01b1654645e3815e338444f53dd62b4d89d6902 --- /dev/null +++ b/tasks/format-code-task-000306/tests/test.patch @@ -0,0 +1,255 @@ +diff --git a/tests/test_sklearn_api.py b/tests/test_sklearn_api.py +new file mode 100644 +index 0000000..80bc800 +--- /dev/null ++++ b/tests/test_sklearn_api.py +@@ -0,0 +1,228 @@ ++ ++ ++import pickle ++ ++import numpy as np ++import pytest ++ ++from sklearn.base import clone ++ ++from tensorflow import keras ++ ++from sklearn_keras_wrap.wrappers import KerasClassifier, KerasRegressor ++ ++ ++INPUT_DIM = 4 ++N_SAMPLES = 30 ++ ++ ++def _data(seed=0): ++ rng = np.random.RandomState(seed) ++ return rng.rand(N_SAMPLES, INPUT_DIM) ++ ++ ++def build_clf(hidden_dim=8, n_classes=3): ++ model = keras.Sequential( ++ [ ++ keras.layers.Input((INPUT_DIM,)), ++ keras.layers.Dense(hidden_dim, activation="relu"), ++ keras.layers.Dense(n_classes, activation="softmax"), ++ ] ++ ) ++ model.compile( ++ optimizer="adam", ++ loss="sparse_categorical_crossentropy", ++ metrics=["accuracy"], ++ ) ++ return model ++ ++ ++def build_binary_single_output(hidden_dim=8): ++ model = keras.Sequential( ++ [ ++ keras.layers.Input((INPUT_DIM,)), ++ keras.layers.Dense(hidden_dim, activation="relu"), ++ keras.layers.Dense(1, activation="sigmoid"), ++ ] ++ ) ++ model.compile( ++ optimizer="adam", loss="binary_crossentropy", metrics=["accuracy"] ++ ) ++ return model ++ ++ ++def build_reg(hidden_dim=8): ++ model = keras.Sequential( ++ [ ++ keras.layers.Input((INPUT_DIM,)), ++ keras.layers.Dense(hidden_dim, activation="relu"), ++ keras.layers.Dense(1), ++ ] ++ ) ++ model.compile(optimizer="adam", loss="mse") ++ return model ++ ++ ++class CallableClassBuilder: ++ def __call__(self, hidden_dim=8): ++ return build_clf(hidden_dim) ++ ++ ++class InheritedClassifier(KerasClassifier): ++ def __call__(self, hidden_dim=8): ++ return build_clf(hidden_dim) ++ ++ ++ ++ ++ ++def test_get_params_contains_build_fn_and_extra_kwargs(): ++ clf = KerasClassifier(build_fn=build_clf, hidden_dim=10) ++ params = clf.get_params() ++ assert params["build_fn"] is build_clf ++ assert params["hidden_dim"] == 10 ++ ++ assert clf.get_params(deep=False)["hidden_dim"] == 10 ++ ++ ++def test_set_params_updates_and_returns_self(): ++ clf = KerasClassifier(build_fn=build_clf, hidden_dim=10) ++ returned = clf.set_params(hidden_dim=4) ++ assert returned is clf ++ assert clf.get_params()["hidden_dim"] == 4 ++ ++ ++def test_clone_returns_unfitted_equivalent(): ++ clf = KerasClassifier(build_fn=build_clf, hidden_dim=7) ++ cloned = clone(clf) ++ assert cloned is not clf ++ assert cloned.get_params() == clf.get_params() ++ ++ with pytest.raises(Exception): ++ cloned.predict(_data()) ++ ++ ++def test_clone_works_for_subclass_build_fn_none(): ++ clf = InheritedClassifier(build_fn=None, hidden_dim=6) ++ cloned = clone(clf) ++ assert isinstance(cloned, InheritedClassifier) ++ assert cloned.get_params() == clf.get_params() ++ ++ ++def test_clone_works_for_callable_class_instance(): ++ clf = KerasClassifier(build_fn=CallableClassBuilder(), hidden_dim=6) ++ cloned = clone(clf) ++ ++ ++ assert isinstance(cloned, KerasClassifier) ++ assert not hasattr(cloned, "model_") ++ ++ ++ ++ ++ ++def test_fit_returns_self_and_sets_classes(): ++ X = _data() ++ y = np.array([1, 2, 5] * (N_SAMPLES // 3)) ++ clf = KerasClassifier(build_fn=build_clf, hidden_dim=8) ++ returned = clf.fit(X, y, epochs=2, batch_size=8) ++ assert returned is clf ++ assert list(clf.classes_) == [1, 2, 5] ++ assert clf.n_classes_ == 3 ++ ++ ++def test_predict_returns_original_labels(): ++ X = _data() ++ y = np.array([1, 2, 5] * (N_SAMPLES // 3)) ++ clf = KerasClassifier(build_fn=build_clf, hidden_dim=8) ++ clf.fit(X, y, epochs=2) ++ preds = clf.predict(X) ++ assert preds.shape == (N_SAMPLES,) ++ assert set(np.unique(preds)).issubset({1, 2, 5}) ++ ++ ++def test_predict_proba_shape_and_normalization(): ++ X = _data() ++ y = np.array([0, 1, 2] * (N_SAMPLES // 3)) ++ clf = KerasClassifier(build_fn=build_clf, hidden_dim=8) ++ clf.fit(X, y, epochs=2) ++ proba = clf.predict_proba(X) ++ assert proba.shape == (N_SAMPLES, 3) ++ assert np.allclose(np.sum(proba, axis=1), np.ones(N_SAMPLES)) ++ ++ ++def test_binary_single_output_returns_two_columns(): ++ X = _data() ++ y = np.array([0, 1] * (N_SAMPLES // 2)) ++ clf = KerasClassifier(build_fn=build_binary_single_output) ++ clf.fit(X, y, epochs=2) ++ proba = clf.predict_proba(X) ++ assert proba.shape == (N_SAMPLES, 2) ++ assert np.allclose(np.sum(proba, axis=1), np.ones(N_SAMPLES)) ++ preds = clf.predict(X) ++ assert preds.shape == (N_SAMPLES,) ++ assert set(np.unique(preds)).issubset({0, 1}) ++ ++ ++def test_score_is_accuracy_in_unit_interval(): ++ X = _data() ++ y = np.array([0, 1, 2] * (N_SAMPLES // 3)) ++ clf = KerasClassifier(build_fn=build_clf, hidden_dim=8) ++ clf.fit(X, y, epochs=2) ++ score = clf.score(X, y) ++ assert np.isscalar(score) or np.ndim(score) == 0 ++ assert 0.0 <= float(score) <= 1.0 ++ ++ expected = np.mean(clf.predict(X) == y) ++ assert np.isclose(float(score), expected) ++ ++ ++def test_classifier_works_with_callable_class_and_subclass(): ++ X = _data() ++ y = np.array([0, 1, 2] * (N_SAMPLES // 3)) ++ for clf in ( ++ KerasClassifier(build_fn=CallableClassBuilder(), hidden_dim=6), ++ InheritedClassifier(build_fn=None, hidden_dim=6), ++ ): ++ clf.fit(X, y, epochs=1) ++ assert clf.predict(X).shape == (N_SAMPLES,) ++ ++ ++ ++ ++ ++def test_regressor_predict_and_score(): ++ X = _data() ++ rng = np.random.RandomState(1) ++ y = rng.rand(N_SAMPLES) ++ reg = KerasRegressor(build_fn=build_reg, hidden_dim=8) ++ returned = reg.fit(X, y, epochs=2) ++ assert returned is reg ++ preds = reg.predict(X) ++ assert preds.shape == (N_SAMPLES,) ++ score = reg.score(X, y) ++ ++ assert float(score) <= 1.0 ++ ++ ++ ++ ++ ++def test_classifier_pickle_roundtrip_predictions(): ++ X = _data() ++ y = np.array([0, 1, 2] * (N_SAMPLES // 3)) ++ clf = KerasClassifier(build_fn=build_clf, hidden_dim=8) ++ clf.fit(X, y, epochs=2) ++ restored = pickle.loads(pickle.dumps(clf)) ++ assert np.array_equal(restored.predict(X), clf.predict(X)) ++ assert np.allclose(restored.predict_proba(X), clf.predict_proba(X)) ++ ++ ++def test_regressor_pickle_roundtrip_predictions(): ++ X = _data() ++ rng = np.random.RandomState(2) ++ y = rng.rand(N_SAMPLES) ++ reg = KerasRegressor(build_fn=build_reg, hidden_dim=8) ++ reg.fit(X, y, epochs=2) ++ restored = pickle.loads(pickle.dumps(reg)) ++ assert np.allclose(restored.predict(X), reg.predict(X)) +diff --git a/mimo_test_command.sh b/mimo_test_command.sh +new file mode 100755 +--- /dev/null ++++ b/mimo_test_command.sh +@@ -0,0 +1,16 @@ ++#!/usr/bin/env bash ++ ++ ++set -euo pipefail ++HERE="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" ++cd /testbed ++ ++ ++ ++ ++ ++ ++ ++ ++ ++python -m pytest tests/test_sklearn_api.py -q diff --git a/tasks/format-code-task-000306/tests/test.sh b/tasks/format-code-task-000306/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..4bd86765a8e74a3e484f6dee0e7ba621d53793fa --- /dev/null +++ b/tasks/format-code-task-000306/tests/test.sh @@ -0,0 +1,38 @@ +#!/bin/bash +# Code grading, mimoagent opensource_code.py: reset the files the hidden test patch touches, apply it, run the +# task's test command; reward 1 when it exits 0. A testbed failure (reset or apply) writes no reward: not scored. +M=/var/lib/mimo +CWD=/testbed +V=/logs/verifier +mkdir -p "$V" +BASE=$(cat "$M/base" 2>/dev/null) || { echo "setup never ran (no $M/base)" >&2; exit 1; } +cd "$CWD" || exit 1 +if [ -d "$M/git-hidden" ]; then rm -rf "$CWD/.git"; mv "$M/git-hidden" "$CWD/.git"; fi +# the agent's change against the base, so its own commits count too +git add -A >/dev/null 2>&1 && git -c core.fileMode=false diff --cached "$BASE" > "$V/agent.diff" +git reset -q +if ! ( +while IFS= read -r tf; do + [ -z "$tf" ] && continue + if git cat-file -e $BASE:"$tf" 2>/dev/null; then + git checkout $BASE -- "$tf" 2>/dev/null || true + else + git rm -f --cached "$tf" >/dev/null 2>&1 || true + rm -f "$tf" + fi +done <<'EOF_RESET_TEST_FILES' +tests/test_sklearn_api.py +mimo_test_command.sh +EOF_RESET_TEST_FILES + +); then echo "could not reset the test files (testbed problem, not scored)" >&2; exit 1; fi +if ! git apply --verbose /tests/test.patch > "$V/apply.log" 2>&1; then + cat "$V/apply.log" >&2 + echo "the hidden tests could not be applied (testbed problem, not scored)" >&2 + exit 1 +fi +timeout 1800 sh -c "$(cat /tests/test_command.sh)" > "$V/test_output.log" 2>&1 +RC=$? +tail -c 12000 "$V/test_output.log" +if [ $RC -eq 0 ]; then echo 1 > "$V/reward.txt"; else echo 0 > "$V/reward.txt"; fi +echo "test command exited $RC" diff --git a/tasks/format-code-task-000306/tests/test_command.sh b/tasks/format-code-task-000306/tests/test_command.sh new file mode 100644 index 0000000000000000000000000000000000000000..7cb23076694ad17d72e8296d62b2b240083e36db --- /dev/null +++ b/tasks/format-code-task-000306/tests/test_command.sh @@ -0,0 +1 @@ +bash /testbed/mimo_test_command.sh \ No newline at end of file diff --git a/tasks/format-code-task-000308/environment/Dockerfile b/tasks/format-code-task-000308/environment/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..2bbbbf062bfe58f78d44e796649f819b5bbd6a2a --- /dev/null +++ b/tasks/format-code-task-000308/environment/Dockerfile @@ -0,0 +1,3 @@ +# The task's image, pinned by digest (the same as [environment].docker_image). +# Setup runs at start from [environment.healthcheck]; environment/setup/ is its readable copy. +FROM docker.io/xiaomimimo/mimo-v2.6-rl-oss@sha256:a019aa67ecfd985b52db20ea60b739d775746c9e4d9eae82c3aee79ed2c80bfb diff --git a/tasks/format-code-task-000308/environment/setup/files/blocklist b/tasks/format-code-task-000308/environment/setup/files/blocklist new file mode 100644 index 0000000000000000000000000000000000000000..a8e4bdc4c7d9b739c047a3cb58ea72a1bb05bcbc --- /dev/null +++ b/tasks/format-code-task-000308/environment/setup/files/blocklist @@ -0,0 +1,33 @@ +# mimo answer-leak blocklist (mimoagent) +0.0.0.0 github.com +0.0.0.0 www.github.com +0.0.0.0 api.github.com +0.0.0.0 raw.githubusercontent.com +0.0.0.0 codeload.github.com +0.0.0.0 objects.githubusercontent.com +0.0.0.0 gist.github.com +0.0.0.0 gist.githubusercontent.com +0.0.0.0 gitlab.com +0.0.0.0 bitbucket.org +0.0.0.0 sourceforge.net +0.0.0.0 git.kernel.org +0.0.0.0 chromium.googlesource.com +0.0.0.0 android.googlesource.com +0.0.0.0 sourcegraph.com +0.0.0.0 bugs.chromium.org +0.0.0.0 issues.oss-fuzz.com +0.0.0.0 oss-fuzz.com +0.0.0.0 osv.dev +0.0.0.0 api.osv.dev +0.0.0.0 bugzilla.mozilla.org +0.0.0.0 proxy.golang.org +0.0.0.0 sum.golang.org +0.0.0.0 pkg.go.dev +0.0.0.0 google.com +0.0.0.0 www.google.com +0.0.0.0 bing.com +0.0.0.0 www.bing.com +0.0.0.0 duckduckgo.com +0.0.0.0 html.duckduckgo.com +0.0.0.0 search.brave.com +0.0.0.0 stackoverflow.com diff --git a/tasks/format-code-task-000308/environment/setup/setup.sh b/tasks/format-code-task-000308/environment/setup/setup.sh new file mode 100644 index 0000000000000000000000000000000000000000..e9eb7daf39f9542bd095367feee457f3da77e492 --- /dev/null +++ b/tasks/format-code-task-000308/environment/setup/setup.sh @@ -0,0 +1,34 @@ +#!/bin/bash +# Runs once, as root, before the agent starts: Harbor's [environment.healthcheck] unpacks this folder into +# /var/lib/mimo and runs it. Generated by mimo_harbor; see its README for how each step maps to Xiaomi's harness. +M=/var/lib/mimo +[ -f "$M/ready" ] && exit 0 +chmod 700 "$M" +fail() { echo "setup: $*" >&2; exit 1; } +# the answer-leak blocklist (mimoagent), applied to /etc/hosts by the agent right after it installs +write_blocklist() { cp "$M/files/blocklist" "$M/blocklist"; } + +# Code: mimoagent environments/datasets/opensource_code.py + base.py, as the explorer runs it (app/runner/domains.py Code). +CWD=/workspace/repo +git config --global --add safe.directory "$CWD" +cd "$CWD" || fail "no working directory $CWD" +if ! git rev-parse --git-dir >/dev/null 2>&1; then # a bare source tree: give it a baseline commit + git init -q && git add -A && git -c user.name=mimo -c user.email=mimo@localhost commit -q -m baseline --allow-empty +fi +BASE=$(git rev-parse HEAD 2>/dev/null) +[ ${#BASE} -eq 40 ] || fail "could not resolve the base commit in $CWD" +echo "$BASE" > "$M/base" +# Images are built with history truncated at the base. If one is not, the fix could be read out of git log, +# so .git is hidden while the agent works and put back for grading. +LATER=$(git rev-list --all --not "$BASE" 2>/dev/null | head -n 5 | grep -c . || true) +rm -f /tmp/fail.log /tmp/pass.log /tmp/patch.diff /tmp/test_patch.diff /tmp/*.log 2>/dev/null; rm -rf /tmp/claude-0 /tmp/claude-* /tmp/testem-* /tmp/puppeteer_dev_chrome_profile-* 2>/dev/null; rm -f /tmp/test_files.json 2>/dev/null; rm -rf /tmp/jest_* /tmp/jest-* /tmp/build /tmp/build_env 2>/dev/null; rm -rf /tmp/pytest-of-root /tmp/pytest-* /tmp/.pytest_cache /tmp/__pycache__ 2>/dev/null; rm -rf /tmp/go-build* /tmp/standards /tmp/wordpress /tmp/zig-* /tmp/testbase /tmp/testbed 2>/dev/null; rm -f /tmp/tmp*.tmp /tmp/*.bak /tmp/expect* /tmp/butwas* 2>/dev/null; rm -rf /root/.cache/go-build 2>/dev/null; rm -rf /tests 2>/dev/null; find /logs -mindepth 1 -delete 2>/dev/null; mkdir -p /logs/agent /logs/verifier /logs/artifacts; chmod 777 /logs/agent /logs/verifier /logs/artifacts; find /var/log -type f -delete 2>/dev/null || true; rm -rf /var/lib/postgresql/*/*/log /var/lib/postgresql/*/*/pg_log 2>/dev/null || true; find /var/lib/mysql /var/lib/mongodb -type f -name '*.log' -delete 2>/dev/null || true; rm -rf /root/.npm/_logs /root/.babel.json /root/.pytest_cache 2>/dev/null || true; find / -maxdepth 4 -xdev -name task_description.md -path '*/.build_env/*' -delete 2>/dev/null || true; true +git clean -fdx --exclude=node_modules --exclude=bower_components --exclude=.husky --exclude=vendor --exclude=third_party --exclude=_deps --exclude=vcpkg_installed --exclude=.venv --exclude=venv --exclude=.gradle --exclude=target --exclude=.build --exclude=lib --exclude=.bundle --exclude=Manifest.toml --exclude=_build --exclude=.stack-work --exclude=dist-newstyle >/dev/null 2>&1 +find /root/.m2 -type f \( -name '*-SNAPSHOT.jar' -o -name '*-SNAPSHOT-sources.jar' -o -name '*-SNAPSHOT-tests.jar' -o -name '*-SNAPSHOT-test-sources.jar' \) -delete 2>/dev/null; rm -rf /root/.julia/compiled 2>/dev/null; rm -rf /root/.gradle/caches/build-cache-* /root/.gradle/daemon 2>/dev/null; rm -rf /root/.gradle/caches/*/scripts /root/.gradle/caches/jars-* 2>/dev/null; rm -rf /root/.cache/bazel 2>/dev/null; true +if [ "$LATER" -gt 0 ]; then + mv "$CWD/.git" "$M/git-hidden" + echo "history not truncated at ${BASE:0:12}: .git hidden while the agent works" +fi +write_blocklist + +touch "$M/ready" +echo "setup done" diff --git a/tasks/format-code-task-000308/tests/test.patch b/tasks/format-code-task-000308/tests/test.patch new file mode 100644 index 0000000000000000000000000000000000000000..81651344c7f1c2a5f42ecc5226426e7aa4f1010b --- /dev/null +++ b/tasks/format-code-task-000308/tests/test.patch @@ -0,0 +1,499 @@ +diff --git a/usercase-test-coderl/batch_exists_test.go b/usercase-test-coderl/batch_exists_test.go +new file mode 100644 +--- /dev/null ++++ b/usercase-test-coderl/batch_exists_test.go +@@ -0,0 +1,400 @@ ++package usercase_test_coderl ++ ++import ( ++ "crypto/sha1" ++ "encoding/hex" ++ "errors" ++ "fmt" ++ "os" ++ "reflect" ++ "strconv" ++ "strings" ++ "testing" ++ "time" ++ ++ as "github.com/aerospike/aerospike-client-go/v8" ++ "github.com/aerospike/aerospike-client-go/v8/types" ++) ++ ++const namespace = "test" ++ ++func testHost() string { ++ if host := os.Getenv("AEROSPIKE_HOST"); host != "" { ++ return host ++ } ++ return "127.0.0.1" ++} ++ ++func testPort() int { ++ if port := os.Getenv("AEROSPIKE_PORT"); port != "" { ++ parsed, err := strconv.Atoi(port) ++ if err == nil { ++ return parsed ++ } ++ } ++ return 3000 ++} ++ ++func newConnectedClient(t *testing.T) *as.Client { ++ t.Helper() ++ ++ policy := as.NewClientPolicy() ++ policy.FailIfNotConnected = true ++ policy.Timeout = 5 * time.Second ++ ++ var client *as.Client ++ var err as.Error ++ deadline := time.Now().Add(10 * time.Second) ++ for { ++ client, err = as.NewClientWithPolicy(policy, testHost(), testPort()) ++ if err == nil { ++ break ++ } ++ if time.Now().After(deadline) { ++ break ++ } ++ time.Sleep(100 * time.Millisecond) ++ } ++ if err != nil { ++ t.Fatalf("NewClientWithPolicy error = %v, want nil", err) ++ } ++ if client.IsConnected() != true { ++ t.Fatalf("client.IsConnected() = %v, want true", client.IsConnected()) ++ } ++ if len(client.GetNodes()) != 1 { ++ t.Fatalf("len(client.GetNodes()) = %d, want 1", len(client.GetNodes())) ++ } ++ return client ++} ++ ++func makeKey(t *testing.T, set string, userKey any) *as.Key { ++ t.Helper() ++ ++ key, err := as.NewKey(namespace, set, userKey) ++ if err != nil { ++ t.Fatalf("NewKey error = %v, want nil", err) ++ } ++ return key ++} ++ ++func writeFixtureRecord(t *testing.T, client *as.Client, key *as.Key, marker int) { ++ t.Helper() ++ ++ err := client.Put(nil, key, as.BinMap{"marker": marker, "payload": fmt.Sprintf("payload-%d", marker)}) ++ if err != nil { ++ t.Fatalf("Put error = %v, want nil", err) ++ } ++} ++ ++func deleteFixtureRecord(t *testing.T, client *as.Client, key *as.Key) { ++ t.Helper() ++ ++ _, _ = client.Delete(nil, key) ++} ++ ++func uniqueSet(t *testing.T) string { ++ sum := sha1.Sum([]byte(t.Name())) ++ prefix := strings.NewReplacer("/", "_", " ", "_").Replace(t.Name()) ++ if len(prefix) > 24 { ++ prefix = prefix[:24] ++ } ++ return "coderl_" + prefix + "_" + hex.EncodeToString(sum[:4]) ++} ++ ++func assertBoolSlice(t *testing.T, got []bool, want []bool) { ++ t.Helper() ++ ++ if !reflect.DeepEqual(got, want) { ++ t.Fatalf("BatchExists result = %#v, want %#v", got, want) ++ } ++} ++ ++func assertAerospikeCode(t *testing.T, err error, want types.ResultCode) { ++ t.Helper() ++ ++ if err == nil { ++ t.Fatalf("error = nil, want *aerospike.AerospikeError with ResultCode %s", want) ++ } ++ var aerospikeErr *as.AerospikeError ++ if !errors.As(err, &aerospikeErr) { ++ t.Fatalf("error type = %T, want *aerospike.AerospikeError", err) ++ } ++ if aerospikeErr.ResultCode != want { ++ t.Fatalf("AerospikeError.ResultCode = %s, want %s", aerospikeErr.ResultCode, want) ++ } ++} ++ ++func metricCount(t *testing.T, stats map[string]any, metricName string) float64 { ++ t.Helper() ++ ++ aggregated, ok := stats["cluster-aggregated-stats"].(map[string]any) ++ if !ok { ++ t.Fatalf("stats[cluster-aggregated-stats] type = %T, want map[string]any", stats["cluster-aggregated-stats"]) ++ } ++ metric, ok := aggregated[metricName].(map[string]any) ++ if !ok { ++ t.Fatalf("aggregated[%s] type = %T, want map[string]any", metricName, aggregated[metricName]) ++ } ++ count, ok := metric["count"].(float64) ++ if !ok { ++ t.Fatalf("aggregated[%s][count] type = %T, want float64", metricName, metric["count"]) ++ } ++ return count ++} ++ ++func TestBatchExistsMixedExistingAndMissingKeysWithNilPolicy(t *testing.T) { ++ ++ ++ client := newConnectedClient(t) ++ defer client.Close() ++ ++ set := uniqueSet(t) ++ keyA := makeKey(t, set, "A") ++ keyB := makeKey(t, set, "B") ++ keyC := makeKey(t, set, "C") ++ deleteFixtureRecord(t, client, keyA) ++ deleteFixtureRecord(t, client, keyB) ++ deleteFixtureRecord(t, client, keyC) ++ writeFixtureRecord(t, client, keyA, 10) ++ writeFixtureRecord(t, client, keyC, 30) ++ ++ exists, err := client.BatchExists(nil, []*as.Key{keyA, keyB, keyC}) ++ if err != nil { ++ t.Fatalf("BatchExists error = %v, want nil", err) ++ } ++ assertBoolSlice(t, exists, []bool{true, false, true}) ++} ++ ++func TestBatchExistsTwoMissingKeysAreFalseNotFailure(t *testing.T) { ++ ++ ++ client := newConnectedClient(t) ++ defer client.Close() ++ ++ set := uniqueSet(t) ++ keyA := makeKey(t, set, "missing-A") ++ keyB := makeKey(t, set, "missing-B") ++ deleteFixtureRecord(t, client, keyA) ++ deleteFixtureRecord(t, client, keyB) ++ ++ exists, err := client.BatchExists(nil, []*as.Key{keyA, keyB}) ++ if err != nil { ++ t.Fatalf("BatchExists error = %v, want nil", err) ++ } ++ assertBoolSlice(t, exists, []bool{false, false}) ++} ++ ++func TestBatchExistsPreservesInputOrderForNonPalindromicResults(t *testing.T) { ++ ++ ++ client := newConnectedClient(t) ++ defer client.Close() ++ ++ set := uniqueSet(t) ++ keyA := makeKey(t, set, "A") ++ keyB := makeKey(t, set, "B") ++ keyC := makeKey(t, set, "C") ++ keyD := makeKey(t, set, "D") ++ for _, key := range []*as.Key{keyA, keyB, keyC, keyD} { ++ deleteFixtureRecord(t, client, key) ++ } ++ writeFixtureRecord(t, client, keyA, 10) ++ writeFixtureRecord(t, client, keyC, 30) ++ ++ exists, err := client.BatchExists(nil, []*as.Key{keyB, keyA, keyD, keyC}) ++ if err != nil { ++ t.Fatalf("BatchExists error = %v, want nil", err) ++ } ++ assertBoolSlice(t, exists, []bool{false, true, false, true}) ++} ++ ++func TestBatchExistsRecordsAsOneBatchReadOperationNotSingleKeyReads(t *testing.T) { ++ ++ ++ client := newConnectedClient(t) ++ defer client.Close() ++ ++ set := uniqueSet(t) ++ keyA := makeKey(t, set, "A") ++ keyB := makeKey(t, set, "B") ++ deleteFixtureRecord(t, client, keyA) ++ deleteFixtureRecord(t, client, keyB) ++ writeFixtureRecord(t, client, keyA, 10) ++ client.EnableMetrics(nil) ++ ++ exists, err := client.BatchExists(nil, []*as.Key{keyA, keyB}) ++ if err != nil { ++ t.Fatalf("BatchExists error = %v, want nil", err) ++ } ++ assertBoolSlice(t, exists, []bool{true, false}) ++ ++ stats, statsErr := client.Stats() ++ if statsErr != nil { ++ t.Fatalf("Stats error = %v, want nil", statsErr) ++ } ++ if metricCount(t, stats, "batch-read-metrics") != 1 { ++ t.Fatalf("batch-read-metrics count = %.0f, want 1", metricCount(t, stats, "batch-read-metrics")) ++ } ++ if metricCount(t, stats, "exists-metrics") != 0 { ++ t.Fatalf("exists-metrics count = %.0f, want 0", metricCount(t, stats, "exists-metrics")) ++ } ++ if metricCount(t, stats, "get-metrics") != 0 { ++ t.Fatalf("get-metrics count = %.0f, want 0", metricCount(t, stats, "get-metrics")) ++ } ++ if metricCount(t, stats, "get-header-metrics") != 0 { ++ t.Fatalf("get-header-metrics count = %.0f, want 0", metricCount(t, stats, "get-header-metrics")) ++ } ++} ++ ++func TestBatchExistsNilPolicyUsesClientDefaultBatchPolicyAndReportsFilteredOut(t *testing.T) { ++ ++ ++ client := newConnectedClient(t) ++ defer client.Close() ++ ++ set := uniqueSet(t) ++ keyA := makeKey(t, set, "A") ++ keyC := makeKey(t, set, "C") ++ deleteFixtureRecord(t, client, keyA) ++ deleteFixtureRecord(t, client, keyC) ++ writeFixtureRecord(t, client, keyA, 10) ++ writeFixtureRecord(t, client, keyC, 30) ++ ++ defaultBatchPolicy := as.NewBatchPolicy() ++ defaultBatchPolicy.FilterExpression = as.ExpEq(as.ExpIntBin("marker"), as.ExpIntVal(10)) ++ client.SetDefaultBatchPolicy(defaultBatchPolicy) ++ ++ exists, err := client.BatchExists(nil, []*as.Key{keyA, keyC}) ++ ++ if exists != nil { ++ assertBoolSlice(t, exists, []bool{true, false}) ++ } ++ assertAerospikeCode(t, err, types.FILTERED_OUT) ++ ++ withoutFilter := as.NewBatchPolicy() ++ exists, err = client.BatchExists(withoutFilter, []*as.Key{keyA, keyC}) ++ if err != nil { ++ t.Fatalf("BatchExists without filter error = %v, want nil", err) ++ } ++ assertBoolSlice(t, exists, []bool{true, true}) ++} ++ ++func TestBatchExistsUnexpectedPerKeyServerErrorIsReturned(t *testing.T) { ++ ++ ++ client := newConnectedClient(t) ++ defer client.Close() ++ ++ set := uniqueSet(t) ++ keyA := makeKey(t, set, "A") ++ deleteFixtureRecord(t, client, keyA) ++ writeFixtureRecord(t, client, keyA, 10) ++ badKey, err := as.NewKey("missing_namespace_coderl", set, "bad") ++ if err != nil { ++ t.Fatalf("NewKey invalid-namespace fixture error = %v, want nil", err) ++ } ++ ++ exists, batchErr := client.BatchExists(nil, []*as.Key{keyA, badKey}) ++ ++ if batchErr == nil { ++ t.Fatalf("BatchExists error = nil, want non-nil Error for unexpected per-key server error") ++ } ++ if exists != nil { ++ if len(exists) != 2 { ++ t.Fatalf("BatchExists result length = %d, want 2 when a result slice is returned", len(exists)) ++ } ++ if exists[1] { ++ t.Fatalf("BatchExists marked unexpected-error key as existing: %#v", exists) ++ } ++ } ++} ++ ++func TestBatchExistsWorksFromExistingConnectedClient(t *testing.T) { ++ ++ ++ client := newConnectedClient(t) ++ defer client.Close() ++ ++ set := uniqueSet(t) ++ keyA := makeKey(t, set, "A") ++ deleteFixtureRecord(t, client, keyA) ++ writeFixtureRecord(t, client, keyA, 10) ++ ++ ++ exists, err := client.BatchExists(nil, []*as.Key{keyA}) ++ if err != nil { ++ t.Fatalf("BatchExists error = %v, want nil", err) ++ } ++ assertBoolSlice(t, exists, []bool{true}) ++} ++ ++func TestBatchExistsReturnsMissingFalseFromConnectedClient(t *testing.T) { ++ ++ ++ client := newConnectedClient(t) ++ defer client.Close() ++ ++ set := uniqueSet(t) ++ keyA := makeKey(t, set, "A") ++ deleteFixtureRecord(t, client, keyA) ++ ++ ++ exists, err := client.BatchExists(nil, []*as.Key{keyA}) ++ if err != nil { ++ t.Fatalf("BatchExists error = %v, want nil", err) ++ } ++ assertBoolSlice(t, exists, []bool{false}) ++} ++ ++func TestBatchExistsStateIsIndependentAcrossClientInstances(t *testing.T) { ++ ++ ++ clientA := newConnectedClient(t) ++ defer clientA.Close() ++ clientB := newConnectedClient(t) ++ defer clientB.Close() ++ ++ set := uniqueSet(t) ++ keyA := makeKey(t, set, "A") ++ keyB := makeKey(t, set, "B") ++ deleteFixtureRecord(t, clientA, keyA) ++ deleteFixtureRecord(t, clientA, keyB) ++ writeFixtureRecord(t, clientA, keyA, 10) ++ ++ existsA, errA := clientA.BatchExists(nil, []*as.Key{keyA, keyB}) ++ if errA != nil { ++ t.Fatalf("clientA.BatchExists error = %v, want nil", errA) ++ } ++ assertBoolSlice(t, existsA, []bool{true, false}) ++ ++ existsB, errB := clientB.BatchExists(nil, []*as.Key{keyB, keyA}) ++ if errB != nil { ++ t.Fatalf("clientB.BatchExists error = %v, want nil", errB) ++ } ++ assertBoolSlice(t, existsB, []bool{false, true}) ++} ++ ++func TestBatchExistsRepeatedConnectedClientsReturnPositionalResults(t *testing.T) { ++ ++ ++ control := newConnectedClient(t) ++ set := uniqueSet(t) ++ keyA := makeKey(t, set, "A") ++ keyB := makeKey(t, set, "B") ++ deleteFixtureRecord(t, control, keyA) ++ deleteFixtureRecord(t, control, keyB) ++ writeFixtureRecord(t, control, keyA, 10) ++ control.Close() ++ ++ ++ for i := 0; i < 20; i++ { ++ client := newConnectedClient(t) ++ exists, err := client.BatchExists(nil, []*as.Key{keyB, keyA}) ++ if err != nil { ++ client.Close() ++ t.Fatalf("cycle %d BatchExists error = %v, want nil", i, err) ++ } ++ assertBoolSlice(t, exists, []bool{false, true}) ++ client.Close() ++ } ++} +diff --git a/mimo_test_command.sh b/mimo_test_command.sh +new file mode 100755 +--- /dev/null ++++ b/mimo_test_command.sh +@@ -0,0 +1,89 @@ ++#!/usr/bin/env bash ++ ++ ++ ++ ++export NODE_OPTIONS="${NODE_OPTIONS:-} --max-old-space-size=4096" ++export MAVEN_OPTS="${MAVEN_OPTS:-} -Xmx3g -XX:+UseG1GC" ++export GRADLE_OPTS="${GRADLE_OPTS:-} -Xmx3g -XX:+UseG1GC" ++export TEST_JVM_OPTS="${TEST_JVM_OPTS:-} -Xmx3g" ++set -e ++cd /workspace/repo ++set -euo pipefail ++ ++cd /workspace/repo ++ ++export AEROSPIKE_HOST="${AEROSPIKE_HOST:-127.0.0.1}" ++export AEROSPIKE_PORT="${AEROSPIKE_PORT:-3000}" ++export GOPROXY=off ++export GOSUMDB=off ++export GOTOOLCHAIN=local ++export GOFLAGS="-mod=mod" ++unset AEROSPIKE_CLIENT_CONFIG_URL ++ ++if ! (exec 3<>"/dev/tcp/${AEROSPIKE_HOST}/${AEROSPIKE_PORT}") >/dev/null 2>&1; then ++ work=/tmp/aerospike-fixture-coderl ++ root=/opt/aerospike-stage3-coderl/root ++ mkdir -p "${work}/work/smd" "${work}/udf/lua" ++ ++ if [ ! -x "${root}/usr/bin/asd" ]; then ++ echo "missing staged Aerospike server at ${root}/usr/bin/asd" >&2 ++ exit 1 ++ fi ++ ++ cat > "${work}/aerospike.conf" </dev/null 2>&1 || true; wait "${asd_pid}" >/dev/null 2>&1 || true' EXIT ++ ++ for _ in $(seq 1 100); do ++ if (exec 3<>"/dev/tcp/${AEROSPIKE_HOST}/${AEROSPIKE_PORT}") >/dev/null 2>&1; then ++ break ++ fi ++ sleep 0.2 ++ done ++fi ++ ++go test -v -count=1 ./usercase-test-coderl/... diff --git a/tasks/format-code-task-000308/tests/test.sh b/tasks/format-code-task-000308/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..02bd874364eff1a042f6d399f4c53ef9a521cf68 --- /dev/null +++ b/tasks/format-code-task-000308/tests/test.sh @@ -0,0 +1,38 @@ +#!/bin/bash +# Code grading, mimoagent opensource_code.py: reset the files the hidden test patch touches, apply it, run the +# task's test command; reward 1 when it exits 0. A testbed failure (reset or apply) writes no reward: not scored. +M=/var/lib/mimo +CWD=/workspace/repo +V=/logs/verifier +mkdir -p "$V" +BASE=$(cat "$M/base" 2>/dev/null) || { echo "setup never ran (no $M/base)" >&2; exit 1; } +cd "$CWD" || exit 1 +if [ -d "$M/git-hidden" ]; then rm -rf "$CWD/.git"; mv "$M/git-hidden" "$CWD/.git"; fi +# the agent's change against the base, so its own commits count too +git add -A >/dev/null 2>&1 && git -c core.fileMode=false diff --cached "$BASE" > "$V/agent.diff" +git reset -q +if ! ( +while IFS= read -r tf; do + [ -z "$tf" ] && continue + if git cat-file -e $BASE:"$tf" 2>/dev/null; then + git checkout $BASE -- "$tf" 2>/dev/null || true + else + git rm -f --cached "$tf" >/dev/null 2>&1 || true + rm -f "$tf" + fi +done <<'EOF_RESET_TEST_FILES' +usercase-test-coderl/batch_exists_test.go +mimo_test_command.sh +EOF_RESET_TEST_FILES + +); then echo "could not reset the test files (testbed problem, not scored)" >&2; exit 1; fi +if ! git apply --verbose /tests/test.patch > "$V/apply.log" 2>&1; then + cat "$V/apply.log" >&2 + echo "the hidden tests could not be applied (testbed problem, not scored)" >&2 + exit 1 +fi +timeout 1800 sh -c "$(cat /tests/test_command.sh)" > "$V/test_output.log" 2>&1 +RC=$? +tail -c 12000 "$V/test_output.log" +if [ $RC -eq 0 ]; then echo 1 > "$V/reward.txt"; else echo 0 > "$V/reward.txt"; fi +echo "test command exited $RC" diff --git a/tasks/format-code-task-000308/tests/test_command.sh b/tasks/format-code-task-000308/tests/test_command.sh new file mode 100644 index 0000000000000000000000000000000000000000..88cb7810b836396c4869db31aeac7d4d4b189685 --- /dev/null +++ b/tasks/format-code-task-000308/tests/test_command.sh @@ -0,0 +1 @@ +bash /workspace/repo/mimo_test_command.sh \ No newline at end of file diff --git a/tasks/format-code-task-000312/environment/Dockerfile b/tasks/format-code-task-000312/environment/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..313cb897fd775cdaf537f1da91501f7a1b32161c --- /dev/null +++ b/tasks/format-code-task-000312/environment/Dockerfile @@ -0,0 +1,3 @@ +# The task's image, pinned by digest (the same as [environment].docker_image). +# Setup runs at start from [environment.healthcheck]; environment/setup/ is its readable copy. +FROM docker.io/xiaomimimo/mimo-v2.6-rl-oss@sha256:97faf0f0c337e15f1ad1d6c2e1e44f4952ed7ddb648304235a96db57f0ddcd0b diff --git a/tasks/format-code-task-000312/environment/setup/files/blocklist b/tasks/format-code-task-000312/environment/setup/files/blocklist new file mode 100644 index 0000000000000000000000000000000000000000..a8e4bdc4c7d9b739c047a3cb58ea72a1bb05bcbc --- /dev/null +++ b/tasks/format-code-task-000312/environment/setup/files/blocklist @@ -0,0 +1,33 @@ +# mimo answer-leak blocklist (mimoagent) +0.0.0.0 github.com +0.0.0.0 www.github.com +0.0.0.0 api.github.com +0.0.0.0 raw.githubusercontent.com +0.0.0.0 codeload.github.com +0.0.0.0 objects.githubusercontent.com +0.0.0.0 gist.github.com +0.0.0.0 gist.githubusercontent.com +0.0.0.0 gitlab.com +0.0.0.0 bitbucket.org +0.0.0.0 sourceforge.net +0.0.0.0 git.kernel.org +0.0.0.0 chromium.googlesource.com +0.0.0.0 android.googlesource.com +0.0.0.0 sourcegraph.com +0.0.0.0 bugs.chromium.org +0.0.0.0 issues.oss-fuzz.com +0.0.0.0 oss-fuzz.com +0.0.0.0 osv.dev +0.0.0.0 api.osv.dev +0.0.0.0 bugzilla.mozilla.org +0.0.0.0 proxy.golang.org +0.0.0.0 sum.golang.org +0.0.0.0 pkg.go.dev +0.0.0.0 google.com +0.0.0.0 www.google.com +0.0.0.0 bing.com +0.0.0.0 www.bing.com +0.0.0.0 duckduckgo.com +0.0.0.0 html.duckduckgo.com +0.0.0.0 search.brave.com +0.0.0.0 stackoverflow.com diff --git a/tasks/format-code-task-000312/environment/setup/setup.sh b/tasks/format-code-task-000312/environment/setup/setup.sh new file mode 100644 index 0000000000000000000000000000000000000000..d883db90cfcfb48f7a139861bbe9f6b5d95cad6f --- /dev/null +++ b/tasks/format-code-task-000312/environment/setup/setup.sh @@ -0,0 +1,34 @@ +#!/bin/bash +# Runs once, as root, before the agent starts: Harbor's [environment.healthcheck] unpacks this folder into +# /var/lib/mimo and runs it. Generated by mimo_harbor; see its README for how each step maps to Xiaomi's harness. +M=/var/lib/mimo +[ -f "$M/ready" ] && exit 0 +chmod 700 "$M" +fail() { echo "setup: $*" >&2; exit 1; } +# the answer-leak blocklist (mimoagent), applied to /etc/hosts by the agent right after it installs +write_blocklist() { cp "$M/files/blocklist" "$M/blocklist"; } + +# Code: mimoagent environments/datasets/opensource_code.py + base.py, as the explorer runs it (app/runner/domains.py Code). +CWD=/testbed +git config --global --add safe.directory "$CWD" +cd "$CWD" || fail "no working directory $CWD" +if ! git rev-parse --git-dir >/dev/null 2>&1; then # a bare source tree: give it a baseline commit + git init -q && git add -A && git -c user.name=mimo -c user.email=mimo@localhost commit -q -m baseline --allow-empty +fi +BASE=$(git rev-parse HEAD 2>/dev/null) +[ ${#BASE} -eq 40 ] || fail "could not resolve the base commit in $CWD" +echo "$BASE" > "$M/base" +# Images are built with history truncated at the base. If one is not, the fix could be read out of git log, +# so .git is hidden while the agent works and put back for grading. +LATER=$(git rev-list --all --not "$BASE" 2>/dev/null | head -n 5 | grep -c . || true) +rm -f /tmp/fail.log /tmp/pass.log /tmp/patch.diff /tmp/test_patch.diff /tmp/*.log 2>/dev/null; rm -rf /tmp/claude-0 /tmp/claude-* /tmp/testem-* /tmp/puppeteer_dev_chrome_profile-* 2>/dev/null; rm -f /tmp/test_files.json 2>/dev/null; rm -rf /tmp/jest_* /tmp/jest-* /tmp/build /tmp/build_env 2>/dev/null; rm -rf /tmp/pytest-of-root /tmp/pytest-* /tmp/.pytest_cache /tmp/__pycache__ 2>/dev/null; rm -rf /tmp/go-build* /tmp/standards /tmp/wordpress /tmp/zig-* /tmp/testbase /tmp/testbed 2>/dev/null; rm -f /tmp/tmp*.tmp /tmp/*.bak /tmp/expect* /tmp/butwas* 2>/dev/null; rm -rf /root/.cache/go-build 2>/dev/null; rm -rf /tests 2>/dev/null; find /logs -mindepth 1 -delete 2>/dev/null; mkdir -p /logs/agent /logs/verifier /logs/artifacts; chmod 777 /logs/agent /logs/verifier /logs/artifacts; find /var/log -type f -delete 2>/dev/null || true; rm -rf /var/lib/postgresql/*/*/log /var/lib/postgresql/*/*/pg_log 2>/dev/null || true; find /var/lib/mysql /var/lib/mongodb -type f -name '*.log' -delete 2>/dev/null || true; rm -rf /root/.npm/_logs /root/.babel.json /root/.pytest_cache 2>/dev/null || true; find / -maxdepth 4 -xdev -name task_description.md -path '*/.build_env/*' -delete 2>/dev/null || true; true +git clean -fdx --exclude=node_modules --exclude=bower_components --exclude=.husky --exclude=vendor --exclude=third_party --exclude=_deps --exclude=vcpkg_installed --exclude=.venv --exclude=venv --exclude=.gradle --exclude=target --exclude=.build --exclude=lib --exclude=.bundle --exclude=Manifest.toml --exclude=_build --exclude=.stack-work --exclude=dist-newstyle >/dev/null 2>&1 +find /root/.m2 -type f \( -name '*-SNAPSHOT.jar' -o -name '*-SNAPSHOT-sources.jar' -o -name '*-SNAPSHOT-tests.jar' -o -name '*-SNAPSHOT-test-sources.jar' \) -delete 2>/dev/null; rm -rf /root/.julia/compiled 2>/dev/null; rm -rf /root/.gradle/caches/build-cache-* /root/.gradle/daemon 2>/dev/null; rm -rf /root/.gradle/caches/*/scripts /root/.gradle/caches/jars-* 2>/dev/null; rm -rf /root/.cache/bazel 2>/dev/null; true +if [ "$LATER" -gt 0 ]; then + mv "$CWD/.git" "$M/git-hidden" + echo "history not truncated at ${BASE:0:12}: .git hidden while the agent works" +fi +write_blocklist + +touch "$M/ready" +echo "setup done" diff --git a/tasks/format-code-task-000312/tests/test.patch b/tasks/format-code-task-000312/tests/test.patch new file mode 100644 index 0000000000000000000000000000000000000000..6cf28aa5006840dbde4ce3d10a6cb116a1ddda77 --- /dev/null +++ b/tasks/format-code-task-000312/tests/test.patch @@ -0,0 +1,156 @@ +diff --git a/tests/test_section_verbose_names.py b/tests/test_section_verbose_names.py +new file mode 100644 +index 0000000..8b8b9c1 +--- /dev/null ++++ b/tests/test_section_verbose_names.py +@@ -0,0 +1,124 @@ ++import re ++ ++from django.contrib.auth import get_user_model ++from django.core.urlresolvers import reverse ++from django.test import SimpleTestCase, TestCase ++ ++from dynamic_preferences.models import GlobalPreferenceModel ++from dynamic_preferences.preferences import Section ++from dynamic_preferences.registries import global_preferences_registry ++from dynamic_preferences.types import StringPreference ++ ++ ++REGISTERED_ADMIN_SECTIONS = ( ++ { ++ 'key': 'admin_verbose_alpha', ++ 'label': 'Alpha admin section', ++ 'preference_name': 'AdminVerboseAlphaPreference', ++ 'default': 'alpha value', ++ 'preference_label': 'Alpha admin verbose preference', ++ }, ++ { ++ 'key': 'admin_verbose_beta', ++ 'label': 'Beta admin section', ++ 'preference_name': 'AdminVerboseBetaPreference', ++ 'default': 'beta value', ++ 'preference_label': 'Beta admin verbose preference', ++ }, ++) ++UNRESOLVED_SECTION_KEY = 'admin_unresolved_section' ++UNRESOLVED_PREFERENCE_NAME = 'AdminUnresolvedPreference' ++UNRESOLVED_DEFAULT = 'fallback value' ++ ++ ++@global_preferences_registry.register ++class AdminVerboseAlphaPreference(StringPreference): ++ section = Section(REGISTERED_ADMIN_SECTIONS[0]['key'], ++ verbose_name=REGISTERED_ADMIN_SECTIONS[0]['label']) ++ name = REGISTERED_ADMIN_SECTIONS[0]['preference_name'] ++ default = REGISTERED_ADMIN_SECTIONS[0]['default'] ++ verbose_name = REGISTERED_ADMIN_SECTIONS[0]['preference_label'] ++ ++ ++@global_preferences_registry.register ++class AdminVerboseBetaPreference(StringPreference): ++ section = Section(REGISTERED_ADMIN_SECTIONS[1]['key'], ++ verbose_name=REGISTERED_ADMIN_SECTIONS[1]['label']) ++ name = REGISTERED_ADMIN_SECTIONS[1]['preference_name'] ++ default = REGISTERED_ADMIN_SECTIONS[1]['default'] ++ verbose_name = REGISTERED_ADMIN_SECTIONS[1]['preference_label'] ++ ++ ++class TestSectionVerboseNameApi(SimpleTestCase): ++ def test_section_str_uses_verbose_name_with_fallbacks(self): ++ examples = ( ++ ('billing', 'Billing preferences'), ++ ('notifications', 'Notification preferences'), ++ ('support', 'Support center'), ++ ) ++ for section_key, label in examples: ++ self.assertEqual(str(Section(section_key, verbose_name=label)), label) ++ self.assertEqual(str(Section(examples[0][0])), examples[0][0]) ++ self.assertEqual(str(Section(None)), '') ++ ++ ++class TestSectionVerboseNameAdminDisplay(TestCase): ++ def setUp(self): ++ user_model = get_user_model() ++ user_model.objects.create_superuser('admin', 'admin@example.com', 'test') ++ self.client.login(username='admin', password='test') ++ self.registered_rows = [] ++ for data in REGISTERED_ADMIN_SECTIONS: ++ row, _ = GlobalPreferenceModel.objects.get_or_create( ++ section=data['key'], ++ name=data['preference_name'], ++ defaults={'raw_value': data['default']}) ++ self.registered_rows.append(row) ++ self.unresolved_row, _ = GlobalPreferenceModel.objects.get_or_create( ++ section=UNRESOLVED_SECTION_KEY, ++ name=UNRESOLVED_PREFERENCE_NAME, ++ defaults={'raw_value': UNRESOLVED_DEFAULT}) ++ ++ def _admin_changelist_html(self): ++ url = reverse('admin:dynamic_preferences_globalpreferencemodel_changelist') ++ response = self.client.get(url) ++ self.assertEqual(response.status_code, 200) ++ return response.content.decode('utf-8') ++ ++ def _admin_change_html(self, obj): ++ url = reverse('admin:dynamic_preferences_globalpreferencemodel_change', ++ args=(obj.pk,)) ++ response = self.client.get(url) ++ self.assertEqual(response.status_code, 200) ++ return response.content.decode('utf-8') ++ ++ def _fragment(self, html, start_pattern, end_pattern): ++ match = re.search(start_pattern, html) ++ self.assertIsNotNone(match, 'Expected admin page region was not found') ++ start = match.start() ++ end = html.find(end_pattern, start) ++ self.assertNotEqual(end, -1, 'Expected admin page region end was not found') ++ return html[start:end] ++ ++ def test_admin_changelist_displays_section_verbose_names(self): ++ html = self._admin_changelist_html() ++ result_table = self._fragment(html, r']+id="result_list"', '') ++ ++ for data in REGISTERED_ADMIN_SECTIONS: ++ self.assertIn(data['label'], result_table) ++ self.assertIn(UNRESOLVED_SECTION_KEY, result_table) ++ ++ def test_admin_section_filter_displays_verbose_names(self): ++ html = self._admin_changelist_html() ++ filter_sidebar = self._fragment(html, r'id="changelist-filter"', '') ++ ++ for data in REGISTERED_ADMIN_SECTIONS: ++ self.assertIn(data['label'], filter_sidebar) ++ self.assertIn(UNRESOLVED_SECTION_KEY, filter_sidebar) ++ ++ def test_admin_change_form_displays_section_verbose_name(self): ++ for row, data in zip(self.registered_rows, REGISTERED_ADMIN_SECTIONS): ++ self.assertIn(data['label'], self._admin_change_html(row)) ++ ++ unresolved_html = self._admin_change_html(self.unresolved_row) ++ self.assertIn(UNRESOLVED_SECTION_KEY, unresolved_html) +diff --git a/mimo_test_command.sh b/mimo_test_command.sh +new file mode 100755 +--- /dev/null ++++ b/mimo_test_command.sh +@@ -0,0 +1,21 @@ ++#!/bin/bash ++set -uo pipefail ++cd /testbed ++ ++ ++export PATH=/root/.venv/bin:$PATH ++ ++pip install -e . --quiet ++ ++case "${1:-}" in ++ base) ++ python -m pytest tests/test_global_preferences.py tests/test_app/dynamic_preferences_registry.py -v ++ ;; ++ new) ++ python -m pytest tests/test_section_verbose_names.py -v ++ ;; ++ *) ++ echo "usage: $0 base|new" ++ exit 2 ++ ;; ++esac diff --git a/tasks/format-code-task-000312/tests/test.sh b/tasks/format-code-task-000312/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..6292a19cc7c995353b2383b49548dfc71087fa14 --- /dev/null +++ b/tasks/format-code-task-000312/tests/test.sh @@ -0,0 +1,38 @@ +#!/bin/bash +# Code grading, mimoagent opensource_code.py: reset the files the hidden test patch touches, apply it, run the +# task's test command; reward 1 when it exits 0. A testbed failure (reset or apply) writes no reward: not scored. +M=/var/lib/mimo +CWD=/testbed +V=/logs/verifier +mkdir -p "$V" +BASE=$(cat "$M/base" 2>/dev/null) || { echo "setup never ran (no $M/base)" >&2; exit 1; } +cd "$CWD" || exit 1 +if [ -d "$M/git-hidden" ]; then rm -rf "$CWD/.git"; mv "$M/git-hidden" "$CWD/.git"; fi +# the agent's change against the base, so its own commits count too +git add -A >/dev/null 2>&1 && git -c core.fileMode=false diff --cached "$BASE" > "$V/agent.diff" +git reset -q +if ! ( +while IFS= read -r tf; do + [ -z "$tf" ] && continue + if git cat-file -e $BASE:"$tf" 2>/dev/null; then + git checkout $BASE -- "$tf" 2>/dev/null || true + else + git rm -f --cached "$tf" >/dev/null 2>&1 || true + rm -f "$tf" + fi +done <<'EOF_RESET_TEST_FILES' +tests/test_section_verbose_names.py +mimo_test_command.sh +EOF_RESET_TEST_FILES + +); then echo "could not reset the test files (testbed problem, not scored)" >&2; exit 1; fi +if ! git apply --verbose /tests/test.patch > "$V/apply.log" 2>&1; then + cat "$V/apply.log" >&2 + echo "the hidden tests could not be applied (testbed problem, not scored)" >&2 + exit 1 +fi +timeout 1800 sh -c "$(cat /tests/test_command.sh)" > "$V/test_output.log" 2>&1 +RC=$? +tail -c 12000 "$V/test_output.log" +if [ $RC -eq 0 ]; then echo 1 > "$V/reward.txt"; else echo 0 > "$V/reward.txt"; fi +echo "test command exited $RC" diff --git a/tasks/format-code-task-000312/tests/test_command.sh b/tasks/format-code-task-000312/tests/test_command.sh new file mode 100644 index 0000000000000000000000000000000000000000..e8d2f32b64045b5a5a56e0ad5667da87d8e0bc2a --- /dev/null +++ b/tasks/format-code-task-000312/tests/test_command.sh @@ -0,0 +1 @@ +bash /testbed/mimo_test_command.sh base && bash /testbed/mimo_test_command.sh new \ No newline at end of file diff --git a/tasks/format-code-task-000315/environment/Dockerfile b/tasks/format-code-task-000315/environment/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..e3046f275a12f26a43319f2ce2b5b85180b057ac --- /dev/null +++ b/tasks/format-code-task-000315/environment/Dockerfile @@ -0,0 +1,3 @@ +# The task's image, pinned by digest (the same as [environment].docker_image). +# Setup runs at start from [environment.healthcheck]; environment/setup/ is its readable copy. +FROM docker.io/xiaomimimo/mimo-v2.6-rl-oss@sha256:e08accdc49aaebe250e710d92cbc973fa99960e4524c81b0b139331ec5f25549 diff --git a/tasks/format-code-task-000315/environment/setup/files/blocklist b/tasks/format-code-task-000315/environment/setup/files/blocklist new file mode 100644 index 0000000000000000000000000000000000000000..a8e4bdc4c7d9b739c047a3cb58ea72a1bb05bcbc --- /dev/null +++ b/tasks/format-code-task-000315/environment/setup/files/blocklist @@ -0,0 +1,33 @@ +# mimo answer-leak blocklist (mimoagent) +0.0.0.0 github.com +0.0.0.0 www.github.com +0.0.0.0 api.github.com +0.0.0.0 raw.githubusercontent.com +0.0.0.0 codeload.github.com +0.0.0.0 objects.githubusercontent.com +0.0.0.0 gist.github.com +0.0.0.0 gist.githubusercontent.com +0.0.0.0 gitlab.com +0.0.0.0 bitbucket.org +0.0.0.0 sourceforge.net +0.0.0.0 git.kernel.org +0.0.0.0 chromium.googlesource.com +0.0.0.0 android.googlesource.com +0.0.0.0 sourcegraph.com +0.0.0.0 bugs.chromium.org +0.0.0.0 issues.oss-fuzz.com +0.0.0.0 oss-fuzz.com +0.0.0.0 osv.dev +0.0.0.0 api.osv.dev +0.0.0.0 bugzilla.mozilla.org +0.0.0.0 proxy.golang.org +0.0.0.0 sum.golang.org +0.0.0.0 pkg.go.dev +0.0.0.0 google.com +0.0.0.0 www.google.com +0.0.0.0 bing.com +0.0.0.0 www.bing.com +0.0.0.0 duckduckgo.com +0.0.0.0 html.duckduckgo.com +0.0.0.0 search.brave.com +0.0.0.0 stackoverflow.com diff --git a/tasks/format-code-task-000315/environment/setup/setup.sh b/tasks/format-code-task-000315/environment/setup/setup.sh new file mode 100644 index 0000000000000000000000000000000000000000..e9eb7daf39f9542bd095367feee457f3da77e492 --- /dev/null +++ b/tasks/format-code-task-000315/environment/setup/setup.sh @@ -0,0 +1,34 @@ +#!/bin/bash +# Runs once, as root, before the agent starts: Harbor's [environment.healthcheck] unpacks this folder into +# /var/lib/mimo and runs it. Generated by mimo_harbor; see its README for how each step maps to Xiaomi's harness. +M=/var/lib/mimo +[ -f "$M/ready" ] && exit 0 +chmod 700 "$M" +fail() { echo "setup: $*" >&2; exit 1; } +# the answer-leak blocklist (mimoagent), applied to /etc/hosts by the agent right after it installs +write_blocklist() { cp "$M/files/blocklist" "$M/blocklist"; } + +# Code: mimoagent environments/datasets/opensource_code.py + base.py, as the explorer runs it (app/runner/domains.py Code). +CWD=/workspace/repo +git config --global --add safe.directory "$CWD" +cd "$CWD" || fail "no working directory $CWD" +if ! git rev-parse --git-dir >/dev/null 2>&1; then # a bare source tree: give it a baseline commit + git init -q && git add -A && git -c user.name=mimo -c user.email=mimo@localhost commit -q -m baseline --allow-empty +fi +BASE=$(git rev-parse HEAD 2>/dev/null) +[ ${#BASE} -eq 40 ] || fail "could not resolve the base commit in $CWD" +echo "$BASE" > "$M/base" +# Images are built with history truncated at the base. If one is not, the fix could be read out of git log, +# so .git is hidden while the agent works and put back for grading. +LATER=$(git rev-list --all --not "$BASE" 2>/dev/null | head -n 5 | grep -c . || true) +rm -f /tmp/fail.log /tmp/pass.log /tmp/patch.diff /tmp/test_patch.diff /tmp/*.log 2>/dev/null; rm -rf /tmp/claude-0 /tmp/claude-* /tmp/testem-* /tmp/puppeteer_dev_chrome_profile-* 2>/dev/null; rm -f /tmp/test_files.json 2>/dev/null; rm -rf /tmp/jest_* /tmp/jest-* /tmp/build /tmp/build_env 2>/dev/null; rm -rf /tmp/pytest-of-root /tmp/pytest-* /tmp/.pytest_cache /tmp/__pycache__ 2>/dev/null; rm -rf /tmp/go-build* /tmp/standards /tmp/wordpress /tmp/zig-* /tmp/testbase /tmp/testbed 2>/dev/null; rm -f /tmp/tmp*.tmp /tmp/*.bak /tmp/expect* /tmp/butwas* 2>/dev/null; rm -rf /root/.cache/go-build 2>/dev/null; rm -rf /tests 2>/dev/null; find /logs -mindepth 1 -delete 2>/dev/null; mkdir -p /logs/agent /logs/verifier /logs/artifacts; chmod 777 /logs/agent /logs/verifier /logs/artifacts; find /var/log -type f -delete 2>/dev/null || true; rm -rf /var/lib/postgresql/*/*/log /var/lib/postgresql/*/*/pg_log 2>/dev/null || true; find /var/lib/mysql /var/lib/mongodb -type f -name '*.log' -delete 2>/dev/null || true; rm -rf /root/.npm/_logs /root/.babel.json /root/.pytest_cache 2>/dev/null || true; find / -maxdepth 4 -xdev -name task_description.md -path '*/.build_env/*' -delete 2>/dev/null || true; true +git clean -fdx --exclude=node_modules --exclude=bower_components --exclude=.husky --exclude=vendor --exclude=third_party --exclude=_deps --exclude=vcpkg_installed --exclude=.venv --exclude=venv --exclude=.gradle --exclude=target --exclude=.build --exclude=lib --exclude=.bundle --exclude=Manifest.toml --exclude=_build --exclude=.stack-work --exclude=dist-newstyle >/dev/null 2>&1 +find /root/.m2 -type f \( -name '*-SNAPSHOT.jar' -o -name '*-SNAPSHOT-sources.jar' -o -name '*-SNAPSHOT-tests.jar' -o -name '*-SNAPSHOT-test-sources.jar' \) -delete 2>/dev/null; rm -rf /root/.julia/compiled 2>/dev/null; rm -rf /root/.gradle/caches/build-cache-* /root/.gradle/daemon 2>/dev/null; rm -rf /root/.gradle/caches/*/scripts /root/.gradle/caches/jars-* 2>/dev/null; rm -rf /root/.cache/bazel 2>/dev/null; true +if [ "$LATER" -gt 0 ]; then + mv "$CWD/.git" "$M/git-hidden" + echo "history not truncated at ${BASE:0:12}: .git hidden while the agent works" +fi +write_blocklist + +touch "$M/ready" +echo "setup done" diff --git a/tasks/format-code-task-000315/tests/test.patch b/tasks/format-code-task-000315/tests/test.patch new file mode 100644 index 0000000000000000000000000000000000000000..56aac448e79ac439558e4af45713185d3548aa2f --- /dev/null +++ b/tasks/format-code-task-000315/tests/test.patch @@ -0,0 +1,323 @@ +diff --git a/usercase-test-coderl/test_run_job_lifecycle.py b/usercase-test-coderl/test_run_job_lifecycle.py +new file mode 100644 +--- /dev/null ++++ b/usercase-test-coderl/test_run_job_lifecycle.py +@@ -0,0 +1,295 @@ ++from __future__ import annotations ++ ++from datetime import datetime, timedelta, timezone ++from typing import Any ++ ++import anyio ++import pytest ++ ++from apscheduler import ( ++ AsyncScheduler, ++ Job, ++ JobAdded, ++ JobCancelled, ++ JobDeadlineMissed, ++ JobReleased, ++ JobOutcome, ++ JobResult, ++ RunState, ++ Scheduler, ++ current_job, ++) ++from apscheduler.datastores.memory import MemoryDataStore ++ ++ ++pytestmark = pytest.mark.anyio ++ ++def add(left: int, right: int) -> int: ++ return left + right ++ ++ ++def greet(*, name: str) -> str: ++ return f"Hello, {name}!" ++ ++ ++def selected_executor() -> str: ++ return current_job.get().executor ++ ++ ++def raise_value_error() -> None: ++ raise ValueError("boom literal") ++ ++ ++def raise_cancelled() -> None: ++ raise anyio.get_cancelled_exc_class()() ++ ++ ++class DeadlineResultDataStore(MemoryDataStore): ++ ++ ++ async def add_job(self, job: Job) -> None: ++ await super().add_job(job) ++ finished_at = datetime.now(timezone.utc) ++ result = JobResult( ++ job_id=job.id, ++ outcome=JobOutcome.missed_start_deadline, ++ finished_at=finished_at, ++ expires_at=finished_at + timedelta(minutes=15), ++ ) ++ await super().release_job("deadline-store", job, result) ++ ++ ++@pytest.fixture ++def anyio_backend() -> str: ++ return "asyncio" ++ ++ ++async def test_async_run_job_positional_one_off_lifecycle() -> None: ++ ++ ++ ++ ++ seen_events: list[Any] = [] ++ ++ async with AsyncScheduler() as scheduler: ++ assert scheduler.state is RunState.stopped ++ assert await scheduler.get_jobs() == [] ++ ++ scheduler.subscribe(seen_events.append) ++ await scheduler.start_in_background() ++ assert scheduler.state is RunState.started ++ ++ result = await scheduler.run_job(add, args=[2, 3]) ++ assert result == 5 ++ assert await scheduler.get_jobs() == [] ++ ++ ++ job_added_events = [ ++ event for event in seen_events if isinstance(event, JobAdded) ++ ] ++ job_released_events = [ ++ event for event in seen_events if isinstance(event, JobReleased) ++ ] ++ assert len(job_added_events) == 1 ++ assert len(job_released_events) == 1 ++ assert job_released_events[0].job_id == job_added_events[0].job_id ++ ++ assert scheduler.state is RunState.stopped ++ ++ ++async def test_async_run_job_keyword_arguments() -> None: ++ ++ ++ ++ ++ async with AsyncScheduler() as scheduler: ++ await scheduler.start_in_background() ++ ++ result = await scheduler.run_job(greet, kwargs={"name": "Ada"}) ++ assert result == "Hello, Ada!" ++ assert await scheduler.get_jobs() == [] ++ ++ ++async def test_async_run_job_executor_override_selects_named_executor() -> None: ++ ++ ++ ++ ++ async with AsyncScheduler() as scheduler: ++ await scheduler.start_in_background() ++ ++ async_executor = await scheduler.run_job( ++ selected_executor, job_executor="async" ++ ) ++ thread_executor = await scheduler.run_job( ++ selected_executor, job_executor="threadpool" ++ ) ++ ++ assert async_executor == "async" ++ assert thread_executor == "threadpool" ++ assert await scheduler.get_jobs() == [] ++ ++ ++async def test_async_run_job_raises_original_task_exception() -> None: ++ ++ ++ ++ ++ async with AsyncScheduler() as scheduler: ++ await scheduler.start_in_background() ++ ++ with pytest.raises(ValueError, match="^boom literal$"): ++ await scheduler.run_job(raise_value_error) ++ ++ assert await scheduler.get_jobs() == [] ++ ++ ++async def test_async_run_job_raises_job_deadline_missed_for_recorded_outcome() -> None: ++ ++ ++ ++ ++ async with AsyncScheduler(data_store=DeadlineResultDataStore()) as scheduler: ++ with pytest.raises(JobDeadlineMissed): ++ await scheduler.run_job(add, args=[1, 2]) ++ ++ assert await scheduler.get_jobs() == [] ++ ++ ++async def test_async_run_job_raises_job_cancelled_for_cancelled_job() -> None: ++ ++ ++ ++ ++ async with AsyncScheduler() as scheduler: ++ await scheduler.start_in_background() ++ ++ with pytest.raises(JobCancelled): ++ await scheduler.run_job(raise_cancelled) ++ ++ assert await scheduler.get_jobs() == [] ++ ++ ++async def test_async_run_job_before_initialized_raises_initialized_only_error() -> None: ++ ++ ++ ++ ++ scheduler = AsyncScheduler() ++ ++ ++ ++ with pytest.raises(RuntimeError): ++ await scheduler.run_job(add, args=[1, 2]) ++ ++ ++async def test_async_scheduler_instances_keep_independent_run_job_state() -> None: ++ ++ ++ ++ ++ async with AsyncScheduler(identity="a") as scheduler_a: ++ async with AsyncScheduler(identity="b") as scheduler_b: ++ assert scheduler_a.state is RunState.stopped ++ assert scheduler_b.state is RunState.stopped ++ assert await scheduler_a.get_jobs() == [] ++ assert await scheduler_b.get_jobs() == [] ++ ++ await scheduler_a.start_in_background() ++ assert scheduler_a.state is RunState.started ++ assert scheduler_b.state is RunState.stopped ++ ++ result = await scheduler_a.run_job(add, args=[4, 6]) ++ assert result == 10 ++ assert scheduler_a.state is RunState.started ++ assert scheduler_b.state is RunState.stopped ++ assert await scheduler_a.get_jobs() == [] ++ assert await scheduler_b.get_jobs() == [] ++ ++ ++async def test_async_scheduler_context_cleanup_is_idempotent() -> None: ++ ++ ++ ++ ++ scheduler = AsyncScheduler() ++ await scheduler.__aenter__() ++ await scheduler.start_in_background() ++ result = await scheduler.run_job(add, args=[3, 4]) ++ assert result == 7 ++ assert scheduler.state is RunState.started ++ ++ await scheduler.__aexit__(None, None, None) ++ ++ ++ assert scheduler.state is RunState.stopped ++ ++ ++def test_sync_run_job_blocks_and_returns_value() -> None: ++ ++ ++ ++ ++ with Scheduler() as scheduler: ++ assert scheduler.state is RunState.stopped ++ assert scheduler.get_jobs() == [] ++ ++ scheduler.start_in_background() ++ assert scheduler.state is RunState.started ++ result = scheduler.run_job(add, args=[7, 8]) ++ assert result == 15 ++ assert scheduler.get_jobs() == [] ++ ++ assert scheduler.state is RunState.stopped ++ ++ ++def test_sync_run_job_keyword_arguments_and_executor_override() -> None: ++ ++ ++ ++ ++ with Scheduler() as scheduler: ++ scheduler.start_in_background() ++ ++ greeting = scheduler.run_job(greet, kwargs={"name": "Ada"}) ++ executor = scheduler.run_job(selected_executor, job_executor="threadpool") ++ ++ assert greeting == "Hello, Ada!" ++ assert executor == "threadpool" ++ assert scheduler.get_jobs() == [] ++ ++ ++def test_sync_scheduler_context_cleanup_is_idempotent() -> None: ++ ++ ++ ++ ++ scheduler = Scheduler() ++ scheduler.__enter__() ++ scheduler.start_in_background() ++ result = scheduler.run_job(add, args=[5, 6]) ++ assert result == 11 ++ assert scheduler.state is RunState.started ++ ++ scheduler.__exit__(None, None, None) ++ ++ ++ assert scheduler.state is RunState.stopped ++ ++ ++def test_repeated_sync_run_job_sessions_do_not_leak_background_threads() -> None: ++ ++ ++ ++ ++ ++ ++ ++ for _ in range(5): ++ with Scheduler() as scheduler: ++ scheduler.start_in_background() ++ result = scheduler.run_job(add, args=[1, 1]) ++ assert result == 2 ++ assert scheduler.get_jobs() == [] ++ ++ assert scheduler.state is RunState.stopped +diff --git a/mimo_test_command.sh b/mimo_test_command.sh +new file mode 100755 +--- /dev/null ++++ b/mimo_test_command.sh +@@ -0,0 +1,18 @@ ++#!/usr/bin/env bash ++ ++ ++ ++ ++export NODE_OPTIONS="${NODE_OPTIONS:-} --max-old-space-size=4096" ++export MAVEN_OPTS="${MAVEN_OPTS:-} -Xmx3g -XX:+UseG1GC" ++export GRADLE_OPTS="${GRADLE_OPTS:-} -Xmx3g -XX:+UseG1GC" ++export TEST_JVM_OPTS="${TEST_JVM_OPTS:-} -Xmx3g" ++set -e ++cd /workspace/repo ++set -euo pipefail ++ ++cd /workspace/repo ++ ++export PYTHONPATH="/workspace/repo/src${PYTHONPATH:+:${PYTHONPATH}}" ++export PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 ++exec python -m pytest -p anyio.pytest_plugin /workspace/repo/usercase-test-coderl/test_run_job_lifecycle.py -v diff --git a/tasks/format-code-task-000315/tests/test.sh b/tasks/format-code-task-000315/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..b49df14dbb66ade68408acefdd15de5f4940ffda --- /dev/null +++ b/tasks/format-code-task-000315/tests/test.sh @@ -0,0 +1,38 @@ +#!/bin/bash +# Code grading, mimoagent opensource_code.py: reset the files the hidden test patch touches, apply it, run the +# task's test command; reward 1 when it exits 0. A testbed failure (reset or apply) writes no reward: not scored. +M=/var/lib/mimo +CWD=/workspace/repo +V=/logs/verifier +mkdir -p "$V" +BASE=$(cat "$M/base" 2>/dev/null) || { echo "setup never ran (no $M/base)" >&2; exit 1; } +cd "$CWD" || exit 1 +if [ -d "$M/git-hidden" ]; then rm -rf "$CWD/.git"; mv "$M/git-hidden" "$CWD/.git"; fi +# the agent's change against the base, so its own commits count too +git add -A >/dev/null 2>&1 && git -c core.fileMode=false diff --cached "$BASE" > "$V/agent.diff" +git reset -q +if ! ( +while IFS= read -r tf; do + [ -z "$tf" ] && continue + if git cat-file -e $BASE:"$tf" 2>/dev/null; then + git checkout $BASE -- "$tf" 2>/dev/null || true + else + git rm -f --cached "$tf" >/dev/null 2>&1 || true + rm -f "$tf" + fi +done <<'EOF_RESET_TEST_FILES' +usercase-test-coderl/test_run_job_lifecycle.py +mimo_test_command.sh +EOF_RESET_TEST_FILES + +); then echo "could not reset the test files (testbed problem, not scored)" >&2; exit 1; fi +if ! git apply --verbose /tests/test.patch > "$V/apply.log" 2>&1; then + cat "$V/apply.log" >&2 + echo "the hidden tests could not be applied (testbed problem, not scored)" >&2 + exit 1 +fi +timeout 1800 sh -c "$(cat /tests/test_command.sh)" > "$V/test_output.log" 2>&1 +RC=$? +tail -c 12000 "$V/test_output.log" +if [ $RC -eq 0 ]; then echo 1 > "$V/reward.txt"; else echo 0 > "$V/reward.txt"; fi +echo "test command exited $RC" diff --git a/tasks/format-code-task-000315/tests/test_command.sh b/tasks/format-code-task-000315/tests/test_command.sh new file mode 100644 index 0000000000000000000000000000000000000000..88cb7810b836396c4869db31aeac7d4d4b189685 --- /dev/null +++ b/tasks/format-code-task-000315/tests/test_command.sh @@ -0,0 +1 @@ +bash /workspace/repo/mimo_test_command.sh \ No newline at end of file diff --git a/tasks/format-code-task-000323/environment/Dockerfile b/tasks/format-code-task-000323/environment/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..cbec34c34580fde489a8bf5a5583edf2c36c45aa --- /dev/null +++ b/tasks/format-code-task-000323/environment/Dockerfile @@ -0,0 +1,3 @@ +# The task's image, pinned by digest (the same as [environment].docker_image). +# Setup runs at start from [environment.healthcheck]; environment/setup/ is its readable copy. +FROM docker.io/xiaomimimo/mimo-v2.6-rl-oss@sha256:1e04d13573d9547702bc8516a42689d840a70e32918202cbad085c415ac8f652 diff --git a/tasks/format-code-task-000323/environment/setup/files/blocklist b/tasks/format-code-task-000323/environment/setup/files/blocklist new file mode 100644 index 0000000000000000000000000000000000000000..a8e4bdc4c7d9b739c047a3cb58ea72a1bb05bcbc --- /dev/null +++ b/tasks/format-code-task-000323/environment/setup/files/blocklist @@ -0,0 +1,33 @@ +# mimo answer-leak blocklist (mimoagent) +0.0.0.0 github.com +0.0.0.0 www.github.com +0.0.0.0 api.github.com +0.0.0.0 raw.githubusercontent.com +0.0.0.0 codeload.github.com +0.0.0.0 objects.githubusercontent.com +0.0.0.0 gist.github.com +0.0.0.0 gist.githubusercontent.com +0.0.0.0 gitlab.com +0.0.0.0 bitbucket.org +0.0.0.0 sourceforge.net +0.0.0.0 git.kernel.org +0.0.0.0 chromium.googlesource.com +0.0.0.0 android.googlesource.com +0.0.0.0 sourcegraph.com +0.0.0.0 bugs.chromium.org +0.0.0.0 issues.oss-fuzz.com +0.0.0.0 oss-fuzz.com +0.0.0.0 osv.dev +0.0.0.0 api.osv.dev +0.0.0.0 bugzilla.mozilla.org +0.0.0.0 proxy.golang.org +0.0.0.0 sum.golang.org +0.0.0.0 pkg.go.dev +0.0.0.0 google.com +0.0.0.0 www.google.com +0.0.0.0 bing.com +0.0.0.0 www.bing.com +0.0.0.0 duckduckgo.com +0.0.0.0 html.duckduckgo.com +0.0.0.0 search.brave.com +0.0.0.0 stackoverflow.com diff --git a/tasks/format-code-task-000323/environment/setup/setup.sh b/tasks/format-code-task-000323/environment/setup/setup.sh new file mode 100644 index 0000000000000000000000000000000000000000..d883db90cfcfb48f7a139861bbe9f6b5d95cad6f --- /dev/null +++ b/tasks/format-code-task-000323/environment/setup/setup.sh @@ -0,0 +1,34 @@ +#!/bin/bash +# Runs once, as root, before the agent starts: Harbor's [environment.healthcheck] unpacks this folder into +# /var/lib/mimo and runs it. Generated by mimo_harbor; see its README for how each step maps to Xiaomi's harness. +M=/var/lib/mimo +[ -f "$M/ready" ] && exit 0 +chmod 700 "$M" +fail() { echo "setup: $*" >&2; exit 1; } +# the answer-leak blocklist (mimoagent), applied to /etc/hosts by the agent right after it installs +write_blocklist() { cp "$M/files/blocklist" "$M/blocklist"; } + +# Code: mimoagent environments/datasets/opensource_code.py + base.py, as the explorer runs it (app/runner/domains.py Code). +CWD=/testbed +git config --global --add safe.directory "$CWD" +cd "$CWD" || fail "no working directory $CWD" +if ! git rev-parse --git-dir >/dev/null 2>&1; then # a bare source tree: give it a baseline commit + git init -q && git add -A && git -c user.name=mimo -c user.email=mimo@localhost commit -q -m baseline --allow-empty +fi +BASE=$(git rev-parse HEAD 2>/dev/null) +[ ${#BASE} -eq 40 ] || fail "could not resolve the base commit in $CWD" +echo "$BASE" > "$M/base" +# Images are built with history truncated at the base. If one is not, the fix could be read out of git log, +# so .git is hidden while the agent works and put back for grading. +LATER=$(git rev-list --all --not "$BASE" 2>/dev/null | head -n 5 | grep -c . || true) +rm -f /tmp/fail.log /tmp/pass.log /tmp/patch.diff /tmp/test_patch.diff /tmp/*.log 2>/dev/null; rm -rf /tmp/claude-0 /tmp/claude-* /tmp/testem-* /tmp/puppeteer_dev_chrome_profile-* 2>/dev/null; rm -f /tmp/test_files.json 2>/dev/null; rm -rf /tmp/jest_* /tmp/jest-* /tmp/build /tmp/build_env 2>/dev/null; rm -rf /tmp/pytest-of-root /tmp/pytest-* /tmp/.pytest_cache /tmp/__pycache__ 2>/dev/null; rm -rf /tmp/go-build* /tmp/standards /tmp/wordpress /tmp/zig-* /tmp/testbase /tmp/testbed 2>/dev/null; rm -f /tmp/tmp*.tmp /tmp/*.bak /tmp/expect* /tmp/butwas* 2>/dev/null; rm -rf /root/.cache/go-build 2>/dev/null; rm -rf /tests 2>/dev/null; find /logs -mindepth 1 -delete 2>/dev/null; mkdir -p /logs/agent /logs/verifier /logs/artifacts; chmod 777 /logs/agent /logs/verifier /logs/artifacts; find /var/log -type f -delete 2>/dev/null || true; rm -rf /var/lib/postgresql/*/*/log /var/lib/postgresql/*/*/pg_log 2>/dev/null || true; find /var/lib/mysql /var/lib/mongodb -type f -name '*.log' -delete 2>/dev/null || true; rm -rf /root/.npm/_logs /root/.babel.json /root/.pytest_cache 2>/dev/null || true; find / -maxdepth 4 -xdev -name task_description.md -path '*/.build_env/*' -delete 2>/dev/null || true; true +git clean -fdx --exclude=node_modules --exclude=bower_components --exclude=.husky --exclude=vendor --exclude=third_party --exclude=_deps --exclude=vcpkg_installed --exclude=.venv --exclude=venv --exclude=.gradle --exclude=target --exclude=.build --exclude=lib --exclude=.bundle --exclude=Manifest.toml --exclude=_build --exclude=.stack-work --exclude=dist-newstyle >/dev/null 2>&1 +find /root/.m2 -type f \( -name '*-SNAPSHOT.jar' -o -name '*-SNAPSHOT-sources.jar' -o -name '*-SNAPSHOT-tests.jar' -o -name '*-SNAPSHOT-test-sources.jar' \) -delete 2>/dev/null; rm -rf /root/.julia/compiled 2>/dev/null; rm -rf /root/.gradle/caches/build-cache-* /root/.gradle/daemon 2>/dev/null; rm -rf /root/.gradle/caches/*/scripts /root/.gradle/caches/jars-* 2>/dev/null; rm -rf /root/.cache/bazel 2>/dev/null; true +if [ "$LATER" -gt 0 ]; then + mv "$CWD/.git" "$M/git-hidden" + echo "history not truncated at ${BASE:0:12}: .git hidden while the agent works" +fi +write_blocklist + +touch "$M/ready" +echo "setup done" diff --git a/tasks/format-code-task-000323/tests/test.patch b/tasks/format-code-task-000323/tests/test.patch new file mode 100644 index 0000000000000000000000000000000000000000..d637b209e70564b6ca67054dce32a446748100fe --- /dev/null +++ b/tasks/format-code-task-000323/tests/test.patch @@ -0,0 +1,176 @@ +diff --git a/tests/test_client_ws_functional.py b/tests/test_client_ws_functional.py +index 026192e7aa4..470ca1afa11 100644 +--- a/tests/test_client_ws_functional.py ++++ b/tests/test_client_ws_functional.py +@@ -6,7 +6,14 @@ + import pytest + + import aiohttp +-from aiohttp import ClientConnectionResetError, ServerTimeoutError, WSMsgType, hdrs, web ++from aiohttp import ( ++ ClientConnectionResetError, ++ ServerTimeoutError, ++ WSMessageTypeError, ++ WSMsgType, ++ hdrs, ++ web, ++) + from aiohttp.client_ws import ClientWSTimeout + from aiohttp.http import WSCloseCode + from aiohttp.pytest_plugin import AiohttpClient, AiohttpServer +@@ -58,7 +65,28 @@ async def handler(request: web.Request) -> NoReturn: + resp = await client.ws_connect("/") + await resp.send_str("ask") + +- with pytest.raises(TypeError): ++ with pytest.raises(WSMessageTypeError): ++ await resp.receive_bytes() ++ await resp.close() ++ ++ ++async def test_recv_bytes_after_close(aiohttp_client: AiohttpClient) -> None: ++ async def handler(request: web.Request) -> NoReturn: ++ ws = web.WebSocketResponse() ++ await ws.prepare(request) ++ ++ await ws.close() ++ assert False ++ ++ app = web.Application() ++ app.router.add_route("GET", "/", handler) ++ client = await aiohttp_client(app) ++ resp = await client.ws_connect("/") ++ ++ with pytest.raises( ++ WSMessageTypeError, ++ match=f"Received message {WSMsgType.CLOSE}:.+ is not WSMsgType.BINARY", ++ ): + await resp.receive_bytes() + await resp.close() + +@@ -103,12 +131,33 @@ async def handler(request: web.Request) -> NoReturn: + + await resp.send_bytes(b"ask") + +- with pytest.raises(TypeError): ++ with pytest.raises(WSMessageTypeError): + await resp.receive_str() + + await resp.close() + + ++async def test_recv_text_after_close(aiohttp_client: AiohttpClient) -> None: ++ async def handler(request: web.Request) -> NoReturn: ++ ws = web.WebSocketResponse() ++ await ws.prepare(request) ++ ++ await ws.close() ++ assert False ++ ++ app = web.Application() ++ app.router.add_route("GET", "/", handler) ++ client = await aiohttp_client(app) ++ resp = await client.ws_connect("/") ++ ++ with pytest.raises( ++ WSMessageTypeError, ++ match=f"Received message {WSMsgType.CLOSE}:.+ is not WSMsgType.TEXT", ++ ): ++ await resp.receive_str() ++ await resp.close() ++ ++ + async def test_send_recv_json(aiohttp_client: AiohttpClient) -> None: + async def handler(request: web.Request) -> web.WebSocketResponse: + ws = web.WebSocketResponse() +diff --git a/tests/test_web_websocket.py b/tests/test_web_websocket.py +index 85ab89980fc..b303f2bb949 100644 +--- a/tests/test_web_websocket.py ++++ b/tests/test_web_websocket.py +@@ -8,7 +8,7 @@ + from multidict import CIMultiDict + from pytest_mock import MockerFixture + +-from aiohttp import WSMsgType, web ++from aiohttp import WSMessageTypeError, WSMsgType, web + from aiohttp.http import WS_CLOSED_MESSAGE, WS_CLOSING_MESSAGE + from aiohttp.http_websocket import WSMessageClose + from aiohttp.streams import EofStream +@@ -263,6 +263,21 @@ async def test_send_str_closed(make_request: _RequestMaker) -> None: + await ws.send_str("string") + + ++async def test_recv_str_closed(make_request: _RequestMaker) -> None: ++ req = make_request("GET", "/") ++ ws = web.WebSocketResponse() ++ await ws.prepare(req) ++ assert ws._reader is not None ++ ws._reader.feed_data(WS_CLOSED_MESSAGE) ++ await ws.close() ++ ++ with pytest.raises( ++ WSMessageTypeError, ++ match=f"Received message {WSMsgType.CLOSED}:.+ is not WSMsgType.TEXT", ++ ): ++ await ws.receive_str() ++ ++ + async def test_send_bytes_closed(make_request: _RequestMaker) -> None: + req = make_request("GET", "/") + ws = web.WebSocketResponse() +@@ -275,6 +290,21 @@ async def test_send_bytes_closed(make_request: _RequestMaker) -> None: + await ws.send_bytes(b"bytes") + + ++async def test_recv_bytes_closed(make_request: _RequestMaker) -> None: ++ req = make_request("GET", "/") ++ ws = web.WebSocketResponse() ++ await ws.prepare(req) ++ assert ws._reader is not None ++ ws._reader.feed_data(WS_CLOSED_MESSAGE) ++ await ws.close() ++ ++ with pytest.raises( ++ WSMessageTypeError, ++ match=f"Received message {WSMsgType.CLOSED}:.+ is not WSMsgType.BINARY", ++ ): ++ await ws.receive_bytes() ++ ++ + async def test_send_json_closed(make_request: _RequestMaker) -> None: + req = make_request("GET", "/") + ws = web.WebSocketResponse() +diff --git a/tests/test_web_websocket_functional.py b/tests/test_web_websocket_functional.py +index 5a522e0fee1..e56bf4720a6 100644 +--- a/tests/test_web_websocket_functional.py ++++ b/tests/test_web_websocket_functional.py +@@ -1026,7 +1026,7 @@ async def handler(request: web.Request) -> NoReturn: + assert ws.can_prepare(request) + + await ws.prepare(request) +- await ws.send_bytes("answer") # type: ignore[arg-type] ++ await ws.send_str("answer") + assert False + + app = web.Application() +diff --git a/mimo_build_env.tar.gz.b64 b/mimo_build_env.tar.gz.b64 +new file mode 100644 +--- /dev/null ++++ b/mimo_build_env.tar.gz.b64 +@@ -0,0 +1,5 @@ ++H4sIAAAAAAAAA+3S0W6DIBQGYK99Cl5ARVLwas9iEFlqptDIwaZvXzTL2jRZe9NmW/Z/iR4MByX+ ++lF0cxr61bqmyV+FJI+VWk9u6jWspuFBcNo3IeF0r3mRMvmxHV2IgPTOWzd7Tvb5H839UecmfbKDW +++GnSri/D/nnfeJS/UOqSv9il/HcqFcaft4Xv/fP8Tc+24Dvb58HH2div56pc1mPRDa7ShoZFk80P ++J9p7x4qJpVFqY+stfB6dcbCO2mNo36NLC7zTY3k4XbccbbdewZsPS/fmbl5RLKwoaJisj/SmeP7T ++fw0AAAAAAAAAAAAAAAAAAAAA4Hc4A7zoLwMAKAAA +diff --git a/mimo_test_command.sh b/mimo_test_command.sh +new file mode 100755 +--- /dev/null ++++ b/mimo_test_command.sh +@@ -0,0 +1,6 @@ ++#!/usr/bin/env bash ++ ++set -uo pipefail ++cd /testbed || exit 1 ++base64 -d mimo_build_env.tar.gz.b64 | tar -xzf - -C /testbed || exit 1 ++exec bash -lc 'cd /testbed && bash -eo pipefail /testbed/.build_env/test_command.sh' diff --git a/tasks/format-code-task-000323/tests/test.sh b/tasks/format-code-task-000323/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..6544881bcfa77f4f93b5178acaf86011e29a7862 --- /dev/null +++ b/tasks/format-code-task-000323/tests/test.sh @@ -0,0 +1,41 @@ +#!/bin/bash +# Code grading, mimoagent opensource_code.py: reset the files the hidden test patch touches, apply it, run the +# task's test command; reward 1 when it exits 0. A testbed failure (reset or apply) writes no reward: not scored. +M=/var/lib/mimo +CWD=/testbed +V=/logs/verifier +mkdir -p "$V" +BASE=$(cat "$M/base" 2>/dev/null) || { echo "setup never ran (no $M/base)" >&2; exit 1; } +cd "$CWD" || exit 1 +if [ -d "$M/git-hidden" ]; then rm -rf "$CWD/.git"; mv "$M/git-hidden" "$CWD/.git"; fi +# the agent's change against the base, so its own commits count too +git add -A >/dev/null 2>&1 && git -c core.fileMode=false diff --cached "$BASE" > "$V/agent.diff" +git reset -q +if ! ( +while IFS= read -r tf; do + [ -z "$tf" ] && continue + if git cat-file -e $BASE:"$tf" 2>/dev/null; then + git checkout $BASE -- "$tf" 2>/dev/null || true + else + git rm -f --cached "$tf" >/dev/null 2>&1 || true + rm -f "$tf" + fi +done <<'EOF_RESET_TEST_FILES' +tests/test_client_ws_functional.py +tests/test_web_websocket.py +tests/test_web_websocket_functional.py +mimo_build_env.tar.gz.b64 +mimo_test_command.sh +EOF_RESET_TEST_FILES + +); then echo "could not reset the test files (testbed problem, not scored)" >&2; exit 1; fi +if ! git apply --verbose /tests/test.patch > "$V/apply.log" 2>&1; then + cat "$V/apply.log" >&2 + echo "the hidden tests could not be applied (testbed problem, not scored)" >&2 + exit 1 +fi +timeout 1800 sh -c "$(cat /tests/test_command.sh)" > "$V/test_output.log" 2>&1 +RC=$? +tail -c 12000 "$V/test_output.log" +if [ $RC -eq 0 ]; then echo 1 > "$V/reward.txt"; else echo 0 > "$V/reward.txt"; fi +echo "test command exited $RC" diff --git a/tasks/format-code-task-000323/tests/test_command.sh b/tasks/format-code-task-000323/tests/test_command.sh new file mode 100644 index 0000000000000000000000000000000000000000..7cb23076694ad17d72e8296d62b2b240083e36db --- /dev/null +++ b/tasks/format-code-task-000323/tests/test_command.sh @@ -0,0 +1 @@ +bash /testbed/mimo_test_command.sh \ No newline at end of file diff --git a/tasks/format-code-task-000324/environment/Dockerfile b/tasks/format-code-task-000324/environment/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..85b1adc118b73fc4320f4e890baae1ea1472776c --- /dev/null +++ b/tasks/format-code-task-000324/environment/Dockerfile @@ -0,0 +1,3 @@ +# The task's image, pinned by digest (the same as [environment].docker_image). +# Setup runs at start from [environment.healthcheck]; environment/setup/ is its readable copy. +FROM docker.io/xiaomimimo/mimo-v2.6-rl-oss@sha256:e27557b2426b19000d7bff62982c1dd396d0ae60d8d2743b8fccdf64786dd727 diff --git a/tasks/format-code-task-000324/environment/setup/files/blocklist b/tasks/format-code-task-000324/environment/setup/files/blocklist new file mode 100644 index 0000000000000000000000000000000000000000..a8e4bdc4c7d9b739c047a3cb58ea72a1bb05bcbc --- /dev/null +++ b/tasks/format-code-task-000324/environment/setup/files/blocklist @@ -0,0 +1,33 @@ +# mimo answer-leak blocklist (mimoagent) +0.0.0.0 github.com +0.0.0.0 www.github.com +0.0.0.0 api.github.com +0.0.0.0 raw.githubusercontent.com +0.0.0.0 codeload.github.com +0.0.0.0 objects.githubusercontent.com +0.0.0.0 gist.github.com +0.0.0.0 gist.githubusercontent.com +0.0.0.0 gitlab.com +0.0.0.0 bitbucket.org +0.0.0.0 sourceforge.net +0.0.0.0 git.kernel.org +0.0.0.0 chromium.googlesource.com +0.0.0.0 android.googlesource.com +0.0.0.0 sourcegraph.com +0.0.0.0 bugs.chromium.org +0.0.0.0 issues.oss-fuzz.com +0.0.0.0 oss-fuzz.com +0.0.0.0 osv.dev +0.0.0.0 api.osv.dev +0.0.0.0 bugzilla.mozilla.org +0.0.0.0 proxy.golang.org +0.0.0.0 sum.golang.org +0.0.0.0 pkg.go.dev +0.0.0.0 google.com +0.0.0.0 www.google.com +0.0.0.0 bing.com +0.0.0.0 www.bing.com +0.0.0.0 duckduckgo.com +0.0.0.0 html.duckduckgo.com +0.0.0.0 search.brave.com +0.0.0.0 stackoverflow.com diff --git a/tasks/format-code-task-000324/environment/setup/setup.sh b/tasks/format-code-task-000324/environment/setup/setup.sh new file mode 100644 index 0000000000000000000000000000000000000000..e9eb7daf39f9542bd095367feee457f3da77e492 --- /dev/null +++ b/tasks/format-code-task-000324/environment/setup/setup.sh @@ -0,0 +1,34 @@ +#!/bin/bash +# Runs once, as root, before the agent starts: Harbor's [environment.healthcheck] unpacks this folder into +# /var/lib/mimo and runs it. Generated by mimo_harbor; see its README for how each step maps to Xiaomi's harness. +M=/var/lib/mimo +[ -f "$M/ready" ] && exit 0 +chmod 700 "$M" +fail() { echo "setup: $*" >&2; exit 1; } +# the answer-leak blocklist (mimoagent), applied to /etc/hosts by the agent right after it installs +write_blocklist() { cp "$M/files/blocklist" "$M/blocklist"; } + +# Code: mimoagent environments/datasets/opensource_code.py + base.py, as the explorer runs it (app/runner/domains.py Code). +CWD=/workspace/repo +git config --global --add safe.directory "$CWD" +cd "$CWD" || fail "no working directory $CWD" +if ! git rev-parse --git-dir >/dev/null 2>&1; then # a bare source tree: give it a baseline commit + git init -q && git add -A && git -c user.name=mimo -c user.email=mimo@localhost commit -q -m baseline --allow-empty +fi +BASE=$(git rev-parse HEAD 2>/dev/null) +[ ${#BASE} -eq 40 ] || fail "could not resolve the base commit in $CWD" +echo "$BASE" > "$M/base" +# Images are built with history truncated at the base. If one is not, the fix could be read out of git log, +# so .git is hidden while the agent works and put back for grading. +LATER=$(git rev-list --all --not "$BASE" 2>/dev/null | head -n 5 | grep -c . || true) +rm -f /tmp/fail.log /tmp/pass.log /tmp/patch.diff /tmp/test_patch.diff /tmp/*.log 2>/dev/null; rm -rf /tmp/claude-0 /tmp/claude-* /tmp/testem-* /tmp/puppeteer_dev_chrome_profile-* 2>/dev/null; rm -f /tmp/test_files.json 2>/dev/null; rm -rf /tmp/jest_* /tmp/jest-* /tmp/build /tmp/build_env 2>/dev/null; rm -rf /tmp/pytest-of-root /tmp/pytest-* /tmp/.pytest_cache /tmp/__pycache__ 2>/dev/null; rm -rf /tmp/go-build* /tmp/standards /tmp/wordpress /tmp/zig-* /tmp/testbase /tmp/testbed 2>/dev/null; rm -f /tmp/tmp*.tmp /tmp/*.bak /tmp/expect* /tmp/butwas* 2>/dev/null; rm -rf /root/.cache/go-build 2>/dev/null; rm -rf /tests 2>/dev/null; find /logs -mindepth 1 -delete 2>/dev/null; mkdir -p /logs/agent /logs/verifier /logs/artifacts; chmod 777 /logs/agent /logs/verifier /logs/artifacts; find /var/log -type f -delete 2>/dev/null || true; rm -rf /var/lib/postgresql/*/*/log /var/lib/postgresql/*/*/pg_log 2>/dev/null || true; find /var/lib/mysql /var/lib/mongodb -type f -name '*.log' -delete 2>/dev/null || true; rm -rf /root/.npm/_logs /root/.babel.json /root/.pytest_cache 2>/dev/null || true; find / -maxdepth 4 -xdev -name task_description.md -path '*/.build_env/*' -delete 2>/dev/null || true; true +git clean -fdx --exclude=node_modules --exclude=bower_components --exclude=.husky --exclude=vendor --exclude=third_party --exclude=_deps --exclude=vcpkg_installed --exclude=.venv --exclude=venv --exclude=.gradle --exclude=target --exclude=.build --exclude=lib --exclude=.bundle --exclude=Manifest.toml --exclude=_build --exclude=.stack-work --exclude=dist-newstyle >/dev/null 2>&1 +find /root/.m2 -type f \( -name '*-SNAPSHOT.jar' -o -name '*-SNAPSHOT-sources.jar' -o -name '*-SNAPSHOT-tests.jar' -o -name '*-SNAPSHOT-test-sources.jar' \) -delete 2>/dev/null; rm -rf /root/.julia/compiled 2>/dev/null; rm -rf /root/.gradle/caches/build-cache-* /root/.gradle/daemon 2>/dev/null; rm -rf /root/.gradle/caches/*/scripts /root/.gradle/caches/jars-* 2>/dev/null; rm -rf /root/.cache/bazel 2>/dev/null; true +if [ "$LATER" -gt 0 ]; then + mv "$CWD/.git" "$M/git-hidden" + echo "history not truncated at ${BASE:0:12}: .git hidden while the agent works" +fi +write_blocklist + +touch "$M/ready" +echo "setup done" diff --git a/tasks/format-code-task-000324/tests/test.patch b/tasks/format-code-task-000324/tests/test.patch new file mode 100644 index 0000000000000000000000000000000000000000..332baaa12da1d948a0e4f9527e5f47fececee11c --- /dev/null +++ b/tasks/format-code-task-000324/tests/test.patch @@ -0,0 +1,341 @@ +diff --git a/usercase-test-coderl/test_simple_cookie_storage.py b/usercase-test-coderl/test_simple_cookie_storage.py +new file mode 100644 +--- /dev/null ++++ b/usercase-test-coderl/test_simple_cookie_storage.py +@@ -0,0 +1,308 @@ ++import json ++from http.cookies import SimpleCookie ++from unittest import mock ++ ++import pytest ++from aiohttp import web ++from aiohttp.test_utils import make_mocked_request ++ ++import aiohttp_session ++from aiohttp_session import ( ++ Session, ++ SimpleCookieStorage, ++ get_session, ++ session_middleware, ++ setup, ++) ++ ++ ++ ++ ++ ++ ++def _cookie_header(values: dict[str, str]) -> str: ++ cookie = SimpleCookie() ++ for name, value in values.items(): ++ cookie[name] = value ++ return cookie.output(header="", sep=";").strip() ++ ++ ++def _request_with_cookies(values: dict[str, str]) -> web.Request: ++ return make_mocked_request("GET", "/", headers={"Cookie": _cookie_header(values)}) ++ ++ ++@pytest.mark.asyncio ++async def test_load_session_absent_cookie_returns_new_empty_session() -> None: ++ ++ ++ ++ ++ storage = SimpleCookieStorage(max_age=33) ++ ++ session = await storage.load_session(make_mocked_request("GET", "/")) ++ ++ assert session.new is True ++ assert session.identity is None ++ assert session.max_age == 33 ++ assert session.empty is True ++ assert len(session) == 0 ++ assert dict(session) == {} ++ ++ ++@pytest.mark.asyncio ++async def test_load_session_existing_json_cookie_decodes_mapping() -> None: ++ ++ ++ ++ ++ storage = SimpleCookieStorage() ++ request = _request_with_cookies( ++ { ++ "AIOHTTP_SESSION": json.dumps( ++ {"created": 1000, "session": {"a": 1, "b": 2}} ++ ) ++ } ++ ) ++ ++ session = await storage.load_session(request) ++ ++ assert session.new is False ++ assert session.identity is None ++ assert session.max_age is None ++ assert session.created == 1000 ++ assert session.empty is False ++ assert len(session) == 2 ++ assert dict(session) == {"a": 1, "b": 2} ++ assert session["a"] == 1 ++ assert session["b"] == 2 ++ ++ ++@pytest.mark.asyncio ++async def test_load_session_malformed_json_propagates_json_decode_error() -> None: ++ ++ ++ ++ ++ storage = SimpleCookieStorage() ++ request = _request_with_cookies({"AIOHTTP_SESSION": "{broken-json"}) ++ ++ with pytest.raises(json.JSONDecodeError): ++ await storage.load_session(request) ++ ++ ++@pytest.mark.asyncio ++async def test_save_session_changed_mapping_serializes_json_and_cookie_attributes() -> None: ++ ++ ++ ++ ++ storage = SimpleCookieStorage( ++ cookie_name="CUSTOM", ++ domain="example.com", ++ max_age=55, ++ path="/app", ++ secure=True, ++ httponly=False, ++ samesite="Lax", ++ ) ++ request = _request_with_cookies( ++ { ++ "CUSTOM": json.dumps( ++ {"created": 1000, "session": {"a": 1, "b": 2}} ++ ) ++ } ++ ) ++ with mock.patch.object(aiohttp_session.time, "time", return_value=1001): ++ session = await storage.load_session(request) ++ ++ with mock.patch.object(aiohttp_session.time, "time", return_value=1234567890): ++ session["c"] = 3 ++ ++ response = web.Response() ++ await storage.save_session(request, response, session) ++ ++ ++ assert "CUSTOM" in response.cookies ++ morsel = response.cookies["CUSTOM"] ++ ++ assert json.loads(morsel.value) == { ++ "created": 1234567890, ++ "session": {"a": 1, "b": 2, "c": 3}, ++ } ++ assert morsel["domain"] == "example.com" ++ assert morsel["max-age"] == "55" ++ assert morsel["path"] == "/app" ++ assert morsel["secure"] is True ++ assert morsel["httponly"] is False ++ assert morsel["samesite"] == "Lax" ++ ++ ++@pytest.mark.asyncio ++async def test_save_session_empty_and_invalidated_write_empty_json_payload() -> None: ++ ++ ++ ++ ++ storage = SimpleCookieStorage() ++ request = make_mocked_request("GET", "/") ++ ++ empty_session = Session(None, data=None, new=True, max_age=None) ++ empty_session.changed() ++ empty_response = web.Response() ++ await storage.save_session(request, empty_response, empty_session) ++ ++ ++ assert "AIOHTTP_SESSION" in empty_response.cookies ++ assert empty_response.cookies["AIOHTTP_SESSION"].value == "{}" ++ assert empty_response.cookies["AIOHTTP_SESSION"]["path"] == "/" ++ assert empty_response.cookies["AIOHTTP_SESSION"]["httponly"] is True ++ ++ invalidated_session = Session( ++ None, data={"created": 1000, "session": {"a": 1}}, new=False ++ ) ++ invalidated_session.invalidate() ++ first_invalidated_response = web.Response() ++ second_invalidated_response = web.Response() ++ ++ await storage.save_session(request, first_invalidated_response, invalidated_session) ++ await storage.save_session(request, second_invalidated_response, invalidated_session) ++ ++ assert first_invalidated_response.cookies["AIOHTTP_SESSION"].value == "{}" ++ assert first_invalidated_response.cookies["AIOHTTP_SESSION"]["path"] == "/" ++ assert first_invalidated_response.cookies["AIOHTTP_SESSION"]["httponly"] is True ++ assert second_invalidated_response.cookies["AIOHTTP_SESSION"].value == "{}" ++ assert second_invalidated_response.cookies["AIOHTTP_SESSION"]["path"] == "/" ++ assert second_invalidated_response.cookies["AIOHTTP_SESSION"]["httponly"] is True ++ ++ ++@pytest.mark.asyncio ++async def test_custom_encoder_and_decoder_are_used_for_save_and_load() -> None: ++ ++ ++ ++ ++ calls: list[tuple[str, object]] = [] ++ ++ def encoder(value: object) -> str: ++ calls.append(("encoder", value)) ++ return "ENCODED:" + json.dumps(value, sort_keys=True) ++ ++ def decoder(value: str) -> object: ++ calls.append(("decoder", value)) ++ return {"created": 2000, "session": {"z": 9}} ++ ++ storage = SimpleCookieStorage(cookie_name="X", encoder=encoder, decoder=decoder) ++ loaded = await storage.load_session(_request_with_cookies({"X": "payload"})) ++ ++ assert dict(loaded) == {"z": 9} ++ assert loaded.created == 2000 ++ assert calls == [("decoder", "payload")] ++ ++ response = web.Response() ++ session = Session(None, data={"created": 3000, "session": {"q": 4}}, new=False) ++ ++ session.changed() ++ await storage.save_session(make_mocked_request("GET", "/"), response, session) ++ ++ assert response.cookies["X"].value == ( ++ 'ENCODED:{"created": 3000, "session": {"q": 4}}' ++ ) ++ assert calls == [ ++ ("decoder", "payload"), ++ ("encoder", {"created": 3000, "session": {"q": 4}}), ++ ] ++ ++ ++@pytest.mark.asyncio ++async def test_setup_and_session_middleware_accept_simple_cookie_storage() -> None: ++ ++ ++ ++ ++ app = web.Application() ++ setup(app, SimpleCookieStorage(cookie_name="APP")) ++ ++ assert len(app.middlewares) == 1 ++ ++ assert callable(app.middlewares[0]) ++ ++ async def handler(request: web.Request) -> web.StreamResponse: ++ session = await get_session(request) ++ session["via"] = "middleware" ++ return web.Response(text="OK") ++ ++ middleware = session_middleware(SimpleCookieStorage()) ++ with mock.patch.object(aiohttp_session.time, "time", return_value=1234567890): ++ response = await middleware(make_mocked_request("GET", "/"), handler) ++ ++ assert response.status == 200 ++ assert response.text == "OK" ++ ++ assert "AIOHTTP_SESSION" in response.cookies ++ ++ assert json.loads(response.cookies["AIOHTTP_SESSION"].value) == { ++ "created": 1234567890, ++ "session": {"via": "middleware"}, ++ } ++ ++ ++@pytest.mark.asyncio ++async def test_two_storage_instances_use_independent_cookie_names_and_max_age() -> None: ++ ++ ++ ++ ++ first = SimpleCookieStorage(cookie_name="A", max_age=11) ++ second = SimpleCookieStorage(cookie_name="B", max_age=22) ++ request = _request_with_cookies( ++ { ++ "A": json.dumps( ++ {"created": 2000000000, "session": {"left": "A"}} ++ ), ++ "B": json.dumps( ++ {"created": 2000000100, "session": {"right": "B"}} ++ ), ++ } ++ ) ++ ++ first_session = await first.load_session(request) ++ second_session = await second.load_session(request) ++ ++ assert dict(first_session) == {"left": "A"} ++ assert first_session.created == 2000000000 ++ assert first_session.max_age == 11 ++ assert first_session.new is False ++ assert dict(second_session) == {"right": "B"} ++ assert second_session.created == 2000000100 ++ assert second_session.max_age == 22 ++ assert second_session.new is False ++ ++ ++@pytest.mark.asyncio ++async def test_repeated_construct_load_save_cycles_remain_independent() -> None: ++ ++ ++ ++ ++ saved_payloads: list[str] = [] ++ ++ for index in range(150): ++ cookie_name = f"S{index}" ++ storage = SimpleCookieStorage(cookie_name=cookie_name) ++ session = Session( ++ None, ++ data={"created": 2000000000 + index, "session": {"n": index}}, ++ new=False, ++ ) ++ session.changed() ++ response = web.Response() ++ await storage.save_session(make_mocked_request("GET", "/"), response, session) ++ loaded = await storage.load_session( ++ _request_with_cookies({cookie_name: response.cookies[cookie_name].value}) ++ ) ++ ++ assert dict(loaded) == {"n": index} ++ saved_payloads.append(response.cookies[cookie_name].value) ++ ++ ++ assert len(saved_payloads) == 150 +diff --git a/mimo_test_command.sh b/mimo_test_command.sh +new file mode 100755 +--- /dev/null ++++ b/mimo_test_command.sh +@@ -0,0 +1,23 @@ ++#!/usr/bin/env bash ++ ++ ++ ++ ++export NODE_OPTIONS="${NODE_OPTIONS:-} --max-old-space-size=4096" ++export MAVEN_OPTS="${MAVEN_OPTS:-} -Xmx3g -XX:+UseG1GC" ++export GRADLE_OPTS="${GRADLE_OPTS:-} -Xmx3g -XX:+UseG1GC" ++export TEST_JVM_OPTS="${TEST_JVM_OPTS:-} -Xmx3g" ++set -e ++cd /workspace/repo ++set -euo pipefail ++ ++cd /workspace/repo ++ ++export PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 ++ ++exec python -m pytest \ ++ -p pytest_asyncio.plugin \ ++ -o addopts='' \ ++ -o asyncio_default_fixture_loop_scope=function \ ++ /workspace/repo/usercase-test-coderl/test_simple_cookie_storage.py \ ++ -v diff --git a/tasks/format-code-task-000324/tests/test.sh b/tasks/format-code-task-000324/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..cd1202e06354166533d7e8a5704a67e2b2cab741 --- /dev/null +++ b/tasks/format-code-task-000324/tests/test.sh @@ -0,0 +1,38 @@ +#!/bin/bash +# Code grading, mimoagent opensource_code.py: reset the files the hidden test patch touches, apply it, run the +# task's test command; reward 1 when it exits 0. A testbed failure (reset or apply) writes no reward: not scored. +M=/var/lib/mimo +CWD=/workspace/repo +V=/logs/verifier +mkdir -p "$V" +BASE=$(cat "$M/base" 2>/dev/null) || { echo "setup never ran (no $M/base)" >&2; exit 1; } +cd "$CWD" || exit 1 +if [ -d "$M/git-hidden" ]; then rm -rf "$CWD/.git"; mv "$M/git-hidden" "$CWD/.git"; fi +# the agent's change against the base, so its own commits count too +git add -A >/dev/null 2>&1 && git -c core.fileMode=false diff --cached "$BASE" > "$V/agent.diff" +git reset -q +if ! ( +while IFS= read -r tf; do + [ -z "$tf" ] && continue + if git cat-file -e $BASE:"$tf" 2>/dev/null; then + git checkout $BASE -- "$tf" 2>/dev/null || true + else + git rm -f --cached "$tf" >/dev/null 2>&1 || true + rm -f "$tf" + fi +done <<'EOF_RESET_TEST_FILES' +usercase-test-coderl/test_simple_cookie_storage.py +mimo_test_command.sh +EOF_RESET_TEST_FILES + +); then echo "could not reset the test files (testbed problem, not scored)" >&2; exit 1; fi +if ! git apply --verbose /tests/test.patch > "$V/apply.log" 2>&1; then + cat "$V/apply.log" >&2 + echo "the hidden tests could not be applied (testbed problem, not scored)" >&2 + exit 1 +fi +timeout 1800 sh -c "$(cat /tests/test_command.sh)" > "$V/test_output.log" 2>&1 +RC=$? +tail -c 12000 "$V/test_output.log" +if [ $RC -eq 0 ]; then echo 1 > "$V/reward.txt"; else echo 0 > "$V/reward.txt"; fi +echo "test command exited $RC" diff --git a/tasks/format-code-task-000324/tests/test_command.sh b/tasks/format-code-task-000324/tests/test_command.sh new file mode 100644 index 0000000000000000000000000000000000000000..88cb7810b836396c4869db31aeac7d4d4b189685 --- /dev/null +++ b/tasks/format-code-task-000324/tests/test_command.sh @@ -0,0 +1 @@ +bash /workspace/repo/mimo_test_command.sh \ No newline at end of file diff --git a/tasks/format-code-task-000330/environment/Dockerfile b/tasks/format-code-task-000330/environment/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..689fddfa6f6cf1cecf8f0db549856d4cbdecaf94 --- /dev/null +++ b/tasks/format-code-task-000330/environment/Dockerfile @@ -0,0 +1,3 @@ +# The task's image, pinned by digest (the same as [environment].docker_image). +# Setup runs at start from [environment.healthcheck]; environment/setup/ is its readable copy. +FROM docker.io/xiaomimimo/mimo-v2.6-rl-oss@sha256:eb812d1da0cb159098546ff7ecdc7912ae4e0898baff4ff4d632246ca2b4ca71 diff --git a/tasks/format-code-task-000330/environment/setup/files/blocklist b/tasks/format-code-task-000330/environment/setup/files/blocklist new file mode 100644 index 0000000000000000000000000000000000000000..a8e4bdc4c7d9b739c047a3cb58ea72a1bb05bcbc --- /dev/null +++ b/tasks/format-code-task-000330/environment/setup/files/blocklist @@ -0,0 +1,33 @@ +# mimo answer-leak blocklist (mimoagent) +0.0.0.0 github.com +0.0.0.0 www.github.com +0.0.0.0 api.github.com +0.0.0.0 raw.githubusercontent.com +0.0.0.0 codeload.github.com +0.0.0.0 objects.githubusercontent.com +0.0.0.0 gist.github.com +0.0.0.0 gist.githubusercontent.com +0.0.0.0 gitlab.com +0.0.0.0 bitbucket.org +0.0.0.0 sourceforge.net +0.0.0.0 git.kernel.org +0.0.0.0 chromium.googlesource.com +0.0.0.0 android.googlesource.com +0.0.0.0 sourcegraph.com +0.0.0.0 bugs.chromium.org +0.0.0.0 issues.oss-fuzz.com +0.0.0.0 oss-fuzz.com +0.0.0.0 osv.dev +0.0.0.0 api.osv.dev +0.0.0.0 bugzilla.mozilla.org +0.0.0.0 proxy.golang.org +0.0.0.0 sum.golang.org +0.0.0.0 pkg.go.dev +0.0.0.0 google.com +0.0.0.0 www.google.com +0.0.0.0 bing.com +0.0.0.0 www.bing.com +0.0.0.0 duckduckgo.com +0.0.0.0 html.duckduckgo.com +0.0.0.0 search.brave.com +0.0.0.0 stackoverflow.com diff --git a/tasks/format-code-task-000330/environment/setup/setup.sh b/tasks/format-code-task-000330/environment/setup/setup.sh new file mode 100644 index 0000000000000000000000000000000000000000..d883db90cfcfb48f7a139861bbe9f6b5d95cad6f --- /dev/null +++ b/tasks/format-code-task-000330/environment/setup/setup.sh @@ -0,0 +1,34 @@ +#!/bin/bash +# Runs once, as root, before the agent starts: Harbor's [environment.healthcheck] unpacks this folder into +# /var/lib/mimo and runs it. Generated by mimo_harbor; see its README for how each step maps to Xiaomi's harness. +M=/var/lib/mimo +[ -f "$M/ready" ] && exit 0 +chmod 700 "$M" +fail() { echo "setup: $*" >&2; exit 1; } +# the answer-leak blocklist (mimoagent), applied to /etc/hosts by the agent right after it installs +write_blocklist() { cp "$M/files/blocklist" "$M/blocklist"; } + +# Code: mimoagent environments/datasets/opensource_code.py + base.py, as the explorer runs it (app/runner/domains.py Code). +CWD=/testbed +git config --global --add safe.directory "$CWD" +cd "$CWD" || fail "no working directory $CWD" +if ! git rev-parse --git-dir >/dev/null 2>&1; then # a bare source tree: give it a baseline commit + git init -q && git add -A && git -c user.name=mimo -c user.email=mimo@localhost commit -q -m baseline --allow-empty +fi +BASE=$(git rev-parse HEAD 2>/dev/null) +[ ${#BASE} -eq 40 ] || fail "could not resolve the base commit in $CWD" +echo "$BASE" > "$M/base" +# Images are built with history truncated at the base. If one is not, the fix could be read out of git log, +# so .git is hidden while the agent works and put back for grading. +LATER=$(git rev-list --all --not "$BASE" 2>/dev/null | head -n 5 | grep -c . || true) +rm -f /tmp/fail.log /tmp/pass.log /tmp/patch.diff /tmp/test_patch.diff /tmp/*.log 2>/dev/null; rm -rf /tmp/claude-0 /tmp/claude-* /tmp/testem-* /tmp/puppeteer_dev_chrome_profile-* 2>/dev/null; rm -f /tmp/test_files.json 2>/dev/null; rm -rf /tmp/jest_* /tmp/jest-* /tmp/build /tmp/build_env 2>/dev/null; rm -rf /tmp/pytest-of-root /tmp/pytest-* /tmp/.pytest_cache /tmp/__pycache__ 2>/dev/null; rm -rf /tmp/go-build* /tmp/standards /tmp/wordpress /tmp/zig-* /tmp/testbase /tmp/testbed 2>/dev/null; rm -f /tmp/tmp*.tmp /tmp/*.bak /tmp/expect* /tmp/butwas* 2>/dev/null; rm -rf /root/.cache/go-build 2>/dev/null; rm -rf /tests 2>/dev/null; find /logs -mindepth 1 -delete 2>/dev/null; mkdir -p /logs/agent /logs/verifier /logs/artifacts; chmod 777 /logs/agent /logs/verifier /logs/artifacts; find /var/log -type f -delete 2>/dev/null || true; rm -rf /var/lib/postgresql/*/*/log /var/lib/postgresql/*/*/pg_log 2>/dev/null || true; find /var/lib/mysql /var/lib/mongodb -type f -name '*.log' -delete 2>/dev/null || true; rm -rf /root/.npm/_logs /root/.babel.json /root/.pytest_cache 2>/dev/null || true; find / -maxdepth 4 -xdev -name task_description.md -path '*/.build_env/*' -delete 2>/dev/null || true; true +git clean -fdx --exclude=node_modules --exclude=bower_components --exclude=.husky --exclude=vendor --exclude=third_party --exclude=_deps --exclude=vcpkg_installed --exclude=.venv --exclude=venv --exclude=.gradle --exclude=target --exclude=.build --exclude=lib --exclude=.bundle --exclude=Manifest.toml --exclude=_build --exclude=.stack-work --exclude=dist-newstyle >/dev/null 2>&1 +find /root/.m2 -type f \( -name '*-SNAPSHOT.jar' -o -name '*-SNAPSHOT-sources.jar' -o -name '*-SNAPSHOT-tests.jar' -o -name '*-SNAPSHOT-test-sources.jar' \) -delete 2>/dev/null; rm -rf /root/.julia/compiled 2>/dev/null; rm -rf /root/.gradle/caches/build-cache-* /root/.gradle/daemon 2>/dev/null; rm -rf /root/.gradle/caches/*/scripts /root/.gradle/caches/jars-* 2>/dev/null; rm -rf /root/.cache/bazel 2>/dev/null; true +if [ "$LATER" -gt 0 ]; then + mv "$CWD/.git" "$M/git-hidden" + echo "history not truncated at ${BASE:0:12}: .git hidden while the agent works" +fi +write_blocklist + +touch "$M/ready" +echo "setup done" diff --git a/tasks/format-code-task-000330/tests/test.patch b/tasks/format-code-task-000330/tests/test.patch new file mode 100644 index 0000000000000000000000000000000000000000..80ea340cacc15e5e532200f3b7cb39af537ec0ed --- /dev/null +++ b/tasks/format-code-task-000330/tests/test.patch @@ -0,0 +1,68 @@ +diff --git a/airbyte-integrations/connectors/source-marketo/unit_tests/test_source.py b/airbyte-integrations/connectors/source-marketo/unit_tests/test_source.py +index 0d4690d1bd9b4..4236a7fadbbe6 100644 +--- a/airbyte-integrations/connectors/source-marketo/unit_tests/test_source.py ++++ b/airbyte-integrations/connectors/source-marketo/unit_tests/test_source.py +@@ -8,9 +8,10 @@ + from functools import partial + from unittest.mock import ANY, Mock, patch + ++import pendulum + import pytest + from airbyte_cdk.models.airbyte_protocol import SyncMode +-from source_marketo.source import Activities, Campaigns, MarketoStream, Programs, SourceMarketo ++from source_marketo.source import Activities, Campaigns, Leads, MarketoStream, Programs, SourceMarketo + + + def test_create_export_job(mocker, send_email_stream, caplog): +@@ -286,3 +287,30 @@ def test_check_connection(config, requests_mock, status_code, response, is_conne + def test_normalize_datetime(config, input, format, expected_result): + stream = Programs(config) + assert stream.normalize_datetime(input, format) == expected_result ++ ++ ++today = pendulum.now() ++yesterday = pendulum.now().subtract(days=1).strftime("%Y-%m-%dT%H:%M:%SZ") ++today = today.strftime("%Y-%m-%dT%H:%M:%SZ") ++ ++ ++@pytest.mark.parametrize( ++ "latest_record, current_state, expected_state", ++ ( ++ ({}, {}, "start_date"), ++ ({"updatedAt": None}, {"updatedAt": None}, "start_date"), ++ ({}, {"updatedAt": None}, "start_date"), ++ ({"updatedAt": None}, {}, "start_date"), ++ ({}, {"updatedAt": today}, {"updatedAt": today}), ++ ({"updatedAt": None}, {"updatedAt": today}, {"updatedAt": today}), ++ ({"updatedAt": today}, {"updatedAt": None}, {"updatedAt": today}), ++ ({"updatedAt": today}, {}, {"updatedAt": today}), ++ ({"updatedAt": yesterday}, {"updatedAt": today}, {"updatedAt": today}), ++ ({"updatedAt": today}, {"updatedAt": yesterday}, {"updatedAt": today}) ++ ) ++) ++def test_get_updated_state(config, latest_record, current_state, expected_state): ++ stream = Leads(config) ++ if expected_state == "start_date": ++ expected_state = {"updatedAt": config["start_date"]} ++ assert stream.get_updated_state(latest_record, current_state) == expected_state +diff --git a/mimo_build_env.tar.gz.b64 b/mimo_build_env.tar.gz.b64 +new file mode 100644 +--- /dev/null ++++ b/mimo_build_env.tar.gz.b64 +@@ -0,0 +1,5 @@ ++H4sIAAAAAAAAA+3S32qDMBQGcK99ijMG7ZUm0do+jsQYZlhNShILvv2ivWgZbL1pGWXf7+Yc8s/g ++l7KbzLFvtT2z7Fl4cmiatSbf69qLphIiLWq4yLgQe15n1DztRjemEKUnyrxz8bd19+ZfVHnNP+oQ ++W+XGUdq+DMPjvnEv/6q65r8Tdcp/t0+F+OOu8LN/nv/7G+uMZZ0MQ656Wh9Bp/t8GaDiqGh7M8qk ++8d0cdWFs1B9eRuNsYMpZq1V0PrDgJq90MUr/qaOjzYZOcxycrakYlzYdQ5M1sV26cHlxlz3laabi ++vM3/+n8AAAAAAAAAAAAAAAAAAAAAALySL5llMecAKAAA +diff --git a/mimo_test_command.sh b/mimo_test_command.sh +new file mode 100755 +--- /dev/null ++++ b/mimo_test_command.sh +@@ -0,0 +1,6 @@ ++#!/usr/bin/env bash ++ ++set -uo pipefail ++cd /testbed || exit 1 ++base64 -d mimo_build_env.tar.gz.b64 | tar -xzf - -C /testbed || exit 1 ++exec bash -lc 'cd /testbed && bash -eo pipefail /testbed/.build_env/test_command.sh' diff --git a/tasks/format-code-task-000330/tests/test.sh b/tasks/format-code-task-000330/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..e87ea4e36f00dc34c41a454bd6cbd71dd98bfb2a --- /dev/null +++ b/tasks/format-code-task-000330/tests/test.sh @@ -0,0 +1,39 @@ +#!/bin/bash +# Code grading, mimoagent opensource_code.py: reset the files the hidden test patch touches, apply it, run the +# task's test command; reward 1 when it exits 0. A testbed failure (reset or apply) writes no reward: not scored. +M=/var/lib/mimo +CWD=/testbed +V=/logs/verifier +mkdir -p "$V" +BASE=$(cat "$M/base" 2>/dev/null) || { echo "setup never ran (no $M/base)" >&2; exit 1; } +cd "$CWD" || exit 1 +if [ -d "$M/git-hidden" ]; then rm -rf "$CWD/.git"; mv "$M/git-hidden" "$CWD/.git"; fi +# the agent's change against the base, so its own commits count too +git add -A >/dev/null 2>&1 && git -c core.fileMode=false diff --cached "$BASE" > "$V/agent.diff" +git reset -q +if ! ( +while IFS= read -r tf; do + [ -z "$tf" ] && continue + if git cat-file -e $BASE:"$tf" 2>/dev/null; then + git checkout $BASE -- "$tf" 2>/dev/null || true + else + git rm -f --cached "$tf" >/dev/null 2>&1 || true + rm -f "$tf" + fi +done <<'EOF_RESET_TEST_FILES' +airbyte-integrations/connectors/source-marketo/unit_tests/test_source.py +mimo_build_env.tar.gz.b64 +mimo_test_command.sh +EOF_RESET_TEST_FILES + +); then echo "could not reset the test files (testbed problem, not scored)" >&2; exit 1; fi +if ! git apply --verbose /tests/test.patch > "$V/apply.log" 2>&1; then + cat "$V/apply.log" >&2 + echo "the hidden tests could not be applied (testbed problem, not scored)" >&2 + exit 1 +fi +timeout 1800 sh -c "$(cat /tests/test_command.sh)" > "$V/test_output.log" 2>&1 +RC=$? +tail -c 12000 "$V/test_output.log" +if [ $RC -eq 0 ]; then echo 1 > "$V/reward.txt"; else echo 0 > "$V/reward.txt"; fi +echo "test command exited $RC" diff --git a/tasks/format-code-task-000330/tests/test_command.sh b/tasks/format-code-task-000330/tests/test_command.sh new file mode 100644 index 0000000000000000000000000000000000000000..7cb23076694ad17d72e8296d62b2b240083e36db --- /dev/null +++ b/tasks/format-code-task-000330/tests/test_command.sh @@ -0,0 +1 @@ +bash /testbed/mimo_test_command.sh \ No newline at end of file diff --git a/tasks/format-code-task-000339/environment/Dockerfile b/tasks/format-code-task-000339/environment/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..40da379967db8ad2ca1d9f551a18f875940c6083 --- /dev/null +++ b/tasks/format-code-task-000339/environment/Dockerfile @@ -0,0 +1,3 @@ +# The task's image, pinned by digest (the same as [environment].docker_image). +# Setup runs at start from [environment.healthcheck]; environment/setup/ is its readable copy. +FROM docker.io/xiaomimimo/mimo-v2.6-rl-oss@sha256:248687bf9e25f8442c502f6a2d58ffd147d77a6e2b9a0a71e108b4947c28d8b8 diff --git a/tasks/format-code-task-000339/environment/setup/files/blocklist b/tasks/format-code-task-000339/environment/setup/files/blocklist new file mode 100644 index 0000000000000000000000000000000000000000..a8e4bdc4c7d9b739c047a3cb58ea72a1bb05bcbc --- /dev/null +++ b/tasks/format-code-task-000339/environment/setup/files/blocklist @@ -0,0 +1,33 @@ +# mimo answer-leak blocklist (mimoagent) +0.0.0.0 github.com +0.0.0.0 www.github.com +0.0.0.0 api.github.com +0.0.0.0 raw.githubusercontent.com +0.0.0.0 codeload.github.com +0.0.0.0 objects.githubusercontent.com +0.0.0.0 gist.github.com +0.0.0.0 gist.githubusercontent.com +0.0.0.0 gitlab.com +0.0.0.0 bitbucket.org +0.0.0.0 sourceforge.net +0.0.0.0 git.kernel.org +0.0.0.0 chromium.googlesource.com +0.0.0.0 android.googlesource.com +0.0.0.0 sourcegraph.com +0.0.0.0 bugs.chromium.org +0.0.0.0 issues.oss-fuzz.com +0.0.0.0 oss-fuzz.com +0.0.0.0 osv.dev +0.0.0.0 api.osv.dev +0.0.0.0 bugzilla.mozilla.org +0.0.0.0 proxy.golang.org +0.0.0.0 sum.golang.org +0.0.0.0 pkg.go.dev +0.0.0.0 google.com +0.0.0.0 www.google.com +0.0.0.0 bing.com +0.0.0.0 www.bing.com +0.0.0.0 duckduckgo.com +0.0.0.0 html.duckduckgo.com +0.0.0.0 search.brave.com +0.0.0.0 stackoverflow.com diff --git a/tasks/format-code-task-000339/environment/setup/setup.sh b/tasks/format-code-task-000339/environment/setup/setup.sh new file mode 100644 index 0000000000000000000000000000000000000000..d883db90cfcfb48f7a139861bbe9f6b5d95cad6f --- /dev/null +++ b/tasks/format-code-task-000339/environment/setup/setup.sh @@ -0,0 +1,34 @@ +#!/bin/bash +# Runs once, as root, before the agent starts: Harbor's [environment.healthcheck] unpacks this folder into +# /var/lib/mimo and runs it. Generated by mimo_harbor; see its README for how each step maps to Xiaomi's harness. +M=/var/lib/mimo +[ -f "$M/ready" ] && exit 0 +chmod 700 "$M" +fail() { echo "setup: $*" >&2; exit 1; } +# the answer-leak blocklist (mimoagent), applied to /etc/hosts by the agent right after it installs +write_blocklist() { cp "$M/files/blocklist" "$M/blocklist"; } + +# Code: mimoagent environments/datasets/opensource_code.py + base.py, as the explorer runs it (app/runner/domains.py Code). +CWD=/testbed +git config --global --add safe.directory "$CWD" +cd "$CWD" || fail "no working directory $CWD" +if ! git rev-parse --git-dir >/dev/null 2>&1; then # a bare source tree: give it a baseline commit + git init -q && git add -A && git -c user.name=mimo -c user.email=mimo@localhost commit -q -m baseline --allow-empty +fi +BASE=$(git rev-parse HEAD 2>/dev/null) +[ ${#BASE} -eq 40 ] || fail "could not resolve the base commit in $CWD" +echo "$BASE" > "$M/base" +# Images are built with history truncated at the base. If one is not, the fix could be read out of git log, +# so .git is hidden while the agent works and put back for grading. +LATER=$(git rev-list --all --not "$BASE" 2>/dev/null | head -n 5 | grep -c . || true) +rm -f /tmp/fail.log /tmp/pass.log /tmp/patch.diff /tmp/test_patch.diff /tmp/*.log 2>/dev/null; rm -rf /tmp/claude-0 /tmp/claude-* /tmp/testem-* /tmp/puppeteer_dev_chrome_profile-* 2>/dev/null; rm -f /tmp/test_files.json 2>/dev/null; rm -rf /tmp/jest_* /tmp/jest-* /tmp/build /tmp/build_env 2>/dev/null; rm -rf /tmp/pytest-of-root /tmp/pytest-* /tmp/.pytest_cache /tmp/__pycache__ 2>/dev/null; rm -rf /tmp/go-build* /tmp/standards /tmp/wordpress /tmp/zig-* /tmp/testbase /tmp/testbed 2>/dev/null; rm -f /tmp/tmp*.tmp /tmp/*.bak /tmp/expect* /tmp/butwas* 2>/dev/null; rm -rf /root/.cache/go-build 2>/dev/null; rm -rf /tests 2>/dev/null; find /logs -mindepth 1 -delete 2>/dev/null; mkdir -p /logs/agent /logs/verifier /logs/artifacts; chmod 777 /logs/agent /logs/verifier /logs/artifacts; find /var/log -type f -delete 2>/dev/null || true; rm -rf /var/lib/postgresql/*/*/log /var/lib/postgresql/*/*/pg_log 2>/dev/null || true; find /var/lib/mysql /var/lib/mongodb -type f -name '*.log' -delete 2>/dev/null || true; rm -rf /root/.npm/_logs /root/.babel.json /root/.pytest_cache 2>/dev/null || true; find / -maxdepth 4 -xdev -name task_description.md -path '*/.build_env/*' -delete 2>/dev/null || true; true +git clean -fdx --exclude=node_modules --exclude=bower_components --exclude=.husky --exclude=vendor --exclude=third_party --exclude=_deps --exclude=vcpkg_installed --exclude=.venv --exclude=venv --exclude=.gradle --exclude=target --exclude=.build --exclude=lib --exclude=.bundle --exclude=Manifest.toml --exclude=_build --exclude=.stack-work --exclude=dist-newstyle >/dev/null 2>&1 +find /root/.m2 -type f \( -name '*-SNAPSHOT.jar' -o -name '*-SNAPSHOT-sources.jar' -o -name '*-SNAPSHOT-tests.jar' -o -name '*-SNAPSHOT-test-sources.jar' \) -delete 2>/dev/null; rm -rf /root/.julia/compiled 2>/dev/null; rm -rf /root/.gradle/caches/build-cache-* /root/.gradle/daemon 2>/dev/null; rm -rf /root/.gradle/caches/*/scripts /root/.gradle/caches/jars-* 2>/dev/null; rm -rf /root/.cache/bazel 2>/dev/null; true +if [ "$LATER" -gt 0 ]; then + mv "$CWD/.git" "$M/git-hidden" + echo "history not truncated at ${BASE:0:12}: .git hidden while the agent works" +fi +write_blocklist + +touch "$M/ready" +echo "setup done" diff --git a/tasks/format-code-task-000339/tests/test.patch b/tasks/format-code-task-000339/tests/test.patch new file mode 100644 index 0000000000000000000000000000000000000000..6523b4b2514c39868980e9f937478acc6662b68b --- /dev/null +++ b/tasks/format-code-task-000339/tests/test.patch @@ -0,0 +1,104 @@ +diff --git a/tests/test_augmentations.py b/tests/test_augmentations.py +index 5b342db07..5d9d69fe0 100644 +--- a/tests/test_augmentations.py ++++ b/tests/test_augmentations.py +@@ -84,7 +84,6 @@ def test_image_only_augmentations_mask_persists(augmentation_cls, params): + A.FromFloat, + A.ISONoise, + A.Posterize, +- A.RandomToneCurve, + }, + ), + ) +@@ -299,7 +298,6 @@ def test_augmentations_wont_change_input(augmentation_cls, params): + A.FancyPCA, + A.ISONoise, + A.Posterize, +- A.RandomToneCurve, + A.RandomSizedBBoxSafeCrop, + A.BBoxSafeRandomCrop, + A.CropNonEmptyMaskIfExists, +@@ -679,7 +677,6 @@ def test_multichannel_image_augmentations(augmentation_cls, params): + A.Equalize, + A.FancyPCA, + A.Posterize, +- A.RandomToneCurve, + A.PixelDistributionAdaptation, + A.Spatter, + A.ChromaticAberration, +@@ -842,7 +839,6 @@ def test_multichannel_image_augmentations_diff_channels(augmentation_cls, params + A.Equalize, + A.FancyPCA, + A.Posterize, +- A.RandomToneCurve, + A.FDA, + A.HistogramMatching, + A.PixelDistributionAdaptation, +diff --git a/tests/test_functional.py b/tests/test_functional.py +index 21c73ddf7..c96c08867 100644 +--- a/tests/test_functional.py ++++ b/tests/test_functional.py +@@ -8,7 +8,7 @@ + import albumentations as A + import albumentations.augmentations.functional as F + import albumentations.augmentations.geometric.functional as FGeometric +-from albucore.utils import is_multispectral_image, MAX_VALUES_BY_DTYPE ++from albucore.utils import is_multispectral_image, MAX_VALUES_BY_DTYPE, get_num_channels + + from albumentations.core.types import d4_group_elements + from tests.conftest import IMAGES, RECTANGULAR_IMAGES +@@ -1015,3 +1015,19 @@ def test_planckian_jitter_cied(): + + cied_plankian_jitter = F.planckian_jitter(img, temperature=4500, mode="cied") + assert np.allclose(cied_plankian_jitter, expected_cied_plankian_jitter, atol=1e-4) ++ ++ ++@pytest.mark.parametrize("image", IMAGES) ++def test_random_tone_curve(image): ++ low_y = 0.1 ++ high_y = 0.9 ++ ++ num_channels = get_num_channels(image) ++ ++ result_float_value = F.move_tone_curve(image, low_y, high_y) ++ result_array_value = F.move_tone_curve(image, np.array([low_y] * num_channels), np.array([high_y] * num_channels)) ++ ++ assert np.array_equal(result_float_value, result_array_value) ++ ++ assert result_float_value.dtype == image.dtype ++ assert result_float_value.shape == image.shape +diff --git a/tests/test_serialization.py b/tests/test_serialization.py +index f4b148287..f459f16cc 100644 +--- a/tests/test_serialization.py ++++ b/tests/test_serialization.py +@@ -294,7 +294,8 @@ def test_augmentations_serialization(augmentation_cls, params, p, seed, image): + ], + [A.Sharpen, {"alpha": [0.2, 0.5], "lightness": [0.5, 1.0]}], + [A.Emboss, {"alpha": [0.2, 0.5], "strength": [0.5, 1.0]}], +- [A.RandomToneCurve, {"scale": 0.2}], ++ [A.RandomToneCurve, {"scale": 0.2, "per_channel": False}, ], ++ [A.RandomToneCurve, {"scale": 0.3, "per_channel": True}], + [ + A.CropAndPad, + { +diff --git a/mimo_build_env.tar.gz.b64 b/mimo_build_env.tar.gz.b64 +new file mode 100644 +--- /dev/null ++++ b/mimo_build_env.tar.gz.b64 +@@ -0,0 +1,5 @@ ++H4sIAAAAAAAAA+3SwWqEMBAGYM95iimF3taYWNdbX2WJmtaAJmISYfv0jZbSZaHdyy5t6f8dnOAk ++GPwnb6IZuoO2C89upUjqqtpqcl63tahkIeuyrAuZFULsU6HqZjc6EX1QM1E2Oxe+23ep/0fln/kH ++7cOhdeOobJf7/nrfuJS/rORH/lLIMuX/uBcio+J6V/jaP8///o5HP/PGWJ5mgBrle9Z2tA1DozvG ++vItzq4m7KfBlHZN1q2qDWVTQjE3H0DtLu5HSKp2h9eHfZ0nFl1HboIJx1ufT8bT3HG27vlfDWcPr ++2ajBvG6n1t5uIfn0INhP/ykAAAAAAAAAAAAAAAAAAAAAgN/nDVf4ZY0AKAAA +diff --git a/mimo_test_command.sh b/mimo_test_command.sh +new file mode 100755 +--- /dev/null ++++ b/mimo_test_command.sh +@@ -0,0 +1,6 @@ ++#!/usr/bin/env bash ++ ++set -uo pipefail ++cd /testbed || exit 1 ++base64 -d mimo_build_env.tar.gz.b64 | tar -xzf - -C /testbed || exit 1 ++exec bash -lc 'cd /testbed && bash -eo pipefail /testbed/.build_env/test_command.sh' diff --git a/tasks/format-code-task-000339/tests/test.sh b/tasks/format-code-task-000339/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..50bcf904f12fee1ffce9d9ae136eb456968142a8 --- /dev/null +++ b/tasks/format-code-task-000339/tests/test.sh @@ -0,0 +1,41 @@ +#!/bin/bash +# Code grading, mimoagent opensource_code.py: reset the files the hidden test patch touches, apply it, run the +# task's test command; reward 1 when it exits 0. A testbed failure (reset or apply) writes no reward: not scored. +M=/var/lib/mimo +CWD=/testbed +V=/logs/verifier +mkdir -p "$V" +BASE=$(cat "$M/base" 2>/dev/null) || { echo "setup never ran (no $M/base)" >&2; exit 1; } +cd "$CWD" || exit 1 +if [ -d "$M/git-hidden" ]; then rm -rf "$CWD/.git"; mv "$M/git-hidden" "$CWD/.git"; fi +# the agent's change against the base, so its own commits count too +git add -A >/dev/null 2>&1 && git -c core.fileMode=false diff --cached "$BASE" > "$V/agent.diff" +git reset -q +if ! ( +while IFS= read -r tf; do + [ -z "$tf" ] && continue + if git cat-file -e $BASE:"$tf" 2>/dev/null; then + git checkout $BASE -- "$tf" 2>/dev/null || true + else + git rm -f --cached "$tf" >/dev/null 2>&1 || true + rm -f "$tf" + fi +done <<'EOF_RESET_TEST_FILES' +tests/test_augmentations.py +tests/test_functional.py +tests/test_serialization.py +mimo_build_env.tar.gz.b64 +mimo_test_command.sh +EOF_RESET_TEST_FILES + +); then echo "could not reset the test files (testbed problem, not scored)" >&2; exit 1; fi +if ! git apply --verbose /tests/test.patch > "$V/apply.log" 2>&1; then + cat "$V/apply.log" >&2 + echo "the hidden tests could not be applied (testbed problem, not scored)" >&2 + exit 1 +fi +timeout 1800 sh -c "$(cat /tests/test_command.sh)" > "$V/test_output.log" 2>&1 +RC=$? +tail -c 12000 "$V/test_output.log" +if [ $RC -eq 0 ]; then echo 1 > "$V/reward.txt"; else echo 0 > "$V/reward.txt"; fi +echo "test command exited $RC" diff --git a/tasks/format-code-task-000339/tests/test_command.sh b/tasks/format-code-task-000339/tests/test_command.sh new file mode 100644 index 0000000000000000000000000000000000000000..7cb23076694ad17d72e8296d62b2b240083e36db --- /dev/null +++ b/tasks/format-code-task-000339/tests/test_command.sh @@ -0,0 +1 @@ +bash /testbed/mimo_test_command.sh \ No newline at end of file diff --git a/tasks/format-code-task-000341/environment/Dockerfile b/tasks/format-code-task-000341/environment/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..2d248e6cae2b2cf23ebde9c5b771f320e4ca1e3c --- /dev/null +++ b/tasks/format-code-task-000341/environment/Dockerfile @@ -0,0 +1,3 @@ +# The task's image, pinned by digest (the same as [environment].docker_image). +# Setup runs at start from [environment.healthcheck]; environment/setup/ is its readable copy. +FROM docker.io/xiaomimimo/mimo-v2.6-rl-oss@sha256:4a4ad85368928b165816d559e3be32205b1322156ccbf2e1b0be51017ab9b4a6 diff --git a/tasks/format-code-task-000341/environment/setup/files/blocklist b/tasks/format-code-task-000341/environment/setup/files/blocklist new file mode 100644 index 0000000000000000000000000000000000000000..a8e4bdc4c7d9b739c047a3cb58ea72a1bb05bcbc --- /dev/null +++ b/tasks/format-code-task-000341/environment/setup/files/blocklist @@ -0,0 +1,33 @@ +# mimo answer-leak blocklist (mimoagent) +0.0.0.0 github.com +0.0.0.0 www.github.com +0.0.0.0 api.github.com +0.0.0.0 raw.githubusercontent.com +0.0.0.0 codeload.github.com +0.0.0.0 objects.githubusercontent.com +0.0.0.0 gist.github.com +0.0.0.0 gist.githubusercontent.com +0.0.0.0 gitlab.com +0.0.0.0 bitbucket.org +0.0.0.0 sourceforge.net +0.0.0.0 git.kernel.org +0.0.0.0 chromium.googlesource.com +0.0.0.0 android.googlesource.com +0.0.0.0 sourcegraph.com +0.0.0.0 bugs.chromium.org +0.0.0.0 issues.oss-fuzz.com +0.0.0.0 oss-fuzz.com +0.0.0.0 osv.dev +0.0.0.0 api.osv.dev +0.0.0.0 bugzilla.mozilla.org +0.0.0.0 proxy.golang.org +0.0.0.0 sum.golang.org +0.0.0.0 pkg.go.dev +0.0.0.0 google.com +0.0.0.0 www.google.com +0.0.0.0 bing.com +0.0.0.0 www.bing.com +0.0.0.0 duckduckgo.com +0.0.0.0 html.duckduckgo.com +0.0.0.0 search.brave.com +0.0.0.0 stackoverflow.com diff --git a/tasks/format-code-task-000341/environment/setup/setup.sh b/tasks/format-code-task-000341/environment/setup/setup.sh new file mode 100644 index 0000000000000000000000000000000000000000..e9eb7daf39f9542bd095367feee457f3da77e492 --- /dev/null +++ b/tasks/format-code-task-000341/environment/setup/setup.sh @@ -0,0 +1,34 @@ +#!/bin/bash +# Runs once, as root, before the agent starts: Harbor's [environment.healthcheck] unpacks this folder into +# /var/lib/mimo and runs it. Generated by mimo_harbor; see its README for how each step maps to Xiaomi's harness. +M=/var/lib/mimo +[ -f "$M/ready" ] && exit 0 +chmod 700 "$M" +fail() { echo "setup: $*" >&2; exit 1; } +# the answer-leak blocklist (mimoagent), applied to /etc/hosts by the agent right after it installs +write_blocklist() { cp "$M/files/blocklist" "$M/blocklist"; } + +# Code: mimoagent environments/datasets/opensource_code.py + base.py, as the explorer runs it (app/runner/domains.py Code). +CWD=/workspace/repo +git config --global --add safe.directory "$CWD" +cd "$CWD" || fail "no working directory $CWD" +if ! git rev-parse --git-dir >/dev/null 2>&1; then # a bare source tree: give it a baseline commit + git init -q && git add -A && git -c user.name=mimo -c user.email=mimo@localhost commit -q -m baseline --allow-empty +fi +BASE=$(git rev-parse HEAD 2>/dev/null) +[ ${#BASE} -eq 40 ] || fail "could not resolve the base commit in $CWD" +echo "$BASE" > "$M/base" +# Images are built with history truncated at the base. If one is not, the fix could be read out of git log, +# so .git is hidden while the agent works and put back for grading. +LATER=$(git rev-list --all --not "$BASE" 2>/dev/null | head -n 5 | grep -c . || true) +rm -f /tmp/fail.log /tmp/pass.log /tmp/patch.diff /tmp/test_patch.diff /tmp/*.log 2>/dev/null; rm -rf /tmp/claude-0 /tmp/claude-* /tmp/testem-* /tmp/puppeteer_dev_chrome_profile-* 2>/dev/null; rm -f /tmp/test_files.json 2>/dev/null; rm -rf /tmp/jest_* /tmp/jest-* /tmp/build /tmp/build_env 2>/dev/null; rm -rf /tmp/pytest-of-root /tmp/pytest-* /tmp/.pytest_cache /tmp/__pycache__ 2>/dev/null; rm -rf /tmp/go-build* /tmp/standards /tmp/wordpress /tmp/zig-* /tmp/testbase /tmp/testbed 2>/dev/null; rm -f /tmp/tmp*.tmp /tmp/*.bak /tmp/expect* /tmp/butwas* 2>/dev/null; rm -rf /root/.cache/go-build 2>/dev/null; rm -rf /tests 2>/dev/null; find /logs -mindepth 1 -delete 2>/dev/null; mkdir -p /logs/agent /logs/verifier /logs/artifacts; chmod 777 /logs/agent /logs/verifier /logs/artifacts; find /var/log -type f -delete 2>/dev/null || true; rm -rf /var/lib/postgresql/*/*/log /var/lib/postgresql/*/*/pg_log 2>/dev/null || true; find /var/lib/mysql /var/lib/mongodb -type f -name '*.log' -delete 2>/dev/null || true; rm -rf /root/.npm/_logs /root/.babel.json /root/.pytest_cache 2>/dev/null || true; find / -maxdepth 4 -xdev -name task_description.md -path '*/.build_env/*' -delete 2>/dev/null || true; true +git clean -fdx --exclude=node_modules --exclude=bower_components --exclude=.husky --exclude=vendor --exclude=third_party --exclude=_deps --exclude=vcpkg_installed --exclude=.venv --exclude=venv --exclude=.gradle --exclude=target --exclude=.build --exclude=lib --exclude=.bundle --exclude=Manifest.toml --exclude=_build --exclude=.stack-work --exclude=dist-newstyle >/dev/null 2>&1 +find /root/.m2 -type f \( -name '*-SNAPSHOT.jar' -o -name '*-SNAPSHOT-sources.jar' -o -name '*-SNAPSHOT-tests.jar' -o -name '*-SNAPSHOT-test-sources.jar' \) -delete 2>/dev/null; rm -rf /root/.julia/compiled 2>/dev/null; rm -rf /root/.gradle/caches/build-cache-* /root/.gradle/daemon 2>/dev/null; rm -rf /root/.gradle/caches/*/scripts /root/.gradle/caches/jars-* 2>/dev/null; rm -rf /root/.cache/bazel 2>/dev/null; true +if [ "$LATER" -gt 0 ]; then + mv "$CWD/.git" "$M/git-hidden" + echo "history not truncated at ${BASE:0:12}: .git hidden while the agent works" +fi +write_blocklist + +touch "$M/ready" +echo "setup done" diff --git a/tasks/format-code-task-000341/tests/test.patch b/tasks/format-code-task-000341/tests/test.patch new file mode 100644 index 0000000000000000000000000000000000000000..2ef0586811f861c5707d6b784ae5b5826de17de1 --- /dev/null +++ b/tasks/format-code-task-000341/tests/test.patch @@ -0,0 +1,266 @@ +diff --git a/usercase-test-coderl/test_command_line_argument_binding.py b/usercase-test-coderl/test_command_line_argument_binding.py +new file mode 100644 +--- /dev/null ++++ b/usercase-test-coderl/test_command_line_argument_binding.py +@@ -0,0 +1,235 @@ ++import argparse ++import os ++import sys ++ ++import pytest ++import yaml ++ ++from vyper import Vyper ++ ++ ++class argv_context: ++ def __init__(self, argv): ++ self.argv = argv ++ self.previous = None ++ ++ def __enter__(self): ++ self.previous = sys.argv[:] ++ sys.argv = self.argv[:] ++ ++ def __exit__(self, exc_type, exc, tb): ++ sys.argv = self.previous ++ ++ ++def port_parser(): ++ parser = argparse.ArgumentParser(prog="fixture-probe") ++ parser.add_argument("--port", type=int, default=5000) ++ parser.add_argument("--host", default="127.0.0.1") ++ parser.add_argument("--debug", action="store_true", default=False) ++ return parser ++ ++ ++def test_bind_args_parser_defaults_are_visible_without_flags(): ++ ++ ++ ++ ++ with argv_context(["fixture-probe"]): ++ v = Vyper() ++ result = v.bind_args(port_parser()) ++ ++ assert result is None ++ assert v.get("port") == 5000 ++ assert v.get("host") == "127.0.0.1" ++ assert v.get("debug") is False ++ assert v.is_set("debug") is True ++ assert sorted(v.all_keys()) == ["debug", "host", "port"] ++ assert dict(sorted(v.all_settings().items())) == { ++ "debug": False, ++ "host": "127.0.0.1", ++ "port": 5000, ++ } ++ ++ ++def test_parser_defaults_do_not_mask_environment_values(): ++ ++ ++ ++ ++ os.environ["VYPER_FIXTURE_PORT"] = "6200" ++ try: ++ with argv_context(["fixture-probe"]): ++ v = Vyper() ++ v.bind_env("port", "VYPER_FIXTURE_PORT") ++ result = v.bind_args(port_parser()) ++ observed_port = v.get("port") ++ observed_settings = dict(sorted(v.all_settings().items())) ++ finally: ++ os.environ.pop("VYPER_FIXTURE_PORT", None) ++ ++ assert result is None ++ assert observed_port == "6200" ++ assert observed_settings == { ++ "debug": False, ++ "host": "127.0.0.1", ++ "port": "6200", ++ } ++ ++ ++def test_explicit_parser_value_overrides_lower_priority_sources_and_set_still_wins(): ++ ++ ++ ++ ++ os.environ["VYPER_FIXTURE_PORT"] = "6200" ++ try: ++ with argv_context(["fixture-probe", "--port", "7000"]): ++ v = Vyper() ++ v.set_default("port", 4000) ++ v.set_config_type("yaml") ++ v.read_config(yaml.safe_dump({"port": 6100, "name": "from-config"})) ++ v.bind_env("port", "VYPER_FIXTURE_PORT") ++ result = v.bind_args(port_parser()) ++ ++ observed_after_args = v.get("port") ++ observed_name = v.get("name") ++ observed_settings_after_args = dict(sorted(v.all_settings().items())) ++ ++ v.set("port", 8000) ++ observed_after_override = v.get("port") ++ observed_settings_after_override = dict(sorted(v.all_settings().items())) ++ finally: ++ os.environ.pop("VYPER_FIXTURE_PORT", None) ++ ++ assert result is None ++ assert observed_after_args == 7000 ++ assert observed_name == "from-config" ++ assert observed_settings_after_args == {"debug": False, "host": "127.0.0.1", "name": "from-config", "port": 7000} ++ assert observed_after_override == 8000 ++ assert observed_settings_after_override == {"debug": False, "host": "127.0.0.1", "name": "from-config", "port": 8000} ++ ++ ++def test_bind_args_mapping_and_bind_arg_values_ignore_null_values(): ++ ++ ++ ++ ++ v = Vyper() ++ ++ first_result = v.bind_args({"port": 7000, "debug": None}) ++ second_result = v.bind_arg_values({"mode": "prod", "workers": 3, "ignored": None}) ++ ++ assert first_result is None ++ assert second_result is None ++ assert v.get("port") == 7000 ++ assert v.get("debug") is None ++ assert v.get("mode") == "prod" ++ assert v.get("workers") == 3 ++ assert v.get("ignored") is None ++ assert v.is_set("debug") is False ++ assert v.is_set("ignored") is False ++ assert sorted(v.all_keys()) == ["mode", "port", "workers"] ++ assert dict(sorted(v.all_settings().items())) == { ++ "mode": "prod", ++ "port": 7000, ++ "workers": 3, ++ } ++ ++ ++def test_direct_single_key_binding_is_case_insensitive_and_stateful(): ++ ++ ++ ++ ++ v = Vyper() ++ ++ first_result = v.bind_arg("FeatureFlag", True) ++ second_result = v.bind_arg_value("MiXeD", "yes") ++ ++ assert first_result is None ++ assert second_result is None ++ assert v.get("featureflag") is True ++ assert v.get("FEATUREFLAG") is True ++ assert v.get("mixed") == "yes" ++ assert v.get("MIXED") == "yes" ++ assert v.is_set("mIxEd") is True ++ assert sorted(v.all_keys()) == ["featureflag", "mixed"] ++ assert dict(sorted(v.all_settings().items())) == { ++ "featureflag": True, ++ "mixed": "yes", ++ } ++ ++ ++def test_bind_arg_value_rejects_null_with_specific_exception(): ++ ++ ++ ++ ++ v = Vyper() ++ ++ ++ with pytest.raises(ValueError): ++ v.bind_arg_value("missing", None) ++ ++ assert v.get("missing") is None ++ assert v.is_set("missing") is False ++ assert sorted(v.all_keys()) == [] ++ assert dict(v.all_settings()) == {} ++ ++ ++def test_argparse_invalid_choice_surfaces_system_exit(): ++ ++ ++ ++ ++ parser = argparse.ArgumentParser(prog="fixture-probe") ++ parser.add_argument("--env", choices=["dev", "prod"]) ++ ++ with argv_context(["fixture-probe", "--env", "qa"]): ++ v = Vyper() ++ with pytest.raises(SystemExit) as exc_info: ++ v.bind_args(parser) ++ ++ ++ assert exc_info.type is SystemExit ++ ++ ++def test_separate_instances_keep_independent_argument_state(): ++ ++ ++ ++ ++ a = Vyper() ++ b = Vyper() ++ ++ a.bind_arg_value("port", 7000) ++ b.bind_arg_values({"port": 5000, "feature": True}) ++ ++ assert a.get("port") == 7000 ++ assert a.get("feature") is None ++ assert sorted(a.all_keys()) == ["port"] ++ assert dict(sorted(a.all_settings().items())) == {"port": 7000} ++ assert b.get("port") == 5000 ++ assert b.get("feature") is True ++ assert sorted(b.all_keys()) == ["feature", "port"] ++ assert dict(sorted(b.all_settings().items())) == {"feature": True, "port": 5000} ++ ++ ++def test_argument_binding_updates_observable_state_across_construct_use_drop_cycles(): ++ ++ ++ ++ ++ for i in range(200): ++ v = Vyper() ++ v.bind_arg_values({"port": i, "mode": "prod"}) ++ assert v.get("mode") == "prod" ++ assert v.is_set("port") is True ++ assert sorted(v.all_keys()) == ["mode", "port"] ++ assert set(v.all_settings()) == {"mode", "port"} ++ del v ++ ++ fresh = Vyper() ++ ++ assert fresh.get("port") is None ++ assert sorted(fresh.all_keys()) == [] +diff --git a/mimo_test_command.sh b/mimo_test_command.sh +new file mode 100755 +--- /dev/null ++++ b/mimo_test_command.sh +@@ -0,0 +1,21 @@ ++#!/usr/bin/env bash ++ ++ ++ ++ ++export NODE_OPTIONS="${NODE_OPTIONS:-} --max-old-space-size=4096" ++export MAVEN_OPTS="${MAVEN_OPTS:-} -Xmx3g -XX:+UseG1GC" ++export GRADLE_OPTS="${GRADLE_OPTS:-} -Xmx3g -XX:+UseG1GC" ++export TEST_JVM_OPTS="${TEST_JVM_OPTS:-} -Xmx3g" ++set -e ++cd /workspace/repo ++set -euo pipefail ++ ++cd /workspace/repo ++ ++ ++ ++export PYTHONPATH="/workspace/repo${PYTHONPATH:+:${PYTHONPATH}}" ++export PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 ++ ++exec python -m pytest /workspace/repo/usercase-test-coderl/test_command_line_argument_binding.py -v diff --git a/tasks/format-code-task-000341/tests/test.sh b/tasks/format-code-task-000341/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..b01872a01f0f060c21bee5759b5cf4fb414172c4 --- /dev/null +++ b/tasks/format-code-task-000341/tests/test.sh @@ -0,0 +1,38 @@ +#!/bin/bash +# Code grading, mimoagent opensource_code.py: reset the files the hidden test patch touches, apply it, run the +# task's test command; reward 1 when it exits 0. A testbed failure (reset or apply) writes no reward: not scored. +M=/var/lib/mimo +CWD=/workspace/repo +V=/logs/verifier +mkdir -p "$V" +BASE=$(cat "$M/base" 2>/dev/null) || { echo "setup never ran (no $M/base)" >&2; exit 1; } +cd "$CWD" || exit 1 +if [ -d "$M/git-hidden" ]; then rm -rf "$CWD/.git"; mv "$M/git-hidden" "$CWD/.git"; fi +# the agent's change against the base, so its own commits count too +git add -A >/dev/null 2>&1 && git -c core.fileMode=false diff --cached "$BASE" > "$V/agent.diff" +git reset -q +if ! ( +while IFS= read -r tf; do + [ -z "$tf" ] && continue + if git cat-file -e $BASE:"$tf" 2>/dev/null; then + git checkout $BASE -- "$tf" 2>/dev/null || true + else + git rm -f --cached "$tf" >/dev/null 2>&1 || true + rm -f "$tf" + fi +done <<'EOF_RESET_TEST_FILES' +usercase-test-coderl/test_command_line_argument_binding.py +mimo_test_command.sh +EOF_RESET_TEST_FILES + +); then echo "could not reset the test files (testbed problem, not scored)" >&2; exit 1; fi +if ! git apply --verbose /tests/test.patch > "$V/apply.log" 2>&1; then + cat "$V/apply.log" >&2 + echo "the hidden tests could not be applied (testbed problem, not scored)" >&2 + exit 1 +fi +timeout 1800 sh -c "$(cat /tests/test_command.sh)" > "$V/test_output.log" 2>&1 +RC=$? +tail -c 12000 "$V/test_output.log" +if [ $RC -eq 0 ]; then echo 1 > "$V/reward.txt"; else echo 0 > "$V/reward.txt"; fi +echo "test command exited $RC" diff --git a/tasks/format-code-task-000341/tests/test_command.sh b/tasks/format-code-task-000341/tests/test_command.sh new file mode 100644 index 0000000000000000000000000000000000000000..88cb7810b836396c4869db31aeac7d4d4b189685 --- /dev/null +++ b/tasks/format-code-task-000341/tests/test_command.sh @@ -0,0 +1 @@ +bash /workspace/repo/mimo_test_command.sh \ No newline at end of file diff --git a/tasks/format-code-task-000346/environment/Dockerfile b/tasks/format-code-task-000346/environment/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..ba3491326766dc0ee19e4dec487b5897b2db4e82 --- /dev/null +++ b/tasks/format-code-task-000346/environment/Dockerfile @@ -0,0 +1,3 @@ +# The task's image, pinned by digest (the same as [environment].docker_image). +# Setup runs at start from [environment.healthcheck]; environment/setup/ is its readable copy. +FROM docker.io/xiaomimimo/mimo-v2.6-rl-oss@sha256:0f16cc588518f47f75acd9e162150d610ec14ef15147f3a61be81672001cdc3c diff --git a/tasks/format-code-task-000346/environment/setup/files/blocklist b/tasks/format-code-task-000346/environment/setup/files/blocklist new file mode 100644 index 0000000000000000000000000000000000000000..a8e4bdc4c7d9b739c047a3cb58ea72a1bb05bcbc --- /dev/null +++ b/tasks/format-code-task-000346/environment/setup/files/blocklist @@ -0,0 +1,33 @@ +# mimo answer-leak blocklist (mimoagent) +0.0.0.0 github.com +0.0.0.0 www.github.com +0.0.0.0 api.github.com +0.0.0.0 raw.githubusercontent.com +0.0.0.0 codeload.github.com +0.0.0.0 objects.githubusercontent.com +0.0.0.0 gist.github.com +0.0.0.0 gist.githubusercontent.com +0.0.0.0 gitlab.com +0.0.0.0 bitbucket.org +0.0.0.0 sourceforge.net +0.0.0.0 git.kernel.org +0.0.0.0 chromium.googlesource.com +0.0.0.0 android.googlesource.com +0.0.0.0 sourcegraph.com +0.0.0.0 bugs.chromium.org +0.0.0.0 issues.oss-fuzz.com +0.0.0.0 oss-fuzz.com +0.0.0.0 osv.dev +0.0.0.0 api.osv.dev +0.0.0.0 bugzilla.mozilla.org +0.0.0.0 proxy.golang.org +0.0.0.0 sum.golang.org +0.0.0.0 pkg.go.dev +0.0.0.0 google.com +0.0.0.0 www.google.com +0.0.0.0 bing.com +0.0.0.0 www.bing.com +0.0.0.0 duckduckgo.com +0.0.0.0 html.duckduckgo.com +0.0.0.0 search.brave.com +0.0.0.0 stackoverflow.com diff --git a/tasks/format-code-task-000346/environment/setup/setup.sh b/tasks/format-code-task-000346/environment/setup/setup.sh new file mode 100644 index 0000000000000000000000000000000000000000..d883db90cfcfb48f7a139861bbe9f6b5d95cad6f --- /dev/null +++ b/tasks/format-code-task-000346/environment/setup/setup.sh @@ -0,0 +1,34 @@ +#!/bin/bash +# Runs once, as root, before the agent starts: Harbor's [environment.healthcheck] unpacks this folder into +# /var/lib/mimo and runs it. Generated by mimo_harbor; see its README for how each step maps to Xiaomi's harness. +M=/var/lib/mimo +[ -f "$M/ready" ] && exit 0 +chmod 700 "$M" +fail() { echo "setup: $*" >&2; exit 1; } +# the answer-leak blocklist (mimoagent), applied to /etc/hosts by the agent right after it installs +write_blocklist() { cp "$M/files/blocklist" "$M/blocklist"; } + +# Code: mimoagent environments/datasets/opensource_code.py + base.py, as the explorer runs it (app/runner/domains.py Code). +CWD=/testbed +git config --global --add safe.directory "$CWD" +cd "$CWD" || fail "no working directory $CWD" +if ! git rev-parse --git-dir >/dev/null 2>&1; then # a bare source tree: give it a baseline commit + git init -q && git add -A && git -c user.name=mimo -c user.email=mimo@localhost commit -q -m baseline --allow-empty +fi +BASE=$(git rev-parse HEAD 2>/dev/null) +[ ${#BASE} -eq 40 ] || fail "could not resolve the base commit in $CWD" +echo "$BASE" > "$M/base" +# Images are built with history truncated at the base. If one is not, the fix could be read out of git log, +# so .git is hidden while the agent works and put back for grading. +LATER=$(git rev-list --all --not "$BASE" 2>/dev/null | head -n 5 | grep -c . || true) +rm -f /tmp/fail.log /tmp/pass.log /tmp/patch.diff /tmp/test_patch.diff /tmp/*.log 2>/dev/null; rm -rf /tmp/claude-0 /tmp/claude-* /tmp/testem-* /tmp/puppeteer_dev_chrome_profile-* 2>/dev/null; rm -f /tmp/test_files.json 2>/dev/null; rm -rf /tmp/jest_* /tmp/jest-* /tmp/build /tmp/build_env 2>/dev/null; rm -rf /tmp/pytest-of-root /tmp/pytest-* /tmp/.pytest_cache /tmp/__pycache__ 2>/dev/null; rm -rf /tmp/go-build* /tmp/standards /tmp/wordpress /tmp/zig-* /tmp/testbase /tmp/testbed 2>/dev/null; rm -f /tmp/tmp*.tmp /tmp/*.bak /tmp/expect* /tmp/butwas* 2>/dev/null; rm -rf /root/.cache/go-build 2>/dev/null; rm -rf /tests 2>/dev/null; find /logs -mindepth 1 -delete 2>/dev/null; mkdir -p /logs/agent /logs/verifier /logs/artifacts; chmod 777 /logs/agent /logs/verifier /logs/artifacts; find /var/log -type f -delete 2>/dev/null || true; rm -rf /var/lib/postgresql/*/*/log /var/lib/postgresql/*/*/pg_log 2>/dev/null || true; find /var/lib/mysql /var/lib/mongodb -type f -name '*.log' -delete 2>/dev/null || true; rm -rf /root/.npm/_logs /root/.babel.json /root/.pytest_cache 2>/dev/null || true; find / -maxdepth 4 -xdev -name task_description.md -path '*/.build_env/*' -delete 2>/dev/null || true; true +git clean -fdx --exclude=node_modules --exclude=bower_components --exclude=.husky --exclude=vendor --exclude=third_party --exclude=_deps --exclude=vcpkg_installed --exclude=.venv --exclude=venv --exclude=.gradle --exclude=target --exclude=.build --exclude=lib --exclude=.bundle --exclude=Manifest.toml --exclude=_build --exclude=.stack-work --exclude=dist-newstyle >/dev/null 2>&1 +find /root/.m2 -type f \( -name '*-SNAPSHOT.jar' -o -name '*-SNAPSHOT-sources.jar' -o -name '*-SNAPSHOT-tests.jar' -o -name '*-SNAPSHOT-test-sources.jar' \) -delete 2>/dev/null; rm -rf /root/.julia/compiled 2>/dev/null; rm -rf /root/.gradle/caches/build-cache-* /root/.gradle/daemon 2>/dev/null; rm -rf /root/.gradle/caches/*/scripts /root/.gradle/caches/jars-* 2>/dev/null; rm -rf /root/.cache/bazel 2>/dev/null; true +if [ "$LATER" -gt 0 ]; then + mv "$CWD/.git" "$M/git-hidden" + echo "history not truncated at ${BASE:0:12}: .git hidden while the agent works" +fi +write_blocklist + +touch "$M/ready" +echo "setup done" diff --git a/tasks/format-code-task-000346/tests/test.patch b/tasks/format-code-task-000346/tests/test.patch new file mode 100644 index 0000000000000000000000000000000000000000..d3f311bdbd76874316f82484ee9a493071335e78 --- /dev/null +++ b/tasks/format-code-task-000346/tests/test.patch @@ -0,0 +1,136 @@ +diff --git a/cmd_sorted_set_test.go b/cmd_sorted_set_test.go +index f6404715..7cb73c37 100644 +--- a/cmd_sorted_set_test.go ++++ b/cmd_sorted_set_test.go +@@ -1109,6 +1109,79 @@ func TestSortedSetScore(t *testing.T) { + }) + } + ++ ++func TestSortedSetMultiScore(t *testing.T) { ++ s, err := Run() ++ ok(t, err) ++ defer s.Close() ++ c, err := proto.Dial(s.Addr()) ++ ok(t, err) ++ defer c.Close() ++ ++ s.ZAdd("z", 1, "one") ++ s.ZAdd("z", 2, "two") ++ s.ZAdd("z", 2, "zwei") ++ ++ ++ mustDo(t, c, ++ "ZMSCORE", "z", "two", ++ proto.Strings("2"), ++ ) ++ ++ ++ mustDo(t, c, ++ "ZMSCORE", "z", "one", "two", ++ proto.Strings("1", "2"), ++ ) ++ ++ ++ mustDo(t, c, ++ "ZMSCORE", "z", "one", "two", "zwei", ++ proto.Strings("1", "2", "2"), ++ ) ++ ++ ++ mustDo(t, c, "ZMSCORE", "z", "nosuch", ++ proto.Array(proto.Nil), ++ ) ++ ++ ++ mustDo(t, c, "ZMSCORE", "z", "nosuch", "two", ++ proto.Array(proto.Nil, proto.String("2")), ++ ) ++ ++ ++ mustNil(t, c, ++ "ZSCORE", "nosuch", "nosuch", ++ ) ++ ++ ++ { ++ s.ZAdd("z2", 1, "one") ++ s.ZAdd("z2", 2, "two") ++ scores, err := s.ZMScore("z2", "one", "two") ++ ok(t, err) ++ equals(t, []float64{1.0, 2.0}, scores) ++ } ++ ++ t.Run("errors", func(t *testing.T) { ++ mustDo(t, c, ++ "ZMSCORE", ++ proto.Error(errWrongNumber("zmscore")), ++ ) ++ mustDo(t, c, ++ "ZMSCORE", "key", ++ proto.Error(errWrongNumber("zmscore")), ++ ) ++ ++ s.Set("str", "value") ++ mustDo(t, c, ++ "ZMSCORE", "str", "aap", ++ proto.Error(msgWrongType), ++ ) ++ }) ++} ++ + // Test ZRANGEBYLEX, ZREVRANGEBYLEX, ZLEXCOUNT + func TestSortedSetRangeByLex(t *testing.T) { + s, err := Run() +diff --git a/integration/sorted_set_test.go b/integration/sorted_set_test.go +index 6633f90a..e6312d56 100644 +--- a/integration/sorted_set_test.go ++++ b/integration/sorted_set_test.go +@@ -891,3 +891,24 @@ func TestZrandmember(t *testing.T) { + c.Error("not an integer", "ZRANDMEMBER", "q", "two") + }) + } ++ ++func TestZMScore(t *testing.T) { ++ testRaw(t, func(c *client) { ++ c.Do("ZADD", "q", "1.0", "key1") ++ c.Do("ZADD", "q", "2.0", "key2") ++ c.Do("ZADD", "q", "3.0", "key3") ++ c.Do("ZADD", "q", "4.0", "key4") ++ c.Do("ZADD", "q", "5.0", "key5") ++ ++ c.Do("ZMSCORE", "q", "key1") ++ c.Do("ZMSCORE", "q", "key1 key2 key3") ++ c.Do("ZMSCORE", "q", "nosuch") ++ c.Do("ZMSCORE", "nosuch", "key1") ++ c.Do("ZMSCORE", "nosuch", "key1", "key2") ++ ++ ++ c.Error("wrong number", "ZMSCORE", "q") ++ c.Do("SET", "str", "I am a string") ++ c.Error("wrong kind", "ZMSCORE", "str", "key1") ++ }) ++} +diff --git a/mimo_build_env.tar.gz.b64 b/mimo_build_env.tar.gz.b64 +new file mode 100644 +--- /dev/null ++++ b/mimo_build_env.tar.gz.b64 +@@ -0,0 +1,7 @@ ++H4sIAAAAAAAAA+3TQU/CMBQH8J35FC8xET1sbIyNk9456IFx4rKUrZmLtiVtRzz44e02I4tGSQiE ++GP+/S1/bx3iPx4JNU7+UOZe7iXcuoTNPkm51vq5dHCXTKErDNI0jL2yjqUfJ2SoaaIxlmsjTStnf ++8g7d/1HBfv6WG5sXSggmy8A8ne47Ds0/nc8+55/ELi+apXHoUXi6En72z+dflNQNfsPL0RUtG0mN ++rC21R4ZqSYUoc6O05W7hNm/Pg0rRTftz0JYVz6zityN30t6QvyO/UI20dxH5thZcNZbiMDTka/fo ++8colZd3TMm7f2t3CmIZHYRevTcFkH7kilDRWaT7Y92EtLdf7qyxbMlnxMQU0vb+OPppokyrNrPvU ++vpfB4eR7T6PF48qVfXwrR5W/3qqtqKVgr/1Wu5dPcLHhut8/ZIVLdd1NhtX3rV76vwMAAAAAAAAA ++AAAAAAAAAAAAl/cOedLiigAoAAA= +diff --git a/mimo_test_command.sh b/mimo_test_command.sh +new file mode 100755 +--- /dev/null ++++ b/mimo_test_command.sh +@@ -0,0 +1,6 @@ ++#!/usr/bin/env bash ++ ++set -uo pipefail ++cd /testbed || exit 1 ++base64 -d mimo_build_env.tar.gz.b64 | tar -xzf - -C /testbed || exit 1 ++exec bash -lc 'cd /testbed && bash -eo pipefail /testbed/.build_env/test_command.sh' diff --git a/tasks/format-code-task-000346/tests/test.sh b/tasks/format-code-task-000346/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..b63aecc9ea10fc7a3c5e41c0c05d83a517e9d728 --- /dev/null +++ b/tasks/format-code-task-000346/tests/test.sh @@ -0,0 +1,40 @@ +#!/bin/bash +# Code grading, mimoagent opensource_code.py: reset the files the hidden test patch touches, apply it, run the +# task's test command; reward 1 when it exits 0. A testbed failure (reset or apply) writes no reward: not scored. +M=/var/lib/mimo +CWD=/testbed +V=/logs/verifier +mkdir -p "$V" +BASE=$(cat "$M/base" 2>/dev/null) || { echo "setup never ran (no $M/base)" >&2; exit 1; } +cd "$CWD" || exit 1 +if [ -d "$M/git-hidden" ]; then rm -rf "$CWD/.git"; mv "$M/git-hidden" "$CWD/.git"; fi +# the agent's change against the base, so its own commits count too +git add -A >/dev/null 2>&1 && git -c core.fileMode=false diff --cached "$BASE" > "$V/agent.diff" +git reset -q +if ! ( +while IFS= read -r tf; do + [ -z "$tf" ] && continue + if git cat-file -e $BASE:"$tf" 2>/dev/null; then + git checkout $BASE -- "$tf" 2>/dev/null || true + else + git rm -f --cached "$tf" >/dev/null 2>&1 || true + rm -f "$tf" + fi +done <<'EOF_RESET_TEST_FILES' +cmd_sorted_set_test.go +integration/sorted_set_test.go +mimo_build_env.tar.gz.b64 +mimo_test_command.sh +EOF_RESET_TEST_FILES + +); then echo "could not reset the test files (testbed problem, not scored)" >&2; exit 1; fi +if ! git apply --verbose /tests/test.patch > "$V/apply.log" 2>&1; then + cat "$V/apply.log" >&2 + echo "the hidden tests could not be applied (testbed problem, not scored)" >&2 + exit 1 +fi +timeout 1800 sh -c "$(cat /tests/test_command.sh)" > "$V/test_output.log" 2>&1 +RC=$? +tail -c 12000 "$V/test_output.log" +if [ $RC -eq 0 ]; then echo 1 > "$V/reward.txt"; else echo 0 > "$V/reward.txt"; fi +echo "test command exited $RC" diff --git a/tasks/format-code-task-000346/tests/test_command.sh b/tasks/format-code-task-000346/tests/test_command.sh new file mode 100644 index 0000000000000000000000000000000000000000..7cb23076694ad17d72e8296d62b2b240083e36db --- /dev/null +++ b/tasks/format-code-task-000346/tests/test_command.sh @@ -0,0 +1 @@ +bash /testbed/mimo_test_command.sh \ No newline at end of file diff --git a/tasks/format-code-task-000379/environment/Dockerfile b/tasks/format-code-task-000379/environment/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..977e53e82857536f365e3015997b67a30baa4ce9 --- /dev/null +++ b/tasks/format-code-task-000379/environment/Dockerfile @@ -0,0 +1,3 @@ +# The task's image, pinned by digest (the same as [environment].docker_image). +# Setup runs at start from [environment.healthcheck]; environment/setup/ is its readable copy. +FROM docker.io/xiaomimimo/mimo-v2.6-rl-oss@sha256:3afe070c45e5dfbf2389a598691d9486facce19c2d509c03215a3a516e44a885 diff --git a/tasks/format-code-task-000379/environment/setup/files/blocklist b/tasks/format-code-task-000379/environment/setup/files/blocklist new file mode 100644 index 0000000000000000000000000000000000000000..a8e4bdc4c7d9b739c047a3cb58ea72a1bb05bcbc --- /dev/null +++ b/tasks/format-code-task-000379/environment/setup/files/blocklist @@ -0,0 +1,33 @@ +# mimo answer-leak blocklist (mimoagent) +0.0.0.0 github.com +0.0.0.0 www.github.com +0.0.0.0 api.github.com +0.0.0.0 raw.githubusercontent.com +0.0.0.0 codeload.github.com +0.0.0.0 objects.githubusercontent.com +0.0.0.0 gist.github.com +0.0.0.0 gist.githubusercontent.com +0.0.0.0 gitlab.com +0.0.0.0 bitbucket.org +0.0.0.0 sourceforge.net +0.0.0.0 git.kernel.org +0.0.0.0 chromium.googlesource.com +0.0.0.0 android.googlesource.com +0.0.0.0 sourcegraph.com +0.0.0.0 bugs.chromium.org +0.0.0.0 issues.oss-fuzz.com +0.0.0.0 oss-fuzz.com +0.0.0.0 osv.dev +0.0.0.0 api.osv.dev +0.0.0.0 bugzilla.mozilla.org +0.0.0.0 proxy.golang.org +0.0.0.0 sum.golang.org +0.0.0.0 pkg.go.dev +0.0.0.0 google.com +0.0.0.0 www.google.com +0.0.0.0 bing.com +0.0.0.0 www.bing.com +0.0.0.0 duckduckgo.com +0.0.0.0 html.duckduckgo.com +0.0.0.0 search.brave.com +0.0.0.0 stackoverflow.com diff --git a/tasks/format-code-task-000379/environment/setup/setup.sh b/tasks/format-code-task-000379/environment/setup/setup.sh new file mode 100644 index 0000000000000000000000000000000000000000..d883db90cfcfb48f7a139861bbe9f6b5d95cad6f --- /dev/null +++ b/tasks/format-code-task-000379/environment/setup/setup.sh @@ -0,0 +1,34 @@ +#!/bin/bash +# Runs once, as root, before the agent starts: Harbor's [environment.healthcheck] unpacks this folder into +# /var/lib/mimo and runs it. Generated by mimo_harbor; see its README for how each step maps to Xiaomi's harness. +M=/var/lib/mimo +[ -f "$M/ready" ] && exit 0 +chmod 700 "$M" +fail() { echo "setup: $*" >&2; exit 1; } +# the answer-leak blocklist (mimoagent), applied to /etc/hosts by the agent right after it installs +write_blocklist() { cp "$M/files/blocklist" "$M/blocklist"; } + +# Code: mimoagent environments/datasets/opensource_code.py + base.py, as the explorer runs it (app/runner/domains.py Code). +CWD=/testbed +git config --global --add safe.directory "$CWD" +cd "$CWD" || fail "no working directory $CWD" +if ! git rev-parse --git-dir >/dev/null 2>&1; then # a bare source tree: give it a baseline commit + git init -q && git add -A && git -c user.name=mimo -c user.email=mimo@localhost commit -q -m baseline --allow-empty +fi +BASE=$(git rev-parse HEAD 2>/dev/null) +[ ${#BASE} -eq 40 ] || fail "could not resolve the base commit in $CWD" +echo "$BASE" > "$M/base" +# Images are built with history truncated at the base. If one is not, the fix could be read out of git log, +# so .git is hidden while the agent works and put back for grading. +LATER=$(git rev-list --all --not "$BASE" 2>/dev/null | head -n 5 | grep -c . || true) +rm -f /tmp/fail.log /tmp/pass.log /tmp/patch.diff /tmp/test_patch.diff /tmp/*.log 2>/dev/null; rm -rf /tmp/claude-0 /tmp/claude-* /tmp/testem-* /tmp/puppeteer_dev_chrome_profile-* 2>/dev/null; rm -f /tmp/test_files.json 2>/dev/null; rm -rf /tmp/jest_* /tmp/jest-* /tmp/build /tmp/build_env 2>/dev/null; rm -rf /tmp/pytest-of-root /tmp/pytest-* /tmp/.pytest_cache /tmp/__pycache__ 2>/dev/null; rm -rf /tmp/go-build* /tmp/standards /tmp/wordpress /tmp/zig-* /tmp/testbase /tmp/testbed 2>/dev/null; rm -f /tmp/tmp*.tmp /tmp/*.bak /tmp/expect* /tmp/butwas* 2>/dev/null; rm -rf /root/.cache/go-build 2>/dev/null; rm -rf /tests 2>/dev/null; find /logs -mindepth 1 -delete 2>/dev/null; mkdir -p /logs/agent /logs/verifier /logs/artifacts; chmod 777 /logs/agent /logs/verifier /logs/artifacts; find /var/log -type f -delete 2>/dev/null || true; rm -rf /var/lib/postgresql/*/*/log /var/lib/postgresql/*/*/pg_log 2>/dev/null || true; find /var/lib/mysql /var/lib/mongodb -type f -name '*.log' -delete 2>/dev/null || true; rm -rf /root/.npm/_logs /root/.babel.json /root/.pytest_cache 2>/dev/null || true; find / -maxdepth 4 -xdev -name task_description.md -path '*/.build_env/*' -delete 2>/dev/null || true; true +git clean -fdx --exclude=node_modules --exclude=bower_components --exclude=.husky --exclude=vendor --exclude=third_party --exclude=_deps --exclude=vcpkg_installed --exclude=.venv --exclude=venv --exclude=.gradle --exclude=target --exclude=.build --exclude=lib --exclude=.bundle --exclude=Manifest.toml --exclude=_build --exclude=.stack-work --exclude=dist-newstyle >/dev/null 2>&1 +find /root/.m2 -type f \( -name '*-SNAPSHOT.jar' -o -name '*-SNAPSHOT-sources.jar' -o -name '*-SNAPSHOT-tests.jar' -o -name '*-SNAPSHOT-test-sources.jar' \) -delete 2>/dev/null; rm -rf /root/.julia/compiled 2>/dev/null; rm -rf /root/.gradle/caches/build-cache-* /root/.gradle/daemon 2>/dev/null; rm -rf /root/.gradle/caches/*/scripts /root/.gradle/caches/jars-* 2>/dev/null; rm -rf /root/.cache/bazel 2>/dev/null; true +if [ "$LATER" -gt 0 ]; then + mv "$CWD/.git" "$M/git-hidden" + echo "history not truncated at ${BASE:0:12}: .git hidden while the agent works" +fi +write_blocklist + +touch "$M/ready" +echo "setup done" diff --git a/tasks/format-code-task-000379/tests/test.patch b/tasks/format-code-task-000379/tests/test.patch new file mode 100644 index 0000000000000000000000000000000000000000..6023c9b97c1b76adbd16188d14a1df9f61da3a66 --- /dev/null +++ b/tasks/format-code-task-000379/tests/test.patch @@ -0,0 +1,97 @@ +diff --git a/tests/test_modes.py b/tests/test_modes.py +index bf1d494..1f11bf3 100644 +--- a/tests/test_modes.py ++++ b/tests/test_modes.py +@@ -33,6 +33,10 @@ def test_should_return_git_status_command(self): + assert isinstance(command, list) + assert mode.command() == ["git", "status", "--short"] + ++ def test_should_not_warn_about_main_branch(self, recwarn): ++ Unstaged([]) ++ assert len(recwarn) == 0 ++ + @pytest.mark.parametrize( + "line,expected_line", + [ +@@ -101,6 +105,11 @@ def test_should_return_command_that_list_all_changed_files(self): + "main", + ] + ++ def test_should_warn_about_main_branch(self, recwarn): ++ Branch([]) ++ assert len(recwarn) == 1 ++ assert str(recwarn[0].message) == "Now `main` is the default parent branch" ++ + def test_should_return_command_that_list_all_changed_files_for_different_branch( + self, + ): +diff --git a/tests/test_pytest_picked.py b/tests/test_pytest_picked.py +index d14234b..fb2bedb 100644 +--- a/tests/test_pytest_picked.py ++++ b/tests/test_pytest_picked.py +@@ -157,7 +157,7 @@ def test_should_match_with_the_begin_of_path(testdir, tmpdir, tmpdir_factory): + ) + + +-def test_should_accept_branch_as_mode(testdir, tmpdir): ++def test_should_accept_branch_as_mode(testdir, tmpdir, recwarn): + with patch("pytest_picked.modes.subprocess.run") as subprocess_mock: + output = b"M test_flows.py\nA test_serializers.py\n" + subprocess_mock.return_value.stdout = output +@@ -182,6 +182,36 @@ def test_sth(): + "Changed test folders... 0. []", + ] + ) ++ assert len(recwarn) == 1 ++ assert str(recwarn[0].message) == "Now `main` is the default parent branch" ++ ++ ++def test_should_accept_unstaged_as_mode(testdir, tmpdir, recwarn): ++ with patch("pytest_picked.modes.subprocess.run") as subprocess_mock: ++ output = b" M test_flows.py\nA test_serializers.py\n" ++ subprocess_mock.return_value.stdout = output ++ ++ result = testdir.runpytest("--picked", "--mode=unstaged") ++ testdir.makepyfile( ++ ".py", ++ test_flows=""" ++ def test_sth(): ++ assert True ++ """, ++ test_serializers=""" ++ def test_sth(): ++ assert True ++ """, ++ ) ++ tmpdir.mkdir("tests") ++ result.stdout.fnmatch_lines( ++ [ ++ "Changed test files... 2. " ++ + "['test_flows.py', 'test_serializers.py']", ++ "Changed test folders... 0. []", ++ ] ++ ) ++ assert len(recwarn) == 0 + + + def test_should_not_run_the_tests_if_mode_is_invalid(testdir, tmpdir): +diff --git a/mimo_build_env.tar.gz.b64 b/mimo_build_env.tar.gz.b64 +new file mode 100644 +--- /dev/null ++++ b/mimo_build_env.tar.gz.b64 +@@ -0,0 +1,4 @@ ++H4sIAAAAAAAAA+3S0QrCIBiGYY93Fd5Aa26zXc6oKRS1OdKC7j5bUBHUThYRvc+Byv8LKp/p6rDZ ++mdp2x7n4lCyqtB7m6Hke1krnKldqUapCZErpSgupP3ajBwcflnspxd658G7fWP9Hpff8g/Whblzb ++LjuT+vV0Z4zlH4O/5V9Uecy/XGSVkNl0V3jtz/NvjByCX1mT9Kewdl0hZ62My1iUl8FfP0brjPVp ++f3qsXXfV/abZWnPpzY7Jtx8EAAAAAAAAAAAAAAAA/JEzgwTAbQAoAAA= +diff --git a/mimo_test_command.sh b/mimo_test_command.sh +new file mode 100755 +--- /dev/null ++++ b/mimo_test_command.sh +@@ -0,0 +1,6 @@ ++#!/usr/bin/env bash ++ ++set -uo pipefail ++cd /testbed || exit 1 ++base64 -d mimo_build_env.tar.gz.b64 | tar -xzf - -C /testbed || exit 1 ++exec bash -lc 'cd /testbed && bash -eo pipefail /testbed/.build_env/test_command.sh' diff --git a/tasks/format-code-task-000379/tests/test.sh b/tasks/format-code-task-000379/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..c79d370aedf2ea676d988b43dad6ec5e98b5d13d --- /dev/null +++ b/tasks/format-code-task-000379/tests/test.sh @@ -0,0 +1,40 @@ +#!/bin/bash +# Code grading, mimoagent opensource_code.py: reset the files the hidden test patch touches, apply it, run the +# task's test command; reward 1 when it exits 0. A testbed failure (reset or apply) writes no reward: not scored. +M=/var/lib/mimo +CWD=/testbed +V=/logs/verifier +mkdir -p "$V" +BASE=$(cat "$M/base" 2>/dev/null) || { echo "setup never ran (no $M/base)" >&2; exit 1; } +cd "$CWD" || exit 1 +if [ -d "$M/git-hidden" ]; then rm -rf "$CWD/.git"; mv "$M/git-hidden" "$CWD/.git"; fi +# the agent's change against the base, so its own commits count too +git add -A >/dev/null 2>&1 && git -c core.fileMode=false diff --cached "$BASE" > "$V/agent.diff" +git reset -q +if ! ( +while IFS= read -r tf; do + [ -z "$tf" ] && continue + if git cat-file -e $BASE:"$tf" 2>/dev/null; then + git checkout $BASE -- "$tf" 2>/dev/null || true + else + git rm -f --cached "$tf" >/dev/null 2>&1 || true + rm -f "$tf" + fi +done <<'EOF_RESET_TEST_FILES' +tests/test_modes.py +tests/test_pytest_picked.py +mimo_build_env.tar.gz.b64 +mimo_test_command.sh +EOF_RESET_TEST_FILES + +); then echo "could not reset the test files (testbed problem, not scored)" >&2; exit 1; fi +if ! git apply --verbose /tests/test.patch > "$V/apply.log" 2>&1; then + cat "$V/apply.log" >&2 + echo "the hidden tests could not be applied (testbed problem, not scored)" >&2 + exit 1 +fi +timeout 1800 sh -c "$(cat /tests/test_command.sh)" > "$V/test_output.log" 2>&1 +RC=$? +tail -c 12000 "$V/test_output.log" +if [ $RC -eq 0 ]; then echo 1 > "$V/reward.txt"; else echo 0 > "$V/reward.txt"; fi +echo "test command exited $RC" diff --git a/tasks/format-code-task-000379/tests/test_command.sh b/tasks/format-code-task-000379/tests/test_command.sh new file mode 100644 index 0000000000000000000000000000000000000000..7cb23076694ad17d72e8296d62b2b240083e36db --- /dev/null +++ b/tasks/format-code-task-000379/tests/test_command.sh @@ -0,0 +1 @@ +bash /testbed/mimo_test_command.sh \ No newline at end of file diff --git a/tasks/format-code-task-000510/environment/Dockerfile b/tasks/format-code-task-000510/environment/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..ae3aed9ae0e0065ffe085d536a35fffaafd9efc2 --- /dev/null +++ b/tasks/format-code-task-000510/environment/Dockerfile @@ -0,0 +1,3 @@ +# The task's image, pinned by digest (the same as [environment].docker_image). +# Setup runs at start from [environment.healthcheck]; environment/setup/ is its readable copy. +FROM docker.io/xiaomimimo/mimo-v2.6-rl-oss@sha256:6ee8b0d8b0f89e11e859284bbfa5504b9ba63cad3321fe6700f71865125b747b diff --git a/tasks/format-code-task-000510/environment/setup/files/blocklist b/tasks/format-code-task-000510/environment/setup/files/blocklist new file mode 100644 index 0000000000000000000000000000000000000000..a8e4bdc4c7d9b739c047a3cb58ea72a1bb05bcbc --- /dev/null +++ b/tasks/format-code-task-000510/environment/setup/files/blocklist @@ -0,0 +1,33 @@ +# mimo answer-leak blocklist (mimoagent) +0.0.0.0 github.com +0.0.0.0 www.github.com +0.0.0.0 api.github.com +0.0.0.0 raw.githubusercontent.com +0.0.0.0 codeload.github.com +0.0.0.0 objects.githubusercontent.com +0.0.0.0 gist.github.com +0.0.0.0 gist.githubusercontent.com +0.0.0.0 gitlab.com +0.0.0.0 bitbucket.org +0.0.0.0 sourceforge.net +0.0.0.0 git.kernel.org +0.0.0.0 chromium.googlesource.com +0.0.0.0 android.googlesource.com +0.0.0.0 sourcegraph.com +0.0.0.0 bugs.chromium.org +0.0.0.0 issues.oss-fuzz.com +0.0.0.0 oss-fuzz.com +0.0.0.0 osv.dev +0.0.0.0 api.osv.dev +0.0.0.0 bugzilla.mozilla.org +0.0.0.0 proxy.golang.org +0.0.0.0 sum.golang.org +0.0.0.0 pkg.go.dev +0.0.0.0 google.com +0.0.0.0 www.google.com +0.0.0.0 bing.com +0.0.0.0 www.bing.com +0.0.0.0 duckduckgo.com +0.0.0.0 html.duckduckgo.com +0.0.0.0 search.brave.com +0.0.0.0 stackoverflow.com diff --git a/tasks/format-code-task-000510/environment/setup/setup.sh b/tasks/format-code-task-000510/environment/setup/setup.sh new file mode 100644 index 0000000000000000000000000000000000000000..d883db90cfcfb48f7a139861bbe9f6b5d95cad6f --- /dev/null +++ b/tasks/format-code-task-000510/environment/setup/setup.sh @@ -0,0 +1,34 @@ +#!/bin/bash +# Runs once, as root, before the agent starts: Harbor's [environment.healthcheck] unpacks this folder into +# /var/lib/mimo and runs it. Generated by mimo_harbor; see its README for how each step maps to Xiaomi's harness. +M=/var/lib/mimo +[ -f "$M/ready" ] && exit 0 +chmod 700 "$M" +fail() { echo "setup: $*" >&2; exit 1; } +# the answer-leak blocklist (mimoagent), applied to /etc/hosts by the agent right after it installs +write_blocklist() { cp "$M/files/blocklist" "$M/blocklist"; } + +# Code: mimoagent environments/datasets/opensource_code.py + base.py, as the explorer runs it (app/runner/domains.py Code). +CWD=/testbed +git config --global --add safe.directory "$CWD" +cd "$CWD" || fail "no working directory $CWD" +if ! git rev-parse --git-dir >/dev/null 2>&1; then # a bare source tree: give it a baseline commit + git init -q && git add -A && git -c user.name=mimo -c user.email=mimo@localhost commit -q -m baseline --allow-empty +fi +BASE=$(git rev-parse HEAD 2>/dev/null) +[ ${#BASE} -eq 40 ] || fail "could not resolve the base commit in $CWD" +echo "$BASE" > "$M/base" +# Images are built with history truncated at the base. If one is not, the fix could be read out of git log, +# so .git is hidden while the agent works and put back for grading. +LATER=$(git rev-list --all --not "$BASE" 2>/dev/null | head -n 5 | grep -c . || true) +rm -f /tmp/fail.log /tmp/pass.log /tmp/patch.diff /tmp/test_patch.diff /tmp/*.log 2>/dev/null; rm -rf /tmp/claude-0 /tmp/claude-* /tmp/testem-* /tmp/puppeteer_dev_chrome_profile-* 2>/dev/null; rm -f /tmp/test_files.json 2>/dev/null; rm -rf /tmp/jest_* /tmp/jest-* /tmp/build /tmp/build_env 2>/dev/null; rm -rf /tmp/pytest-of-root /tmp/pytest-* /tmp/.pytest_cache /tmp/__pycache__ 2>/dev/null; rm -rf /tmp/go-build* /tmp/standards /tmp/wordpress /tmp/zig-* /tmp/testbase /tmp/testbed 2>/dev/null; rm -f /tmp/tmp*.tmp /tmp/*.bak /tmp/expect* /tmp/butwas* 2>/dev/null; rm -rf /root/.cache/go-build 2>/dev/null; rm -rf /tests 2>/dev/null; find /logs -mindepth 1 -delete 2>/dev/null; mkdir -p /logs/agent /logs/verifier /logs/artifacts; chmod 777 /logs/agent /logs/verifier /logs/artifacts; find /var/log -type f -delete 2>/dev/null || true; rm -rf /var/lib/postgresql/*/*/log /var/lib/postgresql/*/*/pg_log 2>/dev/null || true; find /var/lib/mysql /var/lib/mongodb -type f -name '*.log' -delete 2>/dev/null || true; rm -rf /root/.npm/_logs /root/.babel.json /root/.pytest_cache 2>/dev/null || true; find / -maxdepth 4 -xdev -name task_description.md -path '*/.build_env/*' -delete 2>/dev/null || true; true +git clean -fdx --exclude=node_modules --exclude=bower_components --exclude=.husky --exclude=vendor --exclude=third_party --exclude=_deps --exclude=vcpkg_installed --exclude=.venv --exclude=venv --exclude=.gradle --exclude=target --exclude=.build --exclude=lib --exclude=.bundle --exclude=Manifest.toml --exclude=_build --exclude=.stack-work --exclude=dist-newstyle >/dev/null 2>&1 +find /root/.m2 -type f \( -name '*-SNAPSHOT.jar' -o -name '*-SNAPSHOT-sources.jar' -o -name '*-SNAPSHOT-tests.jar' -o -name '*-SNAPSHOT-test-sources.jar' \) -delete 2>/dev/null; rm -rf /root/.julia/compiled 2>/dev/null; rm -rf /root/.gradle/caches/build-cache-* /root/.gradle/daemon 2>/dev/null; rm -rf /root/.gradle/caches/*/scripts /root/.gradle/caches/jars-* 2>/dev/null; rm -rf /root/.cache/bazel 2>/dev/null; true +if [ "$LATER" -gt 0 ]; then + mv "$CWD/.git" "$M/git-hidden" + echo "history not truncated at ${BASE:0:12}: .git hidden while the agent works" +fi +write_blocklist + +touch "$M/ready" +echo "setup done" diff --git a/tasks/format-code-task-000510/tests/test.patch b/tasks/format-code-task-000510/tests/test.patch new file mode 100644 index 0000000000000000000000000000000000000000..b4dd51c5eaae60ad3728d7a603149ac1f527634c --- /dev/null +++ b/tasks/format-code-task-000510/tests/test.patch @@ -0,0 +1,72 @@ +diff --git a/test/EmbeddableDashboardTests.js b/test/EmbeddableDashboardTests.js +index 94404ef..475d6bf 100644 +--- a/test/EmbeddableDashboardTests.js ++++ b/test/EmbeddableDashboardTests.js +@@ -72,4 +72,44 @@ describe('EmbeddableDashboard', function() { + it ('should set correct scrolling attribute for the iframe', () => { + expect(iFrame.scrolling).to.equal('yes'); + }); ++ ++ it ('should use default class name on iframe when className not provided', () => { ++ const opts = Object.assign({}, mockOptions, {container: document.createElement('div')}); ++ delete opts.className; ++ const d = new EmbeddableDashboard(opts); ++ expect(d.iframe.className).to.equal('quicksight-embedding-iframe'); ++ }); ++ ++ it ('should append user className to default class on the iframe', () => { ++ const opts = Object.assign({}, mockOptions, { ++ container: document.createElement('div'), ++ className: 'my-apps-classname' ++ }); ++ const d = new EmbeddableDashboard(opts); ++ const classNames = d.iframe.className.split(/\s+/); ++ expect(classNames).to.contain('quicksight-embedding-iframe'); ++ expect(classNames).to.contain('my-apps-classname'); ++ }); ++ ++ it ('should support the issue example invocation with className option', () => { ++ const opts = { ++ url: mockUrl, ++ container: document.createElement('div'), ++ scrolling: 'no', ++ height: '600px', ++ loadingHeight: '400px', ++ className: 'my-apps-classname' ++ }; ++ const d = new EmbeddableDashboard(opts); ++ const classNames = d.iframe.className.split(/\s+/); ++ expect(classNames).to.contain('quicksight-embedding-iframe'); ++ expect(classNames).to.contain('my-apps-classname'); ++ }); ++ ++ it ('should not include literal "undefined" in className when className not provided', () => { ++ const opts = Object.assign({}, mockOptions, {container: document.createElement('div')}); ++ delete opts.className; ++ const d = new EmbeddableDashboard(opts); ++ expect(d.iframe.className).to.not.contain('undefined'); ++ }); + }); +\ No newline at end of file +diff --git a/test_commands.json b/test_commands.json +new file mode 100644 +index 0000000..2fc57ab +--- /dev/null ++++ b/test_commands.json +@@ -0,0 +1,3 @@ ++{ ++ "test_commands": ["npm test"] ++} +diff --git a/mimo_test_command.sh b/mimo_test_command.sh +new file mode 100755 +--- /dev/null ++++ b/mimo_test_command.sh +@@ -0,0 +1,8 @@ ++#!/usr/bin/env bash ++ ++set -uo pipefail ++cd /testbed ++rc=0 ++npm test ++rc=$(( rc | $? )) ++exit $rc diff --git a/tasks/format-code-task-000510/tests/test.sh b/tasks/format-code-task-000510/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..686c8f09d0991e381a2197c75f1d33408c29c4ca --- /dev/null +++ b/tasks/format-code-task-000510/tests/test.sh @@ -0,0 +1,39 @@ +#!/bin/bash +# Code grading, mimoagent opensource_code.py: reset the files the hidden test patch touches, apply it, run the +# task's test command; reward 1 when it exits 0. A testbed failure (reset or apply) writes no reward: not scored. +M=/var/lib/mimo +CWD=/testbed +V=/logs/verifier +mkdir -p "$V" +BASE=$(cat "$M/base" 2>/dev/null) || { echo "setup never ran (no $M/base)" >&2; exit 1; } +cd "$CWD" || exit 1 +if [ -d "$M/git-hidden" ]; then rm -rf "$CWD/.git"; mv "$M/git-hidden" "$CWD/.git"; fi +# the agent's change against the base, so its own commits count too +git add -A >/dev/null 2>&1 && git -c core.fileMode=false diff --cached "$BASE" > "$V/agent.diff" +git reset -q +if ! ( +while IFS= read -r tf; do + [ -z "$tf" ] && continue + if git cat-file -e $BASE:"$tf" 2>/dev/null; then + git checkout $BASE -- "$tf" 2>/dev/null || true + else + git rm -f --cached "$tf" >/dev/null 2>&1 || true + rm -f "$tf" + fi +done <<'EOF_RESET_TEST_FILES' +test/EmbeddableDashboardTests.js +test_commands.json +mimo_test_command.sh +EOF_RESET_TEST_FILES + +); then echo "could not reset the test files (testbed problem, not scored)" >&2; exit 1; fi +if ! git apply --verbose /tests/test.patch > "$V/apply.log" 2>&1; then + cat "$V/apply.log" >&2 + echo "the hidden tests could not be applied (testbed problem, not scored)" >&2 + exit 1 +fi +timeout 1800 sh -c "$(cat /tests/test_command.sh)" > "$V/test_output.log" 2>&1 +RC=$? +tail -c 12000 "$V/test_output.log" +if [ $RC -eq 0 ]; then echo 1 > "$V/reward.txt"; else echo 0 > "$V/reward.txt"; fi +echo "test command exited $RC" diff --git a/tasks/format-code-task-000510/tests/test_command.sh b/tasks/format-code-task-000510/tests/test_command.sh new file mode 100644 index 0000000000000000000000000000000000000000..7cb23076694ad17d72e8296d62b2b240083e36db --- /dev/null +++ b/tasks/format-code-task-000510/tests/test_command.sh @@ -0,0 +1 @@ +bash /testbed/mimo_test_command.sh \ No newline at end of file diff --git a/tasks/format-code-task-000517/environment/Dockerfile b/tasks/format-code-task-000517/environment/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..7dc21f607d06cbb7b08ebdf3499075e167a7d609 --- /dev/null +++ b/tasks/format-code-task-000517/environment/Dockerfile @@ -0,0 +1,3 @@ +# The task's image, pinned by digest (the same as [environment].docker_image). +# Setup runs at start from [environment.healthcheck]; environment/setup/ is its readable copy. +FROM docker.io/xiaomimimo/mimo-v2.6-rl-oss@sha256:df353a0ef57b30dad087f5275bd48f5bbeb63361a5a4eff12b01a08250ef668d diff --git a/tasks/format-code-task-000517/environment/setup/files/blocklist b/tasks/format-code-task-000517/environment/setup/files/blocklist new file mode 100644 index 0000000000000000000000000000000000000000..a8e4bdc4c7d9b739c047a3cb58ea72a1bb05bcbc --- /dev/null +++ b/tasks/format-code-task-000517/environment/setup/files/blocklist @@ -0,0 +1,33 @@ +# mimo answer-leak blocklist (mimoagent) +0.0.0.0 github.com +0.0.0.0 www.github.com +0.0.0.0 api.github.com +0.0.0.0 raw.githubusercontent.com +0.0.0.0 codeload.github.com +0.0.0.0 objects.githubusercontent.com +0.0.0.0 gist.github.com +0.0.0.0 gist.githubusercontent.com +0.0.0.0 gitlab.com +0.0.0.0 bitbucket.org +0.0.0.0 sourceforge.net +0.0.0.0 git.kernel.org +0.0.0.0 chromium.googlesource.com +0.0.0.0 android.googlesource.com +0.0.0.0 sourcegraph.com +0.0.0.0 bugs.chromium.org +0.0.0.0 issues.oss-fuzz.com +0.0.0.0 oss-fuzz.com +0.0.0.0 osv.dev +0.0.0.0 api.osv.dev +0.0.0.0 bugzilla.mozilla.org +0.0.0.0 proxy.golang.org +0.0.0.0 sum.golang.org +0.0.0.0 pkg.go.dev +0.0.0.0 google.com +0.0.0.0 www.google.com +0.0.0.0 bing.com +0.0.0.0 www.bing.com +0.0.0.0 duckduckgo.com +0.0.0.0 html.duckduckgo.com +0.0.0.0 search.brave.com +0.0.0.0 stackoverflow.com diff --git a/tasks/format-code-task-000517/environment/setup/setup.sh b/tasks/format-code-task-000517/environment/setup/setup.sh new file mode 100644 index 0000000000000000000000000000000000000000..d883db90cfcfb48f7a139861bbe9f6b5d95cad6f --- /dev/null +++ b/tasks/format-code-task-000517/environment/setup/setup.sh @@ -0,0 +1,34 @@ +#!/bin/bash +# Runs once, as root, before the agent starts: Harbor's [environment.healthcheck] unpacks this folder into +# /var/lib/mimo and runs it. Generated by mimo_harbor; see its README for how each step maps to Xiaomi's harness. +M=/var/lib/mimo +[ -f "$M/ready" ] && exit 0 +chmod 700 "$M" +fail() { echo "setup: $*" >&2; exit 1; } +# the answer-leak blocklist (mimoagent), applied to /etc/hosts by the agent right after it installs +write_blocklist() { cp "$M/files/blocklist" "$M/blocklist"; } + +# Code: mimoagent environments/datasets/opensource_code.py + base.py, as the explorer runs it (app/runner/domains.py Code). +CWD=/testbed +git config --global --add safe.directory "$CWD" +cd "$CWD" || fail "no working directory $CWD" +if ! git rev-parse --git-dir >/dev/null 2>&1; then # a bare source tree: give it a baseline commit + git init -q && git add -A && git -c user.name=mimo -c user.email=mimo@localhost commit -q -m baseline --allow-empty +fi +BASE=$(git rev-parse HEAD 2>/dev/null) +[ ${#BASE} -eq 40 ] || fail "could not resolve the base commit in $CWD" +echo "$BASE" > "$M/base" +# Images are built with history truncated at the base. If one is not, the fix could be read out of git log, +# so .git is hidden while the agent works and put back for grading. +LATER=$(git rev-list --all --not "$BASE" 2>/dev/null | head -n 5 | grep -c . || true) +rm -f /tmp/fail.log /tmp/pass.log /tmp/patch.diff /tmp/test_patch.diff /tmp/*.log 2>/dev/null; rm -rf /tmp/claude-0 /tmp/claude-* /tmp/testem-* /tmp/puppeteer_dev_chrome_profile-* 2>/dev/null; rm -f /tmp/test_files.json 2>/dev/null; rm -rf /tmp/jest_* /tmp/jest-* /tmp/build /tmp/build_env 2>/dev/null; rm -rf /tmp/pytest-of-root /tmp/pytest-* /tmp/.pytest_cache /tmp/__pycache__ 2>/dev/null; rm -rf /tmp/go-build* /tmp/standards /tmp/wordpress /tmp/zig-* /tmp/testbase /tmp/testbed 2>/dev/null; rm -f /tmp/tmp*.tmp /tmp/*.bak /tmp/expect* /tmp/butwas* 2>/dev/null; rm -rf /root/.cache/go-build 2>/dev/null; rm -rf /tests 2>/dev/null; find /logs -mindepth 1 -delete 2>/dev/null; mkdir -p /logs/agent /logs/verifier /logs/artifacts; chmod 777 /logs/agent /logs/verifier /logs/artifacts; find /var/log -type f -delete 2>/dev/null || true; rm -rf /var/lib/postgresql/*/*/log /var/lib/postgresql/*/*/pg_log 2>/dev/null || true; find /var/lib/mysql /var/lib/mongodb -type f -name '*.log' -delete 2>/dev/null || true; rm -rf /root/.npm/_logs /root/.babel.json /root/.pytest_cache 2>/dev/null || true; find / -maxdepth 4 -xdev -name task_description.md -path '*/.build_env/*' -delete 2>/dev/null || true; true +git clean -fdx --exclude=node_modules --exclude=bower_components --exclude=.husky --exclude=vendor --exclude=third_party --exclude=_deps --exclude=vcpkg_installed --exclude=.venv --exclude=venv --exclude=.gradle --exclude=target --exclude=.build --exclude=lib --exclude=.bundle --exclude=Manifest.toml --exclude=_build --exclude=.stack-work --exclude=dist-newstyle >/dev/null 2>&1 +find /root/.m2 -type f \( -name '*-SNAPSHOT.jar' -o -name '*-SNAPSHOT-sources.jar' -o -name '*-SNAPSHOT-tests.jar' -o -name '*-SNAPSHOT-test-sources.jar' \) -delete 2>/dev/null; rm -rf /root/.julia/compiled 2>/dev/null; rm -rf /root/.gradle/caches/build-cache-* /root/.gradle/daemon 2>/dev/null; rm -rf /root/.gradle/caches/*/scripts /root/.gradle/caches/jars-* 2>/dev/null; rm -rf /root/.cache/bazel 2>/dev/null; true +if [ "$LATER" -gt 0 ]; then + mv "$CWD/.git" "$M/git-hidden" + echo "history not truncated at ${BASE:0:12}: .git hidden while the agent works" +fi +write_blocklist + +touch "$M/ready" +echo "setup done" diff --git a/tasks/format-code-task-000517/tests/test.patch b/tasks/format-code-task-000517/tests/test.patch new file mode 100644 index 0000000000000000000000000000000000000000..5dbb39abe1da955fbc18d077fbfd3c7ad69e747b --- /dev/null +++ b/tasks/format-code-task-000517/tests/test.patch @@ -0,0 +1,155 @@ +diff --git a/test_commands.json b/test_commands.json +new file mode 100644 +index 00000000..06f804e0 +--- /dev/null ++++ b/test_commands.json +@@ -0,0 +1,3 @@ ++{ ++ "test_commands": ["PYTHONPATH=$(pwd)/src python -m pytest tests/test_pretraining_encode.py -v"] ++} +diff --git a/tests/test_pretraining_encode.py b/tests/test_pretraining_encode.py +new file mode 100644 +index 00000000..3f4b4c77 +--- /dev/null ++++ b/tests/test_pretraining_encode.py +@@ -0,0 +1,127 @@ ++ ++ ++ ++ ++ ++import unittest ++ ++from datasets import Dataset ++from transformers import AutoTokenizer ++ ++from axolotl.utils.data.pretraining import wrap_pretraining_dataset ++from axolotl.utils.dict import DictDefault ++ ++ ++class TestPretrainingNoPacking(unittest.TestCase): ++ ++ ++ @classmethod ++ def setUpClass(cls): ++ cls.tokenizer = AutoTokenizer.from_pretrained("huggyllama/llama-7b") ++ cls.tokenizer.pad_token = "" ++ ++ def test_no_packing_iterates_without_value_error(self): ++ ++ texts = [f"This is example text number {i} with some words to tokenize " * 4 for i in range(40)] ++ dataset = Dataset.from_dict({"text": texts}) ++ cfg = DictDefault({"sample_packing": False}) ++ ++ wrapped = wrap_pretraining_dataset( ++ dataset, ++ self.tokenizer, ++ cfg, ++ ds_wrapper_fn=None, ++ max_tokens=64, ++ batch_size=1, ++ seed=42, ++ buffer_size=10_000, ++ ) ++ ++ samples = list(wrapped) ++ assert len(samples) > 0 ++ for sample in samples: ++ assert "input_ids" in sample ++ assert "labels" in sample ++ assert "attention_mask" in sample ++ ++ def test_no_packing_outputs_padded_to_max_tokens(self): ++ ++ texts = ["hello world how are you today " * 3 for _ in range(30)] ++ dataset = Dataset.from_dict({"text": texts}) ++ cfg = DictDefault({"sample_packing": False}) ++ ++ max_tokens = 48 ++ wrapped = wrap_pretraining_dataset( ++ dataset, ++ self.tokenizer, ++ cfg, ++ ds_wrapper_fn=None, ++ max_tokens=max_tokens, ++ batch_size=1, ++ seed=42, ++ ) ++ ++ samples = list(wrapped) ++ assert len(samples) > 0 ++ for sample in samples: ++ assert len(sample["input_ids"]) == max_tokens ++ assert len(sample["labels"]) == max_tokens ++ assert len(sample["attention_mask"]) == max_tokens ++ ++ def test_no_packing_tokenizes_text_column_content(self): ++ ++ marker = "uniquemarkertoken" ++ texts = [f"{marker} alpha beta gamma delta epsilon zeta eta theta " * 2 for _ in range(20)] ++ dataset = Dataset.from_dict({"text": texts}) ++ cfg = DictDefault({"sample_packing": False}) ++ ++ wrapped = wrap_pretraining_dataset( ++ dataset, ++ self.tokenizer, ++ cfg, ++ ds_wrapper_fn=None, ++ max_tokens=64, ++ batch_size=1, ++ seed=42, ++ ) ++ ++ samples = list(wrapped) ++ assert len(samples) > 0 ++ decoded_first = self.tokenizer.decode(samples[0]["input_ids"]) ++ assert marker in decoded_first, ( ++ f"Expected '{marker}' from text column in decoded output; got: {decoded_first!r}" ++ ) ++ ++ def test_no_packing_with_extra_columns_only_tokenizes_text(self): ++ ++ ++ ++ ++ ++ text_marker = "thetextcolumncontent" ++ meta_marker = "themetadatacontent" ++ texts = [f"{text_marker} alpha beta gamma delta " * 3 for _ in range(20)] ++ metadata = [f"{meta_marker} something irrelevant " * 3 for _ in range(20)] ++ dataset = Dataset.from_dict({"text": texts, "metadata": metadata}) ++ cfg = DictDefault({"sample_packing": False}) ++ ++ wrapped = wrap_pretraining_dataset( ++ dataset, ++ self.tokenizer, ++ cfg, ++ ds_wrapper_fn=None, ++ max_tokens=64, ++ batch_size=1, ++ seed=42, ++ ) ++ ++ samples = list(wrapped) ++ assert len(samples) > 0 ++ ++ all_decoded = " ".join(self.tokenizer.decode(s["input_ids"]) for s in samples) ++ assert text_marker in all_decoded ++ assert meta_marker not in all_decoded ++ ++ ++if __name__ == "__main__": ++ unittest.main() +diff --git a/mimo_test_command.sh b/mimo_test_command.sh +new file mode 100755 +--- /dev/null ++++ b/mimo_test_command.sh +@@ -0,0 +1,8 @@ ++#!/usr/bin/env bash ++ ++set -uo pipefail ++cd /testbed ++rc=0 ++PYTHONPATH=$(pwd)/src python -m pytest tests/test_pretraining_encode.py -v ++rc=$(( rc | $? )) ++exit $rc diff --git a/tasks/format-code-task-000517/tests/test.sh b/tasks/format-code-task-000517/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..7820efc2a3e9abf51440469b0aca86be328528ea --- /dev/null +++ b/tasks/format-code-task-000517/tests/test.sh @@ -0,0 +1,39 @@ +#!/bin/bash +# Code grading, mimoagent opensource_code.py: reset the files the hidden test patch touches, apply it, run the +# task's test command; reward 1 when it exits 0. A testbed failure (reset or apply) writes no reward: not scored. +M=/var/lib/mimo +CWD=/testbed +V=/logs/verifier +mkdir -p "$V" +BASE=$(cat "$M/base" 2>/dev/null) || { echo "setup never ran (no $M/base)" >&2; exit 1; } +cd "$CWD" || exit 1 +if [ -d "$M/git-hidden" ]; then rm -rf "$CWD/.git"; mv "$M/git-hidden" "$CWD/.git"; fi +# the agent's change against the base, so its own commits count too +git add -A >/dev/null 2>&1 && git -c core.fileMode=false diff --cached "$BASE" > "$V/agent.diff" +git reset -q +if ! ( +while IFS= read -r tf; do + [ -z "$tf" ] && continue + if git cat-file -e $BASE:"$tf" 2>/dev/null; then + git checkout $BASE -- "$tf" 2>/dev/null || true + else + git rm -f --cached "$tf" >/dev/null 2>&1 || true + rm -f "$tf" + fi +done <<'EOF_RESET_TEST_FILES' +test_commands.json +tests/test_pretraining_encode.py +mimo_test_command.sh +EOF_RESET_TEST_FILES + +); then echo "could not reset the test files (testbed problem, not scored)" >&2; exit 1; fi +if ! git apply --verbose /tests/test.patch > "$V/apply.log" 2>&1; then + cat "$V/apply.log" >&2 + echo "the hidden tests could not be applied (testbed problem, not scored)" >&2 + exit 1 +fi +timeout 1800 sh -c "$(cat /tests/test_command.sh)" > "$V/test_output.log" 2>&1 +RC=$? +tail -c 12000 "$V/test_output.log" +if [ $RC -eq 0 ]; then echo 1 > "$V/reward.txt"; else echo 0 > "$V/reward.txt"; fi +echo "test command exited $RC" diff --git a/tasks/format-code-task-000517/tests/test_command.sh b/tasks/format-code-task-000517/tests/test_command.sh new file mode 100644 index 0000000000000000000000000000000000000000..7cb23076694ad17d72e8296d62b2b240083e36db --- /dev/null +++ b/tasks/format-code-task-000517/tests/test_command.sh @@ -0,0 +1 @@ +bash /testbed/mimo_test_command.sh \ No newline at end of file diff --git a/tasks/format-code-task-000528/environment/Dockerfile b/tasks/format-code-task-000528/environment/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..f60351c19b90c72fe94ddd2d3f2b9f85cafa79eb --- /dev/null +++ b/tasks/format-code-task-000528/environment/Dockerfile @@ -0,0 +1,3 @@ +# The task's image, pinned by digest (the same as [environment].docker_image). +# Setup runs at start from [environment.healthcheck]; environment/setup/ is its readable copy. +FROM docker.io/xiaomimimo/mimo-v2.6-rl-oss@sha256:d49b5e8c492856926c7c50d516c4d27999cec71c9deeaf006ef9153885653875 diff --git a/tasks/format-code-task-000528/environment/setup/files/blocklist b/tasks/format-code-task-000528/environment/setup/files/blocklist new file mode 100644 index 0000000000000000000000000000000000000000..a8e4bdc4c7d9b739c047a3cb58ea72a1bb05bcbc --- /dev/null +++ b/tasks/format-code-task-000528/environment/setup/files/blocklist @@ -0,0 +1,33 @@ +# mimo answer-leak blocklist (mimoagent) +0.0.0.0 github.com +0.0.0.0 www.github.com +0.0.0.0 api.github.com +0.0.0.0 raw.githubusercontent.com +0.0.0.0 codeload.github.com +0.0.0.0 objects.githubusercontent.com +0.0.0.0 gist.github.com +0.0.0.0 gist.githubusercontent.com +0.0.0.0 gitlab.com +0.0.0.0 bitbucket.org +0.0.0.0 sourceforge.net +0.0.0.0 git.kernel.org +0.0.0.0 chromium.googlesource.com +0.0.0.0 android.googlesource.com +0.0.0.0 sourcegraph.com +0.0.0.0 bugs.chromium.org +0.0.0.0 issues.oss-fuzz.com +0.0.0.0 oss-fuzz.com +0.0.0.0 osv.dev +0.0.0.0 api.osv.dev +0.0.0.0 bugzilla.mozilla.org +0.0.0.0 proxy.golang.org +0.0.0.0 sum.golang.org +0.0.0.0 pkg.go.dev +0.0.0.0 google.com +0.0.0.0 www.google.com +0.0.0.0 bing.com +0.0.0.0 www.bing.com +0.0.0.0 duckduckgo.com +0.0.0.0 html.duckduckgo.com +0.0.0.0 search.brave.com +0.0.0.0 stackoverflow.com diff --git a/tasks/format-code-task-000528/environment/setup/setup.sh b/tasks/format-code-task-000528/environment/setup/setup.sh new file mode 100644 index 0000000000000000000000000000000000000000..d883db90cfcfb48f7a139861bbe9f6b5d95cad6f --- /dev/null +++ b/tasks/format-code-task-000528/environment/setup/setup.sh @@ -0,0 +1,34 @@ +#!/bin/bash +# Runs once, as root, before the agent starts: Harbor's [environment.healthcheck] unpacks this folder into +# /var/lib/mimo and runs it. Generated by mimo_harbor; see its README for how each step maps to Xiaomi's harness. +M=/var/lib/mimo +[ -f "$M/ready" ] && exit 0 +chmod 700 "$M" +fail() { echo "setup: $*" >&2; exit 1; } +# the answer-leak blocklist (mimoagent), applied to /etc/hosts by the agent right after it installs +write_blocklist() { cp "$M/files/blocklist" "$M/blocklist"; } + +# Code: mimoagent environments/datasets/opensource_code.py + base.py, as the explorer runs it (app/runner/domains.py Code). +CWD=/testbed +git config --global --add safe.directory "$CWD" +cd "$CWD" || fail "no working directory $CWD" +if ! git rev-parse --git-dir >/dev/null 2>&1; then # a bare source tree: give it a baseline commit + git init -q && git add -A && git -c user.name=mimo -c user.email=mimo@localhost commit -q -m baseline --allow-empty +fi +BASE=$(git rev-parse HEAD 2>/dev/null) +[ ${#BASE} -eq 40 ] || fail "could not resolve the base commit in $CWD" +echo "$BASE" > "$M/base" +# Images are built with history truncated at the base. If one is not, the fix could be read out of git log, +# so .git is hidden while the agent works and put back for grading. +LATER=$(git rev-list --all --not "$BASE" 2>/dev/null | head -n 5 | grep -c . || true) +rm -f /tmp/fail.log /tmp/pass.log /tmp/patch.diff /tmp/test_patch.diff /tmp/*.log 2>/dev/null; rm -rf /tmp/claude-0 /tmp/claude-* /tmp/testem-* /tmp/puppeteer_dev_chrome_profile-* 2>/dev/null; rm -f /tmp/test_files.json 2>/dev/null; rm -rf /tmp/jest_* /tmp/jest-* /tmp/build /tmp/build_env 2>/dev/null; rm -rf /tmp/pytest-of-root /tmp/pytest-* /tmp/.pytest_cache /tmp/__pycache__ 2>/dev/null; rm -rf /tmp/go-build* /tmp/standards /tmp/wordpress /tmp/zig-* /tmp/testbase /tmp/testbed 2>/dev/null; rm -f /tmp/tmp*.tmp /tmp/*.bak /tmp/expect* /tmp/butwas* 2>/dev/null; rm -rf /root/.cache/go-build 2>/dev/null; rm -rf /tests 2>/dev/null; find /logs -mindepth 1 -delete 2>/dev/null; mkdir -p /logs/agent /logs/verifier /logs/artifacts; chmod 777 /logs/agent /logs/verifier /logs/artifacts; find /var/log -type f -delete 2>/dev/null || true; rm -rf /var/lib/postgresql/*/*/log /var/lib/postgresql/*/*/pg_log 2>/dev/null || true; find /var/lib/mysql /var/lib/mongodb -type f -name '*.log' -delete 2>/dev/null || true; rm -rf /root/.npm/_logs /root/.babel.json /root/.pytest_cache 2>/dev/null || true; find / -maxdepth 4 -xdev -name task_description.md -path '*/.build_env/*' -delete 2>/dev/null || true; true +git clean -fdx --exclude=node_modules --exclude=bower_components --exclude=.husky --exclude=vendor --exclude=third_party --exclude=_deps --exclude=vcpkg_installed --exclude=.venv --exclude=venv --exclude=.gradle --exclude=target --exclude=.build --exclude=lib --exclude=.bundle --exclude=Manifest.toml --exclude=_build --exclude=.stack-work --exclude=dist-newstyle >/dev/null 2>&1 +find /root/.m2 -type f \( -name '*-SNAPSHOT.jar' -o -name '*-SNAPSHOT-sources.jar' -o -name '*-SNAPSHOT-tests.jar' -o -name '*-SNAPSHOT-test-sources.jar' \) -delete 2>/dev/null; rm -rf /root/.julia/compiled 2>/dev/null; rm -rf /root/.gradle/caches/build-cache-* /root/.gradle/daemon 2>/dev/null; rm -rf /root/.gradle/caches/*/scripts /root/.gradle/caches/jars-* 2>/dev/null; rm -rf /root/.cache/bazel 2>/dev/null; true +if [ "$LATER" -gt 0 ]; then + mv "$CWD/.git" "$M/git-hidden" + echo "history not truncated at ${BASE:0:12}: .git hidden while the agent works" +fi +write_blocklist + +touch "$M/ready" +echo "setup done" diff --git a/tasks/format-code-task-000528/tests/test.patch b/tasks/format-code-task-000528/tests/test.patch new file mode 100644 index 0000000000000000000000000000000000000000..c82b56f911d08cde9a2c4e79748bc08e5498bff5 --- /dev/null +++ b/tasks/format-code-task-000528/tests/test.patch @@ -0,0 +1,81 @@ +diff --git a/src/__tests__/polymorphic.repository.spec.ts b/src/__tests__/polymorphic.repository.spec.ts +index 6a486df..759ab95 100644 +--- a/src/__tests__/polymorphic.repository.spec.ts ++++ b/src/__tests__/polymorphic.repository.spec.ts +@@ -6,6 +6,7 @@ import { resolve } from 'path'; + import { AdvertRepository } from './repository/advert.repository'; + import { AbstractPolymorphicRepository } from '../'; + import { MerchantEntity } from './entities/merchant.entity'; ++import { UserRepository } from './repository/user.repository'; + + describe('AbstractPolymorphicRepository', () => { + let connection: DataSource; +@@ -172,4 +173,40 @@ describe('AbstractPolymorphicRepository', () => { + }); + }); + }); ++ ++ describe('Parent', () => { ++ describe('findOne', () => { ++ it('Can find parent entity with children', async () => { ++ const repository = AbstractPolymorphicRepository.createRepository( ++ connection, ++ UserRepository, ++ ); ++ const advertRepository = AbstractPolymorphicRepository.createRepository( ++ connection, ++ AdvertRepository, ++ ); ++ ++ const user = await repository.save(new UserEntity()); ++ ++ const advert = await advertRepository.save( ++ advertRepository.create({ ++ owner: user, ++ }), ++ ); ++ ++ let result = await repository.findOne({ ++ where: { id: user.id }, ++ }); ++ ++ result = await repository.hydrateOne(result); ++ ++ expect(result).toBeInstanceOf(UserEntity); ++ expect(result?.adverts).toHaveLength(1); ++ expect(result?.adverts[0]).toBeInstanceOf(AdvertEntity); ++ expect(result?.adverts[0].id).toBe(advert.id); ++ expect(result?.adverts[0].entityType).toBe(UserEntity.name); ++ expect(result?.adverts[0].entityId).toBe(user.id); ++ }); ++ }); ++ }); + }); +diff --git a/mimo_build_env.tar.gz.b64 b/mimo_build_env.tar.gz.b64 +new file mode 100644 +--- /dev/null ++++ b/mimo_build_env.tar.gz.b64 +@@ -0,0 +1,12 @@ ++H4sIAAAAAAAAA+2UTU/bQBCGc/avGIIE7cFxnA84gJFCMCIS2DR2P+gFOd4JWeTsurvriPz7rp02 ++IKqWC6iqOk8U2Z6dmX1nZu3OrOIFu0Wx8lpvRddyOBw2V8vza3PvD3u+/Q26B9bu+8PDXguGb6bo ++CZU2mQJoKSnNn/xeWv9H6TzO36A2t7lcLjPBOnrxenu8MH+/Pxg8zt8f2PkPDrqHLei+noTf85/P ++f3fHm3HhzTK9cHIGzSGYIXOcXRgrzAxCx54NmEsF6brEeHoFLDOZ9UfIpRCYGy6Fk2cGTjaux8ew ++H0afwvh830lvrkMbcjuOoygcp5M4CpZr/a3YLlzESRoUMs+KhdRma76Op2nQ73cPtpaPSTiNRldh ++UM/h0W+UJJ/j6VmwtZyN0tHpKAmDupCtNbmJxhfTOJp8tQuqQmcjsK4yFLpSCFfr5MMlcA2qEoKL ++O4fPYQcaseBWUO8KLkI7CS9tIeC3bbkew5UnqqKA3smefwRmgcKBTRAD1600qmAT6dZNY1wF3ipT ++XsFn3ib1nvXXBWIJfWfOn3R922SrQ9gM+MC10c6vgsbTcJSG8LNumJxDFKcQfpkkaQJ1F47aVt9W ++a73HRNhDb2UzLFEwFDlH7YhyCfzHgusK6WYV42ZzO68Ee57ktP5w1DVDqeS9PQfwjlmNXt1EgciQ ++wWzdCAAUhps18GUpldHvm61sn6H59tS5pvahzmRfxTs0TZB1eoD7Otp16+frzCzs36ASQbuUxXop ++VbngeUdhKTU3Uq07usS8Y3R7IzqXK1TZHTp/+x0jCIIgCIIgCIIgCIIgCIIgCIIgCIIgCIJ4S74D ++ng2qxQAoAAA= +diff --git a/mimo_test_command.sh b/mimo_test_command.sh +new file mode 100755 +--- /dev/null ++++ b/mimo_test_command.sh +@@ -0,0 +1,6 @@ ++#!/usr/bin/env bash ++ ++set -uo pipefail ++cd /testbed || exit 1 ++base64 -d mimo_build_env.tar.gz.b64 | tar -xzf - -C /testbed || exit 1 ++exec bash -lc 'cd /testbed && bash -eo pipefail /testbed/.build_env/test_command.sh' diff --git a/tasks/format-code-task-000528/tests/test.sh b/tasks/format-code-task-000528/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..2d9157bcc8127e280ba8dffd604aa62662789d08 --- /dev/null +++ b/tasks/format-code-task-000528/tests/test.sh @@ -0,0 +1,39 @@ +#!/bin/bash +# Code grading, mimoagent opensource_code.py: reset the files the hidden test patch touches, apply it, run the +# task's test command; reward 1 when it exits 0. A testbed failure (reset or apply) writes no reward: not scored. +M=/var/lib/mimo +CWD=/testbed +V=/logs/verifier +mkdir -p "$V" +BASE=$(cat "$M/base" 2>/dev/null) || { echo "setup never ran (no $M/base)" >&2; exit 1; } +cd "$CWD" || exit 1 +if [ -d "$M/git-hidden" ]; then rm -rf "$CWD/.git"; mv "$M/git-hidden" "$CWD/.git"; fi +# the agent's change against the base, so its own commits count too +git add -A >/dev/null 2>&1 && git -c core.fileMode=false diff --cached "$BASE" > "$V/agent.diff" +git reset -q +if ! ( +while IFS= read -r tf; do + [ -z "$tf" ] && continue + if git cat-file -e $BASE:"$tf" 2>/dev/null; then + git checkout $BASE -- "$tf" 2>/dev/null || true + else + git rm -f --cached "$tf" >/dev/null 2>&1 || true + rm -f "$tf" + fi +done <<'EOF_RESET_TEST_FILES' +src/__tests__/polymorphic.repository.spec.ts +mimo_build_env.tar.gz.b64 +mimo_test_command.sh +EOF_RESET_TEST_FILES + +); then echo "could not reset the test files (testbed problem, not scored)" >&2; exit 1; fi +if ! git apply --verbose /tests/test.patch > "$V/apply.log" 2>&1; then + cat "$V/apply.log" >&2 + echo "the hidden tests could not be applied (testbed problem, not scored)" >&2 + exit 1 +fi +timeout 1800 sh -c "$(cat /tests/test_command.sh)" > "$V/test_output.log" 2>&1 +RC=$? +tail -c 12000 "$V/test_output.log" +if [ $RC -eq 0 ]; then echo 1 > "$V/reward.txt"; else echo 0 > "$V/reward.txt"; fi +echo "test command exited $RC" diff --git a/tasks/format-code-task-000528/tests/test_command.sh b/tasks/format-code-task-000528/tests/test_command.sh new file mode 100644 index 0000000000000000000000000000000000000000..7cb23076694ad17d72e8296d62b2b240083e36db --- /dev/null +++ b/tasks/format-code-task-000528/tests/test_command.sh @@ -0,0 +1 @@ +bash /testbed/mimo_test_command.sh \ No newline at end of file diff --git a/tasks/format-code-task-000543/environment/Dockerfile b/tasks/format-code-task-000543/environment/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..a33ae3576a4e271ab489c78c28b8fd1bc6ae8408 --- /dev/null +++ b/tasks/format-code-task-000543/environment/Dockerfile @@ -0,0 +1,3 @@ +# The task's image, pinned by digest (the same as [environment].docker_image). +# Setup runs at start from [environment.healthcheck]; environment/setup/ is its readable copy. +FROM docker.io/xiaomimimo/mimo-v2.6-rl-oss@sha256:49ab7a0805c81858a633aaf6022a63b74deaa0a9e2f7748ad9a4c25a0c6be37c diff --git a/tasks/format-code-task-000543/environment/setup/files/blocklist b/tasks/format-code-task-000543/environment/setup/files/blocklist new file mode 100644 index 0000000000000000000000000000000000000000..a8e4bdc4c7d9b739c047a3cb58ea72a1bb05bcbc --- /dev/null +++ b/tasks/format-code-task-000543/environment/setup/files/blocklist @@ -0,0 +1,33 @@ +# mimo answer-leak blocklist (mimoagent) +0.0.0.0 github.com +0.0.0.0 www.github.com +0.0.0.0 api.github.com +0.0.0.0 raw.githubusercontent.com +0.0.0.0 codeload.github.com +0.0.0.0 objects.githubusercontent.com +0.0.0.0 gist.github.com +0.0.0.0 gist.githubusercontent.com +0.0.0.0 gitlab.com +0.0.0.0 bitbucket.org +0.0.0.0 sourceforge.net +0.0.0.0 git.kernel.org +0.0.0.0 chromium.googlesource.com +0.0.0.0 android.googlesource.com +0.0.0.0 sourcegraph.com +0.0.0.0 bugs.chromium.org +0.0.0.0 issues.oss-fuzz.com +0.0.0.0 oss-fuzz.com +0.0.0.0 osv.dev +0.0.0.0 api.osv.dev +0.0.0.0 bugzilla.mozilla.org +0.0.0.0 proxy.golang.org +0.0.0.0 sum.golang.org +0.0.0.0 pkg.go.dev +0.0.0.0 google.com +0.0.0.0 www.google.com +0.0.0.0 bing.com +0.0.0.0 www.bing.com +0.0.0.0 duckduckgo.com +0.0.0.0 html.duckduckgo.com +0.0.0.0 search.brave.com +0.0.0.0 stackoverflow.com diff --git a/tasks/format-code-task-000543/environment/setup/setup.sh b/tasks/format-code-task-000543/environment/setup/setup.sh new file mode 100644 index 0000000000000000000000000000000000000000..d883db90cfcfb48f7a139861bbe9f6b5d95cad6f --- /dev/null +++ b/tasks/format-code-task-000543/environment/setup/setup.sh @@ -0,0 +1,34 @@ +#!/bin/bash +# Runs once, as root, before the agent starts: Harbor's [environment.healthcheck] unpacks this folder into +# /var/lib/mimo and runs it. Generated by mimo_harbor; see its README for how each step maps to Xiaomi's harness. +M=/var/lib/mimo +[ -f "$M/ready" ] && exit 0 +chmod 700 "$M" +fail() { echo "setup: $*" >&2; exit 1; } +# the answer-leak blocklist (mimoagent), applied to /etc/hosts by the agent right after it installs +write_blocklist() { cp "$M/files/blocklist" "$M/blocklist"; } + +# Code: mimoagent environments/datasets/opensource_code.py + base.py, as the explorer runs it (app/runner/domains.py Code). +CWD=/testbed +git config --global --add safe.directory "$CWD" +cd "$CWD" || fail "no working directory $CWD" +if ! git rev-parse --git-dir >/dev/null 2>&1; then # a bare source tree: give it a baseline commit + git init -q && git add -A && git -c user.name=mimo -c user.email=mimo@localhost commit -q -m baseline --allow-empty +fi +BASE=$(git rev-parse HEAD 2>/dev/null) +[ ${#BASE} -eq 40 ] || fail "could not resolve the base commit in $CWD" +echo "$BASE" > "$M/base" +# Images are built with history truncated at the base. If one is not, the fix could be read out of git log, +# so .git is hidden while the agent works and put back for grading. +LATER=$(git rev-list --all --not "$BASE" 2>/dev/null | head -n 5 | grep -c . || true) +rm -f /tmp/fail.log /tmp/pass.log /tmp/patch.diff /tmp/test_patch.diff /tmp/*.log 2>/dev/null; rm -rf /tmp/claude-0 /tmp/claude-* /tmp/testem-* /tmp/puppeteer_dev_chrome_profile-* 2>/dev/null; rm -f /tmp/test_files.json 2>/dev/null; rm -rf /tmp/jest_* /tmp/jest-* /tmp/build /tmp/build_env 2>/dev/null; rm -rf /tmp/pytest-of-root /tmp/pytest-* /tmp/.pytest_cache /tmp/__pycache__ 2>/dev/null; rm -rf /tmp/go-build* /tmp/standards /tmp/wordpress /tmp/zig-* /tmp/testbase /tmp/testbed 2>/dev/null; rm -f /tmp/tmp*.tmp /tmp/*.bak /tmp/expect* /tmp/butwas* 2>/dev/null; rm -rf /root/.cache/go-build 2>/dev/null; rm -rf /tests 2>/dev/null; find /logs -mindepth 1 -delete 2>/dev/null; mkdir -p /logs/agent /logs/verifier /logs/artifacts; chmod 777 /logs/agent /logs/verifier /logs/artifacts; find /var/log -type f -delete 2>/dev/null || true; rm -rf /var/lib/postgresql/*/*/log /var/lib/postgresql/*/*/pg_log 2>/dev/null || true; find /var/lib/mysql /var/lib/mongodb -type f -name '*.log' -delete 2>/dev/null || true; rm -rf /root/.npm/_logs /root/.babel.json /root/.pytest_cache 2>/dev/null || true; find / -maxdepth 4 -xdev -name task_description.md -path '*/.build_env/*' -delete 2>/dev/null || true; true +git clean -fdx --exclude=node_modules --exclude=bower_components --exclude=.husky --exclude=vendor --exclude=third_party --exclude=_deps --exclude=vcpkg_installed --exclude=.venv --exclude=venv --exclude=.gradle --exclude=target --exclude=.build --exclude=lib --exclude=.bundle --exclude=Manifest.toml --exclude=_build --exclude=.stack-work --exclude=dist-newstyle >/dev/null 2>&1 +find /root/.m2 -type f \( -name '*-SNAPSHOT.jar' -o -name '*-SNAPSHOT-sources.jar' -o -name '*-SNAPSHOT-tests.jar' -o -name '*-SNAPSHOT-test-sources.jar' \) -delete 2>/dev/null; rm -rf /root/.julia/compiled 2>/dev/null; rm -rf /root/.gradle/caches/build-cache-* /root/.gradle/daemon 2>/dev/null; rm -rf /root/.gradle/caches/*/scripts /root/.gradle/caches/jars-* 2>/dev/null; rm -rf /root/.cache/bazel 2>/dev/null; true +if [ "$LATER" -gt 0 ]; then + mv "$CWD/.git" "$M/git-hidden" + echo "history not truncated at ${BASE:0:12}: .git hidden while the agent works" +fi +write_blocklist + +touch "$M/ready" +echo "setup done" diff --git a/tasks/format-code-task-000543/tests/test.patch b/tasks/format-code-task-000543/tests/test.patch new file mode 100644 index 0000000000000000000000000000000000000000..3d81b968ffbb572c66fa3ff7b5e086d0cc2c0cd6 --- /dev/null +++ b/tasks/format-code-task-000543/tests/test.patch @@ -0,0 +1,153 @@ +diff --git a/tests/datatypes/test_float_floordiv_mod.py b/tests/datatypes/test_float_floordiv_mod.py +new file mode 100644 +index 00000000..75a9f631 +--- /dev/null ++++ b/tests/datatypes/test_float_floordiv_mod.py +@@ -0,0 +1,122 @@ ++from .. utils import TranspileTestCase ++ ++ ++class FloatFloorDivModTests(TranspileTestCase): ++ ++ ++ ++ def test_floor_divide_int(self): ++ self.assertCodeExecution(""" ++ for x in [9.9, -9.9, 0.0, 5.5]: ++ for y in [2, -2, 5]: ++ print(x // y) ++ """) ++ ++ def test_floor_divide_float(self): ++ self.assertCodeExecution(""" ++ for x in [9.9, -9.9, 2.0, 7.5, -7.5, 0.0]: ++ for y in [2.0, -2.5, 0.5]: ++ print(x // y) ++ """) ++ ++ def test_floor_divide_bool(self): ++ self.assertCodeExecution(""" ++ x = 9.9 ++ y = True ++ print(x // y) ++ x = -9.9 ++ print(x // y) ++ """) ++ ++ def test_modulo_int(self): ++ self.assertCodeExecution(""" ++ for x in [5.5, -5.5, 9.9, 7.0, -7.0]: ++ for y in [2, -2, 7]: ++ print(x % y) ++ """) ++ ++ def test_modulo_float(self): ++ self.assertCodeExecution(""" ++ for x in [5.5, -5.5, 9.9, 3.5, -7.0, 7.0]: ++ for y in [2.0, -2.0, 2.5, 7.0, -7.0]: ++ print(x % y) ++ """) ++ ++ def test_modulo_bool(self): ++ self.assertCodeExecution(""" ++ x = 5.5 ++ y = True ++ print(x % y) ++ x = -5.5 ++ print(x % y) ++ """) ++ ++ def test_signed_zero_results(self): ++ self.assertCodeExecution(""" ++ for x in [0.0, -7.0, 7.0, 6.0, -6.0]: ++ for y in [3, -3, 7.0, -7.0]: ++ print(x % y) ++ """) ++ ++ def test_floor_divide_by_zero_int(self): ++ self.assertCodeExecution(""" ++ x = 1.5 ++ y = 0 ++ print(x // y) ++ """) ++ ++ def test_floor_divide_by_zero_float(self): ++ self.assertCodeExecution(""" ++ x = 1.5 ++ y = 0.0 ++ print(x // y) ++ """) ++ ++ def test_floor_divide_by_false(self): ++ self.assertCodeExecution(""" ++ x = 1.5 ++ y = False ++ print(x // y) ++ """) ++ ++ def test_modulo_by_zero_int(self): ++ self.assertCodeExecution(""" ++ x = 1.5 ++ y = 0 ++ print(x % y) ++ """) ++ ++ def test_modulo_by_zero_float(self): ++ self.assertCodeExecution(""" ++ x = 1.5 ++ y = 0.0 ++ print(x % y) ++ """) ++ ++ def test_modulo_by_false(self): ++ self.assertCodeExecution(""" ++ x = 1.5 ++ y = False ++ print(x % y) ++ """) ++ ++ def test_floor_divide_type_error_str(self): ++ self.assertCodeExecution(""" ++ x = 1.5 ++ y = 'a' ++ print(x // y) ++ """) ++ ++ def test_floor_divide_type_error_list(self): ++ self.assertCodeExecution(""" ++ x = 1.5 ++ y = [1] ++ print(x // y) ++ """) ++ ++ def test_modulo_type_error_str(self): ++ self.assertCodeExecution(""" ++ x = 1.5 ++ y = 'a' ++ print(x % y) ++ """) +diff --git a/mimo_test_command.sh b/mimo_test_command.sh +new file mode 100755 +--- /dev/null ++++ b/mimo_test_command.sh +@@ -0,0 +1,20 @@ ++#!/usr/bin/env bash ++ ++ ++ ++set -euo pipefail ++HERE="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" ++cd /testbed ++ ++ ++ ++ ++ ++PY=~/.pyenv/versions/3.5.10/bin/python ++ant java ++ ++ ++"$PY" -m unittest tests.datatypes.test_int ++ ++ ++"$PY" -m unittest tests.datatypes.test_float_floordiv_mod diff --git a/tasks/format-code-task-000543/tests/test.sh b/tasks/format-code-task-000543/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..2aa046922280fdcb45aa2d2da08bd1def50bb1dc --- /dev/null +++ b/tasks/format-code-task-000543/tests/test.sh @@ -0,0 +1,38 @@ +#!/bin/bash +# Code grading, mimoagent opensource_code.py: reset the files the hidden test patch touches, apply it, run the +# task's test command; reward 1 when it exits 0. A testbed failure (reset or apply) writes no reward: not scored. +M=/var/lib/mimo +CWD=/testbed +V=/logs/verifier +mkdir -p "$V" +BASE=$(cat "$M/base" 2>/dev/null) || { echo "setup never ran (no $M/base)" >&2; exit 1; } +cd "$CWD" || exit 1 +if [ -d "$M/git-hidden" ]; then rm -rf "$CWD/.git"; mv "$M/git-hidden" "$CWD/.git"; fi +# the agent's change against the base, so its own commits count too +git add -A >/dev/null 2>&1 && git -c core.fileMode=false diff --cached "$BASE" > "$V/agent.diff" +git reset -q +if ! ( +while IFS= read -r tf; do + [ -z "$tf" ] && continue + if git cat-file -e $BASE:"$tf" 2>/dev/null; then + git checkout $BASE -- "$tf" 2>/dev/null || true + else + git rm -f --cached "$tf" >/dev/null 2>&1 || true + rm -f "$tf" + fi +done <<'EOF_RESET_TEST_FILES' +tests/datatypes/test_float_floordiv_mod.py +mimo_test_command.sh +EOF_RESET_TEST_FILES + +); then echo "could not reset the test files (testbed problem, not scored)" >&2; exit 1; fi +if ! git apply --verbose /tests/test.patch > "$V/apply.log" 2>&1; then + cat "$V/apply.log" >&2 + echo "the hidden tests could not be applied (testbed problem, not scored)" >&2 + exit 1 +fi +timeout 1800 sh -c "$(cat /tests/test_command.sh)" > "$V/test_output.log" 2>&1 +RC=$? +tail -c 12000 "$V/test_output.log" +if [ $RC -eq 0 ]; then echo 1 > "$V/reward.txt"; else echo 0 > "$V/reward.txt"; fi +echo "test command exited $RC" diff --git a/tasks/format-code-task-000543/tests/test_command.sh b/tasks/format-code-task-000543/tests/test_command.sh new file mode 100644 index 0000000000000000000000000000000000000000..7cb23076694ad17d72e8296d62b2b240083e36db --- /dev/null +++ b/tasks/format-code-task-000543/tests/test_command.sh @@ -0,0 +1 @@ +bash /testbed/mimo_test_command.sh \ No newline at end of file diff --git a/tasks/format-code-task-000544/environment/Dockerfile b/tasks/format-code-task-000544/environment/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..377b529b4d4b5861f65267d5703f50cd119b092a --- /dev/null +++ b/tasks/format-code-task-000544/environment/Dockerfile @@ -0,0 +1,3 @@ +# The task's image, pinned by digest (the same as [environment].docker_image). +# Setup runs at start from [environment.healthcheck]; environment/setup/ is its readable copy. +FROM docker.io/xiaomimimo/mimo-v2.6-rl-oss@sha256:94646fd528d24761f772104842b90e19e6ac5ad0013120de20520817c1254367 diff --git a/tasks/format-code-task-000544/environment/setup/files/blocklist b/tasks/format-code-task-000544/environment/setup/files/blocklist new file mode 100644 index 0000000000000000000000000000000000000000..a8e4bdc4c7d9b739c047a3cb58ea72a1bb05bcbc --- /dev/null +++ b/tasks/format-code-task-000544/environment/setup/files/blocklist @@ -0,0 +1,33 @@ +# mimo answer-leak blocklist (mimoagent) +0.0.0.0 github.com +0.0.0.0 www.github.com +0.0.0.0 api.github.com +0.0.0.0 raw.githubusercontent.com +0.0.0.0 codeload.github.com +0.0.0.0 objects.githubusercontent.com +0.0.0.0 gist.github.com +0.0.0.0 gist.githubusercontent.com +0.0.0.0 gitlab.com +0.0.0.0 bitbucket.org +0.0.0.0 sourceforge.net +0.0.0.0 git.kernel.org +0.0.0.0 chromium.googlesource.com +0.0.0.0 android.googlesource.com +0.0.0.0 sourcegraph.com +0.0.0.0 bugs.chromium.org +0.0.0.0 issues.oss-fuzz.com +0.0.0.0 oss-fuzz.com +0.0.0.0 osv.dev +0.0.0.0 api.osv.dev +0.0.0.0 bugzilla.mozilla.org +0.0.0.0 proxy.golang.org +0.0.0.0 sum.golang.org +0.0.0.0 pkg.go.dev +0.0.0.0 google.com +0.0.0.0 www.google.com +0.0.0.0 bing.com +0.0.0.0 www.bing.com +0.0.0.0 duckduckgo.com +0.0.0.0 html.duckduckgo.com +0.0.0.0 search.brave.com +0.0.0.0 stackoverflow.com diff --git a/tasks/format-code-task-000544/environment/setup/setup.sh b/tasks/format-code-task-000544/environment/setup/setup.sh new file mode 100644 index 0000000000000000000000000000000000000000..d883db90cfcfb48f7a139861bbe9f6b5d95cad6f --- /dev/null +++ b/tasks/format-code-task-000544/environment/setup/setup.sh @@ -0,0 +1,34 @@ +#!/bin/bash +# Runs once, as root, before the agent starts: Harbor's [environment.healthcheck] unpacks this folder into +# /var/lib/mimo and runs it. Generated by mimo_harbor; see its README for how each step maps to Xiaomi's harness. +M=/var/lib/mimo +[ -f "$M/ready" ] && exit 0 +chmod 700 "$M" +fail() { echo "setup: $*" >&2; exit 1; } +# the answer-leak blocklist (mimoagent), applied to /etc/hosts by the agent right after it installs +write_blocklist() { cp "$M/files/blocklist" "$M/blocklist"; } + +# Code: mimoagent environments/datasets/opensource_code.py + base.py, as the explorer runs it (app/runner/domains.py Code). +CWD=/testbed +git config --global --add safe.directory "$CWD" +cd "$CWD" || fail "no working directory $CWD" +if ! git rev-parse --git-dir >/dev/null 2>&1; then # a bare source tree: give it a baseline commit + git init -q && git add -A && git -c user.name=mimo -c user.email=mimo@localhost commit -q -m baseline --allow-empty +fi +BASE=$(git rev-parse HEAD 2>/dev/null) +[ ${#BASE} -eq 40 ] || fail "could not resolve the base commit in $CWD" +echo "$BASE" > "$M/base" +# Images are built with history truncated at the base. If one is not, the fix could be read out of git log, +# so .git is hidden while the agent works and put back for grading. +LATER=$(git rev-list --all --not "$BASE" 2>/dev/null | head -n 5 | grep -c . || true) +rm -f /tmp/fail.log /tmp/pass.log /tmp/patch.diff /tmp/test_patch.diff /tmp/*.log 2>/dev/null; rm -rf /tmp/claude-0 /tmp/claude-* /tmp/testem-* /tmp/puppeteer_dev_chrome_profile-* 2>/dev/null; rm -f /tmp/test_files.json 2>/dev/null; rm -rf /tmp/jest_* /tmp/jest-* /tmp/build /tmp/build_env 2>/dev/null; rm -rf /tmp/pytest-of-root /tmp/pytest-* /tmp/.pytest_cache /tmp/__pycache__ 2>/dev/null; rm -rf /tmp/go-build* /tmp/standards /tmp/wordpress /tmp/zig-* /tmp/testbase /tmp/testbed 2>/dev/null; rm -f /tmp/tmp*.tmp /tmp/*.bak /tmp/expect* /tmp/butwas* 2>/dev/null; rm -rf /root/.cache/go-build 2>/dev/null; rm -rf /tests 2>/dev/null; find /logs -mindepth 1 -delete 2>/dev/null; mkdir -p /logs/agent /logs/verifier /logs/artifacts; chmod 777 /logs/agent /logs/verifier /logs/artifacts; find /var/log -type f -delete 2>/dev/null || true; rm -rf /var/lib/postgresql/*/*/log /var/lib/postgresql/*/*/pg_log 2>/dev/null || true; find /var/lib/mysql /var/lib/mongodb -type f -name '*.log' -delete 2>/dev/null || true; rm -rf /root/.npm/_logs /root/.babel.json /root/.pytest_cache 2>/dev/null || true; find / -maxdepth 4 -xdev -name task_description.md -path '*/.build_env/*' -delete 2>/dev/null || true; true +git clean -fdx --exclude=node_modules --exclude=bower_components --exclude=.husky --exclude=vendor --exclude=third_party --exclude=_deps --exclude=vcpkg_installed --exclude=.venv --exclude=venv --exclude=.gradle --exclude=target --exclude=.build --exclude=lib --exclude=.bundle --exclude=Manifest.toml --exclude=_build --exclude=.stack-work --exclude=dist-newstyle >/dev/null 2>&1 +find /root/.m2 -type f \( -name '*-SNAPSHOT.jar' -o -name '*-SNAPSHOT-sources.jar' -o -name '*-SNAPSHOT-tests.jar' -o -name '*-SNAPSHOT-test-sources.jar' \) -delete 2>/dev/null; rm -rf /root/.julia/compiled 2>/dev/null; rm -rf /root/.gradle/caches/build-cache-* /root/.gradle/daemon 2>/dev/null; rm -rf /root/.gradle/caches/*/scripts /root/.gradle/caches/jars-* 2>/dev/null; rm -rf /root/.cache/bazel 2>/dev/null; true +if [ "$LATER" -gt 0 ]; then + mv "$CWD/.git" "$M/git-hidden" + echo "history not truncated at ${BASE:0:12}: .git hidden while the agent works" +fi +write_blocklist + +touch "$M/ready" +echo "setup done" diff --git a/tasks/format-code-task-000544/tests/test.patch b/tasks/format-code-task-000544/tests/test.patch new file mode 100644 index 0000000000000000000000000000000000000000..8cb38379f78f15bcae44f1a717c52b2c25b8de60 --- /dev/null +++ b/tasks/format-code-task-000544/tests/test.patch @@ -0,0 +1,224 @@ +diff --git a/tests/test_cleanse_java.py b/tests/test_cleanse_java.py +new file mode 100644 +index 00000000..3282358e +--- /dev/null ++++ b/tests/test_cleanse_java.py +@@ -0,0 +1,189 @@ ++import unittest ++ ++from .utils import adjust, cleanse_java ++ ++ ++class CleanseJavaExceptionTests(unittest.TestCase): ++ ++ ++ ++ def assertNormalized(self, actual, expected): ++ self.assertEqual(cleanse_java(adjust(actual)), adjust(expected)) ++ ++ ++ ++ def test_plain_output_preserved(self): ++ self.assertNormalized( ++ """ ++ Hello, world. ++ Goodbye. ++ """, ++ """ ++ Hello, world. ++ Goodbye. ++ """ ++ ) ++ ++ ++ ++ def test_direct_exception_with_thread_prefix(self): ++ self.assertNormalized( ++ """ ++ Exception in thread "main" org.python.exceptions.IndexError: list index out of range ++ at org.python.types.List.__getitem__(List.java:100) ++ at org.python.types.List.__getitem__(List.java:85) ++ at python.test.main(test.py:3) ++ """, ++ """ ++ ### EXCEPTION ### ++ IndexError: list index out of range ++ test.py:3 ++ """ ++ ) ++ ++ def test_direct_exception_without_thread_prefix(self): ++ self.assertNormalized( ++ """ ++ org.python.exceptions.IndexError: list index out of range ++ at org.python.types.List.__getitem__(List.java:100) ++ at org.python.types.List.__getitem__(List.java:85) ++ at python.test.main(test.py:3) ++ """, ++ """ ++ ### EXCEPTION ### ++ IndexError: list index out of range ++ test.py:3 ++ """ ++ ) ++ ++ def test_direct_exception_after_output(self): ++ self.assertNormalized( ++ """ ++ Hello, world. ++ org.python.exceptions.IndexError: list index out of range ++ at org.python.types.List.__getitem__(List.java:100) ++ at python.test.main(test.py:3) ++ """, ++ """ ++ Hello, world. ++ ### EXCEPTION ### ++ IndexError: list index out of range ++ test.py:3 ++ """ ++ ) ++ ++ def test_direct_exception_hyphenated_thread(self): ++ self.assertNormalized( ++ """ ++ Exception in thread "pool-1-thread-1" org.python.exceptions.ValueError: bad value ++ at python.test.main(test.py:7) ++ """, ++ """ ++ ### EXCEPTION ### ++ ValueError: bad value ++ test.py:7 ++ """ ++ ) ++ ++ ++ ++ def test_wrapped_exception_with_thread_prefix(self): ++ self.assertNormalized( ++ """ ++ Exception in thread "main" java.lang.ExceptionInInitializerError ++ Caused by: org.python.exceptions.IndexError: list index out of range ++ at org.python.types.List.__getitem__(List.java:100) ++ at org.python.types.List.__getitem__(List.java:85) ++ at python.test.(test.py:2) ++ """, ++ """ ++ ### EXCEPTION ### ++ IndexError: list index out of range ++ test.py:2 ++ """ ++ ) ++ ++ def test_wrapped_exception_without_thread_prefix(self): ++ self.assertNormalized( ++ """ ++ Hello, world. ++ java.lang.ExceptionInInitializerError ++ Caused by: org.python.exceptions.IndexError: list index out of range ++ at org.python.types.List.__getitem__(List.java:100) ++ at org.python.types.List.__getitem__(List.java:85) ++ at python.test.(test.py:2) ++ """, ++ """ ++ Hello, world. ++ ### EXCEPTION ### ++ IndexError: list index out of range ++ test.py:2 ++ """ ++ ) ++ ++ def test_wrapped_exception_with_reflection_frames_and_more(self): ++ self.assertNormalized( ++ """ ++ False ++ True ++ Exception in thread "main" java.lang.ExceptionInInitializerError ++ \tat sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ++ \tat sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ++ \tat sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ++ \tat java.lang.reflect.Method.invoke(Method.java:497) ++ \tat python.testdaemon.TestDaemon.main(TestDaemon.java:66) ++ Caused by: org.python.exceptions.KeyError: 'c' ++ at org.python.types.Dict.__getitem__(Dict.java:142) ++ at python.test.__init__.(test.py:4) ++ ... 5 more ++ """, ++ """ ++ False ++ True ++ ### EXCEPTION ### ++ KeyError: 'c' ++ test.py:4 ++ """ ++ ) ++ ++ ++ ++ def test_only_python_frames_in_outermost_first_order(self): ++ self.assertNormalized( ++ """ ++ Exception in thread "main" java.lang.ExceptionInInitializerError ++ Caused by: org.python.exceptions.UnboundLocalError: local variable 'x' referenced before assignment ++ at python.example.Foo.__init__(example.py:44) ++ at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ++ at java.lang.reflect.Method.invoke(Method.java:606) ++ at org.python.types.Method.invoke(Method.java:66) ++ at python.example.Foo.(example.py) ++ at org.python.types.Constructor.invoke(Constructor.java:25) ++ at python.example.(example.py:51) ++ """, ++ """ ++ ### EXCEPTION ### ++ UnboundLocalError: local variable 'x' referenced before assignment ++ example.py:51 ++ example.py:44 ++ """ ++ ) ++ ++ ++ ++ def test_float_exponent_lowercased(self): ++ self.assertNormalized('7.950899459780156E-6', '7.950899459780156e-6') ++ ++ def test_memory_reference_masked(self): ++ self.assertNormalized( ++ """ ++ object at 0x1eb19f4e ++ """, ++ """ ++ object at 0xXXXXXXXX ++ """ ++ ) ++ ++ ++if __name__ == '__main__': ++ unittest.main() +diff --git a/mimo_test_command.sh b/mimo_test_command.sh +new file mode 100755 +--- /dev/null ++++ b/mimo_test_command.sh +@@ -0,0 +1,24 @@ ++#!/usr/bin/env bash ++ ++ ++ ++ ++set -euo pipefail ++HERE="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" ++cd /testbed ++ ++ ++ ++ ++python3 -m unittest -v \ ++ tests.test_utils.AdjustTests \ ++ tests.test_utils.PythonNormalizationTests \ ++ tests.test_utils.JavaNormalizationTests.test_no_exception \ ++ tests.test_utils.JavaNormalizationTests.test_exception_in_clinit \ ++ tests.test_utils.JavaNormalizationTests.test_exception_in_clinit_after_output \ ++ tests.test_utils.JavaNormalizationTests.test_exception_in_constructor \ ++ tests.test_utils.JavaNormalizationTests.test_float \ ++ tests.test_utils.JavaNormalizationTests.test_memory_reference ++ ++ ++python3 -m unittest -v tests.test_cleanse_java diff --git a/tasks/format-code-task-000544/tests/test.sh b/tasks/format-code-task-000544/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..ace966643d5d6c2147b1f04f32aea6ff18eb25cc --- /dev/null +++ b/tasks/format-code-task-000544/tests/test.sh @@ -0,0 +1,38 @@ +#!/bin/bash +# Code grading, mimoagent opensource_code.py: reset the files the hidden test patch touches, apply it, run the +# task's test command; reward 1 when it exits 0. A testbed failure (reset or apply) writes no reward: not scored. +M=/var/lib/mimo +CWD=/testbed +V=/logs/verifier +mkdir -p "$V" +BASE=$(cat "$M/base" 2>/dev/null) || { echo "setup never ran (no $M/base)" >&2; exit 1; } +cd "$CWD" || exit 1 +if [ -d "$M/git-hidden" ]; then rm -rf "$CWD/.git"; mv "$M/git-hidden" "$CWD/.git"; fi +# the agent's change against the base, so its own commits count too +git add -A >/dev/null 2>&1 && git -c core.fileMode=false diff --cached "$BASE" > "$V/agent.diff" +git reset -q +if ! ( +while IFS= read -r tf; do + [ -z "$tf" ] && continue + if git cat-file -e $BASE:"$tf" 2>/dev/null; then + git checkout $BASE -- "$tf" 2>/dev/null || true + else + git rm -f --cached "$tf" >/dev/null 2>&1 || true + rm -f "$tf" + fi +done <<'EOF_RESET_TEST_FILES' +tests/test_cleanse_java.py +mimo_test_command.sh +EOF_RESET_TEST_FILES + +); then echo "could not reset the test files (testbed problem, not scored)" >&2; exit 1; fi +if ! git apply --verbose /tests/test.patch > "$V/apply.log" 2>&1; then + cat "$V/apply.log" >&2 + echo "the hidden tests could not be applied (testbed problem, not scored)" >&2 + exit 1 +fi +timeout 1800 sh -c "$(cat /tests/test_command.sh)" > "$V/test_output.log" 2>&1 +RC=$? +tail -c 12000 "$V/test_output.log" +if [ $RC -eq 0 ]; then echo 1 > "$V/reward.txt"; else echo 0 > "$V/reward.txt"; fi +echo "test command exited $RC" diff --git a/tasks/format-code-task-000544/tests/test_command.sh b/tasks/format-code-task-000544/tests/test_command.sh new file mode 100644 index 0000000000000000000000000000000000000000..7cb23076694ad17d72e8296d62b2b240083e36db --- /dev/null +++ b/tasks/format-code-task-000544/tests/test_command.sh @@ -0,0 +1 @@ +bash /testbed/mimo_test_command.sh \ No newline at end of file diff --git a/tasks/format-code-task-000550/environment/Dockerfile b/tasks/format-code-task-000550/environment/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..8687a1bd2aaf1478dd55d9406de2b6693fec0ad4 --- /dev/null +++ b/tasks/format-code-task-000550/environment/Dockerfile @@ -0,0 +1,3 @@ +# The task's image, pinned by digest (the same as [environment].docker_image). +# Setup runs at start from [environment.healthcheck]; environment/setup/ is its readable copy. +FROM docker.io/xiaomimimo/mimo-v2.6-rl-oss@sha256:b7f0e4290b2b231549fa2ea19154aec4f140b0af1b2e60836aac3120b214e3fa diff --git a/tasks/format-code-task-000550/environment/setup/files/blocklist b/tasks/format-code-task-000550/environment/setup/files/blocklist new file mode 100644 index 0000000000000000000000000000000000000000..a8e4bdc4c7d9b739c047a3cb58ea72a1bb05bcbc --- /dev/null +++ b/tasks/format-code-task-000550/environment/setup/files/blocklist @@ -0,0 +1,33 @@ +# mimo answer-leak blocklist (mimoagent) +0.0.0.0 github.com +0.0.0.0 www.github.com +0.0.0.0 api.github.com +0.0.0.0 raw.githubusercontent.com +0.0.0.0 codeload.github.com +0.0.0.0 objects.githubusercontent.com +0.0.0.0 gist.github.com +0.0.0.0 gist.githubusercontent.com +0.0.0.0 gitlab.com +0.0.0.0 bitbucket.org +0.0.0.0 sourceforge.net +0.0.0.0 git.kernel.org +0.0.0.0 chromium.googlesource.com +0.0.0.0 android.googlesource.com +0.0.0.0 sourcegraph.com +0.0.0.0 bugs.chromium.org +0.0.0.0 issues.oss-fuzz.com +0.0.0.0 oss-fuzz.com +0.0.0.0 osv.dev +0.0.0.0 api.osv.dev +0.0.0.0 bugzilla.mozilla.org +0.0.0.0 proxy.golang.org +0.0.0.0 sum.golang.org +0.0.0.0 pkg.go.dev +0.0.0.0 google.com +0.0.0.0 www.google.com +0.0.0.0 bing.com +0.0.0.0 www.bing.com +0.0.0.0 duckduckgo.com +0.0.0.0 html.duckduckgo.com +0.0.0.0 search.brave.com +0.0.0.0 stackoverflow.com diff --git a/tasks/format-code-task-000550/environment/setup/setup.sh b/tasks/format-code-task-000550/environment/setup/setup.sh new file mode 100644 index 0000000000000000000000000000000000000000..e9eb7daf39f9542bd095367feee457f3da77e492 --- /dev/null +++ b/tasks/format-code-task-000550/environment/setup/setup.sh @@ -0,0 +1,34 @@ +#!/bin/bash +# Runs once, as root, before the agent starts: Harbor's [environment.healthcheck] unpacks this folder into +# /var/lib/mimo and runs it. Generated by mimo_harbor; see its README for how each step maps to Xiaomi's harness. +M=/var/lib/mimo +[ -f "$M/ready" ] && exit 0 +chmod 700 "$M" +fail() { echo "setup: $*" >&2; exit 1; } +# the answer-leak blocklist (mimoagent), applied to /etc/hosts by the agent right after it installs +write_blocklist() { cp "$M/files/blocklist" "$M/blocklist"; } + +# Code: mimoagent environments/datasets/opensource_code.py + base.py, as the explorer runs it (app/runner/domains.py Code). +CWD=/workspace/repo +git config --global --add safe.directory "$CWD" +cd "$CWD" || fail "no working directory $CWD" +if ! git rev-parse --git-dir >/dev/null 2>&1; then # a bare source tree: give it a baseline commit + git init -q && git add -A && git -c user.name=mimo -c user.email=mimo@localhost commit -q -m baseline --allow-empty +fi +BASE=$(git rev-parse HEAD 2>/dev/null) +[ ${#BASE} -eq 40 ] || fail "could not resolve the base commit in $CWD" +echo "$BASE" > "$M/base" +# Images are built with history truncated at the base. If one is not, the fix could be read out of git log, +# so .git is hidden while the agent works and put back for grading. +LATER=$(git rev-list --all --not "$BASE" 2>/dev/null | head -n 5 | grep -c . || true) +rm -f /tmp/fail.log /tmp/pass.log /tmp/patch.diff /tmp/test_patch.diff /tmp/*.log 2>/dev/null; rm -rf /tmp/claude-0 /tmp/claude-* /tmp/testem-* /tmp/puppeteer_dev_chrome_profile-* 2>/dev/null; rm -f /tmp/test_files.json 2>/dev/null; rm -rf /tmp/jest_* /tmp/jest-* /tmp/build /tmp/build_env 2>/dev/null; rm -rf /tmp/pytest-of-root /tmp/pytest-* /tmp/.pytest_cache /tmp/__pycache__ 2>/dev/null; rm -rf /tmp/go-build* /tmp/standards /tmp/wordpress /tmp/zig-* /tmp/testbase /tmp/testbed 2>/dev/null; rm -f /tmp/tmp*.tmp /tmp/*.bak /tmp/expect* /tmp/butwas* 2>/dev/null; rm -rf /root/.cache/go-build 2>/dev/null; rm -rf /tests 2>/dev/null; find /logs -mindepth 1 -delete 2>/dev/null; mkdir -p /logs/agent /logs/verifier /logs/artifacts; chmod 777 /logs/agent /logs/verifier /logs/artifacts; find /var/log -type f -delete 2>/dev/null || true; rm -rf /var/lib/postgresql/*/*/log /var/lib/postgresql/*/*/pg_log 2>/dev/null || true; find /var/lib/mysql /var/lib/mongodb -type f -name '*.log' -delete 2>/dev/null || true; rm -rf /root/.npm/_logs /root/.babel.json /root/.pytest_cache 2>/dev/null || true; find / -maxdepth 4 -xdev -name task_description.md -path '*/.build_env/*' -delete 2>/dev/null || true; true +git clean -fdx --exclude=node_modules --exclude=bower_components --exclude=.husky --exclude=vendor --exclude=third_party --exclude=_deps --exclude=vcpkg_installed --exclude=.venv --exclude=venv --exclude=.gradle --exclude=target --exclude=.build --exclude=lib --exclude=.bundle --exclude=Manifest.toml --exclude=_build --exclude=.stack-work --exclude=dist-newstyle >/dev/null 2>&1 +find /root/.m2 -type f \( -name '*-SNAPSHOT.jar' -o -name '*-SNAPSHOT-sources.jar' -o -name '*-SNAPSHOT-tests.jar' -o -name '*-SNAPSHOT-test-sources.jar' \) -delete 2>/dev/null; rm -rf /root/.julia/compiled 2>/dev/null; rm -rf /root/.gradle/caches/build-cache-* /root/.gradle/daemon 2>/dev/null; rm -rf /root/.gradle/caches/*/scripts /root/.gradle/caches/jars-* 2>/dev/null; rm -rf /root/.cache/bazel 2>/dev/null; true +if [ "$LATER" -gt 0 ]; then + mv "$CWD/.git" "$M/git-hidden" + echo "history not truncated at ${BASE:0:12}: .git hidden while the agent works" +fi +write_blocklist + +touch "$M/ready" +echo "setup done" diff --git a/tasks/format-code-task-000550/tests/test.patch b/tasks/format-code-task-000550/tests/test.patch new file mode 100644 index 0000000000000000000000000000000000000000..55adbb74d6710b868ef0f1cd0a096de56431ec60 --- /dev/null +++ b/tasks/format-code-task-000550/tests/test.patch @@ -0,0 +1,468 @@ +diff --git a/usercase-test-coderl/fixtures/aws-config-empty b/usercase-test-coderl/fixtures/aws-config-empty +new file mode 100644 +--- /dev/null ++++ b/usercase-test-coderl/fixtures/aws-config-empty +@@ -0,0 +1,2 @@ ++[default] ++region = us-east-1 +diff --git a/usercase-test-coderl/fixtures/aws-config-three b/usercase-test-coderl/fixtures/aws-config-three +new file mode 100644 +--- /dev/null ++++ b/usercase-test-coderl/fixtures/aws-config-three +@@ -0,0 +1,11 @@ ++[profile alpha] ++sso_start_url = https://alpha.awsapps.com/start ++sso_region = us-east-1 ++ ++[profile beta] ++sso_start_url = https://beta.awsapps.com/start ++sso_region = us-west-2 ++ ++[profile gamma] ++sso_start_url = https://gamma.awsapps.com/start ++sso_region = eu-central-1 +diff --git a/usercase-test-coderl/fixtures/sitecustomize.py b/usercase-test-coderl/fixtures/sitecustomize.py +new file mode 100644 +--- /dev/null ++++ b/usercase-test-coderl/fixtures/sitecustomize.py +@@ -0,0 +1,60 @@ ++import json ++import os ++ ++import botocore.exceptions ++ ++from aws_sso_lib.exceptions import PendingAuthorizationExpiredError ++import aws_sso_lib.sso as sso ++ ++ ++class StubFetcher: ++ def __init__(self, region, disable_browser): ++ self.region = region ++ self.disable_browser = disable_browser ++ ++ def fetch_token(self, start_url, force_refresh=False): ++ _write_event({ ++ "event": "fetch_token", ++ "region": self.region, ++ "start_url": start_url, ++ "force_refresh": force_refresh, ++ }) ++ ++ mode = os.environ.get("AWS_SSO_UTIL_LOGIN_STUB_MODE", "success") ++ if mode == "pending_expired": ++ raise PendingAuthorizationExpiredError() ++ if mode == "invalid_grant": ++ raise botocore.exceptions.ClientError( ++ {"Error": {"Code": "InvalidGrantException", "Message": "Device code expired"}}, ++ "CreateToken", ++ ) ++ if mode == "client_error": ++ raise botocore.exceptions.ClientError( ++ {"Error": {"Code": "ThrottlingException", "Message": "Slow down"}}, ++ "CreateToken", ++ ) ++ if mode == "unexpected": ++ raise RuntimeError("boom") ++ ++ return {"accessToken": "stub-token", "expiresAt": "2031-02-03T04:05:06Z"} ++ ++ ++def _write_event(event): ++ log_path = os.environ.get("AWS_SSO_UTIL_LOGIN_STUB_LOG") ++ if not log_path: ++ return ++ with open(log_path, "a", encoding="utf-8") as f: ++ f.write(json.dumps(event, sort_keys=True) + "\n") ++ ++ ++def get_token_fetcher(session, sso_region, *, interactive=False, disable_browser=None, **kwargs): ++ _write_event({ ++ "event": "get_token_fetcher", ++ "region": sso_region, ++ "interactive": interactive, ++ "disable_browser": disable_browser, ++ }) ++ return StubFetcher(sso_region, disable_browser) ++ ++ ++sso.get_token_fetcher = get_token_fetcher +diff --git a/usercase-test-coderl/usecase.sh b/usercase-test-coderl/usecase.sh +new file mode 100755 +--- /dev/null ++++ b/usercase-test-coderl/usecase.sh +@@ -0,0 +1,358 @@ ++#!/usr/bin/env bash ++ ++set -u ++export LANG=C.UTF-8 LC_ALL=C.UTF-8 TZ=UTC ++ ++REPO=/workspace/repo ++FIXTURES="$REPO/usercase-test-coderl/fixtures" ++ ++python - <<'PY' || { echo "FAIL: dependency check" >&2; exit 1; } ++import aws_error_utils ++import boto3 ++import botocore ++import click ++import dateutil ++PY ++ ++TMP=$(mktemp -d) ++trap 'rm -rf "$TMP"' EXIT ++ ++export PYTHONPATH="$FIXTURES:$REPO/cli/src:$REPO/lib" ++export AWS_SHARED_CREDENTIALS_FILE="$TMP/credentials" ++export AWS_EC2_METADATA_DISABLED=true ++export HOME="$TMP/home" ++mkdir -p "$HOME" ++ ++BIN="$TMP/aws-sso-util" ++cat > "$BIN" <<'PY' ++#!/usr/bin/env python ++from aws_sso_util.cli import cli ++cli(prog_name="aws-sso-util") ++PY ++chmod +x "$BIN" ++ ++fail() { echo "FAIL: $*" >&2; exit 1; } ++ ++set_config() { ++ cp "$1" "$TMP/aws-config" ++ export AWS_CONFIG_FILE="$TMP/aws-config" ++} ++ ++run_cli() { ++ : > "$TMP/log.jsonl" ++ export AWS_SSO_UTIL_LOGIN_STUB_LOG="$TMP/log.jsonl" ++ unset AWS_SSO_UTIL_LOGIN_STUB_MODE ++ "$@" >out 2>err ++ ec=$? ++} ++ ++run_cli_mode() { ++ : > "$TMP/log.jsonl" ++ export AWS_SSO_UTIL_LOGIN_STUB_LOG="$TMP/log.jsonl" ++ AWS_SSO_UTIL_LOGIN_STUB_MODE="$1" "${@:2}" >out 2>err ++ ec=$? ++} ++ ++assert_file_eq() { ++ local label=$1 ++ local path=$2 ++ local expected=$3 ++ local actual ++ actual=$(cat "$path") ++ [ "$actual" = "$expected" ] || fail "$label: got [$actual]" ++} ++ ++assert_log_eq() { ++ local label=$1 ++ local expected=$2 ++ local actual ++ actual=$(cat "$TMP/log.jsonl") ++ [ "$actual" = "$expected" ] || fail "$label log: got [$actual]" ++} ++ ++assert_success_output() { ++ local label=$1 ++ local path=$2 ++ local start_url=$3 ++ ++ python - "$label" "$path" "$start_url" <<'PY' || exit 1 ++import sys ++ ++label, path, start_url = sys.argv[1:4] ++with open(path, encoding="utf-8") as f: ++ lines = f.read().splitlines() ++expected_prefix = "Login succeeded, valid until " ++if len(lines) != 2: ++ raise SystemExit(f"FAIL: {label} stdout line count: got {lines!r}") ++if lines[0] != f"Logging in {start_url}": ++ raise SystemExit(f"FAIL: {label} missing logging line: got {lines[0]!r}") ++if not lines[1].startswith(expected_prefix): ++ raise SystemExit(f"FAIL: {label} missing success prefix: got {lines[1]!r}") ++timestamp = lines[1][len(expected_prefix):].strip() ++if not timestamp: ++ raise SystemExit(f"FAIL: {label} missing success timestamp") ++if "2031-02-03" not in timestamp or "04:05" not in timestamp: ++ raise SystemExit(f"FAIL: {label} timestamp did not reflect stub token expiration: got {timestamp!r}") ++PY ++} ++ ++assert_all_success_output() { ++ local label=$1 ++ local path=$2 ++ ++ python - "$label" "$path" <<'PY' || exit 1 ++import sys ++ ++label, path = sys.argv[1:3] ++expected_urls = { ++ "https://alpha.awsapps.com/start", ++ "https://beta.awsapps.com/start", ++ "https://gamma.awsapps.com/start", ++} ++with open(path, encoding="utf-8") as f: ++ lines = f.read().splitlines() ++if not lines or lines[0] != "Logging in 3 Identity Center instances": ++ raise SystemExit(f"FAIL: {label} missing multi-instance header: got {lines!r}") ++if len(lines[1:]) != len(expected_urls) * 2: ++ raise SystemExit(f"FAIL: {label} wrong per-instance output count: got {lines!r}") ++seen = set() ++prefix = "Login succeeded, valid until " ++for i in range(1, len(lines), 2): ++ line = lines[i] ++ if not line.startswith("Logging in "): ++ raise SystemExit(f"FAIL: {label} expected logging line: got {line!r}") ++ url = line[len("Logging in "):] ++ seen.add(url) ++ success = lines[i + 1] ++ if not success.startswith(prefix): ++ raise SystemExit(f"FAIL: {label} missing success line after {url}: got {success!r}") ++ timestamp = success[len(prefix):].strip() ++ if "2031-02-03" not in timestamp or "04:05" not in timestamp: ++ raise SystemExit(f"FAIL: {label} timestamp did not reflect stub token expiration: got {timestamp!r}") ++if seen != expected_urls: ++ raise SystemExit(f"FAIL: {label} selected URLs mismatch: got {sorted(seen)!r}") ++PY ++} ++ ++assert_fetch_log() { ++ local label=$1 ++ local start_url=$2 ++ local region=$3 ++ local force_refresh=$4 ++ local headless=$5 ++ ++ python - "$label" "$TMP/log.jsonl" "$start_url" "$region" "$force_refresh" "$headless" <<'PY' || exit 1 ++import json ++import sys ++ ++label, path, start_url, region, force_refresh, headless = sys.argv[1:7] ++want_force = force_refresh == "true" ++with open(path, encoding="utf-8") as f: ++ events = [json.loads(line) for line in f if line.strip()] ++fetches = [e for e in events if e.get("event") == "fetch_token"] ++if not any(e.get("start_url") == start_url and e.get("region") == region and e.get("force_refresh") is want_force for e in fetches): ++ raise SystemExit(f"FAIL: {label} missing fetch_token for {start_url} {region} force={want_force}: got {events!r}") ++fetchers = [e for e in events if e.get("event") == "get_token_fetcher" and e.get("region") == region] ++if not fetchers: ++ raise SystemExit(f"FAIL: {label} missing token fetcher for {region}: got {events!r}") ++if not any(e.get("interactive") is True for e in fetchers): ++ raise SystemExit(f"FAIL: {label} token fetcher did not allow interactive user-code flow: got {events!r}") ++if headless == "true": ++ if not any(e.get("disable_browser") is True for e in fetchers): ++ raise SystemExit(f"FAIL: {label} headless did not disable browser: got {events!r}") ++else: ++ if any(e.get("disable_browser") is True for e in fetchers): ++ raise SystemExit(f"FAIL: {label} browser disabled without --headless: got {events!r}") ++PY ++} ++ ++assert_starts_with() { ++ local label=$1 ++ local path=$2 ++ local prefix=$3 ++ local actual ++ actual=$(cat "$path") ++ [[ "$actual" == "$prefix"* ]] || fail "$label: got [$actual]" ++} ++ ++assert_nonempty_after_prefix() { ++ local label=$1 ++ local path=$2 ++ local prefix=$3 ++ local actual rest ++ actual=$(cat "$path") ++ [[ "$actual" == "$prefix"* ]] || fail "$label: got [$actual]" ++ rest=${actual#"$prefix"} ++ [ -n "$rest" ] || fail "$label: missing detail after prefix" ++} ++ ++cd "$TMP" || exit 1 ++ ++ ++ ++ ++set_config "$FIXTURES/aws-config-three" ++run_cli "$BIN" --help ++[ "$ec" -eq 0 ] || fail "F1 exit $ec; want 0" ++ ++grep -Eq '^[[:space:]]*login([[:space:]]|$)' out || fail "F1 missing login command" ++[ ! -s err ] || fail "F1 unexpected stderr: $(cat err)" ++ ++ ++ ++ ++run_cli "$BIN" login --help ++[ "$ec" -eq 0 ] || fail "F2 exit $ec; want 0" ++ ++grep -q 'Usage: .*login' out || fail "F2 missing login usage" ++grep -q 'SSO_START_URL' out || fail "F2 missing SSO_START_URL argument" ++grep -q 'SSO_REGION' out || fail "F2 missing SSO_REGION argument" ++grep -q -- '--profile' out || fail "F2 missing profile option" ++grep -q -- '--all' out || fail "F2 missing all option" ++grep -q -- '--force-refresh' out || fail "F2 missing force-refresh option" ++grep -q -- '--headless' out || fail "F2 missing headless option" ++grep -q -- '-v, --verbose\|--verbose, -v' out || fail "F2 missing verbose option" ++grep -qi 'Identity Center' out || fail "F2 missing login-oriented Identity Center text" ++grep -qi 'log in' out || fail "F2 missing login-oriented help text" ++! grep -q -- '--sso-start-url' out || fail "F2 hidden --sso-start-url was listed" ++! grep -q -- '--sso-region' out || fail "F2 hidden --sso-region was listed" ++! grep -Eq '(^|[[:space:]])--force([,[:space:]]|$)' out || fail "F2 hidden --force was listed" ++[ ! -s err ] || fail "F2 unexpected stderr: $(cat err)" ++ ++ ++ ++ ++run_cli "$BIN" login https://alpha.awsapps.com/start us-east-1 ++[ "$ec" -eq 0 ] || fail "F3 exit $ec; want 0" ++assert_success_output "F3" out "https://alpha.awsapps.com/start" ++[ ! -s err ] || fail "F3 unexpected stderr: $(cat err)" ++assert_fetch_log "F3" "https://alpha.awsapps.com/start" "us-east-1" "false" "false" ++ ++ ++ ++ ++run_cli python -m aws_sso_util.login --profile beta --force-refresh --headless ++[ "$ec" -eq 0 ] || fail "F4 exit $ec; want 0" ++assert_success_output "F4" out "https://beta.awsapps.com/start" ++[ ! -s err ] || fail "F4 unexpected stderr: $(cat err)" ++assert_fetch_log "F4" "https://beta.awsapps.com/start" "us-west-2" "true" "true" ++ ++ ++ ++ ++run_cli "$BIN" login --sso-start-url https://gamma.awsapps.com/start --sso-region eu-central-1 --force ++[ "$ec" -eq 0 ] || fail "F5 exit $ec; want 0" ++assert_success_output "F5" out "https://gamma.awsapps.com/start" ++[ ! -s err ] || fail "F5 unexpected stderr: $(cat err)" ++assert_fetch_log "F5" "https://gamma.awsapps.com/start" "eu-central-1" "true" "false" ++ ++ ++ ++ ++AWS_SSO_LOGIN_DEFAULT_SSO_START_URL=https://beta.awsapps.com/start \ ++AWS_SSO_LOGIN_DEFAULT_SSO_REGION=us-west-2 \ ++run_cli "$BIN" login ++[ "$ec" -eq 0 ] || fail "F6 exit $ec; want 0" ++assert_success_output "F6" out "https://beta.awsapps.com/start" ++[ ! -s err ] || fail "F6 unexpected stderr: $(cat err)" ++assert_fetch_log "F6" "https://beta.awsapps.com/start" "us-west-2" "false" "false" ++ ++ ++ ++ ++set_config "$FIXTURES/aws-config-empty" ++run_cli "$BIN" login ++[ "$ec" -eq 1 ] || fail "F7 exit $ec; want 1" ++[ ! -s out ] || fail "F7 unexpected stdout: $(cat out)" ++assert_file_eq "F7 stderr" err "No Identity Center config found" ++[ ! -s "$TMP/log.jsonl" ] || fail "F7 should not fetch token" ++ ++ ++ ++ ++set_config "$FIXTURES/aws-config-three" ++run_cli "$BIN" login nomatch us-east-1 ++[ "$ec" -eq 1 ] || fail "F8 exit $ec; want 1" ++[ ! -s out ] || fail "F8 unexpected stdout: $(cat out)" ++ ++assert_starts_with "F8 stderr" err "No Identity Center config matched" ++grep -q 'nomatch' err || fail "F8 stderr missing requested start URL matcher" ++grep -q 'us-east-1' err || fail "F8 stderr missing requested region" ++[ ! -s "$TMP/log.jsonl" ] || fail "F8 should not fetch token" ++ ++ ++ ++ ++run_cli "$BIN" login ++[ "$ec" -eq 1 ] || fail "F9 exit $ec; want 1" ++[ ! -s out ] || fail "F9 unexpected stdout: $(cat out)" ++ ++assert_starts_with "F9 stderr" err "Found 3 Identity Center configs, please specify one or use --all:" ++grep -q 'https://alpha.awsapps.com/start' err || fail "F9 stderr missing alpha URL" ++grep -q 'https://beta.awsapps.com/start' err || fail "F9 stderr missing beta URL" ++grep -q 'https://gamma.awsapps.com/start' err || fail "F9 stderr missing gamma URL" ++[ ! -s "$TMP/log.jsonl" ] || fail "F9 should not fetch token" ++ ++ ++ ++ ++run_cli "$BIN" login --all ++[ "$ec" -eq 0 ] || fail "F10 exit $ec; want 0" ++assert_all_success_output "F10" out ++[ ! -s err ] || fail "F10 unexpected stderr: $(cat err)" ++grep -q '"start_url": "https://alpha.awsapps.com/start"' "$TMP/log.jsonl" || fail "F10 missing alpha fetch" ++grep -q '"start_url": "https://beta.awsapps.com/start"' "$TMP/log.jsonl" || fail "F10 missing beta fetch" ++grep -q '"start_url": "https://gamma.awsapps.com/start"' "$TMP/log.jsonl" || fail "F10 missing gamma fetch" ++ ++ ++ ++ ++AWS_SSO_LOGIN_ALL=1 run_cli python -m aws_sso_util.login ++[ "$ec" -eq 0 ] || fail "F11 exit $ec; want 0" ++assert_all_success_output "F11" out ++[ ! -s err ] || fail "F11 unexpected stderr: $(cat err)" ++ ++ ++ ++ ++AWS_SSO_LOGIN_ALL=true run_cli "$BIN" login ++[ "$ec" -eq 0 ] || fail "F12 exit $ec; want 0" ++assert_all_success_output "F12" out ++[ ! -s err ] || fail "F12 unexpected stderr: $(cat err)" ++ ++ ++ ++ ++run_cli_mode pending_expired "$BIN" login https://alpha.awsapps.com/start us-east-1 ++[ "$ec" -eq 2 ] || fail "F13 exit $ec; want 2" ++assert_file_eq "F13 stdout" out "Logging in https://alpha.awsapps.com/start" ++assert_file_eq "F13 stderr" err "Login window expired" ++ ++ ++ ++ ++run_cli_mode invalid_grant "$BIN" login https://alpha.awsapps.com/start us-east-1 ++[ "$ec" -eq 3 ] || fail "F14 exit $ec; want 3" ++assert_file_eq "F14 stdout" out "Logging in https://alpha.awsapps.com/start" ++assert_file_eq "F14 stderr" err "Login failed; the login window may have expired: InvalidGrantException (Device code expired)" ++ ++ ++ ++ ++run_cli_mode client_error "$BIN" login https://alpha.awsapps.com/start us-east-1 ++[ "$ec" -eq 4 ] || fail "F15 exit $ec; want 4" ++assert_file_eq "F15 stdout" out "Logging in https://alpha.awsapps.com/start" ++ ++assert_nonempty_after_prefix "F15 stderr" err "Login failed: " ++ ++ ++ ++ ++run_cli_mode unexpected "$BIN" login https://alpha.awsapps.com/start us-east-1 ++[ "$ec" -eq 4 ] || fail "F16 exit $ec; want 4" ++assert_file_eq "F16 stdout" out "Logging in https://alpha.awsapps.com/start" ++ ++assert_nonempty_after_prefix "F16 stderr" err "Login failed: " ++ ++echo "PASS" ++exit 0 +diff --git a/mimo_test_command.sh b/mimo_test_command.sh +new file mode 100755 +--- /dev/null ++++ b/mimo_test_command.sh +@@ -0,0 +1,12 @@ ++#!/usr/bin/env bash ++ ++ ++ ++ ++export NODE_OPTIONS="${NODE_OPTIONS:-} --max-old-space-size=4096" ++export MAVEN_OPTS="${MAVEN_OPTS:-} -Xmx3g -XX:+UseG1GC" ++export GRADLE_OPTS="${GRADLE_OPTS:-} -Xmx3g -XX:+UseG1GC" ++export TEST_JVM_OPTS="${TEST_JVM_OPTS:-} -Xmx3g" ++set -e ++cd /workspace/repo ++exec bash /workspace/repo/usercase-test-coderl/usecase.sh diff --git a/tasks/format-code-task-000550/tests/test.sh b/tasks/format-code-task-000550/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..31c6ab8a97070b2bf9f23b54a5deeb0f7d4603a8 --- /dev/null +++ b/tasks/format-code-task-000550/tests/test.sh @@ -0,0 +1,41 @@ +#!/bin/bash +# Code grading, mimoagent opensource_code.py: reset the files the hidden test patch touches, apply it, run the +# task's test command; reward 1 when it exits 0. A testbed failure (reset or apply) writes no reward: not scored. +M=/var/lib/mimo +CWD=/workspace/repo +V=/logs/verifier +mkdir -p "$V" +BASE=$(cat "$M/base" 2>/dev/null) || { echo "setup never ran (no $M/base)" >&2; exit 1; } +cd "$CWD" || exit 1 +if [ -d "$M/git-hidden" ]; then rm -rf "$CWD/.git"; mv "$M/git-hidden" "$CWD/.git"; fi +# the agent's change against the base, so its own commits count too +git add -A >/dev/null 2>&1 && git -c core.fileMode=false diff --cached "$BASE" > "$V/agent.diff" +git reset -q +if ! ( +while IFS= read -r tf; do + [ -z "$tf" ] && continue + if git cat-file -e $BASE:"$tf" 2>/dev/null; then + git checkout $BASE -- "$tf" 2>/dev/null || true + else + git rm -f --cached "$tf" >/dev/null 2>&1 || true + rm -f "$tf" + fi +done <<'EOF_RESET_TEST_FILES' +usercase-test-coderl/fixtures/aws-config-empty +usercase-test-coderl/fixtures/aws-config-three +usercase-test-coderl/fixtures/sitecustomize.py +usercase-test-coderl/usecase.sh +mimo_test_command.sh +EOF_RESET_TEST_FILES + +); then echo "could not reset the test files (testbed problem, not scored)" >&2; exit 1; fi +if ! git apply --verbose /tests/test.patch > "$V/apply.log" 2>&1; then + cat "$V/apply.log" >&2 + echo "the hidden tests could not be applied (testbed problem, not scored)" >&2 + exit 1 +fi +timeout 1800 sh -c "$(cat /tests/test_command.sh)" > "$V/test_output.log" 2>&1 +RC=$? +tail -c 12000 "$V/test_output.log" +if [ $RC -eq 0 ]; then echo 1 > "$V/reward.txt"; else echo 0 > "$V/reward.txt"; fi +echo "test command exited $RC" diff --git a/tasks/format-code-task-000550/tests/test_command.sh b/tasks/format-code-task-000550/tests/test_command.sh new file mode 100644 index 0000000000000000000000000000000000000000..88cb7810b836396c4869db31aeac7d4d4b189685 --- /dev/null +++ b/tasks/format-code-task-000550/tests/test_command.sh @@ -0,0 +1 @@ +bash /workspace/repo/mimo_test_command.sh \ No newline at end of file diff --git a/tasks/format-code-task-000557/environment/Dockerfile b/tasks/format-code-task-000557/environment/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..a0940f11206bd342e14c050c120fc31db99578d9 --- /dev/null +++ b/tasks/format-code-task-000557/environment/Dockerfile @@ -0,0 +1,3 @@ +# The task's image, pinned by digest (the same as [environment].docker_image). +# Setup runs at start from [environment.healthcheck]; environment/setup/ is its readable copy. +FROM docker.io/xiaomimimo/mimo-v2.6-rl-oss@sha256:2d945af1d2c10ca52f5475f74fa6e7f66d320f89d6fc91d6805bcf119893b314 diff --git a/tasks/format-code-task-000557/environment/setup/files/blocklist b/tasks/format-code-task-000557/environment/setup/files/blocklist new file mode 100644 index 0000000000000000000000000000000000000000..a8e4bdc4c7d9b739c047a3cb58ea72a1bb05bcbc --- /dev/null +++ b/tasks/format-code-task-000557/environment/setup/files/blocklist @@ -0,0 +1,33 @@ +# mimo answer-leak blocklist (mimoagent) +0.0.0.0 github.com +0.0.0.0 www.github.com +0.0.0.0 api.github.com +0.0.0.0 raw.githubusercontent.com +0.0.0.0 codeload.github.com +0.0.0.0 objects.githubusercontent.com +0.0.0.0 gist.github.com +0.0.0.0 gist.githubusercontent.com +0.0.0.0 gitlab.com +0.0.0.0 bitbucket.org +0.0.0.0 sourceforge.net +0.0.0.0 git.kernel.org +0.0.0.0 chromium.googlesource.com +0.0.0.0 android.googlesource.com +0.0.0.0 sourcegraph.com +0.0.0.0 bugs.chromium.org +0.0.0.0 issues.oss-fuzz.com +0.0.0.0 oss-fuzz.com +0.0.0.0 osv.dev +0.0.0.0 api.osv.dev +0.0.0.0 bugzilla.mozilla.org +0.0.0.0 proxy.golang.org +0.0.0.0 sum.golang.org +0.0.0.0 pkg.go.dev +0.0.0.0 google.com +0.0.0.0 www.google.com +0.0.0.0 bing.com +0.0.0.0 www.bing.com +0.0.0.0 duckduckgo.com +0.0.0.0 html.duckduckgo.com +0.0.0.0 search.brave.com +0.0.0.0 stackoverflow.com diff --git a/tasks/format-code-task-000557/environment/setup/setup.sh b/tasks/format-code-task-000557/environment/setup/setup.sh new file mode 100644 index 0000000000000000000000000000000000000000..d883db90cfcfb48f7a139861bbe9f6b5d95cad6f --- /dev/null +++ b/tasks/format-code-task-000557/environment/setup/setup.sh @@ -0,0 +1,34 @@ +#!/bin/bash +# Runs once, as root, before the agent starts: Harbor's [environment.healthcheck] unpacks this folder into +# /var/lib/mimo and runs it. Generated by mimo_harbor; see its README for how each step maps to Xiaomi's harness. +M=/var/lib/mimo +[ -f "$M/ready" ] && exit 0 +chmod 700 "$M" +fail() { echo "setup: $*" >&2; exit 1; } +# the answer-leak blocklist (mimoagent), applied to /etc/hosts by the agent right after it installs +write_blocklist() { cp "$M/files/blocklist" "$M/blocklist"; } + +# Code: mimoagent environments/datasets/opensource_code.py + base.py, as the explorer runs it (app/runner/domains.py Code). +CWD=/testbed +git config --global --add safe.directory "$CWD" +cd "$CWD" || fail "no working directory $CWD" +if ! git rev-parse --git-dir >/dev/null 2>&1; then # a bare source tree: give it a baseline commit + git init -q && git add -A && git -c user.name=mimo -c user.email=mimo@localhost commit -q -m baseline --allow-empty +fi +BASE=$(git rev-parse HEAD 2>/dev/null) +[ ${#BASE} -eq 40 ] || fail "could not resolve the base commit in $CWD" +echo "$BASE" > "$M/base" +# Images are built with history truncated at the base. If one is not, the fix could be read out of git log, +# so .git is hidden while the agent works and put back for grading. +LATER=$(git rev-list --all --not "$BASE" 2>/dev/null | head -n 5 | grep -c . || true) +rm -f /tmp/fail.log /tmp/pass.log /tmp/patch.diff /tmp/test_patch.diff /tmp/*.log 2>/dev/null; rm -rf /tmp/claude-0 /tmp/claude-* /tmp/testem-* /tmp/puppeteer_dev_chrome_profile-* 2>/dev/null; rm -f /tmp/test_files.json 2>/dev/null; rm -rf /tmp/jest_* /tmp/jest-* /tmp/build /tmp/build_env 2>/dev/null; rm -rf /tmp/pytest-of-root /tmp/pytest-* /tmp/.pytest_cache /tmp/__pycache__ 2>/dev/null; rm -rf /tmp/go-build* /tmp/standards /tmp/wordpress /tmp/zig-* /tmp/testbase /tmp/testbed 2>/dev/null; rm -f /tmp/tmp*.tmp /tmp/*.bak /tmp/expect* /tmp/butwas* 2>/dev/null; rm -rf /root/.cache/go-build 2>/dev/null; rm -rf /tests 2>/dev/null; find /logs -mindepth 1 -delete 2>/dev/null; mkdir -p /logs/agent /logs/verifier /logs/artifacts; chmod 777 /logs/agent /logs/verifier /logs/artifacts; find /var/log -type f -delete 2>/dev/null || true; rm -rf /var/lib/postgresql/*/*/log /var/lib/postgresql/*/*/pg_log 2>/dev/null || true; find /var/lib/mysql /var/lib/mongodb -type f -name '*.log' -delete 2>/dev/null || true; rm -rf /root/.npm/_logs /root/.babel.json /root/.pytest_cache 2>/dev/null || true; find / -maxdepth 4 -xdev -name task_description.md -path '*/.build_env/*' -delete 2>/dev/null || true; true +git clean -fdx --exclude=node_modules --exclude=bower_components --exclude=.husky --exclude=vendor --exclude=third_party --exclude=_deps --exclude=vcpkg_installed --exclude=.venv --exclude=venv --exclude=.gradle --exclude=target --exclude=.build --exclude=lib --exclude=.bundle --exclude=Manifest.toml --exclude=_build --exclude=.stack-work --exclude=dist-newstyle >/dev/null 2>&1 +find /root/.m2 -type f \( -name '*-SNAPSHOT.jar' -o -name '*-SNAPSHOT-sources.jar' -o -name '*-SNAPSHOT-tests.jar' -o -name '*-SNAPSHOT-test-sources.jar' \) -delete 2>/dev/null; rm -rf /root/.julia/compiled 2>/dev/null; rm -rf /root/.gradle/caches/build-cache-* /root/.gradle/daemon 2>/dev/null; rm -rf /root/.gradle/caches/*/scripts /root/.gradle/caches/jars-* 2>/dev/null; rm -rf /root/.cache/bazel 2>/dev/null; true +if [ "$LATER" -gt 0 ]; then + mv "$CWD/.git" "$M/git-hidden" + echo "history not truncated at ${BASE:0:12}: .git hidden while the agent works" +fi +write_blocklist + +touch "$M/ready" +echo "setup done" diff --git a/tasks/format-code-task-000557/tests/test.patch b/tasks/format-code-task-000557/tests/test.patch new file mode 100644 index 0000000000000000000000000000000000000000..881fad433fd0d3f311bcd1a1703072d1d1ec6b2a --- /dev/null +++ b/tasks/format-code-task-000557/tests/test.patch @@ -0,0 +1,62 @@ +diff --git a/foolbox/tests/conftest.py b/foolbox/tests/conftest.py +index bc37f9ae..c9d50de1 100644 +--- a/foolbox/tests/conftest.py ++++ b/foolbox/tests/conftest.py +@@ -368,6 +368,17 @@ def eg_bn_adversarial(request, bn_criterion, bn_image, bn_label): + yield Adversarial(model, criterion, image, label) + + ++@pytest.fixture( ++ params=[CoordinateWiseGradientEstimator, EvolutionaryStrategiesGradientEstimator] ++) ++def eg_bn_model(request): ++ eg_bn_model = eg_bn_model_factory(request) ++ ++ cm_model = contextmanager(eg_bn_model) ++ with cm_model() as model: ++ yield model ++ ++ + @pytest.fixture + def bn_impossible(bn_impossible_criterion, bn_image, bn_label): + criterion = bn_impossible_criterion +diff --git a/foolbox/tests/test_model_wrappers.py b/foolbox/tests/test_model_wrappers.py +index df053a0f..94e448fc 100644 +--- a/foolbox/tests/test_model_wrappers.py ++++ b/foolbox/tests/test_model_wrappers.py +@@ -98,3 +98,15 @@ def test_estimate_gradient_wrapper(eg_bn_adversarial, bn_image): + assert np.all(p == p2) and np.all(p == p3) + assert np.all(g == g2) and np.all(g == g3) + assert ia == ia2 == ia3 ++ ++ ++def test_batched_estimate_gradient_wrapper(eg_bn_model, bn_image, bn_label): ++ set_seeds(22) ++ g1 = eg_bn_model.gradient(bn_image[np.newaxis], [bn_label])[0] ++ set_seeds(22) ++ g2 = eg_bn_model.gradient_one(bn_image, bn_label) ++ ++ assert np.allclose(g1, g2) ++ ++ gs = eg_bn_model.gradient(np.array([bn_image] * 2), np.array([bn_label] * 2)) ++ assert np.allclose(gs[0], gs[1], atol=1e-1) +diff --git a/mimo_build_env.tar.gz.b64 b/mimo_build_env.tar.gz.b64 +new file mode 100644 +--- /dev/null ++++ b/mimo_build_env.tar.gz.b64 +@@ -0,0 +1,4 @@ ++H4sIAAAAAAAAA+3S0WrDIBTGca/7FOcFmmkTk8cJSXV0kMQQbbu+/SSDbQy23rSM0f/v5oge8Mhn ++0R9fBtf66fSk7kVnjbVrzb7XdW3szhjbGFuWShtT60qJvdtEXxxj6hYRtYSQfuu7dv5PFZ/5Jx9T ++uw/j2E2uiIfb3XEtf6Prj/yrqsn5V/XOKNG3G+FnD57/3skafO/dZr6kQ5hK2Y6Sl3lTnkMY+vC6 ++dsT3DzIG54f2vHTz7JdYzBfZnjZ//QoAAAAAAAAAAAAAAADgMb0BSPH+DgAoAAA= +diff --git a/mimo_test_command.sh b/mimo_test_command.sh +new file mode 100755 +--- /dev/null ++++ b/mimo_test_command.sh +@@ -0,0 +1,6 @@ ++#!/usr/bin/env bash ++ ++set -uo pipefail ++cd /testbed || exit 1 ++base64 -d mimo_build_env.tar.gz.b64 | tar -xzf - -C /testbed || exit 1 ++exec bash -lc 'cd /testbed && bash -eo pipefail /testbed/.build_env/test_command.sh' diff --git a/tasks/format-code-task-000557/tests/test.sh b/tasks/format-code-task-000557/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..fecbb2fc5981ac575af38b322a7cd7ecad16cf25 --- /dev/null +++ b/tasks/format-code-task-000557/tests/test.sh @@ -0,0 +1,40 @@ +#!/bin/bash +# Code grading, mimoagent opensource_code.py: reset the files the hidden test patch touches, apply it, run the +# task's test command; reward 1 when it exits 0. A testbed failure (reset or apply) writes no reward: not scored. +M=/var/lib/mimo +CWD=/testbed +V=/logs/verifier +mkdir -p "$V" +BASE=$(cat "$M/base" 2>/dev/null) || { echo "setup never ran (no $M/base)" >&2; exit 1; } +cd "$CWD" || exit 1 +if [ -d "$M/git-hidden" ]; then rm -rf "$CWD/.git"; mv "$M/git-hidden" "$CWD/.git"; fi +# the agent's change against the base, so its own commits count too +git add -A >/dev/null 2>&1 && git -c core.fileMode=false diff --cached "$BASE" > "$V/agent.diff" +git reset -q +if ! ( +while IFS= read -r tf; do + [ -z "$tf" ] && continue + if git cat-file -e $BASE:"$tf" 2>/dev/null; then + git checkout $BASE -- "$tf" 2>/dev/null || true + else + git rm -f --cached "$tf" >/dev/null 2>&1 || true + rm -f "$tf" + fi +done <<'EOF_RESET_TEST_FILES' +foolbox/tests/conftest.py +foolbox/tests/test_model_wrappers.py +mimo_build_env.tar.gz.b64 +mimo_test_command.sh +EOF_RESET_TEST_FILES + +); then echo "could not reset the test files (testbed problem, not scored)" >&2; exit 1; fi +if ! git apply --verbose /tests/test.patch > "$V/apply.log" 2>&1; then + cat "$V/apply.log" >&2 + echo "the hidden tests could not be applied (testbed problem, not scored)" >&2 + exit 1 +fi +timeout 1800 sh -c "$(cat /tests/test_command.sh)" > "$V/test_output.log" 2>&1 +RC=$? +tail -c 12000 "$V/test_output.log" +if [ $RC -eq 0 ]; then echo 1 > "$V/reward.txt"; else echo 0 > "$V/reward.txt"; fi +echo "test command exited $RC" diff --git a/tasks/format-code-task-000557/tests/test_command.sh b/tasks/format-code-task-000557/tests/test_command.sh new file mode 100644 index 0000000000000000000000000000000000000000..7cb23076694ad17d72e8296d62b2b240083e36db --- /dev/null +++ b/tasks/format-code-task-000557/tests/test_command.sh @@ -0,0 +1 @@ +bash /testbed/mimo_test_command.sh \ No newline at end of file diff --git a/tasks/format-code-task-000566/environment/Dockerfile b/tasks/format-code-task-000566/environment/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..35785de0a41cbbff434d26612c63da9eb574c5ca --- /dev/null +++ b/tasks/format-code-task-000566/environment/Dockerfile @@ -0,0 +1,3 @@ +# The task's image, pinned by digest (the same as [environment].docker_image). +# Setup runs at start from [environment.healthcheck]; environment/setup/ is its readable copy. +FROM docker.io/xiaomimimo/mimo-v2.6-rl-oss@sha256:4f5df719c15afd362f0bd6f3153563a5b7d35454eb0d560b92715e05c26d797b diff --git a/tasks/format-code-task-000566/environment/setup/files/blocklist b/tasks/format-code-task-000566/environment/setup/files/blocklist new file mode 100644 index 0000000000000000000000000000000000000000..a8e4bdc4c7d9b739c047a3cb58ea72a1bb05bcbc --- /dev/null +++ b/tasks/format-code-task-000566/environment/setup/files/blocklist @@ -0,0 +1,33 @@ +# mimo answer-leak blocklist (mimoagent) +0.0.0.0 github.com +0.0.0.0 www.github.com +0.0.0.0 api.github.com +0.0.0.0 raw.githubusercontent.com +0.0.0.0 codeload.github.com +0.0.0.0 objects.githubusercontent.com +0.0.0.0 gist.github.com +0.0.0.0 gist.githubusercontent.com +0.0.0.0 gitlab.com +0.0.0.0 bitbucket.org +0.0.0.0 sourceforge.net +0.0.0.0 git.kernel.org +0.0.0.0 chromium.googlesource.com +0.0.0.0 android.googlesource.com +0.0.0.0 sourcegraph.com +0.0.0.0 bugs.chromium.org +0.0.0.0 issues.oss-fuzz.com +0.0.0.0 oss-fuzz.com +0.0.0.0 osv.dev +0.0.0.0 api.osv.dev +0.0.0.0 bugzilla.mozilla.org +0.0.0.0 proxy.golang.org +0.0.0.0 sum.golang.org +0.0.0.0 pkg.go.dev +0.0.0.0 google.com +0.0.0.0 www.google.com +0.0.0.0 bing.com +0.0.0.0 www.bing.com +0.0.0.0 duckduckgo.com +0.0.0.0 html.duckduckgo.com +0.0.0.0 search.brave.com +0.0.0.0 stackoverflow.com diff --git a/tasks/format-code-task-000566/environment/setup/setup.sh b/tasks/format-code-task-000566/environment/setup/setup.sh new file mode 100644 index 0000000000000000000000000000000000000000..d883db90cfcfb48f7a139861bbe9f6b5d95cad6f --- /dev/null +++ b/tasks/format-code-task-000566/environment/setup/setup.sh @@ -0,0 +1,34 @@ +#!/bin/bash +# Runs once, as root, before the agent starts: Harbor's [environment.healthcheck] unpacks this folder into +# /var/lib/mimo and runs it. Generated by mimo_harbor; see its README for how each step maps to Xiaomi's harness. +M=/var/lib/mimo +[ -f "$M/ready" ] && exit 0 +chmod 700 "$M" +fail() { echo "setup: $*" >&2; exit 1; } +# the answer-leak blocklist (mimoagent), applied to /etc/hosts by the agent right after it installs +write_blocklist() { cp "$M/files/blocklist" "$M/blocklist"; } + +# Code: mimoagent environments/datasets/opensource_code.py + base.py, as the explorer runs it (app/runner/domains.py Code). +CWD=/testbed +git config --global --add safe.directory "$CWD" +cd "$CWD" || fail "no working directory $CWD" +if ! git rev-parse --git-dir >/dev/null 2>&1; then # a bare source tree: give it a baseline commit + git init -q && git add -A && git -c user.name=mimo -c user.email=mimo@localhost commit -q -m baseline --allow-empty +fi +BASE=$(git rev-parse HEAD 2>/dev/null) +[ ${#BASE} -eq 40 ] || fail "could not resolve the base commit in $CWD" +echo "$BASE" > "$M/base" +# Images are built with history truncated at the base. If one is not, the fix could be read out of git log, +# so .git is hidden while the agent works and put back for grading. +LATER=$(git rev-list --all --not "$BASE" 2>/dev/null | head -n 5 | grep -c . || true) +rm -f /tmp/fail.log /tmp/pass.log /tmp/patch.diff /tmp/test_patch.diff /tmp/*.log 2>/dev/null; rm -rf /tmp/claude-0 /tmp/claude-* /tmp/testem-* /tmp/puppeteer_dev_chrome_profile-* 2>/dev/null; rm -f /tmp/test_files.json 2>/dev/null; rm -rf /tmp/jest_* /tmp/jest-* /tmp/build /tmp/build_env 2>/dev/null; rm -rf /tmp/pytest-of-root /tmp/pytest-* /tmp/.pytest_cache /tmp/__pycache__ 2>/dev/null; rm -rf /tmp/go-build* /tmp/standards /tmp/wordpress /tmp/zig-* /tmp/testbase /tmp/testbed 2>/dev/null; rm -f /tmp/tmp*.tmp /tmp/*.bak /tmp/expect* /tmp/butwas* 2>/dev/null; rm -rf /root/.cache/go-build 2>/dev/null; rm -rf /tests 2>/dev/null; find /logs -mindepth 1 -delete 2>/dev/null; mkdir -p /logs/agent /logs/verifier /logs/artifacts; chmod 777 /logs/agent /logs/verifier /logs/artifacts; find /var/log -type f -delete 2>/dev/null || true; rm -rf /var/lib/postgresql/*/*/log /var/lib/postgresql/*/*/pg_log 2>/dev/null || true; find /var/lib/mysql /var/lib/mongodb -type f -name '*.log' -delete 2>/dev/null || true; rm -rf /root/.npm/_logs /root/.babel.json /root/.pytest_cache 2>/dev/null || true; find / -maxdepth 4 -xdev -name task_description.md -path '*/.build_env/*' -delete 2>/dev/null || true; true +git clean -fdx --exclude=node_modules --exclude=bower_components --exclude=.husky --exclude=vendor --exclude=third_party --exclude=_deps --exclude=vcpkg_installed --exclude=.venv --exclude=venv --exclude=.gradle --exclude=target --exclude=.build --exclude=lib --exclude=.bundle --exclude=Manifest.toml --exclude=_build --exclude=.stack-work --exclude=dist-newstyle >/dev/null 2>&1 +find /root/.m2 -type f \( -name '*-SNAPSHOT.jar' -o -name '*-SNAPSHOT-sources.jar' -o -name '*-SNAPSHOT-tests.jar' -o -name '*-SNAPSHOT-test-sources.jar' \) -delete 2>/dev/null; rm -rf /root/.julia/compiled 2>/dev/null; rm -rf /root/.gradle/caches/build-cache-* /root/.gradle/daemon 2>/dev/null; rm -rf /root/.gradle/caches/*/scripts /root/.gradle/caches/jars-* 2>/dev/null; rm -rf /root/.cache/bazel 2>/dev/null; true +if [ "$LATER" -gt 0 ]; then + mv "$CWD/.git" "$M/git-hidden" + echo "history not truncated at ${BASE:0:12}: .git hidden while the agent works" +fi +write_blocklist + +touch "$M/ready" +echo "setup done" diff --git a/tasks/format-code-task-000566/tests/test.patch b/tasks/format-code-task-000566/tests/test.patch new file mode 100644 index 0000000000000000000000000000000000000000..10e5b09ed5827520e85e34a9ac97e08e253b55a0 --- /dev/null +++ b/tasks/format-code-task-000566/tests/test.patch @@ -0,0 +1,145 @@ +diff --git a/test_commands.json b/test_commands.json +new file mode 100644 +index 0000000..63e1d9c +--- /dev/null ++++ b/test_commands.json +@@ -0,0 +1,3 @@ ++{ ++ "test_commands": ["python -m pytest tests/doc_task_test.py -v"] ++} +diff --git a/tests/doc_task_test.py b/tests/doc_task_test.py +index b5b348e..f84ba86 100644 +--- a/tests/doc_task_test.py ++++ b/tests/doc_task_test.py +@@ -564,3 +564,118 @@ def test_find_model_in_dbt(model_name, path_model, schema_exists): + path_file, schema = doc_task.find_model_in_dbt(model_name) + assert path_file == path_model + assert schema == schema_exists ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++def _setup_orchestrate_mocks(doc_task, mocker, content, schema_exists): ++ """Mock the moving parts of ``orchestrate_model_documentation``. ++ ++ Only the questionary prompt call (which the user actually sees) and the ++ ``change_model_description`` / ``process_model`` logic remain real. ++ """ ++ fake_path = Path("schema.yml") ++ mocker.patch.object( ++ doc_task, "find_model_in_dbt", return_value=(fake_path, schema_exists) ++ ) ++ mocker.patch("dbt_sugar.core.task.doc.open_yaml", return_value=content) ++ mocker.patch("dbt_sugar.core.task.doc.save_yaml") ++ mocker.patch.object(doc_task, "document_columns") ++ mocker.patch.object(doc_task, "check_tests") ++ mocker.patch.object(doc_task, "update_model_description_test_tags") ++ mocker.patch.object(doc_task, "update_column_descriptions") ++ ++ ++def _capture_prompt_message(mocker): ++ """Patch ``questionary.prompt`` and return the mock so we can inspect calls.""" ++ return mocker.patch( ++ "questionary.prompt", ++ return_value={ ++ "wants_to_document_model": True, ++ "model_description": "Some description", ++ }, ++ ) ++ ++ ++def _first_prompt_message(prompt_mock): ++ """Return the ``message`` of the first questionary.prompt call payload.""" ++ first_call = prompt_mock.call_args_list[0] ++ ++ payload = first_call[0][0] ++ return payload["message"] ++ ++ ++def test_prompt_for_new_model_when_no_schema_exists(mocker): ++ """First-time documentation (no schema.yml at all) -> 'write a description'.""" ++ doc_task = __init_descriptions() ++ _setup_orchestrate_mocks(doc_task, mocker, content=None, schema_exists=False) ++ prompt_mock = _capture_prompt_message(mocker) ++ ++ doc_task.orchestrate_model_documentation("schema", "fct_orders", ["col_a"]) ++ ++ assert ( ++ _first_prompt_message(prompt_mock) ++ == "Do you want to write a description for fct_orders" ++ ) ++ ++ ++def test_prompt_for_new_model_when_schema_exists_without_model(mocker): ++ """First-time documentation (schema.yml present but model not in it).""" ++ existing_content = { ++ "version": 2, ++ "models": [ ++ { ++ "name": "some_other_model", ++ "description": "Some real description for the other model.", ++ "columns": [], ++ } ++ ], ++ } ++ doc_task = __init_descriptions() ++ _setup_orchestrate_mocks( ++ doc_task, mocker, content=existing_content, schema_exists=True ++ ) ++ prompt_mock = _capture_prompt_message(mocker) ++ ++ doc_task.orchestrate_model_documentation("schema", "fct_orders", ["col_a"]) ++ ++ assert ( ++ _first_prompt_message(prompt_mock) ++ == "Do you want to write a description for fct_orders" ++ ) ++ ++ ++def test_prompt_for_existing_model_with_real_description(mocker): ++ """Model already in schema.yml with a real description -> 'change'.""" ++ existing_content = { ++ "version": 2, ++ "models": [ ++ { ++ "name": "fct_orders", ++ "description": "An existing real description.", ++ "columns": [{"name": "col_a", "description": "descriptionA"}], ++ } ++ ], ++ } ++ doc_task = __init_descriptions() ++ _setup_orchestrate_mocks( ++ doc_task, mocker, content=existing_content, schema_exists=True ++ ) ++ prompt_mock = _capture_prompt_message(mocker) ++ ++ doc_task.orchestrate_model_documentation("schema", "fct_orders", ["col_a"]) ++ ++ assert ( ++ _first_prompt_message(prompt_mock) ++ == "Do you want to change the model description of fct_orders" ++ ) ++ ++ +diff --git a/mimo_test_command.sh b/mimo_test_command.sh +new file mode 100755 +--- /dev/null ++++ b/mimo_test_command.sh +@@ -0,0 +1,8 @@ ++#!/usr/bin/env bash ++ ++set -uo pipefail ++cd /testbed ++rc=0 ++python -m pytest -v -rA tests/doc_task_test.py::test_prompt_for_new_model_when_no_schema_exists tests/doc_task_test.py::test_prompt_for_new_model_when_schema_exists_without_model tests/doc_task_test.py::test_prompt_for_existing_model_with_real_description ++rc=$(( rc | $? )) ++exit $rc diff --git a/tasks/format-code-task-000566/tests/test.sh b/tasks/format-code-task-000566/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..e3cb8f3d4e367d5c1c075558a96249269bc7ec9c --- /dev/null +++ b/tasks/format-code-task-000566/tests/test.sh @@ -0,0 +1,39 @@ +#!/bin/bash +# Code grading, mimoagent opensource_code.py: reset the files the hidden test patch touches, apply it, run the +# task's test command; reward 1 when it exits 0. A testbed failure (reset or apply) writes no reward: not scored. +M=/var/lib/mimo +CWD=/testbed +V=/logs/verifier +mkdir -p "$V" +BASE=$(cat "$M/base" 2>/dev/null) || { echo "setup never ran (no $M/base)" >&2; exit 1; } +cd "$CWD" || exit 1 +if [ -d "$M/git-hidden" ]; then rm -rf "$CWD/.git"; mv "$M/git-hidden" "$CWD/.git"; fi +# the agent's change against the base, so its own commits count too +git add -A >/dev/null 2>&1 && git -c core.fileMode=false diff --cached "$BASE" > "$V/agent.diff" +git reset -q +if ! ( +while IFS= read -r tf; do + [ -z "$tf" ] && continue + if git cat-file -e $BASE:"$tf" 2>/dev/null; then + git checkout $BASE -- "$tf" 2>/dev/null || true + else + git rm -f --cached "$tf" >/dev/null 2>&1 || true + rm -f "$tf" + fi +done <<'EOF_RESET_TEST_FILES' +test_commands.json +tests/doc_task_test.py +mimo_test_command.sh +EOF_RESET_TEST_FILES + +); then echo "could not reset the test files (testbed problem, not scored)" >&2; exit 1; fi +if ! git apply --verbose /tests/test.patch > "$V/apply.log" 2>&1; then + cat "$V/apply.log" >&2 + echo "the hidden tests could not be applied (testbed problem, not scored)" >&2 + exit 1 +fi +timeout 1800 sh -c "$(cat /tests/test_command.sh)" > "$V/test_output.log" 2>&1 +RC=$? +tail -c 12000 "$V/test_output.log" +if [ $RC -eq 0 ]; then echo 1 > "$V/reward.txt"; else echo 0 > "$V/reward.txt"; fi +echo "test command exited $RC" diff --git a/tasks/format-code-task-000566/tests/test_command.sh b/tasks/format-code-task-000566/tests/test_command.sh new file mode 100644 index 0000000000000000000000000000000000000000..7cb23076694ad17d72e8296d62b2b240083e36db --- /dev/null +++ b/tasks/format-code-task-000566/tests/test_command.sh @@ -0,0 +1 @@ +bash /testbed/mimo_test_command.sh \ No newline at end of file diff --git a/tasks/format-code-task-000568/environment/Dockerfile b/tasks/format-code-task-000568/environment/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..2916424e5b3022cd2110bb817376a332492dc919 --- /dev/null +++ b/tasks/format-code-task-000568/environment/Dockerfile @@ -0,0 +1,3 @@ +# The task's image, pinned by digest (the same as [environment].docker_image). +# Setup runs at start from [environment.healthcheck]; environment/setup/ is its readable copy. +FROM docker.io/xiaomimimo/mimo-v2.6-rl-oss@sha256:196027ee69906f6f2f2424d29b0bf4fd12d3fe04b1470231a3214fbb5e1e9a79 diff --git a/tasks/format-code-task-000568/environment/setup/files/blocklist b/tasks/format-code-task-000568/environment/setup/files/blocklist new file mode 100644 index 0000000000000000000000000000000000000000..a8e4bdc4c7d9b739c047a3cb58ea72a1bb05bcbc --- /dev/null +++ b/tasks/format-code-task-000568/environment/setup/files/blocklist @@ -0,0 +1,33 @@ +# mimo answer-leak blocklist (mimoagent) +0.0.0.0 github.com +0.0.0.0 www.github.com +0.0.0.0 api.github.com +0.0.0.0 raw.githubusercontent.com +0.0.0.0 codeload.github.com +0.0.0.0 objects.githubusercontent.com +0.0.0.0 gist.github.com +0.0.0.0 gist.githubusercontent.com +0.0.0.0 gitlab.com +0.0.0.0 bitbucket.org +0.0.0.0 sourceforge.net +0.0.0.0 git.kernel.org +0.0.0.0 chromium.googlesource.com +0.0.0.0 android.googlesource.com +0.0.0.0 sourcegraph.com +0.0.0.0 bugs.chromium.org +0.0.0.0 issues.oss-fuzz.com +0.0.0.0 oss-fuzz.com +0.0.0.0 osv.dev +0.0.0.0 api.osv.dev +0.0.0.0 bugzilla.mozilla.org +0.0.0.0 proxy.golang.org +0.0.0.0 sum.golang.org +0.0.0.0 pkg.go.dev +0.0.0.0 google.com +0.0.0.0 www.google.com +0.0.0.0 bing.com +0.0.0.0 www.bing.com +0.0.0.0 duckduckgo.com +0.0.0.0 html.duckduckgo.com +0.0.0.0 search.brave.com +0.0.0.0 stackoverflow.com diff --git a/tasks/format-code-task-000568/environment/setup/setup.sh b/tasks/format-code-task-000568/environment/setup/setup.sh new file mode 100644 index 0000000000000000000000000000000000000000..e9eb7daf39f9542bd095367feee457f3da77e492 --- /dev/null +++ b/tasks/format-code-task-000568/environment/setup/setup.sh @@ -0,0 +1,34 @@ +#!/bin/bash +# Runs once, as root, before the agent starts: Harbor's [environment.healthcheck] unpacks this folder into +# /var/lib/mimo and runs it. Generated by mimo_harbor; see its README for how each step maps to Xiaomi's harness. +M=/var/lib/mimo +[ -f "$M/ready" ] && exit 0 +chmod 700 "$M" +fail() { echo "setup: $*" >&2; exit 1; } +# the answer-leak blocklist (mimoagent), applied to /etc/hosts by the agent right after it installs +write_blocklist() { cp "$M/files/blocklist" "$M/blocklist"; } + +# Code: mimoagent environments/datasets/opensource_code.py + base.py, as the explorer runs it (app/runner/domains.py Code). +CWD=/workspace/repo +git config --global --add safe.directory "$CWD" +cd "$CWD" || fail "no working directory $CWD" +if ! git rev-parse --git-dir >/dev/null 2>&1; then # a bare source tree: give it a baseline commit + git init -q && git add -A && git -c user.name=mimo -c user.email=mimo@localhost commit -q -m baseline --allow-empty +fi +BASE=$(git rev-parse HEAD 2>/dev/null) +[ ${#BASE} -eq 40 ] || fail "could not resolve the base commit in $CWD" +echo "$BASE" > "$M/base" +# Images are built with history truncated at the base. If one is not, the fix could be read out of git log, +# so .git is hidden while the agent works and put back for grading. +LATER=$(git rev-list --all --not "$BASE" 2>/dev/null | head -n 5 | grep -c . || true) +rm -f /tmp/fail.log /tmp/pass.log /tmp/patch.diff /tmp/test_patch.diff /tmp/*.log 2>/dev/null; rm -rf /tmp/claude-0 /tmp/claude-* /tmp/testem-* /tmp/puppeteer_dev_chrome_profile-* 2>/dev/null; rm -f /tmp/test_files.json 2>/dev/null; rm -rf /tmp/jest_* /tmp/jest-* /tmp/build /tmp/build_env 2>/dev/null; rm -rf /tmp/pytest-of-root /tmp/pytest-* /tmp/.pytest_cache /tmp/__pycache__ 2>/dev/null; rm -rf /tmp/go-build* /tmp/standards /tmp/wordpress /tmp/zig-* /tmp/testbase /tmp/testbed 2>/dev/null; rm -f /tmp/tmp*.tmp /tmp/*.bak /tmp/expect* /tmp/butwas* 2>/dev/null; rm -rf /root/.cache/go-build 2>/dev/null; rm -rf /tests 2>/dev/null; find /logs -mindepth 1 -delete 2>/dev/null; mkdir -p /logs/agent /logs/verifier /logs/artifacts; chmod 777 /logs/agent /logs/verifier /logs/artifacts; find /var/log -type f -delete 2>/dev/null || true; rm -rf /var/lib/postgresql/*/*/log /var/lib/postgresql/*/*/pg_log 2>/dev/null || true; find /var/lib/mysql /var/lib/mongodb -type f -name '*.log' -delete 2>/dev/null || true; rm -rf /root/.npm/_logs /root/.babel.json /root/.pytest_cache 2>/dev/null || true; find / -maxdepth 4 -xdev -name task_description.md -path '*/.build_env/*' -delete 2>/dev/null || true; true +git clean -fdx --exclude=node_modules --exclude=bower_components --exclude=.husky --exclude=vendor --exclude=third_party --exclude=_deps --exclude=vcpkg_installed --exclude=.venv --exclude=venv --exclude=.gradle --exclude=target --exclude=.build --exclude=lib --exclude=.bundle --exclude=Manifest.toml --exclude=_build --exclude=.stack-work --exclude=dist-newstyle >/dev/null 2>&1 +find /root/.m2 -type f \( -name '*-SNAPSHOT.jar' -o -name '*-SNAPSHOT-sources.jar' -o -name '*-SNAPSHOT-tests.jar' -o -name '*-SNAPSHOT-test-sources.jar' \) -delete 2>/dev/null; rm -rf /root/.julia/compiled 2>/dev/null; rm -rf /root/.gradle/caches/build-cache-* /root/.gradle/daemon 2>/dev/null; rm -rf /root/.gradle/caches/*/scripts /root/.gradle/caches/jars-* 2>/dev/null; rm -rf /root/.cache/bazel 2>/dev/null; true +if [ "$LATER" -gt 0 ]; then + mv "$CWD/.git" "$M/git-hidden" + echo "history not truncated at ${BASE:0:12}: .git hidden while the agent works" +fi +write_blocklist + +touch "$M/ready" +echo "setup done" diff --git a/tasks/format-code-task-000568/tests/test.patch b/tasks/format-code-task-000568/tests/test.patch new file mode 100644 index 0000000000000000000000000000000000000000..d32670105a5dd695a0cb84b0dbc02ac53ee95754 --- /dev/null +++ b/tasks/format-code-task-000568/tests/test.patch @@ -0,0 +1,263 @@ +diff --git a/usercase-test-coderl/fixtures/playlist_cli_harness.py b/usercase-test-coderl/fixtures/playlist_cli_harness.py +new file mode 100644 +--- /dev/null ++++ b/usercase-test-coderl/fixtures/playlist_cli_harness.py +@@ -0,0 +1,84 @@ ++#!/usr/bin/env python ++from __future__ import unicode_literals ++ ++import importlib ++import sys ++ ++sys.path.insert(0, '/workspace/repo') ++ ++import youtube_dlc ++from youtube_dlc.extractor.common import InfoExtractor ++from youtube_dlc.utils import OnDemandPagedList ++ ++ytdl_mod = importlib.import_module('youtube_dlc.YoutubeDL') ++ ++ ++def video_entry(idx): ++ return { ++ 'id': 'v%s' % idx, ++ 'title': 'Video %s' % idx, ++ 'url': 'http://media.example.invalid/video%s.mp4' % idx, ++ 'ext': 'mp4', ++ } ++ ++ ++class OfflineListIE(InfoExtractor): ++ IE_NAME = 'offline:list' ++ _VALID_URL = r'offline:list$' ++ ++ def _real_extract(self, url): ++ return { ++ '_type': 'playlist', ++ 'id': 'loaded', ++ 'title': 'Loaded Fixture', ++ 'entries': [video_entry(i) for i in range(1, 5)], ++ 'extractor': self.IE_NAME, ++ 'extractor_key': self.ie_key(), ++ 'webpage_url': url, ++ } ++ ++ ++class OfflinePagedIE(InfoExtractor): ++ IE_NAME = 'offline:paged' ++ _VALID_URL = r'offline:paged$' ++ ++ def _real_extract(self, url): ++ def pagefunc(page_num): ++ start = page_num * 2 + 1 ++ if start > 4: ++ return [] ++ return [video_entry(i) for i in range(start, min(start + 2, 5))] ++ ++ return { ++ '_type': 'playlist', ++ 'id': 'paged', ++ 'title': 'Paged Fixture', ++ 'entries': OnDemandPagedList(pagefunc, 2), ++ 'extractor': self.IE_NAME, ++ 'extractor_key': self.ie_key(), ++ 'webpage_url': url, ++ } ++ ++ ++class OfflineIterableIE(InfoExtractor): ++ IE_NAME = 'offline:iterable' ++ _VALID_URL = r'offline:iterable$' ++ ++ def _real_extract(self, url): ++ def entries(): ++ for i in range(1, 5): ++ yield video_entry(i) ++ ++ return { ++ '_type': 'playlist', ++ 'id': 'iterable', ++ 'title': 'Iterable Fixture', ++ 'entries': entries(), ++ 'extractor': self.IE_NAME, ++ 'extractor_key': self.ie_key(), ++ 'webpage_url': url, ++ } ++ ++ ++ytdl_mod.gen_extractor_classes = lambda: [OfflineListIE(), OfflinePagedIE(), OfflineIterableIE()] ++youtube_dlc.main(sys.argv[1:]) +diff --git a/usercase-test-coderl/usecase.sh b/usercase-test-coderl/usecase.sh +new file mode 100755 +--- /dev/null ++++ b/usercase-test-coderl/usecase.sh +@@ -0,0 +1,152 @@ ++#!/usr/bin/env bash ++ ++set -u ++export LANG=C.UTF-8 LC_ALL=C.UTF-8 TZ=UTC PYTHONPATH=/workspace/repo PYTHONDONTWRITEBYTECODE=1 ++ ++ ++ ++( cd /workspace/repo && python -B -m youtube_dlc --ignore-config --version >/dev/null ) \ ++ || { echo "FAIL: build" >&2; exit 1; } ++ ++BIN="python -B /workspace/repo/usercase-test-coderl/fixtures/playlist_cli_harness.py" ++HELP_BIN="python -B -m youtube_dlc --ignore-config" ++ ++TMP=$(mktemp -d); trap 'rm -rf "$TMP"' EXIT ++cd "$TMP" || exit 1 ++fail() { echo "FAIL: $*" >&2; exit 1; } ++ ++assert_file_eq() { ++ local label=$1 expected=$2 actual_file=$3 ++ local actual ++ actual=$(cat "$actual_file") ++ [ "$actual" = "$expected" ] || fail "$label: got [$actual]" ++} ++ ++assert_no_crash_stderr() { ++ local label=$1 stderr_file=$2 ++ ++ ! grep -Eiq 'Traceback \(most recent call last\)|SyntaxError|ImportError|ModuleNotFoundError' "$stderr_file" \ ++ || fail "$label stderr shows internal crash: $(cat "$stderr_file")" ++} ++ ++ ++ ++ ++$HELP_BIN --help >out 2>err; ec=$? ++[ "$ec" -eq 0 ] || fail "F1 exit $ec; want 0" ++grep -q -- '--playlist-items ITEM_SPEC' out || fail "F1 missing --playlist-items ITEM_SPEC" ++ ++grep -qi -- 'comma' out || fail "F1 missing comma-separated description" ++grep -qi -- 'range' out || fail "F1 missing range description" ++assert_no_crash_stderr "F1" err ++ ++ ++ ++ ++$BIN --playlist-items 2,4 --get-id offline:list >out 2>err; ec=$? ++EXPECTED=$'v2\nv4' ++[ "$ec" -eq 0 ] || fail "F2 exit $ec; want 0" ++assert_file_eq "F2 stdout" "$EXPECTED" out ++assert_no_crash_stderr "F2" err ++ ++ ++ ++ ++$BIN --playlist-items 2-4 --get-id offline:list >out 2>err; ec=$? ++EXPECTED=$'v2\nv3\nv4' ++[ "$ec" -eq 0 ] || fail "F3 exit $ec; want 0" ++assert_file_eq "F3 stdout" "$EXPECTED" out ++assert_no_crash_stderr "F3" err ++ ++ ++ ++ ++$BIN --playlist-items 2-4,3-4,3 --get-id offline:list >out 2>err; ec=$? ++EXPECTED=$'v2\nv3\nv4' ++[ "$ec" -eq 0 ] || fail "F4 exit $ec; want 0" ++assert_file_eq "F4 stdout" "$EXPECTED" out ++assert_no_crash_stderr "F4" err ++ ++ ++ ++ ++$BIN --playlist-items 3-10 --get-id offline:list >out 2>err; ec=$? ++EXPECTED=$'v3\nv4' ++[ "$ec" -eq 0 ] || fail "F5 exit $ec; want 0" ++assert_file_eq "F5 stdout" "$EXPECTED" out ++assert_no_crash_stderr "F5" err ++ ++ ++ ++ ++$BIN --playlist-items 10 --get-id offline:list >out 2>err; ec=$? ++[ "$ec" -eq 0 ] || fail "F6 exit $ec; want 0" ++[ ! -s out ] || fail "F6 stdout should be empty: $(cat out)" ++assert_no_crash_stderr "F6" err ++ ++ ++ ++ ++$BIN --playlist-items 2,4 --simulate offline:list >out 2>err; ec=$? ++[ "$ec" -eq 0 ] || fail "F7 exit $ec; want 0" ++ ++grep -Eiq -- '(downloading[^0-9]*2|2[^0-9]*videos|of[[:space:]]+2)' out || fail "F7 stdout missing selected download count: $(cat out)" ++! grep -Eiq -- '(downloading[^0-9]*4|of[[:space:]]+4)' out || fail "F7 stdout reported full playlist count: $(cat out)" ++assert_no_crash_stderr "F7" err ++ ++ ++ ++ ++$BIN --playlist-items 4,2 --dump-json offline:list >out 2>err; ec=$? ++[ "$ec" -eq 0 ] || fail "F8 exit $ec; want 0" ++python - "$PWD/out" <<'PY' || exit 1 ++from __future__ import print_function ++import json ++import sys ++ ++with open(sys.argv[1], 'r') as f: ++ rows = [json.loads(line) for line in f if line.strip()] ++expected = [('v4', 4), ('v2', 2)] ++actual = [(row.get('id'), row.get('playlist_index')) for row in rows] ++if actual != expected: ++ print('FAIL: F8 JSON id/index: %r' % (actual,), file=sys.stderr) ++ sys.exit(1) ++PY ++assert_no_crash_stderr "F8" err ++ ++ ++ ++ ++$BIN --playlist-items 2,4 --get-id offline:paged >out 2>err; ec=$? ++EXPECTED=$'v2\nv4' ++[ "$ec" -eq 0 ] || fail "F9 exit $ec; want 0" ++assert_file_eq "F9 stdout" "$EXPECTED" out ++assert_no_crash_stderr "F9" err ++ ++ ++ ++ ++$BIN --playlist-items 3-10 --get-id offline:iterable >out 2>err; ec=$? ++EXPECTED=$'v3\nv4' ++[ "$ec" -eq 0 ] || fail "F10 exit $ec; want 0" ++assert_file_eq "F10 stdout" "$EXPECTED" out ++assert_no_crash_stderr "F10" err ++ ++ ++ ++ ++$BIN --playlist-items abc --get-id offline:list >out 2>err; ec=$? ++[ "$ec" -ne 0 ] || fail "F11 exit should be non-zero" ++ ++! grep -Eq '^v[1-4]$' out || fail "F11 malformed spec downloaded entries: $(cat out)" ++ ++ ++ ++ ++$BIN --playlist-items 2-x --get-id offline:list >out 2>err; ec=$? ++[ "$ec" -ne 0 ] || fail "F12 exit should be non-zero" ++ ++! grep -Eq '^v[1-4]$' out || fail "F12 malformed spec downloaded entries: $(cat out)" ++ ++echo "PASS" ++exit 0 +diff --git a/mimo_test_command.sh b/mimo_test_command.sh +new file mode 100755 +--- /dev/null ++++ b/mimo_test_command.sh +@@ -0,0 +1,12 @@ ++#!/usr/bin/env bash ++ ++ ++ ++ ++export NODE_OPTIONS="${NODE_OPTIONS:-} --max-old-space-size=4096" ++export MAVEN_OPTS="${MAVEN_OPTS:-} -Xmx3g -XX:+UseG1GC" ++export GRADLE_OPTS="${GRADLE_OPTS:-} -Xmx3g -XX:+UseG1GC" ++export TEST_JVM_OPTS="${TEST_JVM_OPTS:-} -Xmx3g" ++set -e ++cd /workspace/repo ++exec bash /workspace/repo/usercase-test-coderl/usecase.sh diff --git a/tasks/format-code-task-000568/tests/test.sh b/tasks/format-code-task-000568/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..cce52b28c745d5604032cf9324646faa97fe293c --- /dev/null +++ b/tasks/format-code-task-000568/tests/test.sh @@ -0,0 +1,39 @@ +#!/bin/bash +# Code grading, mimoagent opensource_code.py: reset the files the hidden test patch touches, apply it, run the +# task's test command; reward 1 when it exits 0. A testbed failure (reset or apply) writes no reward: not scored. +M=/var/lib/mimo +CWD=/workspace/repo +V=/logs/verifier +mkdir -p "$V" +BASE=$(cat "$M/base" 2>/dev/null) || { echo "setup never ran (no $M/base)" >&2; exit 1; } +cd "$CWD" || exit 1 +if [ -d "$M/git-hidden" ]; then rm -rf "$CWD/.git"; mv "$M/git-hidden" "$CWD/.git"; fi +# the agent's change against the base, so its own commits count too +git add -A >/dev/null 2>&1 && git -c core.fileMode=false diff --cached "$BASE" > "$V/agent.diff" +git reset -q +if ! ( +while IFS= read -r tf; do + [ -z "$tf" ] && continue + if git cat-file -e $BASE:"$tf" 2>/dev/null; then + git checkout $BASE -- "$tf" 2>/dev/null || true + else + git rm -f --cached "$tf" >/dev/null 2>&1 || true + rm -f "$tf" + fi +done <<'EOF_RESET_TEST_FILES' +usercase-test-coderl/fixtures/playlist_cli_harness.py +usercase-test-coderl/usecase.sh +mimo_test_command.sh +EOF_RESET_TEST_FILES + +); then echo "could not reset the test files (testbed problem, not scored)" >&2; exit 1; fi +if ! git apply --verbose /tests/test.patch > "$V/apply.log" 2>&1; then + cat "$V/apply.log" >&2 + echo "the hidden tests could not be applied (testbed problem, not scored)" >&2 + exit 1 +fi +timeout 1800 sh -c "$(cat /tests/test_command.sh)" > "$V/test_output.log" 2>&1 +RC=$? +tail -c 12000 "$V/test_output.log" +if [ $RC -eq 0 ]; then echo 1 > "$V/reward.txt"; else echo 0 > "$V/reward.txt"; fi +echo "test command exited $RC" diff --git a/tasks/format-code-task-000568/tests/test_command.sh b/tasks/format-code-task-000568/tests/test_command.sh new file mode 100644 index 0000000000000000000000000000000000000000..88cb7810b836396c4869db31aeac7d4d4b189685 --- /dev/null +++ b/tasks/format-code-task-000568/tests/test_command.sh @@ -0,0 +1 @@ +bash /workspace/repo/mimo_test_command.sh \ No newline at end of file diff --git a/tasks/format-code-task-000575/environment/Dockerfile b/tasks/format-code-task-000575/environment/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..53188873314e0f1aea3b63d7c0f18fdea624d5ee --- /dev/null +++ b/tasks/format-code-task-000575/environment/Dockerfile @@ -0,0 +1,3 @@ +# The task's image, pinned by digest (the same as [environment].docker_image). +# Setup runs at start from [environment.healthcheck]; environment/setup/ is its readable copy. +FROM docker.io/xiaomimimo/mimo-v2.6-rl-oss@sha256:d3bf5d27e5d07e202c2a48561808c8e9a43cc9039db9ee758e1524912f5974c3 diff --git a/tasks/format-code-task-000575/environment/setup/files/blocklist b/tasks/format-code-task-000575/environment/setup/files/blocklist new file mode 100644 index 0000000000000000000000000000000000000000..a8e4bdc4c7d9b739c047a3cb58ea72a1bb05bcbc --- /dev/null +++ b/tasks/format-code-task-000575/environment/setup/files/blocklist @@ -0,0 +1,33 @@ +# mimo answer-leak blocklist (mimoagent) +0.0.0.0 github.com +0.0.0.0 www.github.com +0.0.0.0 api.github.com +0.0.0.0 raw.githubusercontent.com +0.0.0.0 codeload.github.com +0.0.0.0 objects.githubusercontent.com +0.0.0.0 gist.github.com +0.0.0.0 gist.githubusercontent.com +0.0.0.0 gitlab.com +0.0.0.0 bitbucket.org +0.0.0.0 sourceforge.net +0.0.0.0 git.kernel.org +0.0.0.0 chromium.googlesource.com +0.0.0.0 android.googlesource.com +0.0.0.0 sourcegraph.com +0.0.0.0 bugs.chromium.org +0.0.0.0 issues.oss-fuzz.com +0.0.0.0 oss-fuzz.com +0.0.0.0 osv.dev +0.0.0.0 api.osv.dev +0.0.0.0 bugzilla.mozilla.org +0.0.0.0 proxy.golang.org +0.0.0.0 sum.golang.org +0.0.0.0 pkg.go.dev +0.0.0.0 google.com +0.0.0.0 www.google.com +0.0.0.0 bing.com +0.0.0.0 www.bing.com +0.0.0.0 duckduckgo.com +0.0.0.0 html.duckduckgo.com +0.0.0.0 search.brave.com +0.0.0.0 stackoverflow.com diff --git a/tasks/format-code-task-000575/environment/setup/setup.sh b/tasks/format-code-task-000575/environment/setup/setup.sh new file mode 100644 index 0000000000000000000000000000000000000000..d883db90cfcfb48f7a139861bbe9f6b5d95cad6f --- /dev/null +++ b/tasks/format-code-task-000575/environment/setup/setup.sh @@ -0,0 +1,34 @@ +#!/bin/bash +# Runs once, as root, before the agent starts: Harbor's [environment.healthcheck] unpacks this folder into +# /var/lib/mimo and runs it. Generated by mimo_harbor; see its README for how each step maps to Xiaomi's harness. +M=/var/lib/mimo +[ -f "$M/ready" ] && exit 0 +chmod 700 "$M" +fail() { echo "setup: $*" >&2; exit 1; } +# the answer-leak blocklist (mimoagent), applied to /etc/hosts by the agent right after it installs +write_blocklist() { cp "$M/files/blocklist" "$M/blocklist"; } + +# Code: mimoagent environments/datasets/opensource_code.py + base.py, as the explorer runs it (app/runner/domains.py Code). +CWD=/testbed +git config --global --add safe.directory "$CWD" +cd "$CWD" || fail "no working directory $CWD" +if ! git rev-parse --git-dir >/dev/null 2>&1; then # a bare source tree: give it a baseline commit + git init -q && git add -A && git -c user.name=mimo -c user.email=mimo@localhost commit -q -m baseline --allow-empty +fi +BASE=$(git rev-parse HEAD 2>/dev/null) +[ ${#BASE} -eq 40 ] || fail "could not resolve the base commit in $CWD" +echo "$BASE" > "$M/base" +# Images are built with history truncated at the base. If one is not, the fix could be read out of git log, +# so .git is hidden while the agent works and put back for grading. +LATER=$(git rev-list --all --not "$BASE" 2>/dev/null | head -n 5 | grep -c . || true) +rm -f /tmp/fail.log /tmp/pass.log /tmp/patch.diff /tmp/test_patch.diff /tmp/*.log 2>/dev/null; rm -rf /tmp/claude-0 /tmp/claude-* /tmp/testem-* /tmp/puppeteer_dev_chrome_profile-* 2>/dev/null; rm -f /tmp/test_files.json 2>/dev/null; rm -rf /tmp/jest_* /tmp/jest-* /tmp/build /tmp/build_env 2>/dev/null; rm -rf /tmp/pytest-of-root /tmp/pytest-* /tmp/.pytest_cache /tmp/__pycache__ 2>/dev/null; rm -rf /tmp/go-build* /tmp/standards /tmp/wordpress /tmp/zig-* /tmp/testbase /tmp/testbed 2>/dev/null; rm -f /tmp/tmp*.tmp /tmp/*.bak /tmp/expect* /tmp/butwas* 2>/dev/null; rm -rf /root/.cache/go-build 2>/dev/null; rm -rf /tests 2>/dev/null; find /logs -mindepth 1 -delete 2>/dev/null; mkdir -p /logs/agent /logs/verifier /logs/artifacts; chmod 777 /logs/agent /logs/verifier /logs/artifacts; find /var/log -type f -delete 2>/dev/null || true; rm -rf /var/lib/postgresql/*/*/log /var/lib/postgresql/*/*/pg_log 2>/dev/null || true; find /var/lib/mysql /var/lib/mongodb -type f -name '*.log' -delete 2>/dev/null || true; rm -rf /root/.npm/_logs /root/.babel.json /root/.pytest_cache 2>/dev/null || true; find / -maxdepth 4 -xdev -name task_description.md -path '*/.build_env/*' -delete 2>/dev/null || true; true +git clean -fdx --exclude=node_modules --exclude=bower_components --exclude=.husky --exclude=vendor --exclude=third_party --exclude=_deps --exclude=vcpkg_installed --exclude=.venv --exclude=venv --exclude=.gradle --exclude=target --exclude=.build --exclude=lib --exclude=.bundle --exclude=Manifest.toml --exclude=_build --exclude=.stack-work --exclude=dist-newstyle >/dev/null 2>&1 +find /root/.m2 -type f \( -name '*-SNAPSHOT.jar' -o -name '*-SNAPSHOT-sources.jar' -o -name '*-SNAPSHOT-tests.jar' -o -name '*-SNAPSHOT-test-sources.jar' \) -delete 2>/dev/null; rm -rf /root/.julia/compiled 2>/dev/null; rm -rf /root/.gradle/caches/build-cache-* /root/.gradle/daemon 2>/dev/null; rm -rf /root/.gradle/caches/*/scripts /root/.gradle/caches/jars-* 2>/dev/null; rm -rf /root/.cache/bazel 2>/dev/null; true +if [ "$LATER" -gt 0 ]; then + mv "$CWD/.git" "$M/git-hidden" + echo "history not truncated at ${BASE:0:12}: .git hidden while the agent works" +fi +write_blocklist + +touch "$M/ready" +echo "setup done" diff --git a/tasks/format-code-task-000575/tests/test.patch b/tasks/format-code-task-000575/tests/test.patch new file mode 100644 index 0000000000000000000000000000000000000000..8d437ac1a2ce953922a694e233ade75725200c3f --- /dev/null +++ b/tasks/format-code-task-000575/tests/test.patch @@ -0,0 +1,64 @@ +diff --git a/virtio/net_test.go b/virtio/net_test.go +index a2c040c..c540f84 100644 +--- a/virtio/net_test.go ++++ b/virtio/net_test.go +@@ -125,3 +125,39 @@ func TestQueueNotifyHandler(t *testing.T) { + t.Fatalf("expected: %v, actual: %v", expected, b.Bytes()) + } + } ++ ++func TestRx(t *testing.T) { ++ t.Parallel() ++ ++ irqInjected := false ++ irqCallback := func(_, _ uint32) { ++ irqInjected = true ++ } ++ ++ expected := []byte{0xaa, 0xbb} ++ mem := make([]byte, 0x1000000) ++ v := virtio.NewNet(irqCallback, bytes.NewBuffer(expected), mem).(*virtio.Net) ++ ++ ++ vq := virtio.VirtQueue{} ++ vq.AvailRing.Idx = 1 ++ vq.DescTable[0].Addr = 0x100 ++ vq.DescTable[0].Len = 0x200 ++ v.VirtQueue[0] = &vq ++ ++ ++ const K = 10 ++ ++ if err := v.Rx(); err != nil { ++ t.Fatalf("err: %v\n", err) ++ } ++ ++ if !irqInjected { ++ t.Fatalf("irqInjected = false\n") ++ } ++ ++ actual := mem[0x100+K : 0x100+K+2] ++ if !bytes.Equal(expected, actual) { ++ t.Fatalf("expected: %v, actual: %v", expected, actual) ++ } ++} +diff --git a/mimo_build_env.tar.gz.b64 b/mimo_build_env.tar.gz.b64 +new file mode 100644 +--- /dev/null ++++ b/mimo_build_env.tar.gz.b64 +@@ -0,0 +1,4 @@ ++H4sIAAAAAAAAA+3R0QqCMBTG8V37FHuB1K2pjxPqpIR0oNPnz4QoAvNGiej/uzkHzmAffGEx1Fd7 ++qtoxEnuJJ1mSzHPyPuddJVppbYzWmYiVSmMtZLJbohdD7/NOStE55z+9W7v/qPDZv696fypd0+St ++DfvLdn+s9m/Uo/9jluqpf5MqI2S8XYRlf95/aeVcfFHZ4OzkfZWHUYbRWHe+dlHw7YAAAAAAAAAA ++AAAAAAAAFt0A5ajgJwAoAAA= +diff --git a/mimo_test_command.sh b/mimo_test_command.sh +new file mode 100755 +--- /dev/null ++++ b/mimo_test_command.sh +@@ -0,0 +1,6 @@ ++#!/usr/bin/env bash ++ ++set -uo pipefail ++cd /testbed || exit 1 ++base64 -d mimo_build_env.tar.gz.b64 | tar -xzf - -C /testbed || exit 1 ++exec bash -lc 'cd /testbed && bash -eo pipefail /testbed/.build_env/test_command.sh' diff --git a/tasks/format-code-task-000575/tests/test.sh b/tasks/format-code-task-000575/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..f2104ddcd37a66bf8c69935c17721f9be7219b87 --- /dev/null +++ b/tasks/format-code-task-000575/tests/test.sh @@ -0,0 +1,39 @@ +#!/bin/bash +# Code grading, mimoagent opensource_code.py: reset the files the hidden test patch touches, apply it, run the +# task's test command; reward 1 when it exits 0. A testbed failure (reset or apply) writes no reward: not scored. +M=/var/lib/mimo +CWD=/testbed +V=/logs/verifier +mkdir -p "$V" +BASE=$(cat "$M/base" 2>/dev/null) || { echo "setup never ran (no $M/base)" >&2; exit 1; } +cd "$CWD" || exit 1 +if [ -d "$M/git-hidden" ]; then rm -rf "$CWD/.git"; mv "$M/git-hidden" "$CWD/.git"; fi +# the agent's change against the base, so its own commits count too +git add -A >/dev/null 2>&1 && git -c core.fileMode=false diff --cached "$BASE" > "$V/agent.diff" +git reset -q +if ! ( +while IFS= read -r tf; do + [ -z "$tf" ] && continue + if git cat-file -e $BASE:"$tf" 2>/dev/null; then + git checkout $BASE -- "$tf" 2>/dev/null || true + else + git rm -f --cached "$tf" >/dev/null 2>&1 || true + rm -f "$tf" + fi +done <<'EOF_RESET_TEST_FILES' +virtio/net_test.go +mimo_build_env.tar.gz.b64 +mimo_test_command.sh +EOF_RESET_TEST_FILES + +); then echo "could not reset the test files (testbed problem, not scored)" >&2; exit 1; fi +if ! git apply --verbose /tests/test.patch > "$V/apply.log" 2>&1; then + cat "$V/apply.log" >&2 + echo "the hidden tests could not be applied (testbed problem, not scored)" >&2 + exit 1 +fi +timeout 1800 sh -c "$(cat /tests/test_command.sh)" > "$V/test_output.log" 2>&1 +RC=$? +tail -c 12000 "$V/test_output.log" +if [ $RC -eq 0 ]; then echo 1 > "$V/reward.txt"; else echo 0 > "$V/reward.txt"; fi +echo "test command exited $RC" diff --git a/tasks/format-code-task-000575/tests/test_command.sh b/tasks/format-code-task-000575/tests/test_command.sh new file mode 100644 index 0000000000000000000000000000000000000000..7cb23076694ad17d72e8296d62b2b240083e36db --- /dev/null +++ b/tasks/format-code-task-000575/tests/test_command.sh @@ -0,0 +1 @@ +bash /testbed/mimo_test_command.sh \ No newline at end of file diff --git a/tasks/format-code-task-000581/environment/Dockerfile b/tasks/format-code-task-000581/environment/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..9957e433d00ef27bd455d1c9793abb197db9c37d --- /dev/null +++ b/tasks/format-code-task-000581/environment/Dockerfile @@ -0,0 +1,3 @@ +# The task's image, pinned by digest (the same as [environment].docker_image). +# Setup runs at start from [environment.healthcheck]; environment/setup/ is its readable copy. +FROM docker.io/xiaomimimo/mimo-v2.6-rl-oss@sha256:b9f84884e5211828f85d25df4d54268e53313a1779887751865a9207a9aeaae8 diff --git a/tasks/format-code-task-000581/environment/setup/files/blocklist b/tasks/format-code-task-000581/environment/setup/files/blocklist new file mode 100644 index 0000000000000000000000000000000000000000..a8e4bdc4c7d9b739c047a3cb58ea72a1bb05bcbc --- /dev/null +++ b/tasks/format-code-task-000581/environment/setup/files/blocklist @@ -0,0 +1,33 @@ +# mimo answer-leak blocklist (mimoagent) +0.0.0.0 github.com +0.0.0.0 www.github.com +0.0.0.0 api.github.com +0.0.0.0 raw.githubusercontent.com +0.0.0.0 codeload.github.com +0.0.0.0 objects.githubusercontent.com +0.0.0.0 gist.github.com +0.0.0.0 gist.githubusercontent.com +0.0.0.0 gitlab.com +0.0.0.0 bitbucket.org +0.0.0.0 sourceforge.net +0.0.0.0 git.kernel.org +0.0.0.0 chromium.googlesource.com +0.0.0.0 android.googlesource.com +0.0.0.0 sourcegraph.com +0.0.0.0 bugs.chromium.org +0.0.0.0 issues.oss-fuzz.com +0.0.0.0 oss-fuzz.com +0.0.0.0 osv.dev +0.0.0.0 api.osv.dev +0.0.0.0 bugzilla.mozilla.org +0.0.0.0 proxy.golang.org +0.0.0.0 sum.golang.org +0.0.0.0 pkg.go.dev +0.0.0.0 google.com +0.0.0.0 www.google.com +0.0.0.0 bing.com +0.0.0.0 www.bing.com +0.0.0.0 duckduckgo.com +0.0.0.0 html.duckduckgo.com +0.0.0.0 search.brave.com +0.0.0.0 stackoverflow.com diff --git a/tasks/format-code-task-000581/environment/setup/setup.sh b/tasks/format-code-task-000581/environment/setup/setup.sh new file mode 100644 index 0000000000000000000000000000000000000000..d883db90cfcfb48f7a139861bbe9f6b5d95cad6f --- /dev/null +++ b/tasks/format-code-task-000581/environment/setup/setup.sh @@ -0,0 +1,34 @@ +#!/bin/bash +# Runs once, as root, before the agent starts: Harbor's [environment.healthcheck] unpacks this folder into +# /var/lib/mimo and runs it. Generated by mimo_harbor; see its README for how each step maps to Xiaomi's harness. +M=/var/lib/mimo +[ -f "$M/ready" ] && exit 0 +chmod 700 "$M" +fail() { echo "setup: $*" >&2; exit 1; } +# the answer-leak blocklist (mimoagent), applied to /etc/hosts by the agent right after it installs +write_blocklist() { cp "$M/files/blocklist" "$M/blocklist"; } + +# Code: mimoagent environments/datasets/opensource_code.py + base.py, as the explorer runs it (app/runner/domains.py Code). +CWD=/testbed +git config --global --add safe.directory "$CWD" +cd "$CWD" || fail "no working directory $CWD" +if ! git rev-parse --git-dir >/dev/null 2>&1; then # a bare source tree: give it a baseline commit + git init -q && git add -A && git -c user.name=mimo -c user.email=mimo@localhost commit -q -m baseline --allow-empty +fi +BASE=$(git rev-parse HEAD 2>/dev/null) +[ ${#BASE} -eq 40 ] || fail "could not resolve the base commit in $CWD" +echo "$BASE" > "$M/base" +# Images are built with history truncated at the base. If one is not, the fix could be read out of git log, +# so .git is hidden while the agent works and put back for grading. +LATER=$(git rev-list --all --not "$BASE" 2>/dev/null | head -n 5 | grep -c . || true) +rm -f /tmp/fail.log /tmp/pass.log /tmp/patch.diff /tmp/test_patch.diff /tmp/*.log 2>/dev/null; rm -rf /tmp/claude-0 /tmp/claude-* /tmp/testem-* /tmp/puppeteer_dev_chrome_profile-* 2>/dev/null; rm -f /tmp/test_files.json 2>/dev/null; rm -rf /tmp/jest_* /tmp/jest-* /tmp/build /tmp/build_env 2>/dev/null; rm -rf /tmp/pytest-of-root /tmp/pytest-* /tmp/.pytest_cache /tmp/__pycache__ 2>/dev/null; rm -rf /tmp/go-build* /tmp/standards /tmp/wordpress /tmp/zig-* /tmp/testbase /tmp/testbed 2>/dev/null; rm -f /tmp/tmp*.tmp /tmp/*.bak /tmp/expect* /tmp/butwas* 2>/dev/null; rm -rf /root/.cache/go-build 2>/dev/null; rm -rf /tests 2>/dev/null; find /logs -mindepth 1 -delete 2>/dev/null; mkdir -p /logs/agent /logs/verifier /logs/artifacts; chmod 777 /logs/agent /logs/verifier /logs/artifacts; find /var/log -type f -delete 2>/dev/null || true; rm -rf /var/lib/postgresql/*/*/log /var/lib/postgresql/*/*/pg_log 2>/dev/null || true; find /var/lib/mysql /var/lib/mongodb -type f -name '*.log' -delete 2>/dev/null || true; rm -rf /root/.npm/_logs /root/.babel.json /root/.pytest_cache 2>/dev/null || true; find / -maxdepth 4 -xdev -name task_description.md -path '*/.build_env/*' -delete 2>/dev/null || true; true +git clean -fdx --exclude=node_modules --exclude=bower_components --exclude=.husky --exclude=vendor --exclude=third_party --exclude=_deps --exclude=vcpkg_installed --exclude=.venv --exclude=venv --exclude=.gradle --exclude=target --exclude=.build --exclude=lib --exclude=.bundle --exclude=Manifest.toml --exclude=_build --exclude=.stack-work --exclude=dist-newstyle >/dev/null 2>&1 +find /root/.m2 -type f \( -name '*-SNAPSHOT.jar' -o -name '*-SNAPSHOT-sources.jar' -o -name '*-SNAPSHOT-tests.jar' -o -name '*-SNAPSHOT-test-sources.jar' \) -delete 2>/dev/null; rm -rf /root/.julia/compiled 2>/dev/null; rm -rf /root/.gradle/caches/build-cache-* /root/.gradle/daemon 2>/dev/null; rm -rf /root/.gradle/caches/*/scripts /root/.gradle/caches/jars-* 2>/dev/null; rm -rf /root/.cache/bazel 2>/dev/null; true +if [ "$LATER" -gt 0 ]; then + mv "$CWD/.git" "$M/git-hidden" + echo "history not truncated at ${BASE:0:12}: .git hidden while the agent works" +fi +write_blocklist + +touch "$M/ready" +echo "setup done" diff --git a/tasks/format-code-task-000581/tests/test.patch b/tasks/format-code-task-000581/tests/test.patch new file mode 100644 index 0000000000000000000000000000000000000000..35c455e6fbf15f14666f3489aeb26000429b9c79 --- /dev/null +++ b/tasks/format-code-task-000581/tests/test.patch @@ -0,0 +1,94 @@ +diff --git a/test_commands.json b/test_commands.json +new file mode 100644 +index 000000000..242a9845e +--- /dev/null ++++ b/test_commands.json +@@ -0,0 +1,3 @@ ++{ ++ "test_commands": ["python -m nose tests/unit/test_credentials.py:TestEnvVar -v"] ++} +diff --git a/tests/unit/test_credentials.py b/tests/unit/test_credentials.py +index 12caa4b09..f3c105700 100644 +--- a/tests/unit/test_credentials.py ++++ b/tests/unit/test_credentials.py +@@ -905,6 +905,67 @@ class TestEnvVar(BaseEnvVar): + with self.assertRaises(credentials.PartialCredentialsError): + creds.get_frozen_credentials() + ++ def test_load_returns_none_when_access_key_is_empty_string(self): ++ ++ ++ environ = { ++ 'AWS_ACCESS_KEY_ID': '', ++ 'AWS_SECRET_ACCESS_KEY': 'bar', ++ } ++ provider = credentials.EnvProvider(environ) ++ creds = provider.load() ++ self.assertIsNone(creds) ++ ++ def test_load_returns_none_when_access_key_empty_and_secret_empty(self): ++ environ = { ++ 'AWS_ACCESS_KEY_ID': '', ++ 'AWS_SECRET_ACCESS_KEY': '', ++ } ++ provider = credentials.EnvProvider(environ) ++ creds = provider.load() ++ self.assertIsNone(creds) ++ ++ def test_load_raises_when_secret_key_is_empty_string(self): ++ ++ ++ ++ environ = { ++ 'AWS_ACCESS_KEY_ID': 'foo', ++ 'AWS_SECRET_ACCESS_KEY': '', ++ } ++ provider = credentials.EnvProvider(environ) ++ with self.assertRaises(botocore.exceptions.PartialCredentialsError): ++ provider.load() ++ ++ def test_load_treats_empty_session_token_as_missing(self): ++ ++ ++ ++ environ = { ++ 'AWS_ACCESS_KEY_ID': 'foo', ++ 'AWS_SECRET_ACCESS_KEY': 'bar', ++ 'AWS_SESSION_TOKEN': '', ++ } ++ provider = credentials.EnvProvider(environ) ++ creds = provider.load() ++ self.assertIsNotNone(creds) ++ self.assertEqual(creds.access_key, 'foo') ++ self.assertEqual(creds.secret_key, 'bar') ++ self.assertIsNone(creds.token) ++ ++ def test_load_treats_empty_security_token_as_missing(self): ++ environ = { ++ 'AWS_ACCESS_KEY_ID': 'foo', ++ 'AWS_SECRET_ACCESS_KEY': 'bar', ++ 'AWS_SECURITY_TOKEN': '', ++ } ++ provider = credentials.EnvProvider(environ) ++ creds = provider.load() ++ self.assertIsNotNone(creds) ++ self.assertEqual(creds.access_key, 'foo') ++ self.assertEqual(creds.secret_key, 'bar') ++ self.assertIsNone(creds.token) ++ + + class TestSharedCredentialsProvider(BaseEnvVar): + def setUp(self): +diff --git a/mimo_test_command.sh b/mimo_test_command.sh +new file mode 100755 +--- /dev/null ++++ b/mimo_test_command.sh +@@ -0,0 +1,8 @@ ++#!/usr/bin/env bash ++ ++set -uo pipefail ++cd /testbed ++rc=0 ++python -m nose tests/unit/test_credentials.py:TestEnvVar -v ++rc=$(( rc | $? )) ++exit $rc diff --git a/tasks/format-code-task-000581/tests/test.sh b/tasks/format-code-task-000581/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..60200f316db1b48c9732c3cb56f82bc7fa614688 --- /dev/null +++ b/tasks/format-code-task-000581/tests/test.sh @@ -0,0 +1,39 @@ +#!/bin/bash +# Code grading, mimoagent opensource_code.py: reset the files the hidden test patch touches, apply it, run the +# task's test command; reward 1 when it exits 0. A testbed failure (reset or apply) writes no reward: not scored. +M=/var/lib/mimo +CWD=/testbed +V=/logs/verifier +mkdir -p "$V" +BASE=$(cat "$M/base" 2>/dev/null) || { echo "setup never ran (no $M/base)" >&2; exit 1; } +cd "$CWD" || exit 1 +if [ -d "$M/git-hidden" ]; then rm -rf "$CWD/.git"; mv "$M/git-hidden" "$CWD/.git"; fi +# the agent's change against the base, so its own commits count too +git add -A >/dev/null 2>&1 && git -c core.fileMode=false diff --cached "$BASE" > "$V/agent.diff" +git reset -q +if ! ( +while IFS= read -r tf; do + [ -z "$tf" ] && continue + if git cat-file -e $BASE:"$tf" 2>/dev/null; then + git checkout $BASE -- "$tf" 2>/dev/null || true + else + git rm -f --cached "$tf" >/dev/null 2>&1 || true + rm -f "$tf" + fi +done <<'EOF_RESET_TEST_FILES' +test_commands.json +tests/unit/test_credentials.py +mimo_test_command.sh +EOF_RESET_TEST_FILES + +); then echo "could not reset the test files (testbed problem, not scored)" >&2; exit 1; fi +if ! git apply --verbose /tests/test.patch > "$V/apply.log" 2>&1; then + cat "$V/apply.log" >&2 + echo "the hidden tests could not be applied (testbed problem, not scored)" >&2 + exit 1 +fi +timeout 1800 sh -c "$(cat /tests/test_command.sh)" > "$V/test_output.log" 2>&1 +RC=$? +tail -c 12000 "$V/test_output.log" +if [ $RC -eq 0 ]; then echo 1 > "$V/reward.txt"; else echo 0 > "$V/reward.txt"; fi +echo "test command exited $RC" diff --git a/tasks/format-code-task-000581/tests/test_command.sh b/tasks/format-code-task-000581/tests/test_command.sh new file mode 100644 index 0000000000000000000000000000000000000000..7cb23076694ad17d72e8296d62b2b240083e36db --- /dev/null +++ b/tasks/format-code-task-000581/tests/test_command.sh @@ -0,0 +1 @@ +bash /testbed/mimo_test_command.sh \ No newline at end of file diff --git a/tasks/format-code-task-000586/environment/Dockerfile b/tasks/format-code-task-000586/environment/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..51520a934c353e344cc3eec0c6ac4f29050493b4 --- /dev/null +++ b/tasks/format-code-task-000586/environment/Dockerfile @@ -0,0 +1,3 @@ +# The task's image, pinned by digest (the same as [environment].docker_image). +# Setup runs at start from [environment.healthcheck]; environment/setup/ is its readable copy. +FROM docker.io/xiaomimimo/mimo-v2.6-rl-oss@sha256:9b5a7b1bbfa689de74725904036b206b9f425edd07bdc04fb055d68dcffd0b65 diff --git a/tasks/format-code-task-000586/environment/setup/files/blocklist b/tasks/format-code-task-000586/environment/setup/files/blocklist new file mode 100644 index 0000000000000000000000000000000000000000..a8e4bdc4c7d9b739c047a3cb58ea72a1bb05bcbc --- /dev/null +++ b/tasks/format-code-task-000586/environment/setup/files/blocklist @@ -0,0 +1,33 @@ +# mimo answer-leak blocklist (mimoagent) +0.0.0.0 github.com +0.0.0.0 www.github.com +0.0.0.0 api.github.com +0.0.0.0 raw.githubusercontent.com +0.0.0.0 codeload.github.com +0.0.0.0 objects.githubusercontent.com +0.0.0.0 gist.github.com +0.0.0.0 gist.githubusercontent.com +0.0.0.0 gitlab.com +0.0.0.0 bitbucket.org +0.0.0.0 sourceforge.net +0.0.0.0 git.kernel.org +0.0.0.0 chromium.googlesource.com +0.0.0.0 android.googlesource.com +0.0.0.0 sourcegraph.com +0.0.0.0 bugs.chromium.org +0.0.0.0 issues.oss-fuzz.com +0.0.0.0 oss-fuzz.com +0.0.0.0 osv.dev +0.0.0.0 api.osv.dev +0.0.0.0 bugzilla.mozilla.org +0.0.0.0 proxy.golang.org +0.0.0.0 sum.golang.org +0.0.0.0 pkg.go.dev +0.0.0.0 google.com +0.0.0.0 www.google.com +0.0.0.0 bing.com +0.0.0.0 www.bing.com +0.0.0.0 duckduckgo.com +0.0.0.0 html.duckduckgo.com +0.0.0.0 search.brave.com +0.0.0.0 stackoverflow.com diff --git a/tasks/format-code-task-000586/environment/setup/setup.sh b/tasks/format-code-task-000586/environment/setup/setup.sh new file mode 100644 index 0000000000000000000000000000000000000000..d883db90cfcfb48f7a139861bbe9f6b5d95cad6f --- /dev/null +++ b/tasks/format-code-task-000586/environment/setup/setup.sh @@ -0,0 +1,34 @@ +#!/bin/bash +# Runs once, as root, before the agent starts: Harbor's [environment.healthcheck] unpacks this folder into +# /var/lib/mimo and runs it. Generated by mimo_harbor; see its README for how each step maps to Xiaomi's harness. +M=/var/lib/mimo +[ -f "$M/ready" ] && exit 0 +chmod 700 "$M" +fail() { echo "setup: $*" >&2; exit 1; } +# the answer-leak blocklist (mimoagent), applied to /etc/hosts by the agent right after it installs +write_blocklist() { cp "$M/files/blocklist" "$M/blocklist"; } + +# Code: mimoagent environments/datasets/opensource_code.py + base.py, as the explorer runs it (app/runner/domains.py Code). +CWD=/testbed +git config --global --add safe.directory "$CWD" +cd "$CWD" || fail "no working directory $CWD" +if ! git rev-parse --git-dir >/dev/null 2>&1; then # a bare source tree: give it a baseline commit + git init -q && git add -A && git -c user.name=mimo -c user.email=mimo@localhost commit -q -m baseline --allow-empty +fi +BASE=$(git rev-parse HEAD 2>/dev/null) +[ ${#BASE} -eq 40 ] || fail "could not resolve the base commit in $CWD" +echo "$BASE" > "$M/base" +# Images are built with history truncated at the base. If one is not, the fix could be read out of git log, +# so .git is hidden while the agent works and put back for grading. +LATER=$(git rev-list --all --not "$BASE" 2>/dev/null | head -n 5 | grep -c . || true) +rm -f /tmp/fail.log /tmp/pass.log /tmp/patch.diff /tmp/test_patch.diff /tmp/*.log 2>/dev/null; rm -rf /tmp/claude-0 /tmp/claude-* /tmp/testem-* /tmp/puppeteer_dev_chrome_profile-* 2>/dev/null; rm -f /tmp/test_files.json 2>/dev/null; rm -rf /tmp/jest_* /tmp/jest-* /tmp/build /tmp/build_env 2>/dev/null; rm -rf /tmp/pytest-of-root /tmp/pytest-* /tmp/.pytest_cache /tmp/__pycache__ 2>/dev/null; rm -rf /tmp/go-build* /tmp/standards /tmp/wordpress /tmp/zig-* /tmp/testbase /tmp/testbed 2>/dev/null; rm -f /tmp/tmp*.tmp /tmp/*.bak /tmp/expect* /tmp/butwas* 2>/dev/null; rm -rf /root/.cache/go-build 2>/dev/null; rm -rf /tests 2>/dev/null; find /logs -mindepth 1 -delete 2>/dev/null; mkdir -p /logs/agent /logs/verifier /logs/artifacts; chmod 777 /logs/agent /logs/verifier /logs/artifacts; find /var/log -type f -delete 2>/dev/null || true; rm -rf /var/lib/postgresql/*/*/log /var/lib/postgresql/*/*/pg_log 2>/dev/null || true; find /var/lib/mysql /var/lib/mongodb -type f -name '*.log' -delete 2>/dev/null || true; rm -rf /root/.npm/_logs /root/.babel.json /root/.pytest_cache 2>/dev/null || true; find / -maxdepth 4 -xdev -name task_description.md -path '*/.build_env/*' -delete 2>/dev/null || true; true +git clean -fdx --exclude=node_modules --exclude=bower_components --exclude=.husky --exclude=vendor --exclude=third_party --exclude=_deps --exclude=vcpkg_installed --exclude=.venv --exclude=venv --exclude=.gradle --exclude=target --exclude=.build --exclude=lib --exclude=.bundle --exclude=Manifest.toml --exclude=_build --exclude=.stack-work --exclude=dist-newstyle >/dev/null 2>&1 +find /root/.m2 -type f \( -name '*-SNAPSHOT.jar' -o -name '*-SNAPSHOT-sources.jar' -o -name '*-SNAPSHOT-tests.jar' -o -name '*-SNAPSHOT-test-sources.jar' \) -delete 2>/dev/null; rm -rf /root/.julia/compiled 2>/dev/null; rm -rf /root/.gradle/caches/build-cache-* /root/.gradle/daemon 2>/dev/null; rm -rf /root/.gradle/caches/*/scripts /root/.gradle/caches/jars-* 2>/dev/null; rm -rf /root/.cache/bazel 2>/dev/null; true +if [ "$LATER" -gt 0 ]; then + mv "$CWD/.git" "$M/git-hidden" + echo "history not truncated at ${BASE:0:12}: .git hidden while the agent works" +fi +write_blocklist + +touch "$M/ready" +echo "setup done" diff --git a/tasks/format-code-task-000586/tests/test.patch b/tasks/format-code-task-000586/tests/test.patch new file mode 100644 index 0000000000000000000000000000000000000000..4b45e0c68bb902aec21bf760a5289d1db0e9f043 --- /dev/null +++ b/tasks/format-code-task-000586/tests/test.patch @@ -0,0 +1,123 @@ +diff --git a/errtrace_test.go b/errtrace_test.go +index b652b24..7c149db 100644 +--- a/errtrace_test.go ++++ b/errtrace_test.go +@@ -99,6 +99,98 @@ func TestFormatTrace(t *testing.T) { + } + } + ++func TestFormatVerbs(t *testing.T) { ++ err := errors.New("error") ++ wrapped := errtrace.Wrap(err) ++ ++ tests := []struct { ++ name string ++ fmt string ++ want string ++ }{ ++ { ++ name: "verb s", ++ fmt: "%s", ++ want: "error", ++ }, ++ { ++ name: "verb v", ++ fmt: "%v", ++ want: "error", ++ }, ++ { ++ name: "verb q", ++ fmt: "%q", ++ want: `"error"`, ++ }, ++ { ++ name: "padded string", ++ fmt: "%10s", ++ want: " error", ++ }, ++ } ++ ++ for _, tt := range tests { ++ t.Run(tt.name, func(t *testing.T) { ++ if want, got := tt.want, fmt.Sprintf(tt.fmt, err); want != got { ++ t.Errorf("unwrapped: want %q, got %q", want, got) ++ } ++ ++ if want, got := tt.want, fmt.Sprintf(tt.fmt, wrapped); want != got { ++ t.Errorf("wrapped: want %q, got %q", want, got) ++ } ++ }) ++ } ++} ++ ++func TestFormat(t *testing.T) { ++ e1 := errtrace.New("e1") ++ e2 := errtrace.Errorf("e2: %w", e1) ++ e3 := errtrace.Wrap(e2) ++ ++ tests := []struct { ++ name string ++ err error ++ want string ++ wantTraces int ++ }{ ++ { ++ name: "new error", ++ err: e1, ++ want: "e1", ++ wantTraces: 1, ++ }, ++ { ++ name: "wrapped with Errorf", ++ err: e2, ++ want: "e2: e1", ++ wantTraces: 2, ++ }, ++ { ++ name: "wrap after Errorf", ++ err: e3, ++ want: "e2: e1", ++ wantTraces: 3, ++ }, ++ } ++ ++ for _, tt := range tests { ++ t.Run(tt.name, func(t *testing.T) { ++ if want, got := tt.want, fmt.Sprintf("%s", tt.err); want != got { ++ t.Errorf("message: want %q, got: %q", want, got) ++ } ++ ++ withTrace := fmt.Sprintf("%+v", tt.err) ++ if !strings.HasPrefix(withTrace, tt.want) { ++ t.Errorf("expected error message %q in trace:\n%s", tt.want, withTrace) ++ } ++ if want, got := tt.wantTraces, strings.Count(withTrace, "errtrace_test.TestFormat"); want != got { ++ t.Errorf("expected traces %v, got %v in:\n%s", want, got, withTrace) ++ } ++ }) ++ } ++} ++ + func BenchmarkWrap(b *testing.B) { + err := errors.New("foo") + b.RunParallel(func(pb *testing.PB) { +diff --git a/mimo_build_env.tar.gz.b64 b/mimo_build_env.tar.gz.b64 +new file mode 100644 +--- /dev/null ++++ b/mimo_build_env.tar.gz.b64 +@@ -0,0 +1,4 @@ ++H4sIAAAAAAAAA+3SwQqCQBDGcc89xRwCT61upL5BTxBdQ1MqSBfW1VMP3+alCKqLEtH/d5kZdmEH ++vlVFdzqXu6rpo2AqsZclyVC95zr0OllqnWbZUqdB7DutA0km2+hB17rcigTWGPfu3qfzH6Xu+buq ++dbu9qeu8KVV7HO+NT/nrh/z16pb/KvXfQOLxVnjtz/PflzIEX1Tl7GDk1sqil4XtGgk3flobW+du ++W9mivdzneSgqUkrNvr0/AAAAAAAAAAAAAAAA8M+uVF4d6AAoAAA= +diff --git a/mimo_test_command.sh b/mimo_test_command.sh +new file mode 100755 +--- /dev/null ++++ b/mimo_test_command.sh +@@ -0,0 +1,6 @@ ++#!/usr/bin/env bash ++ ++set -uo pipefail ++cd /testbed || exit 1 ++base64 -d mimo_build_env.tar.gz.b64 | tar -xzf - -C /testbed || exit 1 ++exec bash -lc 'cd /testbed && bash -eo pipefail /testbed/.build_env/test_command.sh' diff --git a/tasks/format-code-task-000586/tests/test.sh b/tasks/format-code-task-000586/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..e78f01741ac1e62e85e901fc49613c29c310c0ec --- /dev/null +++ b/tasks/format-code-task-000586/tests/test.sh @@ -0,0 +1,39 @@ +#!/bin/bash +# Code grading, mimoagent opensource_code.py: reset the files the hidden test patch touches, apply it, run the +# task's test command; reward 1 when it exits 0. A testbed failure (reset or apply) writes no reward: not scored. +M=/var/lib/mimo +CWD=/testbed +V=/logs/verifier +mkdir -p "$V" +BASE=$(cat "$M/base" 2>/dev/null) || { echo "setup never ran (no $M/base)" >&2; exit 1; } +cd "$CWD" || exit 1 +if [ -d "$M/git-hidden" ]; then rm -rf "$CWD/.git"; mv "$M/git-hidden" "$CWD/.git"; fi +# the agent's change against the base, so its own commits count too +git add -A >/dev/null 2>&1 && git -c core.fileMode=false diff --cached "$BASE" > "$V/agent.diff" +git reset -q +if ! ( +while IFS= read -r tf; do + [ -z "$tf" ] && continue + if git cat-file -e $BASE:"$tf" 2>/dev/null; then + git checkout $BASE -- "$tf" 2>/dev/null || true + else + git rm -f --cached "$tf" >/dev/null 2>&1 || true + rm -f "$tf" + fi +done <<'EOF_RESET_TEST_FILES' +errtrace_test.go +mimo_build_env.tar.gz.b64 +mimo_test_command.sh +EOF_RESET_TEST_FILES + +); then echo "could not reset the test files (testbed problem, not scored)" >&2; exit 1; fi +if ! git apply --verbose /tests/test.patch > "$V/apply.log" 2>&1; then + cat "$V/apply.log" >&2 + echo "the hidden tests could not be applied (testbed problem, not scored)" >&2 + exit 1 +fi +timeout 1800 sh -c "$(cat /tests/test_command.sh)" > "$V/test_output.log" 2>&1 +RC=$? +tail -c 12000 "$V/test_output.log" +if [ $RC -eq 0 ]; then echo 1 > "$V/reward.txt"; else echo 0 > "$V/reward.txt"; fi +echo "test command exited $RC" diff --git a/tasks/format-code-task-000586/tests/test_command.sh b/tasks/format-code-task-000586/tests/test_command.sh new file mode 100644 index 0000000000000000000000000000000000000000..7cb23076694ad17d72e8296d62b2b240083e36db --- /dev/null +++ b/tasks/format-code-task-000586/tests/test_command.sh @@ -0,0 +1 @@ +bash /testbed/mimo_test_command.sh \ No newline at end of file diff --git a/tasks/format-code-task-000588/environment/Dockerfile b/tasks/format-code-task-000588/environment/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..073c47af60ab507be2da337de30ad2cdb1325208 --- /dev/null +++ b/tasks/format-code-task-000588/environment/Dockerfile @@ -0,0 +1,3 @@ +# The task's image, pinned by digest (the same as [environment].docker_image). +# Setup runs at start from [environment.healthcheck]; environment/setup/ is its readable copy. +FROM docker.io/xiaomimimo/mimo-v2.6-rl-oss@sha256:d98da8cd14f2bbd384a1ab7d7a2b5cd275dafad401301f8aa576aa659ca3f1ac diff --git a/tasks/format-code-task-000588/environment/setup/files/blocklist b/tasks/format-code-task-000588/environment/setup/files/blocklist new file mode 100644 index 0000000000000000000000000000000000000000..a8e4bdc4c7d9b739c047a3cb58ea72a1bb05bcbc --- /dev/null +++ b/tasks/format-code-task-000588/environment/setup/files/blocklist @@ -0,0 +1,33 @@ +# mimo answer-leak blocklist (mimoagent) +0.0.0.0 github.com +0.0.0.0 www.github.com +0.0.0.0 api.github.com +0.0.0.0 raw.githubusercontent.com +0.0.0.0 codeload.github.com +0.0.0.0 objects.githubusercontent.com +0.0.0.0 gist.github.com +0.0.0.0 gist.githubusercontent.com +0.0.0.0 gitlab.com +0.0.0.0 bitbucket.org +0.0.0.0 sourceforge.net +0.0.0.0 git.kernel.org +0.0.0.0 chromium.googlesource.com +0.0.0.0 android.googlesource.com +0.0.0.0 sourcegraph.com +0.0.0.0 bugs.chromium.org +0.0.0.0 issues.oss-fuzz.com +0.0.0.0 oss-fuzz.com +0.0.0.0 osv.dev +0.0.0.0 api.osv.dev +0.0.0.0 bugzilla.mozilla.org +0.0.0.0 proxy.golang.org +0.0.0.0 sum.golang.org +0.0.0.0 pkg.go.dev +0.0.0.0 google.com +0.0.0.0 www.google.com +0.0.0.0 bing.com +0.0.0.0 www.bing.com +0.0.0.0 duckduckgo.com +0.0.0.0 html.duckduckgo.com +0.0.0.0 search.brave.com +0.0.0.0 stackoverflow.com diff --git a/tasks/format-code-task-000588/environment/setup/setup.sh b/tasks/format-code-task-000588/environment/setup/setup.sh new file mode 100644 index 0000000000000000000000000000000000000000..d883db90cfcfb48f7a139861bbe9f6b5d95cad6f --- /dev/null +++ b/tasks/format-code-task-000588/environment/setup/setup.sh @@ -0,0 +1,34 @@ +#!/bin/bash +# Runs once, as root, before the agent starts: Harbor's [environment.healthcheck] unpacks this folder into +# /var/lib/mimo and runs it. Generated by mimo_harbor; see its README for how each step maps to Xiaomi's harness. +M=/var/lib/mimo +[ -f "$M/ready" ] && exit 0 +chmod 700 "$M" +fail() { echo "setup: $*" >&2; exit 1; } +# the answer-leak blocklist (mimoagent), applied to /etc/hosts by the agent right after it installs +write_blocklist() { cp "$M/files/blocklist" "$M/blocklist"; } + +# Code: mimoagent environments/datasets/opensource_code.py + base.py, as the explorer runs it (app/runner/domains.py Code). +CWD=/testbed +git config --global --add safe.directory "$CWD" +cd "$CWD" || fail "no working directory $CWD" +if ! git rev-parse --git-dir >/dev/null 2>&1; then # a bare source tree: give it a baseline commit + git init -q && git add -A && git -c user.name=mimo -c user.email=mimo@localhost commit -q -m baseline --allow-empty +fi +BASE=$(git rev-parse HEAD 2>/dev/null) +[ ${#BASE} -eq 40 ] || fail "could not resolve the base commit in $CWD" +echo "$BASE" > "$M/base" +# Images are built with history truncated at the base. If one is not, the fix could be read out of git log, +# so .git is hidden while the agent works and put back for grading. +LATER=$(git rev-list --all --not "$BASE" 2>/dev/null | head -n 5 | grep -c . || true) +rm -f /tmp/fail.log /tmp/pass.log /tmp/patch.diff /tmp/test_patch.diff /tmp/*.log 2>/dev/null; rm -rf /tmp/claude-0 /tmp/claude-* /tmp/testem-* /tmp/puppeteer_dev_chrome_profile-* 2>/dev/null; rm -f /tmp/test_files.json 2>/dev/null; rm -rf /tmp/jest_* /tmp/jest-* /tmp/build /tmp/build_env 2>/dev/null; rm -rf /tmp/pytest-of-root /tmp/pytest-* /tmp/.pytest_cache /tmp/__pycache__ 2>/dev/null; rm -rf /tmp/go-build* /tmp/standards /tmp/wordpress /tmp/zig-* /tmp/testbase /tmp/testbed 2>/dev/null; rm -f /tmp/tmp*.tmp /tmp/*.bak /tmp/expect* /tmp/butwas* 2>/dev/null; rm -rf /root/.cache/go-build 2>/dev/null; rm -rf /tests 2>/dev/null; find /logs -mindepth 1 -delete 2>/dev/null; mkdir -p /logs/agent /logs/verifier /logs/artifacts; chmod 777 /logs/agent /logs/verifier /logs/artifacts; find /var/log -type f -delete 2>/dev/null || true; rm -rf /var/lib/postgresql/*/*/log /var/lib/postgresql/*/*/pg_log 2>/dev/null || true; find /var/lib/mysql /var/lib/mongodb -type f -name '*.log' -delete 2>/dev/null || true; rm -rf /root/.npm/_logs /root/.babel.json /root/.pytest_cache 2>/dev/null || true; find / -maxdepth 4 -xdev -name task_description.md -path '*/.build_env/*' -delete 2>/dev/null || true; true +git clean -fdx --exclude=node_modules --exclude=bower_components --exclude=.husky --exclude=vendor --exclude=third_party --exclude=_deps --exclude=vcpkg_installed --exclude=.venv --exclude=venv --exclude=.gradle --exclude=target --exclude=.build --exclude=lib --exclude=.bundle --exclude=Manifest.toml --exclude=_build --exclude=.stack-work --exclude=dist-newstyle >/dev/null 2>&1 +find /root/.m2 -type f \( -name '*-SNAPSHOT.jar' -o -name '*-SNAPSHOT-sources.jar' -o -name '*-SNAPSHOT-tests.jar' -o -name '*-SNAPSHOT-test-sources.jar' \) -delete 2>/dev/null; rm -rf /root/.julia/compiled 2>/dev/null; rm -rf /root/.gradle/caches/build-cache-* /root/.gradle/daemon 2>/dev/null; rm -rf /root/.gradle/caches/*/scripts /root/.gradle/caches/jars-* 2>/dev/null; rm -rf /root/.cache/bazel 2>/dev/null; true +if [ "$LATER" -gt 0 ]; then + mv "$CWD/.git" "$M/git-hidden" + echo "history not truncated at ${BASE:0:12}: .git hidden while the agent works" +fi +write_blocklist + +touch "$M/ready" +echo "setup done" diff --git a/tasks/format-code-task-000588/tests/test.patch b/tasks/format-code-task-000588/tests/test.patch new file mode 100644 index 0000000000000000000000000000000000000000..d79790d9553131f30149e6ff2543146a1a33a8b9 --- /dev/null +++ b/tasks/format-code-task-000588/tests/test.patch @@ -0,0 +1,167 @@ +diff --git a/test/unit/app/browser/api/ledgerNotificationsAllowPromotionsTest.js b/test/unit/app/browser/api/ledgerNotificationsAllowPromotionsTest.js +new file mode 100644 +index 000000000..f079dc591 +--- /dev/null ++++ b/test/unit/app/browser/api/ledgerNotificationsAllowPromotionsTest.js +@@ -0,0 +1,139 @@ ++ ++ ++ ++ ++ ++const Immutable = require('immutable') ++const assert = require('assert') ++const sinon = require('sinon') ++const mockery = require('mockery') ++const settings = require('../../../../../js/constants/settings') ++ ++describe('ledgerNotifications PAYMENTS_ALLOW_PROMOTIONS unit test', function () { ++ let ledgerNotificationsApi ++ let appAction ++ let showNotificationSpy ++ ++ let paymentsEnabled ++ let paymentsNotifications ++ let paymentsAllowPromotions ++ ++ const defaultAppState = Immutable.fromJS({ ++ ledger: {}, ++ migrations: {} ++ }) ++ ++ const promotionState = defaultAppState ++ .setIn(['ledger', 'promotion', 'activeState'], 'disabledWallet') ++ .setIn(['ledger', 'promotion', 'stateWallet'], Immutable.fromJS({ ++ disabledWallet: { ++ notification: { ++ message: 'Hello' ++ } ++ } ++ })) ++ ++ before(function () { ++ mockery.enable({ ++ warnOnReplace: false, ++ warnOnUnregistered: false, ++ useCleanCache: true ++ }) ++ ++ const fakeElectron = require('../../../lib/fakeElectron') ++ const fakeAdBlock = require('../../../lib/fakeAdBlock') ++ const fakeLevel = require('../../../lib/fakeLevel') ++ mockery.registerMock('electron', fakeElectron) ++ mockery.registerMock('ad-block', fakeAdBlock) ++ mockery.registerMock('level', fakeLevel) ++ mockery.registerMock('../../../js/settings', { ++ getSetting: (settingKey) => { ++ switch (settingKey) { ++ case settings.PAYMENTS_ENABLED: ++ return paymentsEnabled ++ case settings.PAYMENTS_NOTIFICATIONS: ++ return paymentsNotifications ++ case settings.PAYMENTS_ALLOW_PROMOTIONS: ++ return paymentsAllowPromotions ++ } ++ return false ++ } ++ }) ++ ++ ledgerNotificationsApi = require('../../../../../app/browser/api/ledgerNotifications') ++ appAction = require('../../../../../js/actions/appActions') ++ showNotificationSpy = sinon.spy(appAction, 'showNotification') ++ }) ++ ++ after(function () { ++ showNotificationSpy.restore() ++ mockery.deregisterAll() ++ mockery.disable() ++ }) ++ ++ beforeEach(function () { ++ showNotificationSpy.reset() ++ ++ paymentsEnabled = true ++ paymentsNotifications = true ++ paymentsAllowPromotions = true ++ }) ++ ++ describe('showPromotionNotification', function () { ++ it('does NOT show when PAYMENTS_ALLOW_PROMOTIONS is false (the bug scenario)', function () { ++ paymentsEnabled = true ++ paymentsNotifications = true ++ paymentsAllowPromotions = false ++ ledgerNotificationsApi.showPromotionNotification(promotionState) ++ assert(showNotificationSpy.notCalled) ++ }) ++ ++ it('does NOT show when PAYMENTS_ALLOW_PROMOTIONS is false even if payments disabled', function () { ++ paymentsEnabled = false ++ paymentsNotifications = true ++ paymentsAllowPromotions = false ++ ledgerNotificationsApi.showPromotionNotification(promotionState) ++ assert(showNotificationSpy.notCalled) ++ }) ++ ++ it('shows notification when PAYMENTS_ALLOW_PROMOTIONS is true and other settings allow', function () { ++ paymentsEnabled = true ++ paymentsNotifications = true ++ paymentsAllowPromotions = true ++ ledgerNotificationsApi.showPromotionNotification(promotionState) ++ assert(showNotificationSpy.calledOnce) ++ }) ++ ++ it('shows notification when payments disabled but PAYMENTS_ALLOW_PROMOTIONS is true', function () { ++ paymentsEnabled = false ++ paymentsNotifications = false ++ paymentsAllowPromotions = true ++ ledgerNotificationsApi.showPromotionNotification(promotionState) ++ assert(showNotificationSpy.calledOnce) ++ }) ++ ++ it('does NOT show when PAYMENTS_NOTIFICATIONS is off (preserved behavior)', function () { ++ paymentsEnabled = true ++ paymentsNotifications = false ++ paymentsAllowPromotions = true ++ ledgerNotificationsApi.showPromotionNotification(promotionState) ++ assert(showNotificationSpy.notCalled) ++ }) ++ ++ it('does NOT show when promotion is empty (preserved behavior)', function () { ++ paymentsEnabled = true ++ paymentsNotifications = true ++ paymentsAllowPromotions = true ++ ledgerNotificationsApi.showPromotionNotification(defaultAppState) ++ assert(showNotificationSpy.notCalled) ++ }) ++ ++ it('does NOT show when both PAYMENTS_NOTIFICATIONS off and PAYMENTS_ALLOW_PROMOTIONS off', function () { ++ paymentsEnabled = true ++ paymentsNotifications = false ++ paymentsAllowPromotions = false ++ ledgerNotificationsApi.showPromotionNotification(promotionState) ++ assert(showNotificationSpy.notCalled) ++ }) ++ }) ++}) +diff --git a/test_commands.json b/test_commands.json +new file mode 100644 +index 000000000..f4ca6b654 +--- /dev/null ++++ b/test_commands.json +@@ -0,0 +1,3 @@ ++{ ++ "test_commands": ["NODE_ENV=test npx mocha test/unit/app/browser/api/ledgerNotificationsAllowPromotionsTest.js"] ++} +diff --git a/mimo_test_command.sh b/mimo_test_command.sh +new file mode 100755 +--- /dev/null ++++ b/mimo_test_command.sh +@@ -0,0 +1,8 @@ ++#!/usr/bin/env bash ++ ++set -uo pipefail ++cd /testbed ++rc=0 ++NODE_ENV=test npx mocha test/unit/app/browser/api/ledgerNotificationsAllowPromotionsTest.js ++rc=$(( rc | $? )) ++exit $rc diff --git a/tasks/format-code-task-000588/tests/test.sh b/tasks/format-code-task-000588/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..f294970bb1579aa0616f1b1501d120d79facfde3 --- /dev/null +++ b/tasks/format-code-task-000588/tests/test.sh @@ -0,0 +1,39 @@ +#!/bin/bash +# Code grading, mimoagent opensource_code.py: reset the files the hidden test patch touches, apply it, run the +# task's test command; reward 1 when it exits 0. A testbed failure (reset or apply) writes no reward: not scored. +M=/var/lib/mimo +CWD=/testbed +V=/logs/verifier +mkdir -p "$V" +BASE=$(cat "$M/base" 2>/dev/null) || { echo "setup never ran (no $M/base)" >&2; exit 1; } +cd "$CWD" || exit 1 +if [ -d "$M/git-hidden" ]; then rm -rf "$CWD/.git"; mv "$M/git-hidden" "$CWD/.git"; fi +# the agent's change against the base, so its own commits count too +git add -A >/dev/null 2>&1 && git -c core.fileMode=false diff --cached "$BASE" > "$V/agent.diff" +git reset -q +if ! ( +while IFS= read -r tf; do + [ -z "$tf" ] && continue + if git cat-file -e $BASE:"$tf" 2>/dev/null; then + git checkout $BASE -- "$tf" 2>/dev/null || true + else + git rm -f --cached "$tf" >/dev/null 2>&1 || true + rm -f "$tf" + fi +done <<'EOF_RESET_TEST_FILES' +test/unit/app/browser/api/ledgerNotificationsAllowPromotionsTest.js +test_commands.json +mimo_test_command.sh +EOF_RESET_TEST_FILES + +); then echo "could not reset the test files (testbed problem, not scored)" >&2; exit 1; fi +if ! git apply --verbose /tests/test.patch > "$V/apply.log" 2>&1; then + cat "$V/apply.log" >&2 + echo "the hidden tests could not be applied (testbed problem, not scored)" >&2 + exit 1 +fi +timeout 1800 sh -c "$(cat /tests/test_command.sh)" > "$V/test_output.log" 2>&1 +RC=$? +tail -c 12000 "$V/test_output.log" +if [ $RC -eq 0 ]; then echo 1 > "$V/reward.txt"; else echo 0 > "$V/reward.txt"; fi +echo "test command exited $RC" diff --git a/tasks/format-code-task-000588/tests/test_command.sh b/tasks/format-code-task-000588/tests/test_command.sh new file mode 100644 index 0000000000000000000000000000000000000000..7cb23076694ad17d72e8296d62b2b240083e36db --- /dev/null +++ b/tasks/format-code-task-000588/tests/test_command.sh @@ -0,0 +1 @@ +bash /testbed/mimo_test_command.sh \ No newline at end of file diff --git a/tasks/format-code-task-000722/environment/Dockerfile b/tasks/format-code-task-000722/environment/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..883c71df8d5e969d281a9ff10ad88bc41767d1d8 --- /dev/null +++ b/tasks/format-code-task-000722/environment/Dockerfile @@ -0,0 +1,3 @@ +# The task's image, pinned by digest (the same as [environment].docker_image). +# Setup runs at start from [environment.healthcheck]; environment/setup/ is its readable copy. +FROM docker.io/xiaomimimo/mimo-v2.6-rl-oss@sha256:813d39ad573e8a0294490e08496e97a6b12000b1cd6f8d02c53531d672686fe5 diff --git a/tasks/format-code-task-000722/environment/setup/files/blocklist b/tasks/format-code-task-000722/environment/setup/files/blocklist new file mode 100644 index 0000000000000000000000000000000000000000..a8e4bdc4c7d9b739c047a3cb58ea72a1bb05bcbc --- /dev/null +++ b/tasks/format-code-task-000722/environment/setup/files/blocklist @@ -0,0 +1,33 @@ +# mimo answer-leak blocklist (mimoagent) +0.0.0.0 github.com +0.0.0.0 www.github.com +0.0.0.0 api.github.com +0.0.0.0 raw.githubusercontent.com +0.0.0.0 codeload.github.com +0.0.0.0 objects.githubusercontent.com +0.0.0.0 gist.github.com +0.0.0.0 gist.githubusercontent.com +0.0.0.0 gitlab.com +0.0.0.0 bitbucket.org +0.0.0.0 sourceforge.net +0.0.0.0 git.kernel.org +0.0.0.0 chromium.googlesource.com +0.0.0.0 android.googlesource.com +0.0.0.0 sourcegraph.com +0.0.0.0 bugs.chromium.org +0.0.0.0 issues.oss-fuzz.com +0.0.0.0 oss-fuzz.com +0.0.0.0 osv.dev +0.0.0.0 api.osv.dev +0.0.0.0 bugzilla.mozilla.org +0.0.0.0 proxy.golang.org +0.0.0.0 sum.golang.org +0.0.0.0 pkg.go.dev +0.0.0.0 google.com +0.0.0.0 www.google.com +0.0.0.0 bing.com +0.0.0.0 www.bing.com +0.0.0.0 duckduckgo.com +0.0.0.0 html.duckduckgo.com +0.0.0.0 search.brave.com +0.0.0.0 stackoverflow.com diff --git a/tasks/format-code-task-000722/environment/setup/setup.sh b/tasks/format-code-task-000722/environment/setup/setup.sh new file mode 100644 index 0000000000000000000000000000000000000000..d883db90cfcfb48f7a139861bbe9f6b5d95cad6f --- /dev/null +++ b/tasks/format-code-task-000722/environment/setup/setup.sh @@ -0,0 +1,34 @@ +#!/bin/bash +# Runs once, as root, before the agent starts: Harbor's [environment.healthcheck] unpacks this folder into +# /var/lib/mimo and runs it. Generated by mimo_harbor; see its README for how each step maps to Xiaomi's harness. +M=/var/lib/mimo +[ -f "$M/ready" ] && exit 0 +chmod 700 "$M" +fail() { echo "setup: $*" >&2; exit 1; } +# the answer-leak blocklist (mimoagent), applied to /etc/hosts by the agent right after it installs +write_blocklist() { cp "$M/files/blocklist" "$M/blocklist"; } + +# Code: mimoagent environments/datasets/opensource_code.py + base.py, as the explorer runs it (app/runner/domains.py Code). +CWD=/testbed +git config --global --add safe.directory "$CWD" +cd "$CWD" || fail "no working directory $CWD" +if ! git rev-parse --git-dir >/dev/null 2>&1; then # a bare source tree: give it a baseline commit + git init -q && git add -A && git -c user.name=mimo -c user.email=mimo@localhost commit -q -m baseline --allow-empty +fi +BASE=$(git rev-parse HEAD 2>/dev/null) +[ ${#BASE} -eq 40 ] || fail "could not resolve the base commit in $CWD" +echo "$BASE" > "$M/base" +# Images are built with history truncated at the base. If one is not, the fix could be read out of git log, +# so .git is hidden while the agent works and put back for grading. +LATER=$(git rev-list --all --not "$BASE" 2>/dev/null | head -n 5 | grep -c . || true) +rm -f /tmp/fail.log /tmp/pass.log /tmp/patch.diff /tmp/test_patch.diff /tmp/*.log 2>/dev/null; rm -rf /tmp/claude-0 /tmp/claude-* /tmp/testem-* /tmp/puppeteer_dev_chrome_profile-* 2>/dev/null; rm -f /tmp/test_files.json 2>/dev/null; rm -rf /tmp/jest_* /tmp/jest-* /tmp/build /tmp/build_env 2>/dev/null; rm -rf /tmp/pytest-of-root /tmp/pytest-* /tmp/.pytest_cache /tmp/__pycache__ 2>/dev/null; rm -rf /tmp/go-build* /tmp/standards /tmp/wordpress /tmp/zig-* /tmp/testbase /tmp/testbed 2>/dev/null; rm -f /tmp/tmp*.tmp /tmp/*.bak /tmp/expect* /tmp/butwas* 2>/dev/null; rm -rf /root/.cache/go-build 2>/dev/null; rm -rf /tests 2>/dev/null; find /logs -mindepth 1 -delete 2>/dev/null; mkdir -p /logs/agent /logs/verifier /logs/artifacts; chmod 777 /logs/agent /logs/verifier /logs/artifacts; find /var/log -type f -delete 2>/dev/null || true; rm -rf /var/lib/postgresql/*/*/log /var/lib/postgresql/*/*/pg_log 2>/dev/null || true; find /var/lib/mysql /var/lib/mongodb -type f -name '*.log' -delete 2>/dev/null || true; rm -rf /root/.npm/_logs /root/.babel.json /root/.pytest_cache 2>/dev/null || true; find / -maxdepth 4 -xdev -name task_description.md -path '*/.build_env/*' -delete 2>/dev/null || true; true +git clean -fdx --exclude=node_modules --exclude=bower_components --exclude=.husky --exclude=vendor --exclude=third_party --exclude=_deps --exclude=vcpkg_installed --exclude=.venv --exclude=venv --exclude=.gradle --exclude=target --exclude=.build --exclude=lib --exclude=.bundle --exclude=Manifest.toml --exclude=_build --exclude=.stack-work --exclude=dist-newstyle >/dev/null 2>&1 +find /root/.m2 -type f \( -name '*-SNAPSHOT.jar' -o -name '*-SNAPSHOT-sources.jar' -o -name '*-SNAPSHOT-tests.jar' -o -name '*-SNAPSHOT-test-sources.jar' \) -delete 2>/dev/null; rm -rf /root/.julia/compiled 2>/dev/null; rm -rf /root/.gradle/caches/build-cache-* /root/.gradle/daemon 2>/dev/null; rm -rf /root/.gradle/caches/*/scripts /root/.gradle/caches/jars-* 2>/dev/null; rm -rf /root/.cache/bazel 2>/dev/null; true +if [ "$LATER" -gt 0 ]; then + mv "$CWD/.git" "$M/git-hidden" + echo "history not truncated at ${BASE:0:12}: .git hidden while the agent works" +fi +write_blocklist + +touch "$M/ready" +echo "setup done" diff --git a/tasks/format-code-task-000722/tests/test.patch b/tasks/format-code-task-000722/tests/test.patch new file mode 100644 index 0000000000000000000000000000000000000000..9d4f810b04e14304c3868ddc2ab60f13508667d5 --- /dev/null +++ b/tasks/format-code-task-000722/tests/test.patch @@ -0,0 +1,195 @@ +diff --git a/compose/decoder/decoder_behavior_test.go b/compose/decoder/decoder_behavior_test.go +new file mode 100644 +index 000000000..e76a7a636 +--- /dev/null ++++ b/compose/decoder/decoder_behavior_test.go +@@ -0,0 +1,163 @@ ++package decoder_test ++ ++import ( ++ "bytes" ++ "encoding/csv" ++ "encoding/json" ++ "io" ++ "testing" ++ ++ "github.com/cortezaproject/corteza-server/compose/decoder" ++ "github.com/cortezaproject/corteza-server/compose/types" ++ "github.com/cortezaproject/corteza-server/internal/test" ++) ++ ++func rs(c string) io.ReadSeeker { ++ return bytes.NewReader([]byte(c)) ++} ++ ++func newFlat(c string) decoder.Decoder { ++ r := rs(c) ++ return decoder.NewFlatReader(csv.NewReader(r), r) ++} ++ ++func newStructured(c string) decoder.Decoder { ++ r := rs(c) ++ return decoder.NewStructuredDecoder(json.NewDecoder(r), r) ++} ++ ++const ( ++ csvOne = "f1,f2,ID\nr1v1,r1v2,1\n" ++ csvTwo = "f1,f2,ID\na,b,1\nc,d,2\n" ++ jsonlOne = "{ \"f1\": \"nr1v1\", \"f2\": \"r1v2\", \"ID\": \"1\" }\n" ++ jsonlTwo = "{ \"f1\": \"a\", \"f2\": \"b\", \"ID\": \"1\" }\n{ \"f1\": \"c\", \"f2\": \"d\", \"ID\": \"2\" }\n" ++) ++ ++func TestEntryCount(t *testing.T) { ++ cases := []struct { ++ name string ++ dec decoder.Decoder ++ expect uint64 ++ }{ ++ {"flat single data row", newFlat(csvOne), 1}, ++ {"flat two data rows", newFlat(csvTwo), 2}, ++ {"flat empty", newFlat(""), 0}, ++ {"structured single", newStructured(jsonlOne), 1}, ++ {"structured two", newStructured(jsonlTwo), 2}, ++ } ++ ++ for _, c := range cases { ++ t.Run(c.name, func(t *testing.T) { ++ got, err := c.dec.EntryCount() ++ test.NoError(t, err, "unexpected error: %v") ++ test.Assert(t, got == c.expect, "expected %d entries, got %d", c.expect, got) ++ }) ++ } ++} ++ ++func TestHeader(t *testing.T) { ++ t.Run("flat returns the first row in order", func(t *testing.T) { ++ h := newFlat(csvOne).Header() ++ test.Assert(t, len(h) == 3, "expected 3 header fields, got %d", len(h)) ++ expect := []string{"f1", "f2", "ID"} ++ for i := range expect { ++ test.Assert(t, h[i] == expect[i], "header[%d]=%q, expected %q", i, h[i], expect[i]) ++ } ++ }) ++ ++ t.Run("structured returns object keys", func(t *testing.T) { ++ h := newStructured(jsonlOne).Header() ++ test.Assert(t, len(h) == 3, "expected 3 header fields, got %d", len(h)) ++ set := map[string]bool{} ++ for _, k := range h { ++ set[k] = true ++ } ++ for _, k := range []string{"f1", "f2", "ID"} { ++ test.Assert(t, set[k], "missing header field %q", k) ++ } ++ }) ++} ++ ++func collect(t *testing.T, dec decoder.Decoder, fields map[string]string) []*types.Record { ++ t.Helper() ++ var out []*types.Record ++ err := dec.Records(fields, func(r *types.Record) error { ++ out = append(out, r) ++ return nil ++ }) ++ test.NoError(t, err, "unexpected error: %v") ++ return out ++} ++ ++func TestRecordsFlat(t *testing.T) { ++ fields := map[string]string{"f1": "f1", "f2": "f2", "ID": "ID"} ++ ++ recs := collect(t, newFlat(csvTwo), fields) ++ test.Assert(t, len(recs) == 2, "expected 2 records, got %d", len(recs)) ++ ++ first := recs[0] ++ test.Assert(t, first.ID == 1, "expected system field ID==1, got %d", first.ID) ++ test.Assert(t, len(first.Values) == 2, "expected 2 record values, got %d", len(first.Values)) ++ ++ v1 := first.Values.FilterByName("f1") ++ test.Assert(t, len(v1) == 1 && v1[0].Value == "a", "expected value f1==a") ++ v2 := first.Values.FilterByName("f2") ++ test.Assert(t, len(v2) == 1 && v2[0].Value == "b", "expected value f2==b") ++ ++ test.Assert(t, recs[1].ID == 2, "expected second record ID==2, got %d", recs[1].ID) ++} ++ ++func TestRecordsStructured(t *testing.T) { ++ fields := map[string]string{"f1": "f1", "f2": "f2", "ID": "ID"} ++ ++ recs := collect(t, newStructured(jsonlTwo), fields) ++ test.Assert(t, len(recs) == 2, "expected 2 records, got %d", len(recs)) ++ ++ first := recs[0] ++ test.Assert(t, first.ID == 1, "expected system field ID==1, got %d", first.ID) ++ test.Assert(t, len(first.Values) == 2, "expected 2 record values, got %d", len(first.Values)) ++ v1 := first.Values.FilterByName("f1") ++ test.Assert(t, len(v1) == 1 && v1[0].Value == "a", "expected value f1==a") ++} ++ ++func TestRecordsSubsetMapping(t *testing.T) { ++ ++ fields := map[string]string{"f1": "f1"} ++ ++ recs := collect(t, newFlat(csvOne), fields) ++ test.Assert(t, len(recs) == 1, "expected 1 record, got %d", len(recs)) ++ test.Assert(t, len(recs[0].Values) == 1, "expected 1 record value, got %d", len(recs[0].Values)) ++ test.Assert(t, recs[0].ID == 0, "ID should be untouched when not mapped, got %d", recs[0].ID) ++} ++ ++func TestRecordsEmptyTargetIsError(t *testing.T) { ++ fields := map[string]string{"f1": ""} ++ ++ t.Run("flat", func(t *testing.T) { ++ err := newFlat(csvOne).Records(fields, func(*types.Record) error { return nil }) ++ test.Error(t, err, "expected error for empty target field name") ++ }) ++ ++ t.Run("structured", func(t *testing.T) { ++ err := newStructured(jsonlOne).Records(fields, func(*types.Record) error { return nil }) ++ test.Error(t, err, "expected error for empty target field name") ++ }) ++} ++ ++func TestHeaderDoesNotConsumeRecords(t *testing.T) { ++ fields := map[string]string{"f1": "f1", "f2": "f2", "ID": "ID"} ++ ++ t.Run("flat", func(t *testing.T) { ++ dec := newFlat(csvTwo) ++ _ = dec.Header() ++ recs := collect(t, dec, fields) ++ test.Assert(t, len(recs) == 2, "expected 2 records after Header(), got %d", len(recs)) ++ }) ++ ++ t.Run("structured", func(t *testing.T) { ++ dec := newStructured(jsonlTwo) ++ _ = dec.Header() ++ recs := collect(t, dec, fields) ++ test.Assert(t, len(recs) == 2, "expected 2 records after Header(), got %d", len(recs)) ++ }) ++} +diff --git a/mimo_test_command.sh b/mimo_test_command.sh +new file mode 100755 +--- /dev/null ++++ b/mimo_test_command.sh +@@ -0,0 +1,21 @@ ++#!/usr/bin/env bash ++ ++ ++ ++set -euo pipefail ++HERE="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" ++cd /testbed ++ ++ ++ ++ ++ ++export GO111MODULE=off ++SRC="$(go env GOPATH)/src/github.com/cortezaproject/corteza-server" ++cd "$SRC" ++ ++ ++go test ./compose/types/ ++ ++ ++go test ./compose/decoder/ diff --git a/tasks/format-code-task-000722/tests/test.sh b/tasks/format-code-task-000722/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..2134adc85eb6d944d4dccb2d38fb5438338242fb --- /dev/null +++ b/tasks/format-code-task-000722/tests/test.sh @@ -0,0 +1,38 @@ +#!/bin/bash +# Code grading, mimoagent opensource_code.py: reset the files the hidden test patch touches, apply it, run the +# task's test command; reward 1 when it exits 0. A testbed failure (reset or apply) writes no reward: not scored. +M=/var/lib/mimo +CWD=/testbed +V=/logs/verifier +mkdir -p "$V" +BASE=$(cat "$M/base" 2>/dev/null) || { echo "setup never ran (no $M/base)" >&2; exit 1; } +cd "$CWD" || exit 1 +if [ -d "$M/git-hidden" ]; then rm -rf "$CWD/.git"; mv "$M/git-hidden" "$CWD/.git"; fi +# the agent's change against the base, so its own commits count too +git add -A >/dev/null 2>&1 && git -c core.fileMode=false diff --cached "$BASE" > "$V/agent.diff" +git reset -q +if ! ( +while IFS= read -r tf; do + [ -z "$tf" ] && continue + if git cat-file -e $BASE:"$tf" 2>/dev/null; then + git checkout $BASE -- "$tf" 2>/dev/null || true + else + git rm -f --cached "$tf" >/dev/null 2>&1 || true + rm -f "$tf" + fi +done <<'EOF_RESET_TEST_FILES' +compose/decoder/decoder_behavior_test.go +mimo_test_command.sh +EOF_RESET_TEST_FILES + +); then echo "could not reset the test files (testbed problem, not scored)" >&2; exit 1; fi +if ! git apply --verbose /tests/test.patch > "$V/apply.log" 2>&1; then + cat "$V/apply.log" >&2 + echo "the hidden tests could not be applied (testbed problem, not scored)" >&2 + exit 1 +fi +timeout 1800 sh -c "$(cat /tests/test_command.sh)" > "$V/test_output.log" 2>&1 +RC=$? +tail -c 12000 "$V/test_output.log" +if [ $RC -eq 0 ]; then echo 1 > "$V/reward.txt"; else echo 0 > "$V/reward.txt"; fi +echo "test command exited $RC" diff --git a/tasks/format-code-task-000722/tests/test_command.sh b/tasks/format-code-task-000722/tests/test_command.sh new file mode 100644 index 0000000000000000000000000000000000000000..7cb23076694ad17d72e8296d62b2b240083e36db --- /dev/null +++ b/tasks/format-code-task-000722/tests/test_command.sh @@ -0,0 +1 @@ +bash /testbed/mimo_test_command.sh \ No newline at end of file diff --git a/tasks/format-code-task-000740/environment/Dockerfile b/tasks/format-code-task-000740/environment/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..ec5a825ddc0808fda49a79fef84672ee5830928b --- /dev/null +++ b/tasks/format-code-task-000740/environment/Dockerfile @@ -0,0 +1,3 @@ +# The task's image, pinned by digest (the same as [environment].docker_image). +# Setup runs at start from [environment.healthcheck]; environment/setup/ is its readable copy. +FROM docker.io/xiaomimimo/mimo-v2.6-rl-oss@sha256:ae37155dd0276a0947addab78c235509f317faed1b434cdf19589caadc9fb6b0 diff --git a/tasks/format-code-task-000740/environment/setup/files/blocklist b/tasks/format-code-task-000740/environment/setup/files/blocklist new file mode 100644 index 0000000000000000000000000000000000000000..a8e4bdc4c7d9b739c047a3cb58ea72a1bb05bcbc --- /dev/null +++ b/tasks/format-code-task-000740/environment/setup/files/blocklist @@ -0,0 +1,33 @@ +# mimo answer-leak blocklist (mimoagent) +0.0.0.0 github.com +0.0.0.0 www.github.com +0.0.0.0 api.github.com +0.0.0.0 raw.githubusercontent.com +0.0.0.0 codeload.github.com +0.0.0.0 objects.githubusercontent.com +0.0.0.0 gist.github.com +0.0.0.0 gist.githubusercontent.com +0.0.0.0 gitlab.com +0.0.0.0 bitbucket.org +0.0.0.0 sourceforge.net +0.0.0.0 git.kernel.org +0.0.0.0 chromium.googlesource.com +0.0.0.0 android.googlesource.com +0.0.0.0 sourcegraph.com +0.0.0.0 bugs.chromium.org +0.0.0.0 issues.oss-fuzz.com +0.0.0.0 oss-fuzz.com +0.0.0.0 osv.dev +0.0.0.0 api.osv.dev +0.0.0.0 bugzilla.mozilla.org +0.0.0.0 proxy.golang.org +0.0.0.0 sum.golang.org +0.0.0.0 pkg.go.dev +0.0.0.0 google.com +0.0.0.0 www.google.com +0.0.0.0 bing.com +0.0.0.0 www.bing.com +0.0.0.0 duckduckgo.com +0.0.0.0 html.duckduckgo.com +0.0.0.0 search.brave.com +0.0.0.0 stackoverflow.com diff --git a/tasks/format-code-task-000740/environment/setup/setup.sh b/tasks/format-code-task-000740/environment/setup/setup.sh new file mode 100644 index 0000000000000000000000000000000000000000..d883db90cfcfb48f7a139861bbe9f6b5d95cad6f --- /dev/null +++ b/tasks/format-code-task-000740/environment/setup/setup.sh @@ -0,0 +1,34 @@ +#!/bin/bash +# Runs once, as root, before the agent starts: Harbor's [environment.healthcheck] unpacks this folder into +# /var/lib/mimo and runs it. Generated by mimo_harbor; see its README for how each step maps to Xiaomi's harness. +M=/var/lib/mimo +[ -f "$M/ready" ] && exit 0 +chmod 700 "$M" +fail() { echo "setup: $*" >&2; exit 1; } +# the answer-leak blocklist (mimoagent), applied to /etc/hosts by the agent right after it installs +write_blocklist() { cp "$M/files/blocklist" "$M/blocklist"; } + +# Code: mimoagent environments/datasets/opensource_code.py + base.py, as the explorer runs it (app/runner/domains.py Code). +CWD=/testbed +git config --global --add safe.directory "$CWD" +cd "$CWD" || fail "no working directory $CWD" +if ! git rev-parse --git-dir >/dev/null 2>&1; then # a bare source tree: give it a baseline commit + git init -q && git add -A && git -c user.name=mimo -c user.email=mimo@localhost commit -q -m baseline --allow-empty +fi +BASE=$(git rev-parse HEAD 2>/dev/null) +[ ${#BASE} -eq 40 ] || fail "could not resolve the base commit in $CWD" +echo "$BASE" > "$M/base" +# Images are built with history truncated at the base. If one is not, the fix could be read out of git log, +# so .git is hidden while the agent works and put back for grading. +LATER=$(git rev-list --all --not "$BASE" 2>/dev/null | head -n 5 | grep -c . || true) +rm -f /tmp/fail.log /tmp/pass.log /tmp/patch.diff /tmp/test_patch.diff /tmp/*.log 2>/dev/null; rm -rf /tmp/claude-0 /tmp/claude-* /tmp/testem-* /tmp/puppeteer_dev_chrome_profile-* 2>/dev/null; rm -f /tmp/test_files.json 2>/dev/null; rm -rf /tmp/jest_* /tmp/jest-* /tmp/build /tmp/build_env 2>/dev/null; rm -rf /tmp/pytest-of-root /tmp/pytest-* /tmp/.pytest_cache /tmp/__pycache__ 2>/dev/null; rm -rf /tmp/go-build* /tmp/standards /tmp/wordpress /tmp/zig-* /tmp/testbase /tmp/testbed 2>/dev/null; rm -f /tmp/tmp*.tmp /tmp/*.bak /tmp/expect* /tmp/butwas* 2>/dev/null; rm -rf /root/.cache/go-build 2>/dev/null; rm -rf /tests 2>/dev/null; find /logs -mindepth 1 -delete 2>/dev/null; mkdir -p /logs/agent /logs/verifier /logs/artifacts; chmod 777 /logs/agent /logs/verifier /logs/artifacts; find /var/log -type f -delete 2>/dev/null || true; rm -rf /var/lib/postgresql/*/*/log /var/lib/postgresql/*/*/pg_log 2>/dev/null || true; find /var/lib/mysql /var/lib/mongodb -type f -name '*.log' -delete 2>/dev/null || true; rm -rf /root/.npm/_logs /root/.babel.json /root/.pytest_cache 2>/dev/null || true; find / -maxdepth 4 -xdev -name task_description.md -path '*/.build_env/*' -delete 2>/dev/null || true; true +git clean -fdx --exclude=node_modules --exclude=bower_components --exclude=.husky --exclude=vendor --exclude=third_party --exclude=_deps --exclude=vcpkg_installed --exclude=.venv --exclude=venv --exclude=.gradle --exclude=target --exclude=.build --exclude=lib --exclude=.bundle --exclude=Manifest.toml --exclude=_build --exclude=.stack-work --exclude=dist-newstyle >/dev/null 2>&1 +find /root/.m2 -type f \( -name '*-SNAPSHOT.jar' -o -name '*-SNAPSHOT-sources.jar' -o -name '*-SNAPSHOT-tests.jar' -o -name '*-SNAPSHOT-test-sources.jar' \) -delete 2>/dev/null; rm -rf /root/.julia/compiled 2>/dev/null; rm -rf /root/.gradle/caches/build-cache-* /root/.gradle/daemon 2>/dev/null; rm -rf /root/.gradle/caches/*/scripts /root/.gradle/caches/jars-* 2>/dev/null; rm -rf /root/.cache/bazel 2>/dev/null; true +if [ "$LATER" -gt 0 ]; then + mv "$CWD/.git" "$M/git-hidden" + echo "history not truncated at ${BASE:0:12}: .git hidden while the agent works" +fi +write_blocklist + +touch "$M/ready" +echo "setup done" diff --git a/tasks/format-code-task-000740/tests/test.patch b/tasks/format-code-task-000740/tests/test.patch new file mode 100644 index 0000000000000000000000000000000000000000..7ae78d762bdb194edfaefbe67d9d671bf6e23907 --- /dev/null +++ b/tasks/format-code-task-000740/tests/test.patch @@ -0,0 +1,199 @@ +diff --git a/tests/functional/param_expand/03-env-tmpl.t b/tests/functional/param_expand/03-env-tmpl.t +index f4997c11269..6e40735bdea 100755 +--- a/tests/functional/param_expand/03-env-tmpl.t ++++ b/tests/functional/param_expand/03-env-tmpl.t +@@ -16,6 +16,7 @@ + # along with this program. If not, see . + #------------------------------------------------------------------------------- + # Test parameter environment templates ++# Extended to include inheritance from parameterized parents (GitHub #4248) + . "$(dirname "$0")/test_header" + set_test_number 2 + reftest +diff --git a/tests/functional/param_expand/03-env-tmpl/flow.cylc b/tests/functional/param_expand/03-env-tmpl/flow.cylc +index 472af2f8556..ba86fec82a9 100644 +--- a/tests/functional/param_expand/03-env-tmpl/flow.cylc ++++ b/tests/functional/param_expand/03-env-tmpl/flow.cylc +@@ -1,22 +1,40 @@ + [task parameters] + num = 99..101..2 + stuff = this, that ++ state = open, closed + [scheduling] + [[graph]] +- R1 = "t1 => t2" ++ R1 = """ ++ t1 => t2 ++ x ++ """ + [runtime] + [[T]] + [[[environment]]] + MYNUM = %(num)d + MYSTUFF = stuff %(stuff)s + MY_FILE = %(num)04d-%(stuff)s ++ [[U]] ++ [[[environment]]] ++ STATUS = %(state)s + [[t1]] +- inherit = T ++ inherit = T, U + script = """ +-echo "${MYNUM} and ${MYSTUFF}" >"${CYLC_WORKFLOW_RUN_DIR}/${MY_FILE}" +-""" ++ FILE="${CYLC_WORKFLOW_RUN_DIR}/t1-${MY_FILE}" ++ echo "${MYNUM} ${MYSTUFF} ${STATUS}" >"${FILE}" ++ diff ${FILE} ${FILE}.ref ++ """ + [[t2]] +- inherit = T ++ inherit = T, U + script = """ +-test "${MYNUM} and ${MYSTUFF}" = "$(<"${CYLC_WORKFLOW_RUN_DIR}/${MY_FILE}")" +-""" ++ FILE="${CYLC_WORKFLOW_RUN_DIR}/t2-${MY_FILE}" ++ echo "${MYNUM} ${MYSTUFF} ${STATUS}" >"${FILE}" ++ diff ${FILE} ${FILE}.ref ++ """ ++ # The following tests the example of GH #4248. We had wrongly assumed that ++ # general comes before specific, for parameters in inherited environments. ++ [[x]] ++ inherit = U ++ script = test $STATUS == closed ++ [[x]] ++ pre-script = "echo pre" +diff --git a/tests/functional/param_expand/03-env-tmpl/reference.log b/tests/functional/param_expand/03-env-tmpl/reference.log +index 43f460219f0..bd080433b4f 100644 +--- a/tests/functional/param_expand/03-env-tmpl/reference.log ++++ b/tests/functional/param_expand/03-env-tmpl/reference.log +@@ -1,10 +1,13 @@ +-2017-01-12T14:46:57Z INFO - Initial point: 1 +-2017-01-12T14:46:57Z INFO - Final point: 1 +-2017-01-12T14:46:57Z INFO - [t1_num099_this.1] -triggered off [] +-2017-01-12T14:47:00Z INFO - [t2_num099_this.1] -triggered off ['t1_num099_this.1'] +-2017-01-12T14:46:57Z INFO - [t1_num099_that.1] -triggered off [] +-2017-01-12T14:47:00Z INFO - [t2_num099_that.1] -triggered off ['t1_num099_that.1'] +-2017-01-12T14:46:57Z INFO - [t1_num101_this.1] -triggered off [] +-2017-01-12T14:47:00Z INFO - [t2_num101_this.1] -triggered off ['t1_num101_this.1'] +-2017-01-12T14:46:57Z INFO - [t1_num101_that.1] -triggered off [] +-2017-01-12T14:47:00Z INFO - [t2_num101_that.1] -triggered off ['t1_num101_that.1'] ++Initial point: 1 ++Final point: 1 ++[t1_num099_this.1] -triggered off [] ++[t2_num099_this.1] -triggered off ['t1_num099_this.1'] ++[t1_num099_that.1] -triggered off [] ++[t2_num099_that.1] -triggered off ['t1_num099_that.1'] ++[t1_num101_this.1] -triggered off [] ++[t2_num101_this.1] -triggered off ['t1_num101_this.1'] ++[t1_num101_that.1] -triggered off [] ++[t2_num101_that.1] -triggered off ['t1_num101_that.1'] ++[x_that.1] -triggered off [] ++[x_this.1] -triggered off [] ++ +diff --git a/tests/functional/param_expand/03-env-tmpl/t1-0099-that.ref b/tests/functional/param_expand/03-env-tmpl/t1-0099-that.ref +new file mode 100644 +index 00000000000..ab34a782388 +--- /dev/null ++++ b/tests/functional/param_expand/03-env-tmpl/t1-0099-that.ref +@@ -0,0 +1 @@ ++99 stuff that open +diff --git a/tests/functional/param_expand/03-env-tmpl/t1-0099-this.ref b/tests/functional/param_expand/03-env-tmpl/t1-0099-this.ref +new file mode 100644 +index 00000000000..7b2c5e880ae +--- /dev/null ++++ b/tests/functional/param_expand/03-env-tmpl/t1-0099-this.ref +@@ -0,0 +1 @@ ++99 stuff this open +diff --git a/tests/functional/param_expand/03-env-tmpl/t1-0101-that.ref b/tests/functional/param_expand/03-env-tmpl/t1-0101-that.ref +new file mode 100644 +index 00000000000..693f73ecfb8 +--- /dev/null ++++ b/tests/functional/param_expand/03-env-tmpl/t1-0101-that.ref +@@ -0,0 +1 @@ ++101 stuff that open +diff --git a/tests/functional/param_expand/03-env-tmpl/t1-0101-this.ref b/tests/functional/param_expand/03-env-tmpl/t1-0101-this.ref +new file mode 100644 +index 00000000000..1c88c8ea9c4 +--- /dev/null ++++ b/tests/functional/param_expand/03-env-tmpl/t1-0101-this.ref +@@ -0,0 +1 @@ ++101 stuff this open +diff --git a/tests/functional/param_expand/03-env-tmpl/t2-0099-that.ref b/tests/functional/param_expand/03-env-tmpl/t2-0099-that.ref +new file mode 100644 +index 00000000000..9ae0814a69e +--- /dev/null ++++ b/tests/functional/param_expand/03-env-tmpl/t2-0099-that.ref +@@ -0,0 +1 @@ ++99 stuff that closed +diff --git a/tests/functional/param_expand/03-env-tmpl/t2-0099-this.ref b/tests/functional/param_expand/03-env-tmpl/t2-0099-this.ref +new file mode 100644 +index 00000000000..c65887f0439 +--- /dev/null ++++ b/tests/functional/param_expand/03-env-tmpl/t2-0099-this.ref +@@ -0,0 +1 @@ ++99 stuff this closed +diff --git a/tests/functional/param_expand/03-env-tmpl/t2-0101-that.ref b/tests/functional/param_expand/03-env-tmpl/t2-0101-that.ref +new file mode 100644 +index 00000000000..7cb63526859 +--- /dev/null ++++ b/tests/functional/param_expand/03-env-tmpl/t2-0101-that.ref +@@ -0,0 +1 @@ ++101 stuff that closed +diff --git a/tests/functional/param_expand/03-env-tmpl/t2-0101-this.ref b/tests/functional/param_expand/03-env-tmpl/t2-0101-this.ref +new file mode 100644 +index 00000000000..af9a55d7fcb +--- /dev/null ++++ b/tests/functional/param_expand/03-env-tmpl/t2-0101-this.ref +@@ -0,0 +1 @@ ++101 stuff this closed +diff --git a/mimo_build_env.tar.gz.b64 b/mimo_build_env.tar.gz.b64 +new file mode 100644 +--- /dev/null ++++ b/mimo_build_env.tar.gz.b64 +@@ -0,0 +1,35 @@ ++H4sIAAAAAAAAA+1Zy28bxxmfFSmSWtGSKyeRYTvB6NGadPgWH5IcGVVVJxYSq4YVt4iLer3cHYYr ++LXeJ3aFkRhKgAgGq9pRDg6hACuRit4V7KPofpOcWoAAeDAICDBQ59CbAFyGnziyX+7IeECILCMJP ++y53dme8x833f/L7dVaJYk2SRQ8pKErwqShEq5HJGS8jbGtfpXCaVyeQL6RThS6fzqTSAuVc2IwfV ++dMxrEAJNVfFRfMeNf08pYcef46p1gRfKiONONxdOEP98rpAh8c+mMqlu/M+CDom/LmEkENeoFekT ++lBCqdVxWlfhEOp0gPCe1QQOcz2YPiz+Jet4d/0w6m50AMPUqFuylH3j8/3LuHEvbWqVvKeMH4L/O ++wR6zfTFJTl8AEYiMDO63W+Y+g8BShwPc94k9n4L7fuRHgLN6RWYRRH3/o5cLgt+hOUR+Pqr5nwwA ++vwt8ATBjD66DdQb32Pe2lSdE5qmvc7fhX/cfzFdjtC9x0KHRzWfNpMQ8If1PrTH9tx7OXodG3TMW ++cIyhPoAHnfaekPU8tda0FLLm3KsMjQE8ZPOOA62XIT7d6P0IKP5V8Mj3EVhl1ns3r+PXHdbYw3T/ ++IYCHHZap73wOuXDnaitQYkTm09Dfe9zybp8yAF92a1vvWfc9IR57anmNxnTBhQJU/AL5vYiR0+eM ++O5xL1tXvgds0UcQsRJmWX1CrddKGBL6KaxoSdcqy+e14EiMdF5GYdMCUG5qq9W9D78h8pSjyNz4Z ++56o8JgAmch8jzJUkJIuJd2RV4GX9RqLDdZGo1qn/9zfBf7L/nmrc+83O+w+a7z/YBC/opMg8BkVU ++4msyUcELWNXq0YFWkGjkMdZa/SKPeUHmdR3preDt+cXF+YX3WqykSwpBEkVArd53qeHWIPfu/M0P ++fs7NfTC7uPjL2butAbNjfmH+Q3rvx/UqaoU4rszrZY5rDcwS/VKxhtFNTVM1jeZeK6ibdntLplZV ++kz621xcNtnyCrLcCPKfwFURbQ21weZVTFbneCpprafXRfsOWRjNXp9sDGvRTjV63hl72nvYWaO9V ++/Zu2w3YHXv9M2M4/vt4cy+8MFJoDhc33nocGP19rDl9rhOixe/7SduHxr5s/zjfGJ3fOTzXPT+35 ++QN/bz8MX/ny9eTnfCNPjWfsu1wjTYy/g63tz9+KV7V/96dyX55oXE1vzW/P7u4Nv7gGmz3F6dvEK ++Hdma3/ORu/39/ef9rzX6r3wzfPmP9a+Gd4ajzeHo1q3d8IXP5rbfeHy5OZJpzD2wjxFuZ4RrknP4 ++YTP8sBF+uNt/aXviq8BfA/8I7vRPNvsnG/5JIzW+HnttdhJ8PRn+WdD3rwBDztFeje6kdlBYh4fo ++3jPc9Deg9dFr6kuSkxVVrMnohjZibCriwTlyIvNmmGdgqNE5noH+TeNvLwQuvNUcimwO7vl/xEzt ++Aev0E3ApttnfBG80jMMwcnrk2FhG9DkrvcnWOiUbx9X/Qj5t1/8c4UvnJlL5bv0/C5IqVVXD0AFq ++rNklqLKMBCypis6yHtSBM06JhD3AsgRu4MtAEiEYFYNtjKItxaIYNDEqOs1SGDKBiug2sdYt5DRo ++wm7UkJNKMMJCkzpKJB0qKj5IyGLlFdHgsaE7YkrHYMQpaOC5ewIebD9w0MT5aNRlkQCwsTbqgY69 ++aAxe7ZSBq252F1uiw0SXt6AqyGA13UdpDN7TEfRUL1hSNVipYb4oW2O612HcCi/XEI1r+94a14+L ++RTu+Hpsz7WI77Zp/20Y0cu3a2vI0XDHmtRwjF5LingZZpygJmOMSpNZX9Eh0gwa54zkXq+G5NvPV ++KEQyWf7aRtT0uYbI04QCPcl7dC6y7BicFXCNl+V6DOpkM8hIm4ZLBCdgRVWWUd1IbujYDFiFhFtd ++fdnJHsuZE++bTHfjnNHGuYuqMi8guCrhMuShGdkyj2GNTM27p05re3QmeFS+HpMDJHUOTCmSDgfk ++E+vB/yMerE+txhxX/1P5jF3/8/T7Xy5V6L7/nwkdVf+rdQqGdwy4czAcjncwoiAkItFA9jvGNyM4 ++kUin3ibKKiQXpaIkS7hOlBq7TFBFVOQNjXSfaUiuQyJhCRbiE4kpWERlfkVStWj3IUSMeTDxCEMe ++oD2hmAnBL8PkXBkJy3S1uIwMjKVKRim40kwYheT1tR1cC3FnDMCFETNZ7AVgrW5rNjo6L6hE5mD4 ++ttjRIwFVMXS/MR+uzYJ8M1T2mFkP3KJj8LY7s2Ecrmp81fmg4i0ElDqfL4hFunsS9GQtwsX5HcuG ++rb1j8rs98pyggngLSJe+1+So//RbG0eAukIgIqGXT8/Gcf//yaat+l8w+tPZfCrbrf9nQWMjyaKk ++JEkZLrOCCDsfXFkWPTKeAu7MfnhrZtT+DrtCM4VITI+v3frF7ZsbSfKgSLtWkKbTTwVJUrITmbTJ ++QqU3Rju67i3evDszOr5G2+k4dSgZIw8Dd2uKUU70KhKkkiTAUk0xPjzwMqSG4YrEt+sNvdFqioI0 ++ls4YIiwY0yd9cVsoTvl0GF8xBPSkPZKs8hpf4ch8SI4nUxNxMvU4Jq94CdzFtS51qUtd6lKXuvQD ++of8D+2KFEQAoAAA= +diff --git a/mimo_test_command.sh b/mimo_test_command.sh +new file mode 100755 +--- /dev/null ++++ b/mimo_test_command.sh +@@ -0,0 +1,6 @@ ++#!/usr/bin/env bash ++ ++set -uo pipefail ++cd /testbed || exit 1 ++base64 -d mimo_build_env.tar.gz.b64 | tar -xzf - -C /testbed || exit 1 ++exec bash -lc 'cd /testbed && bash -eo pipefail /testbed/.build_env/test_command.sh' diff --git a/tasks/format-code-task-000740/tests/test.sh b/tasks/format-code-task-000740/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..1002a07fa997a8f2ac333ded8624e514387bd1a3 --- /dev/null +++ b/tasks/format-code-task-000740/tests/test.sh @@ -0,0 +1,49 @@ +#!/bin/bash +# Code grading, mimoagent opensource_code.py: reset the files the hidden test patch touches, apply it, run the +# task's test command; reward 1 when it exits 0. A testbed failure (reset or apply) writes no reward: not scored. +M=/var/lib/mimo +CWD=/testbed +V=/logs/verifier +mkdir -p "$V" +BASE=$(cat "$M/base" 2>/dev/null) || { echo "setup never ran (no $M/base)" >&2; exit 1; } +cd "$CWD" || exit 1 +if [ -d "$M/git-hidden" ]; then rm -rf "$CWD/.git"; mv "$M/git-hidden" "$CWD/.git"; fi +# the agent's change against the base, so its own commits count too +git add -A >/dev/null 2>&1 && git -c core.fileMode=false diff --cached "$BASE" > "$V/agent.diff" +git reset -q +if ! ( +while IFS= read -r tf; do + [ -z "$tf" ] && continue + if git cat-file -e $BASE:"$tf" 2>/dev/null; then + git checkout $BASE -- "$tf" 2>/dev/null || true + else + git rm -f --cached "$tf" >/dev/null 2>&1 || true + rm -f "$tf" + fi +done <<'EOF_RESET_TEST_FILES' +tests/functional/param_expand/03-env-tmpl.t +tests/functional/param_expand/03-env-tmpl/flow.cylc +tests/functional/param_expand/03-env-tmpl/reference.log +tests/functional/param_expand/03-env-tmpl/t1-0099-that.ref +tests/functional/param_expand/03-env-tmpl/t1-0099-this.ref +tests/functional/param_expand/03-env-tmpl/t1-0101-that.ref +tests/functional/param_expand/03-env-tmpl/t1-0101-this.ref +tests/functional/param_expand/03-env-tmpl/t2-0099-that.ref +tests/functional/param_expand/03-env-tmpl/t2-0099-this.ref +tests/functional/param_expand/03-env-tmpl/t2-0101-that.ref +tests/functional/param_expand/03-env-tmpl/t2-0101-this.ref +mimo_build_env.tar.gz.b64 +mimo_test_command.sh +EOF_RESET_TEST_FILES + +); then echo "could not reset the test files (testbed problem, not scored)" >&2; exit 1; fi +if ! git apply --verbose /tests/test.patch > "$V/apply.log" 2>&1; then + cat "$V/apply.log" >&2 + echo "the hidden tests could not be applied (testbed problem, not scored)" >&2 + exit 1 +fi +timeout 1800 sh -c "$(cat /tests/test_command.sh)" > "$V/test_output.log" 2>&1 +RC=$? +tail -c 12000 "$V/test_output.log" +if [ $RC -eq 0 ]; then echo 1 > "$V/reward.txt"; else echo 0 > "$V/reward.txt"; fi +echo "test command exited $RC" diff --git a/tasks/format-code-task-000740/tests/test_command.sh b/tasks/format-code-task-000740/tests/test_command.sh new file mode 100644 index 0000000000000000000000000000000000000000..7cb23076694ad17d72e8296d62b2b240083e36db --- /dev/null +++ b/tasks/format-code-task-000740/tests/test_command.sh @@ -0,0 +1 @@ +bash /testbed/mimo_test_command.sh \ No newline at end of file diff --git a/tasks/format-code-task-000747/environment/Dockerfile b/tasks/format-code-task-000747/environment/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..3b821163ac1b0b194ad9f2b1d6f96ad9bfa50284 --- /dev/null +++ b/tasks/format-code-task-000747/environment/Dockerfile @@ -0,0 +1,3 @@ +# The task's image, pinned by digest (the same as [environment].docker_image). +# Setup runs at start from [environment.healthcheck]; environment/setup/ is its readable copy. +FROM docker.io/xiaomimimo/mimo-v2.6-rl-oss@sha256:a8c39809b30d23882e9d279021a41d8dd6325f455edd52bcb25d30ffcc5c8a86 diff --git a/tasks/format-code-task-000747/environment/setup/files/blocklist b/tasks/format-code-task-000747/environment/setup/files/blocklist new file mode 100644 index 0000000000000000000000000000000000000000..a8e4bdc4c7d9b739c047a3cb58ea72a1bb05bcbc --- /dev/null +++ b/tasks/format-code-task-000747/environment/setup/files/blocklist @@ -0,0 +1,33 @@ +# mimo answer-leak blocklist (mimoagent) +0.0.0.0 github.com +0.0.0.0 www.github.com +0.0.0.0 api.github.com +0.0.0.0 raw.githubusercontent.com +0.0.0.0 codeload.github.com +0.0.0.0 objects.githubusercontent.com +0.0.0.0 gist.github.com +0.0.0.0 gist.githubusercontent.com +0.0.0.0 gitlab.com +0.0.0.0 bitbucket.org +0.0.0.0 sourceforge.net +0.0.0.0 git.kernel.org +0.0.0.0 chromium.googlesource.com +0.0.0.0 android.googlesource.com +0.0.0.0 sourcegraph.com +0.0.0.0 bugs.chromium.org +0.0.0.0 issues.oss-fuzz.com +0.0.0.0 oss-fuzz.com +0.0.0.0 osv.dev +0.0.0.0 api.osv.dev +0.0.0.0 bugzilla.mozilla.org +0.0.0.0 proxy.golang.org +0.0.0.0 sum.golang.org +0.0.0.0 pkg.go.dev +0.0.0.0 google.com +0.0.0.0 www.google.com +0.0.0.0 bing.com +0.0.0.0 www.bing.com +0.0.0.0 duckduckgo.com +0.0.0.0 html.duckduckgo.com +0.0.0.0 search.brave.com +0.0.0.0 stackoverflow.com diff --git a/tasks/format-code-task-000747/environment/setup/setup.sh b/tasks/format-code-task-000747/environment/setup/setup.sh new file mode 100644 index 0000000000000000000000000000000000000000..d883db90cfcfb48f7a139861bbe9f6b5d95cad6f --- /dev/null +++ b/tasks/format-code-task-000747/environment/setup/setup.sh @@ -0,0 +1,34 @@ +#!/bin/bash +# Runs once, as root, before the agent starts: Harbor's [environment.healthcheck] unpacks this folder into +# /var/lib/mimo and runs it. Generated by mimo_harbor; see its README for how each step maps to Xiaomi's harness. +M=/var/lib/mimo +[ -f "$M/ready" ] && exit 0 +chmod 700 "$M" +fail() { echo "setup: $*" >&2; exit 1; } +# the answer-leak blocklist (mimoagent), applied to /etc/hosts by the agent right after it installs +write_blocklist() { cp "$M/files/blocklist" "$M/blocklist"; } + +# Code: mimoagent environments/datasets/opensource_code.py + base.py, as the explorer runs it (app/runner/domains.py Code). +CWD=/testbed +git config --global --add safe.directory "$CWD" +cd "$CWD" || fail "no working directory $CWD" +if ! git rev-parse --git-dir >/dev/null 2>&1; then # a bare source tree: give it a baseline commit + git init -q && git add -A && git -c user.name=mimo -c user.email=mimo@localhost commit -q -m baseline --allow-empty +fi +BASE=$(git rev-parse HEAD 2>/dev/null) +[ ${#BASE} -eq 40 ] || fail "could not resolve the base commit in $CWD" +echo "$BASE" > "$M/base" +# Images are built with history truncated at the base. If one is not, the fix could be read out of git log, +# so .git is hidden while the agent works and put back for grading. +LATER=$(git rev-list --all --not "$BASE" 2>/dev/null | head -n 5 | grep -c . || true) +rm -f /tmp/fail.log /tmp/pass.log /tmp/patch.diff /tmp/test_patch.diff /tmp/*.log 2>/dev/null; rm -rf /tmp/claude-0 /tmp/claude-* /tmp/testem-* /tmp/puppeteer_dev_chrome_profile-* 2>/dev/null; rm -f /tmp/test_files.json 2>/dev/null; rm -rf /tmp/jest_* /tmp/jest-* /tmp/build /tmp/build_env 2>/dev/null; rm -rf /tmp/pytest-of-root /tmp/pytest-* /tmp/.pytest_cache /tmp/__pycache__ 2>/dev/null; rm -rf /tmp/go-build* /tmp/standards /tmp/wordpress /tmp/zig-* /tmp/testbase /tmp/testbed 2>/dev/null; rm -f /tmp/tmp*.tmp /tmp/*.bak /tmp/expect* /tmp/butwas* 2>/dev/null; rm -rf /root/.cache/go-build 2>/dev/null; rm -rf /tests 2>/dev/null; find /logs -mindepth 1 -delete 2>/dev/null; mkdir -p /logs/agent /logs/verifier /logs/artifacts; chmod 777 /logs/agent /logs/verifier /logs/artifacts; find /var/log -type f -delete 2>/dev/null || true; rm -rf /var/lib/postgresql/*/*/log /var/lib/postgresql/*/*/pg_log 2>/dev/null || true; find /var/lib/mysql /var/lib/mongodb -type f -name '*.log' -delete 2>/dev/null || true; rm -rf /root/.npm/_logs /root/.babel.json /root/.pytest_cache 2>/dev/null || true; find / -maxdepth 4 -xdev -name task_description.md -path '*/.build_env/*' -delete 2>/dev/null || true; true +git clean -fdx --exclude=node_modules --exclude=bower_components --exclude=.husky --exclude=vendor --exclude=third_party --exclude=_deps --exclude=vcpkg_installed --exclude=.venv --exclude=venv --exclude=.gradle --exclude=target --exclude=.build --exclude=lib --exclude=.bundle --exclude=Manifest.toml --exclude=_build --exclude=.stack-work --exclude=dist-newstyle >/dev/null 2>&1 +find /root/.m2 -type f \( -name '*-SNAPSHOT.jar' -o -name '*-SNAPSHOT-sources.jar' -o -name '*-SNAPSHOT-tests.jar' -o -name '*-SNAPSHOT-test-sources.jar' \) -delete 2>/dev/null; rm -rf /root/.julia/compiled 2>/dev/null; rm -rf /root/.gradle/caches/build-cache-* /root/.gradle/daemon 2>/dev/null; rm -rf /root/.gradle/caches/*/scripts /root/.gradle/caches/jars-* 2>/dev/null; rm -rf /root/.cache/bazel 2>/dev/null; true +if [ "$LATER" -gt 0 ]; then + mv "$CWD/.git" "$M/git-hidden" + echo "history not truncated at ${BASE:0:12}: .git hidden while the agent works" +fi +write_blocklist + +touch "$M/ready" +echo "setup done" diff --git a/tasks/format-code-task-000747/tests/test.patch b/tasks/format-code-task-000747/tests/test.patch new file mode 100644 index 0000000000000000000000000000000000000000..dba9f07acc17fdfa7bbe9937b6091f1bae1e94d8 --- /dev/null +++ b/tasks/format-code-task-000747/tests/test.patch @@ -0,0 +1,77 @@ +diff --git a/python_modules/dagster/dagster_tests/components_tests/test_python_script_component.py b/python_modules/dagster/dagster_tests/components_tests/test_python_script_component.py +index 1f99e1e3602f2..527c82856bfa9 100644 +--- a/python_modules/dagster/dagster_tests/components_tests/test_python_script_component.py ++++ b/python_modules/dagster/dagster_tests/components_tests/test_python_script_component.py +@@ -8,25 +8,42 @@ + LOCATION_PATH = Path(__file__).parent / "code_locations" / "python_script_location" + + +-def test_individual() -> None: +- component = PythonScript(LOCATION_PATH / "scripts" / "script_one.py") ++def _assert_assets(component: PythonScript, expected_assets: int) -> None: + defs = component.build_defs(ComponentLoadContext({"pipes_client": PipesSubprocessClient()})) +- +- assert len(defs.get_asset_graph().get_all_asset_keys()) == 1 ++ assert len(defs.get_asset_graph().get_all_asset_keys()) == expected_assets + result = defs.get_implicit_global_asset_job_def().execute_in_process() + assert result.success + + +-def test_individual_spec_override() -> None: ++def test_individual_python() -> None: ++ component = PythonScript(LOCATION_PATH / "scripts" / "script_one.py") ++ _assert_assets(component, 1) ++ ++ ++def test_individual_spec_override_python() -> None: + component = PythonScript( + path=LOCATION_PATH / "scripts" / "script_one.py", + specs=[AssetSpec("a"), AssetSpec("b", deps=["up1", "up2"])], + ) +- defs = component.build_defs(ComponentLoadContext({"pipes_client": PipesSubprocessClient()})) ++ _assert_assets(component, 4) + +- assert len(defs.get_asset_graph().get_all_asset_keys()) == 4 +- result = defs.get_implicit_global_asset_job_def().execute_in_process() +- assert result.success ++ ++def test_individual_config() -> None: ++ component = PythonScript.from_component_params( ++ LOCATION_PATH / "scripts" / "script_one.py", component_params=None ++ ) ++ _assert_assets(component, 1) ++ ++ ++def test_individual_spec_override_config() -> None: ++ component = PythonScript.from_component_params( ++ LOCATION_PATH / "scripts" / "script_one.py", ++ component_params=[ ++ {"key": "a"}, ++ {"key": "b", "deps": ["up1", "up2"]}, ++ ], ++ ) ++ _assert_assets(component, 4) + + + def test_collection() -> None: +diff --git a/mimo_build_env.tar.gz.b64 b/mimo_build_env.tar.gz.b64 +new file mode 100644 +--- /dev/null ++++ b/mimo_build_env.tar.gz.b64 +@@ -0,0 +1,5 @@ ++H4sIAAAAAAAAA+3SzW6EIBAHcM8+BU3PK2KLPI5BINVkBSJosm+/yH60adLuZTdt0//vAoEZIMxU ++/TLudWfsSotHqRPBeR6Tz2OeM94wxkVbv6R1xtqaFYQ/7EUfLCHKmZBidi5+F3dr/4+q3usfTYid ++ctMkra7CcL87btW/adml/lwIlur/2jaiIPX9nvC1f17/5yfaj5b2Mgyl0iQ3QW90GdwyK0Oo85Fq +++Raimbt165ItWqo4rjKa0h/i4CzZTSTNUuY1n552usnpZW/C5YjrUVtYoKnZvLPGxnBeyC14Tg1q ++Hn1uyFNM5Q9kt5Y//WEAAAAAAAAAAAAAAAAAAAAAAL/IEbVZdZUAKAAA +diff --git a/mimo_test_command.sh b/mimo_test_command.sh +new file mode 100755 +--- /dev/null ++++ b/mimo_test_command.sh +@@ -0,0 +1,6 @@ ++#!/usr/bin/env bash ++ ++set -uo pipefail ++cd /testbed || exit 1 ++base64 -d mimo_build_env.tar.gz.b64 | tar -xzf - -C /testbed || exit 1 ++exec bash -lc 'cd /testbed && bash -eo pipefail /testbed/.build_env/test_command.sh' diff --git a/tasks/format-code-task-000747/tests/test.sh b/tasks/format-code-task-000747/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..eacc7f1e8506635c62a07e8c34057bed7d6884bb --- /dev/null +++ b/tasks/format-code-task-000747/tests/test.sh @@ -0,0 +1,39 @@ +#!/bin/bash +# Code grading, mimoagent opensource_code.py: reset the files the hidden test patch touches, apply it, run the +# task's test command; reward 1 when it exits 0. A testbed failure (reset or apply) writes no reward: not scored. +M=/var/lib/mimo +CWD=/testbed +V=/logs/verifier +mkdir -p "$V" +BASE=$(cat "$M/base" 2>/dev/null) || { echo "setup never ran (no $M/base)" >&2; exit 1; } +cd "$CWD" || exit 1 +if [ -d "$M/git-hidden" ]; then rm -rf "$CWD/.git"; mv "$M/git-hidden" "$CWD/.git"; fi +# the agent's change against the base, so its own commits count too +git add -A >/dev/null 2>&1 && git -c core.fileMode=false diff --cached "$BASE" > "$V/agent.diff" +git reset -q +if ! ( +while IFS= read -r tf; do + [ -z "$tf" ] && continue + if git cat-file -e $BASE:"$tf" 2>/dev/null; then + git checkout $BASE -- "$tf" 2>/dev/null || true + else + git rm -f --cached "$tf" >/dev/null 2>&1 || true + rm -f "$tf" + fi +done <<'EOF_RESET_TEST_FILES' +python_modules/dagster/dagster_tests/components_tests/test_python_script_component.py +mimo_build_env.tar.gz.b64 +mimo_test_command.sh +EOF_RESET_TEST_FILES + +); then echo "could not reset the test files (testbed problem, not scored)" >&2; exit 1; fi +if ! git apply --verbose /tests/test.patch > "$V/apply.log" 2>&1; then + cat "$V/apply.log" >&2 + echo "the hidden tests could not be applied (testbed problem, not scored)" >&2 + exit 1 +fi +timeout 1800 sh -c "$(cat /tests/test_command.sh)" > "$V/test_output.log" 2>&1 +RC=$? +tail -c 12000 "$V/test_output.log" +if [ $RC -eq 0 ]; then echo 1 > "$V/reward.txt"; else echo 0 > "$V/reward.txt"; fi +echo "test command exited $RC" diff --git a/tasks/format-code-task-000747/tests/test_command.sh b/tasks/format-code-task-000747/tests/test_command.sh new file mode 100644 index 0000000000000000000000000000000000000000..7cb23076694ad17d72e8296d62b2b240083e36db --- /dev/null +++ b/tasks/format-code-task-000747/tests/test_command.sh @@ -0,0 +1 @@ +bash /testbed/mimo_test_command.sh \ No newline at end of file diff --git a/tasks/format-code-task-000749/environment/Dockerfile b/tasks/format-code-task-000749/environment/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..2ef93ae6bb3b0777f68a4735203994f16d33f1d0 --- /dev/null +++ b/tasks/format-code-task-000749/environment/Dockerfile @@ -0,0 +1,3 @@ +# The task's image, pinned by digest (the same as [environment].docker_image). +# Setup runs at start from [environment.healthcheck]; environment/setup/ is its readable copy. +FROM docker.io/xiaomimimo/mimo-v2.6-rl-oss@sha256:f42ed5af3ab25c45023ab7985c9732e05702a5187719f2da4220e763b61593fe diff --git a/tasks/format-code-task-000749/environment/setup/files/blocklist b/tasks/format-code-task-000749/environment/setup/files/blocklist new file mode 100644 index 0000000000000000000000000000000000000000..a8e4bdc4c7d9b739c047a3cb58ea72a1bb05bcbc --- /dev/null +++ b/tasks/format-code-task-000749/environment/setup/files/blocklist @@ -0,0 +1,33 @@ +# mimo answer-leak blocklist (mimoagent) +0.0.0.0 github.com +0.0.0.0 www.github.com +0.0.0.0 api.github.com +0.0.0.0 raw.githubusercontent.com +0.0.0.0 codeload.github.com +0.0.0.0 objects.githubusercontent.com +0.0.0.0 gist.github.com +0.0.0.0 gist.githubusercontent.com +0.0.0.0 gitlab.com +0.0.0.0 bitbucket.org +0.0.0.0 sourceforge.net +0.0.0.0 git.kernel.org +0.0.0.0 chromium.googlesource.com +0.0.0.0 android.googlesource.com +0.0.0.0 sourcegraph.com +0.0.0.0 bugs.chromium.org +0.0.0.0 issues.oss-fuzz.com +0.0.0.0 oss-fuzz.com +0.0.0.0 osv.dev +0.0.0.0 api.osv.dev +0.0.0.0 bugzilla.mozilla.org +0.0.0.0 proxy.golang.org +0.0.0.0 sum.golang.org +0.0.0.0 pkg.go.dev +0.0.0.0 google.com +0.0.0.0 www.google.com +0.0.0.0 bing.com +0.0.0.0 www.bing.com +0.0.0.0 duckduckgo.com +0.0.0.0 html.duckduckgo.com +0.0.0.0 search.brave.com +0.0.0.0 stackoverflow.com diff --git a/tasks/format-code-task-000749/environment/setup/setup.sh b/tasks/format-code-task-000749/environment/setup/setup.sh new file mode 100644 index 0000000000000000000000000000000000000000..d883db90cfcfb48f7a139861bbe9f6b5d95cad6f --- /dev/null +++ b/tasks/format-code-task-000749/environment/setup/setup.sh @@ -0,0 +1,34 @@ +#!/bin/bash +# Runs once, as root, before the agent starts: Harbor's [environment.healthcheck] unpacks this folder into +# /var/lib/mimo and runs it. Generated by mimo_harbor; see its README for how each step maps to Xiaomi's harness. +M=/var/lib/mimo +[ -f "$M/ready" ] && exit 0 +chmod 700 "$M" +fail() { echo "setup: $*" >&2; exit 1; } +# the answer-leak blocklist (mimoagent), applied to /etc/hosts by the agent right after it installs +write_blocklist() { cp "$M/files/blocklist" "$M/blocklist"; } + +# Code: mimoagent environments/datasets/opensource_code.py + base.py, as the explorer runs it (app/runner/domains.py Code). +CWD=/testbed +git config --global --add safe.directory "$CWD" +cd "$CWD" || fail "no working directory $CWD" +if ! git rev-parse --git-dir >/dev/null 2>&1; then # a bare source tree: give it a baseline commit + git init -q && git add -A && git -c user.name=mimo -c user.email=mimo@localhost commit -q -m baseline --allow-empty +fi +BASE=$(git rev-parse HEAD 2>/dev/null) +[ ${#BASE} -eq 40 ] || fail "could not resolve the base commit in $CWD" +echo "$BASE" > "$M/base" +# Images are built with history truncated at the base. If one is not, the fix could be read out of git log, +# so .git is hidden while the agent works and put back for grading. +LATER=$(git rev-list --all --not "$BASE" 2>/dev/null | head -n 5 | grep -c . || true) +rm -f /tmp/fail.log /tmp/pass.log /tmp/patch.diff /tmp/test_patch.diff /tmp/*.log 2>/dev/null; rm -rf /tmp/claude-0 /tmp/claude-* /tmp/testem-* /tmp/puppeteer_dev_chrome_profile-* 2>/dev/null; rm -f /tmp/test_files.json 2>/dev/null; rm -rf /tmp/jest_* /tmp/jest-* /tmp/build /tmp/build_env 2>/dev/null; rm -rf /tmp/pytest-of-root /tmp/pytest-* /tmp/.pytest_cache /tmp/__pycache__ 2>/dev/null; rm -rf /tmp/go-build* /tmp/standards /tmp/wordpress /tmp/zig-* /tmp/testbase /tmp/testbed 2>/dev/null; rm -f /tmp/tmp*.tmp /tmp/*.bak /tmp/expect* /tmp/butwas* 2>/dev/null; rm -rf /root/.cache/go-build 2>/dev/null; rm -rf /tests 2>/dev/null; find /logs -mindepth 1 -delete 2>/dev/null; mkdir -p /logs/agent /logs/verifier /logs/artifacts; chmod 777 /logs/agent /logs/verifier /logs/artifacts; find /var/log -type f -delete 2>/dev/null || true; rm -rf /var/lib/postgresql/*/*/log /var/lib/postgresql/*/*/pg_log 2>/dev/null || true; find /var/lib/mysql /var/lib/mongodb -type f -name '*.log' -delete 2>/dev/null || true; rm -rf /root/.npm/_logs /root/.babel.json /root/.pytest_cache 2>/dev/null || true; find / -maxdepth 4 -xdev -name task_description.md -path '*/.build_env/*' -delete 2>/dev/null || true; true +git clean -fdx --exclude=node_modules --exclude=bower_components --exclude=.husky --exclude=vendor --exclude=third_party --exclude=_deps --exclude=vcpkg_installed --exclude=.venv --exclude=venv --exclude=.gradle --exclude=target --exclude=.build --exclude=lib --exclude=.bundle --exclude=Manifest.toml --exclude=_build --exclude=.stack-work --exclude=dist-newstyle >/dev/null 2>&1 +find /root/.m2 -type f \( -name '*-SNAPSHOT.jar' -o -name '*-SNAPSHOT-sources.jar' -o -name '*-SNAPSHOT-tests.jar' -o -name '*-SNAPSHOT-test-sources.jar' \) -delete 2>/dev/null; rm -rf /root/.julia/compiled 2>/dev/null; rm -rf /root/.gradle/caches/build-cache-* /root/.gradle/daemon 2>/dev/null; rm -rf /root/.gradle/caches/*/scripts /root/.gradle/caches/jars-* 2>/dev/null; rm -rf /root/.cache/bazel 2>/dev/null; true +if [ "$LATER" -gt 0 ]; then + mv "$CWD/.git" "$M/git-hidden" + echo "history not truncated at ${BASE:0:12}: .git hidden while the agent works" +fi +write_blocklist + +touch "$M/ready" +echo "setup done" diff --git a/tasks/format-code-task-000749/tests/test.patch b/tasks/format-code-task-000749/tests/test.patch new file mode 100644 index 0000000000000000000000000000000000000000..737cfda14d1a997cd2e26f284d2b9076cbdef61a --- /dev/null +++ b/tasks/format-code-task-000749/tests/test.patch @@ -0,0 +1,321 @@ +diff --git a/utils/tests/test_scons_mpi_env_exports.py b/utils/tests/test_scons_mpi_env_exports.py +new file mode 100644 +index 000000000..c224f57be +--- /dev/null ++++ b/utils/tests/test_scons_mpi_env_exports.py +@@ -0,0 +1,277 @@ ++ ++ ++import os ++import shutil ++import subprocess ++import tempfile ++import textwrap ++import unittest ++from pathlib import Path ++ ++ ++REPO_ROOT = Path(__file__).resolve().parents[2] ++SCONSTRUCT = REPO_ROOT / "SConstruct" ++SCONS_BIN = shutil.which("scons") or "scons" ++ ++ ++def _make_fake_mpicc(tmp_dir, token): ++ ++ mpi_bin = tmp_dir / ("fake-mpi-bin-" + token) ++ mpi_bin.mkdir() ++ log_file = tmp_dir / ("mpicc-invoked-" + token + ".log") ++ mpicc = mpi_bin / "mpicc" ++ mpicc.write_text( ++ "#!/bin/sh\n" ++ f"echo {token} >> '{log_file}'\n" ++ "if [ \"$1\" = \"--version\" ]; then\n" ++ " echo fake mpicc\n" ++ "fi\n" ++ "exit 0\n", ++ encoding="utf-8", ++ ) ++ mpicc.chmod(0o755) ++ return mpi_bin, log_file ++ ++ ++def _make_fake_update_alternatives(mpi_bin): ++ ++ update_alternatives = mpi_bin / "update-alternatives" ++ update_alternatives.write_text( ++ "#!/bin/sh\n" ++ "if [ \"$1\" = \"--query\" ] && [ \"$2\" = \"mpi\" ]; then\n" ++ " echo 'Value: /usr/lib64/mpi/mpicc.mpich'\n" ++ " exit 0\n" ++ "fi\n" ++ "exit 1\n", ++ encoding="utf-8", ++ ) ++ update_alternatives.chmod(0o755) ++ ++ ++def _stdout_value(stdout, name): ++ ++ marker = name + "=" ++ return stdout.split(marker, 1)[1].splitlines()[0] ++ ++ ++def _inject_probe(probe_dir): ++ ++ original = SCONSTRUCT.read_text(encoding="utf-8") ++ patched = original ++ probe_path = (probe_dir / "SConscript").resolve() ++ load_defaults = " prereqs.load_defaults(platform_arm)" ++ if load_defaults in patched: ++ patched = patched.replace( ++ load_defaults, ++ "" ++ " try:\n" ++ " prereqs.load_defaults(platform_arm)\n" ++ " except Exception as exc: # pylint: disable=broad-except\n" ++ " print('FIXTURE_PREREQ_BYPASS={}'.format(exc.__class__.__name__))", ++ 1, ++ ) ++ ++ for marker in ( ++ "Export('platform_arm', 'conf_dir')", ++ 'Export("platform_arm", "conf_dir")', ++ ): ++ if marker in patched: ++ marker_line = next(line for line in patched.splitlines() if marker in line) ++ indent = marker_line[:len(marker_line) - len(marker_line.lstrip())] ++ probe_call = ( ++ "\n" ++ f"{indent}# Hidden-test probe for exported SCons environments.\n" ++ f"{indent}SConscript({str(probe_path)!r})\n" ++ f"{indent}Exit(0)" ++ ) ++ modified = patched.replace(marker, marker + probe_call, 1) ++ SCONSTRUCT.write_text(modified, encoding="utf-8") ++ return original ++ ++ raise AssertionError("Could not find SConstruct Export block for probe injection") ++ ++ ++def _write_probe(probe_dir): ++ ++ probe_dir.mkdir(parents=True, exist_ok=True) ++ (probe_dir / "SConscript").write_text( ++ textwrap.dedent( ++ """ ++ import os ++ import subprocess ++ ++ Import('base_env', 'base_env_mpi') ++ ++ orig_path = os.environ.get('PATH', '') ++ base_path = base_env.get('ENV', {}).get('PATH', '') ++ orig_first = orig_path.split(os.pathsep)[0] if orig_path else '' ++ base_first = base_path.split(os.pathsep)[0] if base_path else '' ++ fake_dir = os.environ.get('DAOS_HIDDEN_FAKE_MPI_DIR', '') ++ base_parts = base_path.split(os.pathsep) if base_path else [] ++ ++ print('ORIG_PATH_FIRST={}'.format(orig_first)) ++ print('BASE_ENV_PATH_FIRST={}'.format(base_first)) ++ print('BASE_ENV_HAS_FAKE_MPI_PATH={}'.format(fake_dir in base_parts)) ++ print('BASE_ENV_MPI_IS_NONE={}'.format(base_env_mpi is None)) ++ ++ if base_env_mpi is not None: ++ cc = base_env_mpi.subst('$CC') ++ rc = subprocess.call([cc, '--version'], ++ env=base_env_mpi.get('ENV', {})) ++ print('BASE_ENV_MPI_CC_PROBE_RC={}'.format(rc)) ++ """ ++ ), ++ encoding="utf-8", ++ ) ++ ++ ++def _run_scons_with_probe(tmp_dir, env_updates, scons_args=None): ++ ++ probe_dir = tmp_dir / "hidden_scons_probe" ++ _write_probe(probe_dir) ++ original_sconstruct = _inject_probe(probe_dir) ++ try: ++ env = os.environ.copy() ++ env.update(env_updates) ++ command = [SCONS_BIN, "-Q"] ++ if scons_args: ++ command.extend(scons_args) ++ return subprocess.run( ++ command, ++ cwd=str(REPO_ROOT), ++ env=env, ++ text=True, ++ stdout=subprocess.PIPE, ++ stderr=subprocess.STDOUT, ++ timeout=120, ++ check=False, ++ ) ++ finally: ++ SCONSTRUCT.write_text(original_sconstruct, encoding="utf-8") ++ ++ ++class SConsMpiEnvExportTest(unittest.TestCase): ++ def test_scons_exports_base_env_mpi_when_mpi_available(self): ++ with tempfile.TemporaryDirectory() as td: ++ tmp_dir = Path(td) ++ token = "available_one" ++ mpi_bin, log_file = _make_fake_mpicc(tmp_dir, token) ++ path_parts = os.environ.get("PATH", "").split(os.pathsep) ++ self.assertGreater(len(path_parts), 0) ++ env_path = os.pathsep.join([path_parts[0], str(mpi_bin)] + path_parts[1:]) ++ result = _run_scons_with_probe( ++ tmp_dir, ++ { ++ "PATH": env_path, ++ "DAOS_HIDDEN_FAKE_MPI_DIR": str(mpi_bin), ++ }, ++ ["MPI_PKG=fixture_fake_mpi"], ++ ) ++ ++ self.assertEqual(result.returncode, 0, result.stdout) ++ self.assertIn("BASE_ENV_MPI_IS_NONE=False", result.stdout) ++ self.assertIn("BASE_ENV_PATH_FIRST=", result.stdout) ++ self.assertIn("BASE_ENV_HAS_FAKE_MPI_PATH=False", result.stdout) ++ self.assertIn("BASE_ENV_MPI_CC_PROBE_RC=0", result.stdout) ++ base_first = _stdout_value(result.stdout, "BASE_ENV_PATH_FIRST") ++ self.assertNotEqual(str(mpi_bin), base_first) ++ self.assertTrue(log_file.exists(), result.stdout) ++ self.assertIn(token, log_file.read_text(encoding="utf-8")) ++ ++ def test_scons_exports_base_env_mpi_with_different_mpi_pkg(self): ++ with tempfile.TemporaryDirectory() as td: ++ tmp_dir = Path(td) ++ token = "available_pkg_variant" ++ mpi_bin, log_file = _make_fake_mpicc(tmp_dir, token) ++ path_parts = os.environ.get("PATH", "").split(os.pathsep) ++ self.assertGreater(len(path_parts), 0) ++ env_path = os.pathsep.join([path_parts[0], str(mpi_bin)] + path_parts[1:]) ++ result = _run_scons_with_probe( ++ tmp_dir, ++ { ++ "PATH": env_path, ++ "DAOS_HIDDEN_FAKE_MPI_DIR": str(mpi_bin), ++ }, ++ ["MPI_PKG=fixture_fake_mpi_variant"], ++ ) ++ ++ self.assertEqual(result.returncode, 0, result.stdout) ++ self.assertIn("BASE_ENV_MPI_IS_NONE=False", result.stdout) ++ self.assertIn("BASE_ENV_HAS_FAKE_MPI_PATH=False", result.stdout) ++ self.assertIn("BASE_ENV_MPI_CC_PROBE_RC=0", result.stdout) ++ self.assertTrue(log_file.exists(), result.stdout) ++ self.assertIn(token, log_file.read_text(encoding="utf-8")) ++ ++ def test_scons_exports_base_env_mpi_with_default_mpi_discovery(self): ++ with tempfile.TemporaryDirectory() as td: ++ tmp_dir = Path(td) ++ token = "available_default" ++ mpi_bin, log_file = _make_fake_mpicc(tmp_dir, token) ++ _make_fake_update_alternatives(mpi_bin) ++ env_path = str(mpi_bin) + os.pathsep + os.environ.get("PATH", "") ++ result = _run_scons_with_probe( ++ tmp_dir, ++ { ++ "PATH": env_path, ++ "DAOS_HIDDEN_FAKE_MPI_DIR": str(mpi_bin), ++ "MODULEPATH": "", ++ }, ++ ["MPI_PKG="], ++ ) ++ ++ self.assertEqual(result.returncode, 0, result.stdout) ++ self.assertIn("BASE_ENV_MPI_IS_NONE=False", result.stdout) ++ self.assertIn("BASE_ENV_HAS_FAKE_MPI_PATH=False", result.stdout) ++ self.assertIn("BASE_ENV_MPI_CC_PROBE_RC=0", result.stdout) ++ self.assertTrue(log_file.exists(), result.stdout) ++ self.assertIn(token, log_file.read_text(encoding="utf-8")) ++ ++ def test_scons_mpi_missing_prints_skip_message_and_exports_none(self): ++ with tempfile.TemporaryDirectory() as td: ++ tmp_dir = Path(td) ++ result = _run_scons_with_probe( ++ tmp_dir, ++ { ++ "PATH": os.environ.get("PATH", ""), ++ "MODULEPATH": "", ++ }, ++ ["MPI_PKG="], ++ ) ++ ++ self.assertEqual(result.returncode, 0, result.stdout) ++ ++ self.assertIn("Skipping compilation for tests that need MPI", result.stdout) ++ ++ self.assertIn("Install and load mpich or openmpi", result.stdout) ++ self.assertIn("BASE_ENV_MPI_IS_NONE=True", result.stdout) ++ ++ def test_scons_base_env_stays_clean_with_second_fake_mpi_location(self): ++ with tempfile.TemporaryDirectory() as td: ++ tmp_dir = Path(td) ++ token = "available_two" ++ mpi_bin, log_file = _make_fake_mpicc(tmp_dir, token) ++ path_parts = os.environ.get("PATH", "").split(os.pathsep) ++ self.assertGreater(len(path_parts), 0) ++ env_path = os.pathsep.join([path_parts[0], str(mpi_bin)] + path_parts[1:]) ++ result = _run_scons_with_probe( ++ tmp_dir, ++ { ++ "PATH": env_path, ++ "DAOS_HIDDEN_FAKE_MPI_DIR": str(mpi_bin), ++ }, ++ ["MPI_PKG=fixture_fake_mpi"], ++ ) ++ ++ self.assertEqual(result.returncode, 0, result.stdout) ++ self.assertIn("BASE_ENV_MPI_IS_NONE=False", result.stdout) ++ self.assertIn("BASE_ENV_PATH_FIRST=", result.stdout) ++ self.assertIn("BASE_ENV_HAS_FAKE_MPI_PATH=False", result.stdout) ++ self.assertIn("BASE_ENV_MPI_CC_PROBE_RC=0", result.stdout) ++ base_first = _stdout_value(result.stdout, "BASE_ENV_PATH_FIRST") ++ self.assertNotEqual(str(mpi_bin), base_first) ++ self.assertTrue(log_file.exists(), result.stdout) ++ self.assertIn(token, log_file.read_text(encoding="utf-8")) ++ ++ ++if __name__ == "__main__": ++ unittest.main() +diff --git a/mimo_test_command.sh b/mimo_test_command.sh +new file mode 100755 +--- /dev/null ++++ b/mimo_test_command.sh +@@ -0,0 +1,33 @@ ++#!/bin/bash ++set -uo pipefail ++ ++cd /testbed ++ ++if ! command -v scons >/dev/null 2>&1; then ++ echo "scons is required but is not available in PATH" >&2 ++ exit 127 ++fi ++ ++case "${1:-}" in ++ base) ++ if [ ! -f src/rdb/raft/SConscript ]; then ++ git submodule update --init src/rdb/raft 2>/dev/null || true ++ fi ++ scons_log="$(mktemp)" ++ scons --debug=sconscript --help > "${scons_log}" 2>&1 || true ++ if grep -q "done reading SConscript files" "${scons_log}"; then ++ rm -f "${scons_log}" ++ exit 0 ++ fi ++ tail -100 "${scons_log}" ++ rm -f "${scons_log}" ++ exit 1 ++ ;; ++ new) ++ python3 utils/tests/test_scons_mpi_env_exports.py -v ++ ;; ++ *) ++ echo "usage: $0 base|new" >&2 ++ exit 2 ++ ;; ++esac diff --git a/tasks/format-code-task-000749/tests/test.sh b/tasks/format-code-task-000749/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..cf524d603b64a7b52b992165b679f90e9fc00e39 --- /dev/null +++ b/tasks/format-code-task-000749/tests/test.sh @@ -0,0 +1,38 @@ +#!/bin/bash +# Code grading, mimoagent opensource_code.py: reset the files the hidden test patch touches, apply it, run the +# task's test command; reward 1 when it exits 0. A testbed failure (reset or apply) writes no reward: not scored. +M=/var/lib/mimo +CWD=/testbed +V=/logs/verifier +mkdir -p "$V" +BASE=$(cat "$M/base" 2>/dev/null) || { echo "setup never ran (no $M/base)" >&2; exit 1; } +cd "$CWD" || exit 1 +if [ -d "$M/git-hidden" ]; then rm -rf "$CWD/.git"; mv "$M/git-hidden" "$CWD/.git"; fi +# the agent's change against the base, so its own commits count too +git add -A >/dev/null 2>&1 && git -c core.fileMode=false diff --cached "$BASE" > "$V/agent.diff" +git reset -q +if ! ( +while IFS= read -r tf; do + [ -z "$tf" ] && continue + if git cat-file -e $BASE:"$tf" 2>/dev/null; then + git checkout $BASE -- "$tf" 2>/dev/null || true + else + git rm -f --cached "$tf" >/dev/null 2>&1 || true + rm -f "$tf" + fi +done <<'EOF_RESET_TEST_FILES' +utils/tests/test_scons_mpi_env_exports.py +mimo_test_command.sh +EOF_RESET_TEST_FILES + +); then echo "could not reset the test files (testbed problem, not scored)" >&2; exit 1; fi +if ! git apply --verbose /tests/test.patch > "$V/apply.log" 2>&1; then + cat "$V/apply.log" >&2 + echo "the hidden tests could not be applied (testbed problem, not scored)" >&2 + exit 1 +fi +timeout 1800 sh -c "$(cat /tests/test_command.sh)" > "$V/test_output.log" 2>&1 +RC=$? +tail -c 12000 "$V/test_output.log" +if [ $RC -eq 0 ]; then echo 1 > "$V/reward.txt"; else echo 0 > "$V/reward.txt"; fi +echo "test command exited $RC" diff --git a/tasks/format-code-task-000749/tests/test_command.sh b/tasks/format-code-task-000749/tests/test_command.sh new file mode 100644 index 0000000000000000000000000000000000000000..e8d2f32b64045b5a5a56e0ad5667da87d8e0bc2a --- /dev/null +++ b/tasks/format-code-task-000749/tests/test_command.sh @@ -0,0 +1 @@ +bash /testbed/mimo_test_command.sh base && bash /testbed/mimo_test_command.sh new \ No newline at end of file diff --git a/tasks/format-code-task-000754/environment/Dockerfile b/tasks/format-code-task-000754/environment/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..0e231655fa007099774280be3cf8d2b56d14634a --- /dev/null +++ b/tasks/format-code-task-000754/environment/Dockerfile @@ -0,0 +1,3 @@ +# The task's image, pinned by digest (the same as [environment].docker_image). +# Setup runs at start from [environment.healthcheck]; environment/setup/ is its readable copy. +FROM docker.io/xiaomimimo/mimo-v2.6-rl-oss@sha256:4e83316b461cd39065331878c7493f213e2f8ace1a94ac51235f00d5b5e3ed11 diff --git a/tasks/format-code-task-000754/environment/setup/files/blocklist b/tasks/format-code-task-000754/environment/setup/files/blocklist new file mode 100644 index 0000000000000000000000000000000000000000..a8e4bdc4c7d9b739c047a3cb58ea72a1bb05bcbc --- /dev/null +++ b/tasks/format-code-task-000754/environment/setup/files/blocklist @@ -0,0 +1,33 @@ +# mimo answer-leak blocklist (mimoagent) +0.0.0.0 github.com +0.0.0.0 www.github.com +0.0.0.0 api.github.com +0.0.0.0 raw.githubusercontent.com +0.0.0.0 codeload.github.com +0.0.0.0 objects.githubusercontent.com +0.0.0.0 gist.github.com +0.0.0.0 gist.githubusercontent.com +0.0.0.0 gitlab.com +0.0.0.0 bitbucket.org +0.0.0.0 sourceforge.net +0.0.0.0 git.kernel.org +0.0.0.0 chromium.googlesource.com +0.0.0.0 android.googlesource.com +0.0.0.0 sourcegraph.com +0.0.0.0 bugs.chromium.org +0.0.0.0 issues.oss-fuzz.com +0.0.0.0 oss-fuzz.com +0.0.0.0 osv.dev +0.0.0.0 api.osv.dev +0.0.0.0 bugzilla.mozilla.org +0.0.0.0 proxy.golang.org +0.0.0.0 sum.golang.org +0.0.0.0 pkg.go.dev +0.0.0.0 google.com +0.0.0.0 www.google.com +0.0.0.0 bing.com +0.0.0.0 www.bing.com +0.0.0.0 duckduckgo.com +0.0.0.0 html.duckduckgo.com +0.0.0.0 search.brave.com +0.0.0.0 stackoverflow.com diff --git a/tasks/format-code-task-000754/environment/setup/setup.sh b/tasks/format-code-task-000754/environment/setup/setup.sh new file mode 100644 index 0000000000000000000000000000000000000000..e9eb7daf39f9542bd095367feee457f3da77e492 --- /dev/null +++ b/tasks/format-code-task-000754/environment/setup/setup.sh @@ -0,0 +1,34 @@ +#!/bin/bash +# Runs once, as root, before the agent starts: Harbor's [environment.healthcheck] unpacks this folder into +# /var/lib/mimo and runs it. Generated by mimo_harbor; see its README for how each step maps to Xiaomi's harness. +M=/var/lib/mimo +[ -f "$M/ready" ] && exit 0 +chmod 700 "$M" +fail() { echo "setup: $*" >&2; exit 1; } +# the answer-leak blocklist (mimoagent), applied to /etc/hosts by the agent right after it installs +write_blocklist() { cp "$M/files/blocklist" "$M/blocklist"; } + +# Code: mimoagent environments/datasets/opensource_code.py + base.py, as the explorer runs it (app/runner/domains.py Code). +CWD=/workspace/repo +git config --global --add safe.directory "$CWD" +cd "$CWD" || fail "no working directory $CWD" +if ! git rev-parse --git-dir >/dev/null 2>&1; then # a bare source tree: give it a baseline commit + git init -q && git add -A && git -c user.name=mimo -c user.email=mimo@localhost commit -q -m baseline --allow-empty +fi +BASE=$(git rev-parse HEAD 2>/dev/null) +[ ${#BASE} -eq 40 ] || fail "could not resolve the base commit in $CWD" +echo "$BASE" > "$M/base" +# Images are built with history truncated at the base. If one is not, the fix could be read out of git log, +# so .git is hidden while the agent works and put back for grading. +LATER=$(git rev-list --all --not "$BASE" 2>/dev/null | head -n 5 | grep -c . || true) +rm -f /tmp/fail.log /tmp/pass.log /tmp/patch.diff /tmp/test_patch.diff /tmp/*.log 2>/dev/null; rm -rf /tmp/claude-0 /tmp/claude-* /tmp/testem-* /tmp/puppeteer_dev_chrome_profile-* 2>/dev/null; rm -f /tmp/test_files.json 2>/dev/null; rm -rf /tmp/jest_* /tmp/jest-* /tmp/build /tmp/build_env 2>/dev/null; rm -rf /tmp/pytest-of-root /tmp/pytest-* /tmp/.pytest_cache /tmp/__pycache__ 2>/dev/null; rm -rf /tmp/go-build* /tmp/standards /tmp/wordpress /tmp/zig-* /tmp/testbase /tmp/testbed 2>/dev/null; rm -f /tmp/tmp*.tmp /tmp/*.bak /tmp/expect* /tmp/butwas* 2>/dev/null; rm -rf /root/.cache/go-build 2>/dev/null; rm -rf /tests 2>/dev/null; find /logs -mindepth 1 -delete 2>/dev/null; mkdir -p /logs/agent /logs/verifier /logs/artifacts; chmod 777 /logs/agent /logs/verifier /logs/artifacts; find /var/log -type f -delete 2>/dev/null || true; rm -rf /var/lib/postgresql/*/*/log /var/lib/postgresql/*/*/pg_log 2>/dev/null || true; find /var/lib/mysql /var/lib/mongodb -type f -name '*.log' -delete 2>/dev/null || true; rm -rf /root/.npm/_logs /root/.babel.json /root/.pytest_cache 2>/dev/null || true; find / -maxdepth 4 -xdev -name task_description.md -path '*/.build_env/*' -delete 2>/dev/null || true; true +git clean -fdx --exclude=node_modules --exclude=bower_components --exclude=.husky --exclude=vendor --exclude=third_party --exclude=_deps --exclude=vcpkg_installed --exclude=.venv --exclude=venv --exclude=.gradle --exclude=target --exclude=.build --exclude=lib --exclude=.bundle --exclude=Manifest.toml --exclude=_build --exclude=.stack-work --exclude=dist-newstyle >/dev/null 2>&1 +find /root/.m2 -type f \( -name '*-SNAPSHOT.jar' -o -name '*-SNAPSHOT-sources.jar' -o -name '*-SNAPSHOT-tests.jar' -o -name '*-SNAPSHOT-test-sources.jar' \) -delete 2>/dev/null; rm -rf /root/.julia/compiled 2>/dev/null; rm -rf /root/.gradle/caches/build-cache-* /root/.gradle/daemon 2>/dev/null; rm -rf /root/.gradle/caches/*/scripts /root/.gradle/caches/jars-* 2>/dev/null; rm -rf /root/.cache/bazel 2>/dev/null; true +if [ "$LATER" -gt 0 ]; then + mv "$CWD/.git" "$M/git-hidden" + echo "history not truncated at ${BASE:0:12}: .git hidden while the agent works" +fi +write_blocklist + +touch "$M/ready" +echo "setup done" diff --git a/tasks/format-code-task-000754/tests/test.patch b/tasks/format-code-task-000754/tests/test.patch new file mode 100644 index 0000000000000000000000000000000000000000..63cb209db43336656b03ddb481699f219a390d0b --- /dev/null +++ b/tasks/format-code-task-000754/tests/test.patch @@ -0,0 +1,267 @@ +diff --git a/usercase-test-coderl/select-next.test.ts b/usercase-test-coderl/select-next.test.ts +new file mode 100644 +--- /dev/null ++++ b/usercase-test-coderl/select-next.test.ts +@@ -0,0 +1,226 @@ ++jest.mock( ++ '@data-driven-forms/react-form-renderer', ++ () => ({ ++ useFormApi: () => ({}), ++ WizardContext: { Provider: ({ children }: { children: unknown }) => children }, ++ }), ++ { virtual: true } ++); ++ ++const { execFileSync } = require('child_process'); ++const { selectNext } = require('../packages/common/src/wizard'); ++ ++describe('public selectNext wizard helper', () => { ++ test('returns a string next step unchanged', () => { ++ ++ ++ const actual = selectNext('shipping', () => ({ values: { choice: 'x' } })); ++ ++ expect(actual).toBe('shipping'); ++ }); ++ ++ test('resolves an object mapper from a direct value path', () => { ++ ++ ++ const nextStep = { ++ when: 'choice', ++ stepMapper: { ++ business: 'business-details', ++ personal: 'personal-details', ++ }, ++ }; ++ ++ const actual = selectNext(nextStep, () => ({ values: { choice: 'business' } })); ++ ++ expect(actual).toBe('business-details'); ++ }); ++ ++ test('resolves a different object mapper branch from the same direct path', () => { ++ ++ ++ const nextStep = { ++ when: 'choice', ++ stepMapper: { ++ business: 'business-details', ++ personal: 'personal-details', ++ }, ++ }; ++ ++ const actual = selectNext(nextStep, () => ({ values: { choice: 'personal' } })); ++ ++ expect(actual).toBe('personal-details'); ++ }); ++ ++ test('resolves an object mapper through a lodash-style nested array path', () => { ++ ++ ++ const nextStep = { ++ when: ['account', 'type'], ++ stepMapper: { ++ paid: 'billing', ++ free: 'summary', ++ }, ++ }; ++ ++ const actual = selectNext(nextStep, () => ({ values: { account: { type: 'paid' } } })); ++ ++ expect(actual).toBe('billing'); ++ }); ++ ++ test('resolves another nested object mapper branch from the same lodash path', () => { ++ ++ ++ const nextStep = { ++ when: ['account', 'type'], ++ stepMapper: { ++ paid: 'billing', ++ free: 'summary', ++ }, ++ }; ++ ++ const actual = selectNext(nextStep, () => ({ values: { account: { type: 'free' } } })); ++ ++ expect(actual).toBe('summary'); ++ }); ++ ++ test('calls a function nextStep with only the current values wrapper', () => { ++ ++ ++ const nextStep = (context: { values: { route: string } }) => ++ Object.prototype.hasOwnProperty.call(context, 'ignored') ? 'leaked-state' : context.values.route; ++ ++ const actual = selectNext(nextStep, () => ({ values: { route: 'review' }, ignored: 'secret' })); ++ ++ expect(actual).toBe('review'); ++ }); ++ ++ test('returns the promise produced by a function nextStep', async () => { ++ ++ ++ const expectedPromise = Promise.resolve('async-review'); ++ const nextStep = ({ values }: { values: { route: string } }) => (values.route === 'async-review' ? expectedPromise : Promise.resolve('wrong')); ++ ++ const actualPromise = selectNext(nextStep, () => ({ values: { route: 'async-review' } })); ++ ++ expect(actualPromise).toBe(expectedPromise); ++ await expect(actualPromise).resolves.toBe('async-review'); ++ }); ++ ++ test('throws TypeError for an object-style nextStep missing stepMapper', () => { ++ const nextStep = { when: 'choice' }; ++ const getState = () => ({ values: { choice: 'business' } }); ++ ++ expect(() => selectNext(nextStep, getState)).toThrow(TypeError); ++ }); ++ ++ test('is referentially transparent for the same nextStep and state result', () => { ++ const nextStep = { ++ when: 'choice', ++ stepMapper: { ++ business: 'business-details', ++ personal: 'personal-details', ++ }, ++ }; ++ const getState = () => ({ values: { choice: 'personal' } }); ++ ++ const first = selectNext(nextStep, getState); ++ const second = selectNext(nextStep, getState); ++ ++ expect(first).toBe(second); ++ expect(first).toBe('personal-details'); ++ expect(second).toBe('personal-details'); ++ }); ++ ++ test('does not mutate the nextStep definition or the state returned by getState', () => { ++ const nextStep = { ++ when: ['account', 'type'], ++ stepMapper: { ++ paid: 'billing', ++ free: 'summary', ++ }, ++ }; ++ const state = { ++ values: { ++ account: { ++ type: 'paid', ++ metadata: { tier: 3 }, ++ }, ++ }, ++ }; ++ const originalNextStep = JSON.parse(JSON.stringify(nextStep)); ++ const originalState = JSON.parse(JSON.stringify(state)); ++ ++ const actual = selectNext(nextStep, () => state); ++ ++ expect(actual).toBe('billing'); ++ expect(nextStep).toEqual(originalNextStep); ++ expect(state).toEqual(originalState); ++ }); ++ ++ test('matches the same result in a fresh Node process', () => { ++ const nextStep = { ++ when: ['account', 'type'], ++ stepMapper: { ++ paid: 'billing', ++ free: 'summary', ++ }, ++ }; ++ const inProcess = selectNext(nextStep, () => ({ values: { account: { type: 'paid' } } })); ++ const script = ` ++ const Module = require('module'); ++ const originalLoad = Module._load; ++ Module._load = function(request, parent, isMain) { ++ if (request === '@data-driven-forms/react-form-renderer') { ++ return { useFormApi: () => ({}), WizardContext: { Provider: ({ children }) => children } }; ++ } ++ return originalLoad.apply(this, arguments); ++ }; ++ require('ts-node/register/transpile-only'); ++ const { selectNext } = require('/workspace/repo/packages/common/src/wizard'); ++ const actual = selectNext( ++ { when: ['account', 'type'], stepMapper: { paid: 'billing', free: 'summary' } }, ++ () => ({ values: { account: { type: 'paid' } } }) ++ ); ++ process.stdout.write(JSON.stringify(actual)); ++ `; ++ const fresh = JSON.parse( ++ execFileSync(process.execPath, ['-e', script], { ++ cwd: '/workspace/repo', ++ env: { ++ ...process.env, ++ TS_NODE_COMPILER_OPTIONS: JSON.stringify({ ++ module: 'commonjs', ++ jsx: 'react-jsx', ++ target: 'es2019', ++ moduleResolution: 'node', ++ esModuleInterop: true, ++ allowSyntheticDefaultImports: true, ++ }), ++ }, ++ encoding: 'utf8', ++ }) ++ ); ++ ++ expect(inProcess).toBe('billing'); ++ expect(fresh).toBe('billing'); ++ expect(fresh).toBe(inProcess); ++ }); ++ ++ test('uses values for object-style selection without mutating inputs', () => { ++ const nextStep = { when: ['account', 'type'], stepMapper: { paid: 'billing', free: 'summary' } }; ++ const state = { ++ account: { type: 'free' }, ++ values: { account: { type: 'paid' } }, ++ }; ++ const originalNextStep = JSON.parse(JSON.stringify(nextStep)); ++ const originalState = JSON.parse(JSON.stringify(state)); ++ ++ const actual = selectNext(nextStep, () => state); ++ ++ ++ expect(actual).toBe('billing'); ++ ++ expect(nextStep).toEqual(originalNextStep); ++ expect(state).toEqual(originalState); ++ }); ++}); +diff --git a/mimo_test_command.sh b/mimo_test_command.sh +new file mode 100755 +--- /dev/null ++++ b/mimo_test_command.sh +@@ -0,0 +1,31 @@ ++#!/usr/bin/env bash ++ ++ ++ ++ ++export NODE_OPTIONS="${NODE_OPTIONS:-} --max-old-space-size=4096" ++export MAVEN_OPTS="${MAVEN_OPTS:-} -Xmx3g -XX:+UseG1GC" ++export GRADLE_OPTS="${GRADLE_OPTS:-} -Xmx3g -XX:+UseG1GC" ++export TEST_JVM_OPTS="${TEST_JVM_OPTS:-} -Xmx3g" ++set -e ++cd /workspace/repo ++set -euo pipefail ++cd /workspace/repo ++ ++export TS_NODE_COMPILER_OPTIONS='{"module":"commonjs","jsx":"react-jsx","target":"es2019","moduleResolution":"node","esModuleInterop":true,"allowSyntheticDefaultImports":true}' ++ ++export CI="${CI:-true}" ++export NO_UPDATE_NOTIFIER=1 ++export npm_config_update_notifier=false ++export npm_config_offline=true ++ ++if [ ! -x ./node_modules/.bin/jest ]; then ++ echo "Missing local Jest binary at /workspace/repo/node_modules/.bin/jest; refusing to install in offline test command." >&2 ++ exit 127 ++fi ++ ++exec ./node_modules/.bin/jest /workspace/repo/usercase-test-coderl/select-next.test.ts \ ++ --runInBand \ ++ --no-cache \ ++ --env=node \ ++ --config '{"testEnvironment":"node","watchman":false,"roots":["/workspace/repo/usercase-test-coderl","/workspace/repo/packages/common/src"],"transform":{"^.+\\.[tj]sx?$":["ts-jest",{"tsconfig":"/workspace/repo/packages/common/tsconfig.spec.json","diagnostics":false,"isolatedModules":true}]},"moduleFileExtensions":["ts","tsx","js","jsx","json"],"testRegex":"select-next\\.test\\.ts$"}' diff --git a/tasks/format-code-task-000754/tests/test.sh b/tasks/format-code-task-000754/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..aee8c62ee1c9994e364392acabdfb4ca6af3af89 --- /dev/null +++ b/tasks/format-code-task-000754/tests/test.sh @@ -0,0 +1,38 @@ +#!/bin/bash +# Code grading, mimoagent opensource_code.py: reset the files the hidden test patch touches, apply it, run the +# task's test command; reward 1 when it exits 0. A testbed failure (reset or apply) writes no reward: not scored. +M=/var/lib/mimo +CWD=/workspace/repo +V=/logs/verifier +mkdir -p "$V" +BASE=$(cat "$M/base" 2>/dev/null) || { echo "setup never ran (no $M/base)" >&2; exit 1; } +cd "$CWD" || exit 1 +if [ -d "$M/git-hidden" ]; then rm -rf "$CWD/.git"; mv "$M/git-hidden" "$CWD/.git"; fi +# the agent's change against the base, so its own commits count too +git add -A >/dev/null 2>&1 && git -c core.fileMode=false diff --cached "$BASE" > "$V/agent.diff" +git reset -q +if ! ( +while IFS= read -r tf; do + [ -z "$tf" ] && continue + if git cat-file -e $BASE:"$tf" 2>/dev/null; then + git checkout $BASE -- "$tf" 2>/dev/null || true + else + git rm -f --cached "$tf" >/dev/null 2>&1 || true + rm -f "$tf" + fi +done <<'EOF_RESET_TEST_FILES' +usercase-test-coderl/select-next.test.ts +mimo_test_command.sh +EOF_RESET_TEST_FILES + +); then echo "could not reset the test files (testbed problem, not scored)" >&2; exit 1; fi +if ! git apply --verbose /tests/test.patch > "$V/apply.log" 2>&1; then + cat "$V/apply.log" >&2 + echo "the hidden tests could not be applied (testbed problem, not scored)" >&2 + exit 1 +fi +timeout 1800 sh -c "$(cat /tests/test_command.sh)" > "$V/test_output.log" 2>&1 +RC=$? +tail -c 12000 "$V/test_output.log" +if [ $RC -eq 0 ]; then echo 1 > "$V/reward.txt"; else echo 0 > "$V/reward.txt"; fi +echo "test command exited $RC" diff --git a/tasks/format-code-task-000754/tests/test_command.sh b/tasks/format-code-task-000754/tests/test_command.sh new file mode 100644 index 0000000000000000000000000000000000000000..88cb7810b836396c4869db31aeac7d4d4b189685 --- /dev/null +++ b/tasks/format-code-task-000754/tests/test_command.sh @@ -0,0 +1 @@ +bash /workspace/repo/mimo_test_command.sh \ No newline at end of file diff --git a/tasks/format-code-task-000762/environment/Dockerfile b/tasks/format-code-task-000762/environment/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..ee8ffd26faf7513d06bfe2abacdb3b1841969e5f --- /dev/null +++ b/tasks/format-code-task-000762/environment/Dockerfile @@ -0,0 +1,3 @@ +# The task's image, pinned by digest (the same as [environment].docker_image). +# Setup runs at start from [environment.healthcheck]; environment/setup/ is its readable copy. +FROM docker.io/xiaomimimo/mimo-v2.6-rl-oss@sha256:db65aeb314ce957b8a10a38457bd668fb8a3d11752a590a6c34418fa14103b00 diff --git a/tasks/format-code-task-000762/environment/setup/files/blocklist b/tasks/format-code-task-000762/environment/setup/files/blocklist new file mode 100644 index 0000000000000000000000000000000000000000..a8e4bdc4c7d9b739c047a3cb58ea72a1bb05bcbc --- /dev/null +++ b/tasks/format-code-task-000762/environment/setup/files/blocklist @@ -0,0 +1,33 @@ +# mimo answer-leak blocklist (mimoagent) +0.0.0.0 github.com +0.0.0.0 www.github.com +0.0.0.0 api.github.com +0.0.0.0 raw.githubusercontent.com +0.0.0.0 codeload.github.com +0.0.0.0 objects.githubusercontent.com +0.0.0.0 gist.github.com +0.0.0.0 gist.githubusercontent.com +0.0.0.0 gitlab.com +0.0.0.0 bitbucket.org +0.0.0.0 sourceforge.net +0.0.0.0 git.kernel.org +0.0.0.0 chromium.googlesource.com +0.0.0.0 android.googlesource.com +0.0.0.0 sourcegraph.com +0.0.0.0 bugs.chromium.org +0.0.0.0 issues.oss-fuzz.com +0.0.0.0 oss-fuzz.com +0.0.0.0 osv.dev +0.0.0.0 api.osv.dev +0.0.0.0 bugzilla.mozilla.org +0.0.0.0 proxy.golang.org +0.0.0.0 sum.golang.org +0.0.0.0 pkg.go.dev +0.0.0.0 google.com +0.0.0.0 www.google.com +0.0.0.0 bing.com +0.0.0.0 www.bing.com +0.0.0.0 duckduckgo.com +0.0.0.0 html.duckduckgo.com +0.0.0.0 search.brave.com +0.0.0.0 stackoverflow.com diff --git a/tasks/format-code-task-000762/environment/setup/setup.sh b/tasks/format-code-task-000762/environment/setup/setup.sh new file mode 100644 index 0000000000000000000000000000000000000000..d883db90cfcfb48f7a139861bbe9f6b5d95cad6f --- /dev/null +++ b/tasks/format-code-task-000762/environment/setup/setup.sh @@ -0,0 +1,34 @@ +#!/bin/bash +# Runs once, as root, before the agent starts: Harbor's [environment.healthcheck] unpacks this folder into +# /var/lib/mimo and runs it. Generated by mimo_harbor; see its README for how each step maps to Xiaomi's harness. +M=/var/lib/mimo +[ -f "$M/ready" ] && exit 0 +chmod 700 "$M" +fail() { echo "setup: $*" >&2; exit 1; } +# the answer-leak blocklist (mimoagent), applied to /etc/hosts by the agent right after it installs +write_blocklist() { cp "$M/files/blocklist" "$M/blocklist"; } + +# Code: mimoagent environments/datasets/opensource_code.py + base.py, as the explorer runs it (app/runner/domains.py Code). +CWD=/testbed +git config --global --add safe.directory "$CWD" +cd "$CWD" || fail "no working directory $CWD" +if ! git rev-parse --git-dir >/dev/null 2>&1; then # a bare source tree: give it a baseline commit + git init -q && git add -A && git -c user.name=mimo -c user.email=mimo@localhost commit -q -m baseline --allow-empty +fi +BASE=$(git rev-parse HEAD 2>/dev/null) +[ ${#BASE} -eq 40 ] || fail "could not resolve the base commit in $CWD" +echo "$BASE" > "$M/base" +# Images are built with history truncated at the base. If one is not, the fix could be read out of git log, +# so .git is hidden while the agent works and put back for grading. +LATER=$(git rev-list --all --not "$BASE" 2>/dev/null | head -n 5 | grep -c . || true) +rm -f /tmp/fail.log /tmp/pass.log /tmp/patch.diff /tmp/test_patch.diff /tmp/*.log 2>/dev/null; rm -rf /tmp/claude-0 /tmp/claude-* /tmp/testem-* /tmp/puppeteer_dev_chrome_profile-* 2>/dev/null; rm -f /tmp/test_files.json 2>/dev/null; rm -rf /tmp/jest_* /tmp/jest-* /tmp/build /tmp/build_env 2>/dev/null; rm -rf /tmp/pytest-of-root /tmp/pytest-* /tmp/.pytest_cache /tmp/__pycache__ 2>/dev/null; rm -rf /tmp/go-build* /tmp/standards /tmp/wordpress /tmp/zig-* /tmp/testbase /tmp/testbed 2>/dev/null; rm -f /tmp/tmp*.tmp /tmp/*.bak /tmp/expect* /tmp/butwas* 2>/dev/null; rm -rf /root/.cache/go-build 2>/dev/null; rm -rf /tests 2>/dev/null; find /logs -mindepth 1 -delete 2>/dev/null; mkdir -p /logs/agent /logs/verifier /logs/artifacts; chmod 777 /logs/agent /logs/verifier /logs/artifacts; find /var/log -type f -delete 2>/dev/null || true; rm -rf /var/lib/postgresql/*/*/log /var/lib/postgresql/*/*/pg_log 2>/dev/null || true; find /var/lib/mysql /var/lib/mongodb -type f -name '*.log' -delete 2>/dev/null || true; rm -rf /root/.npm/_logs /root/.babel.json /root/.pytest_cache 2>/dev/null || true; find / -maxdepth 4 -xdev -name task_description.md -path '*/.build_env/*' -delete 2>/dev/null || true; true +git clean -fdx --exclude=node_modules --exclude=bower_components --exclude=.husky --exclude=vendor --exclude=third_party --exclude=_deps --exclude=vcpkg_installed --exclude=.venv --exclude=venv --exclude=.gradle --exclude=target --exclude=.build --exclude=lib --exclude=.bundle --exclude=Manifest.toml --exclude=_build --exclude=.stack-work --exclude=dist-newstyle >/dev/null 2>&1 +find /root/.m2 -type f \( -name '*-SNAPSHOT.jar' -o -name '*-SNAPSHOT-sources.jar' -o -name '*-SNAPSHOT-tests.jar' -o -name '*-SNAPSHOT-test-sources.jar' \) -delete 2>/dev/null; rm -rf /root/.julia/compiled 2>/dev/null; rm -rf /root/.gradle/caches/build-cache-* /root/.gradle/daemon 2>/dev/null; rm -rf /root/.gradle/caches/*/scripts /root/.gradle/caches/jars-* 2>/dev/null; rm -rf /root/.cache/bazel 2>/dev/null; true +if [ "$LATER" -gt 0 ]; then + mv "$CWD/.git" "$M/git-hidden" + echo "history not truncated at ${BASE:0:12}: .git hidden while the agent works" +fi +write_blocklist + +touch "$M/ready" +echo "setup done" diff --git a/tasks/format-code-task-000762/tests/test.patch b/tasks/format-code-task-000762/tests/test.patch new file mode 100644 index 0000000000000000000000000000000000000000..8ca0163a967ee288f10cb66344b9232055703018 --- /dev/null +++ b/tasks/format-code-task-000762/tests/test.patch @@ -0,0 +1,173 @@ +diff --git a/functions/openapi/no_ref_siblings_test.go b/functions/openapi/no_ref_siblings_test.go +index 9f49f31e..4dd4bc33 100644 +--- a/functions/openapi/no_ref_siblings_test.go ++++ b/functions/openapi/no_ref_siblings_test.go +@@ -6,6 +6,7 @@ import ( + "github.com/pb33f/libopenapi/utils" + "github.com/stretchr/testify/assert" + "gopkg.in/yaml.v3" ++ "net/url" + "testing" + ) + +@@ -225,3 +226,63 @@ func TestNoRefSiblings_RunRule_Fail_Single(t *testing.T) { + assert.Len(t, res, 1) + + } ++ ++func TestNoRefSiblings_RunRule_MultiFile(t *testing.T) { ++ rootYML := ` ++openapi: 3.0.0 ++info: {title: api, version: 1.0.0} ++paths: ++ /item: ++ get: ++ responses: ++ '200': ++ content: ++ application/json: ++ schema: ++ $ref: './child.yaml#/components/schemas/External' ++components: ++ schemas: ++ RootBad: ++ description: wrong ++ $ref: '#/components/schemas/Ok' ++ Ok: {type: object}` ++ ++ childYML := ` ++components: ++ schemas: ++ ExternalBad: ++ description: wrong ++ $ref: '#/components/schemas/Ok2' ++ External: {type: object} ++ Ok2: {type: object}` ++ ++ var rootNode, childNode yaml.Node ++ _ = yaml.Unmarshal([]byte(rootYML), &rootNode) ++ _ = yaml.Unmarshal([]byte(childYML), &childNode) ++ ++ childCfg := index.CreateOpenAPIIndexConfig() ++ childCfg.BaseURL, _ = url.Parse("child.yaml") ++ childCfg.AllowFileLookup = false ++ childCfg.AllowRemoteLookup = false ++ childIdx := index.NewSpecIndexWithConfig(&childNode, childCfg) ++ ++ rolodex := index.NewRolodex(childCfg) ++ rolodex.AddIndex(childIdx) ++ ++ rootCfg := index.CreateOpenAPIIndexConfig() ++ rootCfg.Rolodex = rolodex ++ rootCfg.AllowFileLookup = false ++ rootCfg.AllowRemoteLookup = false ++ rootIdx := index.NewSpecIndexWithConfig(&rootNode, rootCfg) ++ ++ rule := buildOpenApiTestRuleAction("$", "no_ref_siblings_multi_file", "", nil) ++ ctx := buildOpenApiTestContext(model.CastToRuleAction(rule.Then), nil) ++ ctx.Index = rootIdx ++ ++ nodes, _ := utils.FindNodes([]byte(rootYML), "$") ++ ++ var def NoRefSiblings ++ res := def.RunRule(nodes, ctx) ++ ++ assert.Len(t, res, 2) ++} +diff --git a/functions/openapi/oas_ref_siblings_test.go b/functions/openapi/oas_ref_siblings_test.go +index 31a5d5c9..f420b78b 100644 +--- a/functions/openapi/oas_ref_siblings_test.go ++++ b/functions/openapi/oas_ref_siblings_test.go +@@ -1,6 +1,7 @@ + package openapi + + import ( ++ "net/url" + "testing" + + "github.com/daveshanley/vacuum/model" +@@ -262,3 +263,63 @@ func TestOASNoRefSiblings_RunRule_Fail_Single(t *testing.T) { + assert.Len(t, res, 1) + + } ++ ++func TestOASNoRefSiblings_RunRule_MultiFile(t *testing.T) { ++ rootYML := ` ++openapi: 3.0.0 ++info: {title: api, version: 1.0.0} ++paths: ++ /item: ++ get: ++ responses: ++ '200': ++ content: ++ application/json: ++ schema: ++ $ref: './child.yaml#/components/schemas/External' ++components: ++ schemas: ++ RootBad: ++ type: object ++ $ref: '#/components/schemas/Ok' ++ Ok: {type: object}` ++ ++ childYML := ` ++components: ++ schemas: ++ ExternalBad: ++ type: object ++ $ref: '#/components/schemas/Ok2' ++ External: {type: object} ++ Ok2: {type: object}` ++ ++ var rootNode, childNode yaml.Node ++ _ = yaml.Unmarshal([]byte(rootYML), &rootNode) ++ _ = yaml.Unmarshal([]byte(childYML), &childNode) ++ ++ childCfg := index.CreateOpenAPIIndexConfig() ++ childCfg.BaseURL, _ = url.Parse("child.yaml") ++ childCfg.AllowFileLookup = false ++ childCfg.AllowRemoteLookup = false ++ childIdx := index.NewSpecIndexWithConfig(&childNode, childCfg) ++ ++ rolodex := index.NewRolodex(childCfg) ++ rolodex.AddIndex(childIdx) ++ ++ rootCfg := index.CreateOpenAPIIndexConfig() ++ rootCfg.Rolodex = rolodex ++ rootCfg.AllowFileLookup = false ++ rootCfg.AllowRemoteLookup = false ++ rootIdx := index.NewSpecIndexWithConfig(&rootNode, rootCfg) ++ ++ rule := buildOpenApiTestRuleAction("$", "no_ref_siblings_multi_file", "", nil) ++ ctx := buildOpenApiTestContext(model.CastToRuleAction(rule.Then), nil) ++ ctx.Index = rootIdx ++ ++ nodes, _ := utils.FindNodes([]byte(rootYML), "$") ++ ++ var def OASNoRefSiblings ++ res := def.RunRule(nodes, ctx) ++ ++ assert.Len(t, res, 2) ++} +diff --git a/mimo_build_env.tar.gz.b64 b/mimo_build_env.tar.gz.b64 +new file mode 100644 +--- /dev/null ++++ b/mimo_build_env.tar.gz.b64 +@@ -0,0 +1,5 @@ ++H4sIAAAAAAAAA+3RvW7CMBSG4cxchcVOYoc6mXsDrVS6o/wYaglsFDtMvfiGLG2RCgsIQd9nOUc+ ++lnysL617u2mXxu2z5FrkoNR6rIPjOvZK5yqXcq6KMpFK6bJIhL7aRj/0IVadEEnnfTx179z8TqXf +++UcT4rLx223l2jR8XO6Nc/mreX6U/1Mhh/zl5Vb42z/Pv2nFGHxt2snai0Mr0mzVuyZa70Lmd8ZV ++O5uJWdc7MX0f5i/+zawWtt5Ytw6fh5PX58Wvw6mY7Se3/hkAAAAAAAAAAAAAAADw+L4AMaJsdwAo ++AAA= +diff --git a/mimo_test_command.sh b/mimo_test_command.sh +new file mode 100755 +--- /dev/null ++++ b/mimo_test_command.sh +@@ -0,0 +1,6 @@ ++#!/usr/bin/env bash ++ ++set -uo pipefail ++cd /testbed || exit 1 ++base64 -d mimo_build_env.tar.gz.b64 | tar -xzf - -C /testbed || exit 1 ++exec bash -lc 'cd /testbed && bash -eo pipefail /testbed/.build_env/test_command.sh' diff --git a/tasks/format-code-task-000762/tests/test.sh b/tasks/format-code-task-000762/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..a0ecc73c4a56ce5224311b2e67a35fe1107ca90a --- /dev/null +++ b/tasks/format-code-task-000762/tests/test.sh @@ -0,0 +1,40 @@ +#!/bin/bash +# Code grading, mimoagent opensource_code.py: reset the files the hidden test patch touches, apply it, run the +# task's test command; reward 1 when it exits 0. A testbed failure (reset or apply) writes no reward: not scored. +M=/var/lib/mimo +CWD=/testbed +V=/logs/verifier +mkdir -p "$V" +BASE=$(cat "$M/base" 2>/dev/null) || { echo "setup never ran (no $M/base)" >&2; exit 1; } +cd "$CWD" || exit 1 +if [ -d "$M/git-hidden" ]; then rm -rf "$CWD/.git"; mv "$M/git-hidden" "$CWD/.git"; fi +# the agent's change against the base, so its own commits count too +git add -A >/dev/null 2>&1 && git -c core.fileMode=false diff --cached "$BASE" > "$V/agent.diff" +git reset -q +if ! ( +while IFS= read -r tf; do + [ -z "$tf" ] && continue + if git cat-file -e $BASE:"$tf" 2>/dev/null; then + git checkout $BASE -- "$tf" 2>/dev/null || true + else + git rm -f --cached "$tf" >/dev/null 2>&1 || true + rm -f "$tf" + fi +done <<'EOF_RESET_TEST_FILES' +functions/openapi/no_ref_siblings_test.go +functions/openapi/oas_ref_siblings_test.go +mimo_build_env.tar.gz.b64 +mimo_test_command.sh +EOF_RESET_TEST_FILES + +); then echo "could not reset the test files (testbed problem, not scored)" >&2; exit 1; fi +if ! git apply --verbose /tests/test.patch > "$V/apply.log" 2>&1; then + cat "$V/apply.log" >&2 + echo "the hidden tests could not be applied (testbed problem, not scored)" >&2 + exit 1 +fi +timeout 1800 sh -c "$(cat /tests/test_command.sh)" > "$V/test_output.log" 2>&1 +RC=$? +tail -c 12000 "$V/test_output.log" +if [ $RC -eq 0 ]; then echo 1 > "$V/reward.txt"; else echo 0 > "$V/reward.txt"; fi +echo "test command exited $RC" diff --git a/tasks/format-code-task-000762/tests/test_command.sh b/tasks/format-code-task-000762/tests/test_command.sh new file mode 100644 index 0000000000000000000000000000000000000000..7cb23076694ad17d72e8296d62b2b240083e36db --- /dev/null +++ b/tasks/format-code-task-000762/tests/test_command.sh @@ -0,0 +1 @@ +bash /testbed/mimo_test_command.sh \ No newline at end of file diff --git a/tasks/format-code-task-000771/environment/Dockerfile b/tasks/format-code-task-000771/environment/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..cbacf83fb6b871a841c201135b7c02958c4d37b0 --- /dev/null +++ b/tasks/format-code-task-000771/environment/Dockerfile @@ -0,0 +1,3 @@ +# The task's image, pinned by digest (the same as [environment].docker_image). +# Setup runs at start from [environment.healthcheck]; environment/setup/ is its readable copy. +FROM docker.io/xiaomimimo/mimo-v2.6-rl-oss@sha256:2f397d0d9ea5615c433ecbe345a4e1b5a81da5d4dacc02ad96c39ec73d063971 diff --git a/tasks/format-code-task-000771/environment/setup/files/blocklist b/tasks/format-code-task-000771/environment/setup/files/blocklist new file mode 100644 index 0000000000000000000000000000000000000000..a8e4bdc4c7d9b739c047a3cb58ea72a1bb05bcbc --- /dev/null +++ b/tasks/format-code-task-000771/environment/setup/files/blocklist @@ -0,0 +1,33 @@ +# mimo answer-leak blocklist (mimoagent) +0.0.0.0 github.com +0.0.0.0 www.github.com +0.0.0.0 api.github.com +0.0.0.0 raw.githubusercontent.com +0.0.0.0 codeload.github.com +0.0.0.0 objects.githubusercontent.com +0.0.0.0 gist.github.com +0.0.0.0 gist.githubusercontent.com +0.0.0.0 gitlab.com +0.0.0.0 bitbucket.org +0.0.0.0 sourceforge.net +0.0.0.0 git.kernel.org +0.0.0.0 chromium.googlesource.com +0.0.0.0 android.googlesource.com +0.0.0.0 sourcegraph.com +0.0.0.0 bugs.chromium.org +0.0.0.0 issues.oss-fuzz.com +0.0.0.0 oss-fuzz.com +0.0.0.0 osv.dev +0.0.0.0 api.osv.dev +0.0.0.0 bugzilla.mozilla.org +0.0.0.0 proxy.golang.org +0.0.0.0 sum.golang.org +0.0.0.0 pkg.go.dev +0.0.0.0 google.com +0.0.0.0 www.google.com +0.0.0.0 bing.com +0.0.0.0 www.bing.com +0.0.0.0 duckduckgo.com +0.0.0.0 html.duckduckgo.com +0.0.0.0 search.brave.com +0.0.0.0 stackoverflow.com diff --git a/tasks/format-code-task-000771/environment/setup/setup.sh b/tasks/format-code-task-000771/environment/setup/setup.sh new file mode 100644 index 0000000000000000000000000000000000000000..d883db90cfcfb48f7a139861bbe9f6b5d95cad6f --- /dev/null +++ b/tasks/format-code-task-000771/environment/setup/setup.sh @@ -0,0 +1,34 @@ +#!/bin/bash +# Runs once, as root, before the agent starts: Harbor's [environment.healthcheck] unpacks this folder into +# /var/lib/mimo and runs it. Generated by mimo_harbor; see its README for how each step maps to Xiaomi's harness. +M=/var/lib/mimo +[ -f "$M/ready" ] && exit 0 +chmod 700 "$M" +fail() { echo "setup: $*" >&2; exit 1; } +# the answer-leak blocklist (mimoagent), applied to /etc/hosts by the agent right after it installs +write_blocklist() { cp "$M/files/blocklist" "$M/blocklist"; } + +# Code: mimoagent environments/datasets/opensource_code.py + base.py, as the explorer runs it (app/runner/domains.py Code). +CWD=/testbed +git config --global --add safe.directory "$CWD" +cd "$CWD" || fail "no working directory $CWD" +if ! git rev-parse --git-dir >/dev/null 2>&1; then # a bare source tree: give it a baseline commit + git init -q && git add -A && git -c user.name=mimo -c user.email=mimo@localhost commit -q -m baseline --allow-empty +fi +BASE=$(git rev-parse HEAD 2>/dev/null) +[ ${#BASE} -eq 40 ] || fail "could not resolve the base commit in $CWD" +echo "$BASE" > "$M/base" +# Images are built with history truncated at the base. If one is not, the fix could be read out of git log, +# so .git is hidden while the agent works and put back for grading. +LATER=$(git rev-list --all --not "$BASE" 2>/dev/null | head -n 5 | grep -c . || true) +rm -f /tmp/fail.log /tmp/pass.log /tmp/patch.diff /tmp/test_patch.diff /tmp/*.log 2>/dev/null; rm -rf /tmp/claude-0 /tmp/claude-* /tmp/testem-* /tmp/puppeteer_dev_chrome_profile-* 2>/dev/null; rm -f /tmp/test_files.json 2>/dev/null; rm -rf /tmp/jest_* /tmp/jest-* /tmp/build /tmp/build_env 2>/dev/null; rm -rf /tmp/pytest-of-root /tmp/pytest-* /tmp/.pytest_cache /tmp/__pycache__ 2>/dev/null; rm -rf /tmp/go-build* /tmp/standards /tmp/wordpress /tmp/zig-* /tmp/testbase /tmp/testbed 2>/dev/null; rm -f /tmp/tmp*.tmp /tmp/*.bak /tmp/expect* /tmp/butwas* 2>/dev/null; rm -rf /root/.cache/go-build 2>/dev/null; rm -rf /tests 2>/dev/null; find /logs -mindepth 1 -delete 2>/dev/null; mkdir -p /logs/agent /logs/verifier /logs/artifacts; chmod 777 /logs/agent /logs/verifier /logs/artifacts; find /var/log -type f -delete 2>/dev/null || true; rm -rf /var/lib/postgresql/*/*/log /var/lib/postgresql/*/*/pg_log 2>/dev/null || true; find /var/lib/mysql /var/lib/mongodb -type f -name '*.log' -delete 2>/dev/null || true; rm -rf /root/.npm/_logs /root/.babel.json /root/.pytest_cache 2>/dev/null || true; find / -maxdepth 4 -xdev -name task_description.md -path '*/.build_env/*' -delete 2>/dev/null || true; true +git clean -fdx --exclude=node_modules --exclude=bower_components --exclude=.husky --exclude=vendor --exclude=third_party --exclude=_deps --exclude=vcpkg_installed --exclude=.venv --exclude=venv --exclude=.gradle --exclude=target --exclude=.build --exclude=lib --exclude=.bundle --exclude=Manifest.toml --exclude=_build --exclude=.stack-work --exclude=dist-newstyle >/dev/null 2>&1 +find /root/.m2 -type f \( -name '*-SNAPSHOT.jar' -o -name '*-SNAPSHOT-sources.jar' -o -name '*-SNAPSHOT-tests.jar' -o -name '*-SNAPSHOT-test-sources.jar' \) -delete 2>/dev/null; rm -rf /root/.julia/compiled 2>/dev/null; rm -rf /root/.gradle/caches/build-cache-* /root/.gradle/daemon 2>/dev/null; rm -rf /root/.gradle/caches/*/scripts /root/.gradle/caches/jars-* 2>/dev/null; rm -rf /root/.cache/bazel 2>/dev/null; true +if [ "$LATER" -gt 0 ]; then + mv "$CWD/.git" "$M/git-hidden" + echo "history not truncated at ${BASE:0:12}: .git hidden while the agent works" +fi +write_blocklist + +touch "$M/ready" +echo "setup done" diff --git a/tasks/format-code-task-000771/tests/test.patch b/tasks/format-code-task-000771/tests/test.patch new file mode 100644 index 0000000000000000000000000000000000000000..804ad42085223e006bb0d4b7b08b2330bea19f0a --- /dev/null +++ b/tasks/format-code-task-000771/tests/test.patch @@ -0,0 +1,79 @@ +diff --git a/packages/dcos-launch/extra/test_aws.py b/packages/dcos-launch/extra/test_aws.py +index b63d98276e..8cb03b10dc 100644 +--- a/packages/dcos-launch/extra/test_aws.py ++++ b/packages/dcos-launch/extra/test_aws.py +@@ -40,7 +40,6 @@ def test_missing_aws_stack(aws_cf_config_path, monkeypatch): + """ + monkeypatch.setattr(test_util.aws, 'fetch_stack', mock_stack_not_found) + config = launch.config.get_validated_config(aws_cf_config_path) +- assert 'platform' in config, str(config.items()) + aws_launcher = launch.get_launcher(config) + + def check_stack_error(cmd, args): +@@ -48,17 +47,18 @@ def check_stack_error(cmd, args): + getattr(aws_launcher, cmd)(*args) + assert exinfo.value.error == 'StackNotFound' + +- info = aws_launcher.create(config) +- check_stack_error('wait', (info,)) +- check_stack_error('describe', (info,)) +- check_stack_error('delete', (info,)) +- check_stack_error('test', (info, 'py.test')) ++ info = aws_launcher.create() ++ aws_launcher = launch.get_launcher(info) ++ check_stack_error('wait', ()) ++ check_stack_error('describe', ()) ++ check_stack_error('delete', ()) ++ check_stack_error('test', ('py.test',)) + + + def test_key_helper(aws_cf_config_path): + config = launch.config.get_validated_config(aws_cf_config_path) + aws_launcher = launch.get_launcher(config) +- temp_resources = aws_launcher.key_helper(config) ++ temp_resources = aws_launcher.key_helper() + assert temp_resources['key_name'] == config['deployment_name'] + assert yaml.load(config['template_parameters'])['KeyName'] == config['deployment_name'] + assert config['ssh_private_key'] == launch.util.MOCK_SSH_KEY_DATA +@@ -67,7 +67,7 @@ def test_key_helper(aws_cf_config_path): + def test_zen_helper(aws_zen_cf_config_path): + config = launch.config.get_validated_config(aws_zen_cf_config_path) + aws_launcher = launch.get_launcher(config) +- temp_resources = aws_launcher.zen_helper(config) ++ temp_resources = aws_launcher.zen_helper() + assert temp_resources['vpc'] == launch.util.MOCK_VPC_ID + assert temp_resources['gateway'] == launch.util.MOCK_GATEWAY_ID + assert temp_resources['private_subnet'] == launch.util.MOCK_SUBNET_ID +diff --git a/mimo_build_env.tar.gz.b64 b/mimo_build_env.tar.gz.b64 +new file mode 100644 +--- /dev/null ++++ b/mimo_build_env.tar.gz.b64 +@@ -0,0 +1,17 @@ ++H4sIAAAAAAAAA+1W247bNhD1s75ikgD1OrUsX9YOkGQXSBfbdtFcijjNQ4vCoKWxza5EKiRlV0U+ ++PkNJlmWvvUGBBEVbnheJM+TMGc5F6s0zHkczFOug9bXQJzwZj4sn4fBZvA/Gw8Hw/Lw/mZy3+oPB ++pD9uwfirMWog04YpgJaS0ty373P6fyl6u/wb1GYWyiRhIurp1Zfz8Zn8j8ZPRrv8D2nf4HwynLSg ++/+UonMb/PP+PHgRzLoI50ysvjKAogjlGnvcIroXOFMLPuVlJAaPeYABcAwsNXyOcmRVCKCOkkwgC ++MdK0jGMktRS6d2NQsXmMQMUEOUviXixZBBtOxjIDL2mBquNFuPY1CcMVpIWfUeloeBmQKhBZHMPH ++j2BUhpbSjaBskUhzgyFlTib8L+ylOaSMTKCGhVQNwv1viVNCOj7nMTc5WThrkAQWc2KvDzhGuGBZ ++vOPIF/CgZueH8JAnqVSmGe4zYFojyVZMM2NU00sX2tvLaHceNiN7BnSJwgNCyAxcQpBpFcR8HlTe ++6CaCO6E+fw7t6c2766tfpu/evLr59brt3SV0RNRj89Cz9yNYgsAF/NZ+sWHcFMSI5JVUlBkuisUL ++nYuwpr0nMFK1uwXpGqX2BxRbNbR/pILanm3aOWli7/RbXKPSvGYmDCNiqlxsI7pj4opKY+tnisY+ ++XmVFfNsVS1Mulg1FLTkwVcnfc9zY3T9hrrfvFEFSL96zOMNqdWBiih8yFCHu0diJvssNTo2yzn9/ ++WhylOhPyRAnZnHWKOj2itpmttjytSWg0x810YXlX1TDR8bbFY1vCm0nFl1yweGaXs6JDLnbdQh28 ++gFnZftFuy5k2ClnSrZro4rUU5Pjx49sNU0vdqQMu1Xau2B079pW8cvQ9NUspKTYoNJkScITZodvy ++0XDs7dr84ghtb6+xvAVvDh078RKqQ4hCqWc8YUuEVMk/6ArhjF7WPKJZskTRhfR2mVKyWBe0XnWh +++LJSb8Xd6mxp8b7hQmZOzYp6dwIpT6EyBj5CD3xfSJ+LlEas7/OlkAr9rbcI5jEXt3Stw8tvBkBT ++lXE6NjoI0zL0Y5YJO5NZeGvD3IVXKk7zLvV/n3rlSQcN9wH+aRRrxnSUePWdChcLXnyg1qQtPj12 ++2IUqT41cKpauckhklMXonWBRGNhzVodg3bzNRFEC9LtADVTkVO+Zyq3onkDKHyy20XaK+2vvn/70 ++Ozg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4/MfwCSgVhN4AKAAA +diff --git a/mimo_test_command.sh b/mimo_test_command.sh +new file mode 100755 +--- /dev/null ++++ b/mimo_test_command.sh +@@ -0,0 +1,6 @@ ++#!/usr/bin/env bash ++ ++set -uo pipefail ++cd /testbed || exit 1 ++base64 -d mimo_build_env.tar.gz.b64 | tar -xzf - -C /testbed || exit 1 ++exec bash -lc 'cd /testbed && bash -eo pipefail /testbed/.build_env/test_command.sh' diff --git a/tasks/format-code-task-000771/tests/test.sh b/tasks/format-code-task-000771/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..35c929f21c761873d48a4ecc8e1927a116e51879 --- /dev/null +++ b/tasks/format-code-task-000771/tests/test.sh @@ -0,0 +1,39 @@ +#!/bin/bash +# Code grading, mimoagent opensource_code.py: reset the files the hidden test patch touches, apply it, run the +# task's test command; reward 1 when it exits 0. A testbed failure (reset or apply) writes no reward: not scored. +M=/var/lib/mimo +CWD=/testbed +V=/logs/verifier +mkdir -p "$V" +BASE=$(cat "$M/base" 2>/dev/null) || { echo "setup never ran (no $M/base)" >&2; exit 1; } +cd "$CWD" || exit 1 +if [ -d "$M/git-hidden" ]; then rm -rf "$CWD/.git"; mv "$M/git-hidden" "$CWD/.git"; fi +# the agent's change against the base, so its own commits count too +git add -A >/dev/null 2>&1 && git -c core.fileMode=false diff --cached "$BASE" > "$V/agent.diff" +git reset -q +if ! ( +while IFS= read -r tf; do + [ -z "$tf" ] && continue + if git cat-file -e $BASE:"$tf" 2>/dev/null; then + git checkout $BASE -- "$tf" 2>/dev/null || true + else + git rm -f --cached "$tf" >/dev/null 2>&1 || true + rm -f "$tf" + fi +done <<'EOF_RESET_TEST_FILES' +packages/dcos-launch/extra/test_aws.py +mimo_build_env.tar.gz.b64 +mimo_test_command.sh +EOF_RESET_TEST_FILES + +); then echo "could not reset the test files (testbed problem, not scored)" >&2; exit 1; fi +if ! git apply --verbose /tests/test.patch > "$V/apply.log" 2>&1; then + cat "$V/apply.log" >&2 + echo "the hidden tests could not be applied (testbed problem, not scored)" >&2 + exit 1 +fi +timeout 1800 sh -c "$(cat /tests/test_command.sh)" > "$V/test_output.log" 2>&1 +RC=$? +tail -c 12000 "$V/test_output.log" +if [ $RC -eq 0 ]; then echo 1 > "$V/reward.txt"; else echo 0 > "$V/reward.txt"; fi +echo "test command exited $RC" diff --git a/tasks/format-code-task-000771/tests/test_command.sh b/tasks/format-code-task-000771/tests/test_command.sh new file mode 100644 index 0000000000000000000000000000000000000000..7cb23076694ad17d72e8296d62b2b240083e36db --- /dev/null +++ b/tasks/format-code-task-000771/tests/test_command.sh @@ -0,0 +1 @@ +bash /testbed/mimo_test_command.sh \ No newline at end of file diff --git a/tasks/format-code-task-000776/environment/Dockerfile b/tasks/format-code-task-000776/environment/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..3922769bbe1273ad49bb63d1522c2f45b9010b71 --- /dev/null +++ b/tasks/format-code-task-000776/environment/Dockerfile @@ -0,0 +1,3 @@ +# The task's image, pinned by digest (the same as [environment].docker_image). +# Setup runs at start from [environment.healthcheck]; environment/setup/ is its readable copy. +FROM docker.io/xiaomimimo/mimo-v2.6-rl-oss@sha256:41fa11cf0ab0f63f7d77a03e91167fbfc9a39d26e213fae0496eaeb26ea39213 diff --git a/tasks/format-code-task-000776/environment/setup/files/blocklist b/tasks/format-code-task-000776/environment/setup/files/blocklist new file mode 100644 index 0000000000000000000000000000000000000000..a8e4bdc4c7d9b739c047a3cb58ea72a1bb05bcbc --- /dev/null +++ b/tasks/format-code-task-000776/environment/setup/files/blocklist @@ -0,0 +1,33 @@ +# mimo answer-leak blocklist (mimoagent) +0.0.0.0 github.com +0.0.0.0 www.github.com +0.0.0.0 api.github.com +0.0.0.0 raw.githubusercontent.com +0.0.0.0 codeload.github.com +0.0.0.0 objects.githubusercontent.com +0.0.0.0 gist.github.com +0.0.0.0 gist.githubusercontent.com +0.0.0.0 gitlab.com +0.0.0.0 bitbucket.org +0.0.0.0 sourceforge.net +0.0.0.0 git.kernel.org +0.0.0.0 chromium.googlesource.com +0.0.0.0 android.googlesource.com +0.0.0.0 sourcegraph.com +0.0.0.0 bugs.chromium.org +0.0.0.0 issues.oss-fuzz.com +0.0.0.0 oss-fuzz.com +0.0.0.0 osv.dev +0.0.0.0 api.osv.dev +0.0.0.0 bugzilla.mozilla.org +0.0.0.0 proxy.golang.org +0.0.0.0 sum.golang.org +0.0.0.0 pkg.go.dev +0.0.0.0 google.com +0.0.0.0 www.google.com +0.0.0.0 bing.com +0.0.0.0 www.bing.com +0.0.0.0 duckduckgo.com +0.0.0.0 html.duckduckgo.com +0.0.0.0 search.brave.com +0.0.0.0 stackoverflow.com diff --git a/tasks/format-code-task-000776/environment/setup/setup.sh b/tasks/format-code-task-000776/environment/setup/setup.sh new file mode 100644 index 0000000000000000000000000000000000000000..d883db90cfcfb48f7a139861bbe9f6b5d95cad6f --- /dev/null +++ b/tasks/format-code-task-000776/environment/setup/setup.sh @@ -0,0 +1,34 @@ +#!/bin/bash +# Runs once, as root, before the agent starts: Harbor's [environment.healthcheck] unpacks this folder into +# /var/lib/mimo and runs it. Generated by mimo_harbor; see its README for how each step maps to Xiaomi's harness. +M=/var/lib/mimo +[ -f "$M/ready" ] && exit 0 +chmod 700 "$M" +fail() { echo "setup: $*" >&2; exit 1; } +# the answer-leak blocklist (mimoagent), applied to /etc/hosts by the agent right after it installs +write_blocklist() { cp "$M/files/blocklist" "$M/blocklist"; } + +# Code: mimoagent environments/datasets/opensource_code.py + base.py, as the explorer runs it (app/runner/domains.py Code). +CWD=/testbed +git config --global --add safe.directory "$CWD" +cd "$CWD" || fail "no working directory $CWD" +if ! git rev-parse --git-dir >/dev/null 2>&1; then # a bare source tree: give it a baseline commit + git init -q && git add -A && git -c user.name=mimo -c user.email=mimo@localhost commit -q -m baseline --allow-empty +fi +BASE=$(git rev-parse HEAD 2>/dev/null) +[ ${#BASE} -eq 40 ] || fail "could not resolve the base commit in $CWD" +echo "$BASE" > "$M/base" +# Images are built with history truncated at the base. If one is not, the fix could be read out of git log, +# so .git is hidden while the agent works and put back for grading. +LATER=$(git rev-list --all --not "$BASE" 2>/dev/null | head -n 5 | grep -c . || true) +rm -f /tmp/fail.log /tmp/pass.log /tmp/patch.diff /tmp/test_patch.diff /tmp/*.log 2>/dev/null; rm -rf /tmp/claude-0 /tmp/claude-* /tmp/testem-* /tmp/puppeteer_dev_chrome_profile-* 2>/dev/null; rm -f /tmp/test_files.json 2>/dev/null; rm -rf /tmp/jest_* /tmp/jest-* /tmp/build /tmp/build_env 2>/dev/null; rm -rf /tmp/pytest-of-root /tmp/pytest-* /tmp/.pytest_cache /tmp/__pycache__ 2>/dev/null; rm -rf /tmp/go-build* /tmp/standards /tmp/wordpress /tmp/zig-* /tmp/testbase /tmp/testbed 2>/dev/null; rm -f /tmp/tmp*.tmp /tmp/*.bak /tmp/expect* /tmp/butwas* 2>/dev/null; rm -rf /root/.cache/go-build 2>/dev/null; rm -rf /tests 2>/dev/null; find /logs -mindepth 1 -delete 2>/dev/null; mkdir -p /logs/agent /logs/verifier /logs/artifacts; chmod 777 /logs/agent /logs/verifier /logs/artifacts; find /var/log -type f -delete 2>/dev/null || true; rm -rf /var/lib/postgresql/*/*/log /var/lib/postgresql/*/*/pg_log 2>/dev/null || true; find /var/lib/mysql /var/lib/mongodb -type f -name '*.log' -delete 2>/dev/null || true; rm -rf /root/.npm/_logs /root/.babel.json /root/.pytest_cache 2>/dev/null || true; find / -maxdepth 4 -xdev -name task_description.md -path '*/.build_env/*' -delete 2>/dev/null || true; true +git clean -fdx --exclude=node_modules --exclude=bower_components --exclude=.husky --exclude=vendor --exclude=third_party --exclude=_deps --exclude=vcpkg_installed --exclude=.venv --exclude=venv --exclude=.gradle --exclude=target --exclude=.build --exclude=lib --exclude=.bundle --exclude=Manifest.toml --exclude=_build --exclude=.stack-work --exclude=dist-newstyle >/dev/null 2>&1 +find /root/.m2 -type f \( -name '*-SNAPSHOT.jar' -o -name '*-SNAPSHOT-sources.jar' -o -name '*-SNAPSHOT-tests.jar' -o -name '*-SNAPSHOT-test-sources.jar' \) -delete 2>/dev/null; rm -rf /root/.julia/compiled 2>/dev/null; rm -rf /root/.gradle/caches/build-cache-* /root/.gradle/daemon 2>/dev/null; rm -rf /root/.gradle/caches/*/scripts /root/.gradle/caches/jars-* 2>/dev/null; rm -rf /root/.cache/bazel 2>/dev/null; true +if [ "$LATER" -gt 0 ]; then + mv "$CWD/.git" "$M/git-hidden" + echo "history not truncated at ${BASE:0:12}: .git hidden while the agent works" +fi +write_blocklist + +touch "$M/ready" +echo "setup done" diff --git a/tasks/format-code-task-000776/tests/test.patch b/tasks/format-code-task-000776/tests/test.patch new file mode 100644 index 0000000000000000000000000000000000000000..44ed9a7816b07e6dc5670ef45b5f02cc295e3c68 --- /dev/null +++ b/tasks/format-code-task-000776/tests/test.patch @@ -0,0 +1,54 @@ +diff --git a/packages/netlify-cms-lib-widgets/src/__tests__/stringTemplate.spec.js b/packages/netlify-cms-lib-widgets/src/__tests__/stringTemplate.spec.js +index 5d38e24206f4..3a62a34139ee 100644 +--- a/packages/netlify-cms-lib-widgets/src/__tests__/stringTemplate.spec.js ++++ b/packages/netlify-cms-lib-widgets/src/__tests__/stringTemplate.spec.js +@@ -130,6 +130,28 @@ describe('stringTemplate', () => { + ), + ).toBe('BACKENDSLUG-title-01-02-2020'); + }); ++ ++ it('return apply filter for default value', () => { ++ expect( ++ compileStringTemplate( ++ "{{slug | upper}}-{{title | default('none')}}-{{subtitle | default('none')}}", ++ date, ++ 'backendSlug', ++ fromJS({ slug: 'entrySlug', title: 'title', subtitle: null, published: date, date }), ++ ), ++ ).toBe('BACKENDSLUG-title-none'); ++ }); ++ ++ it('return apply filter for ternary', () => { ++ expect( ++ compileStringTemplate( ++ "{{slug | upper}}-{{starred | ternary('star️','nostar')}}-{{done | ternary('done', 'open️')}}", ++ date, ++ 'backendSlug', ++ fromJS({ slug: 'entrySlug', starred: true, done: false }), ++ ), ++ ).toBe('BACKENDSLUG-star️-open️'); ++ }); + }); + + describe('expandPath', () => { +diff --git a/mimo_build_env.tar.gz.b64 b/mimo_build_env.tar.gz.b64 +new file mode 100644 +--- /dev/null ++++ b/mimo_build_env.tar.gz.b64 +@@ -0,0 +1,5 @@ ++H4sIAAAAAAAAA+3RQW7DIBAFUK9zCi6AMalxLtI9wkAdUhtbDGmV25d6k6pSm02iqsl/mxkEgkG/ ++7o9hdNrHN1HdSlPslFpr8b2uvVRbKbsnpVpZNaVr2oqpm030xZGySYxVaZ7zb+cu7f9T9Tn/7Clr ++O0+Tia6m/fXeuJS/bHfn/GVX8m+7bcm/ud4IP3vw/K1ja/C9d5uTSZEdyoJxHmdujd17thj7agZP ++Ivo8hpcTtxPxMfT8PbjBZxKUrND68w7SWlBOIQ7PflpGk31Ni7f1gTZ//U0AAAAAAAAAAAAAAAAA ++AAAAgLv0AdXm3dcAKAAA +diff --git a/mimo_test_command.sh b/mimo_test_command.sh +new file mode 100755 +--- /dev/null ++++ b/mimo_test_command.sh +@@ -0,0 +1,6 @@ ++#!/usr/bin/env bash ++ ++set -uo pipefail ++cd /testbed || exit 1 ++base64 -d mimo_build_env.tar.gz.b64 | tar -xzf - -C /testbed || exit 1 ++exec bash -lc 'cd /testbed && bash -eo pipefail /testbed/.build_env/test_command.sh' diff --git a/tasks/format-code-task-000776/tests/test.sh b/tasks/format-code-task-000776/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..2aac560893d49fcc07214e31fb05f57186bb6273 --- /dev/null +++ b/tasks/format-code-task-000776/tests/test.sh @@ -0,0 +1,39 @@ +#!/bin/bash +# Code grading, mimoagent opensource_code.py: reset the files the hidden test patch touches, apply it, run the +# task's test command; reward 1 when it exits 0. A testbed failure (reset or apply) writes no reward: not scored. +M=/var/lib/mimo +CWD=/testbed +V=/logs/verifier +mkdir -p "$V" +BASE=$(cat "$M/base" 2>/dev/null) || { echo "setup never ran (no $M/base)" >&2; exit 1; } +cd "$CWD" || exit 1 +if [ -d "$M/git-hidden" ]; then rm -rf "$CWD/.git"; mv "$M/git-hidden" "$CWD/.git"; fi +# the agent's change against the base, so its own commits count too +git add -A >/dev/null 2>&1 && git -c core.fileMode=false diff --cached "$BASE" > "$V/agent.diff" +git reset -q +if ! ( +while IFS= read -r tf; do + [ -z "$tf" ] && continue + if git cat-file -e $BASE:"$tf" 2>/dev/null; then + git checkout $BASE -- "$tf" 2>/dev/null || true + else + git rm -f --cached "$tf" >/dev/null 2>&1 || true + rm -f "$tf" + fi +done <<'EOF_RESET_TEST_FILES' +packages/netlify-cms-lib-widgets/src/__tests__/stringTemplate.spec.js +mimo_build_env.tar.gz.b64 +mimo_test_command.sh +EOF_RESET_TEST_FILES + +); then echo "could not reset the test files (testbed problem, not scored)" >&2; exit 1; fi +if ! git apply --verbose /tests/test.patch > "$V/apply.log" 2>&1; then + cat "$V/apply.log" >&2 + echo "the hidden tests could not be applied (testbed problem, not scored)" >&2 + exit 1 +fi +timeout 1800 sh -c "$(cat /tests/test_command.sh)" > "$V/test_output.log" 2>&1 +RC=$? +tail -c 12000 "$V/test_output.log" +if [ $RC -eq 0 ]; then echo 1 > "$V/reward.txt"; else echo 0 > "$V/reward.txt"; fi +echo "test command exited $RC" diff --git a/tasks/format-code-task-000776/tests/test_command.sh b/tasks/format-code-task-000776/tests/test_command.sh new file mode 100644 index 0000000000000000000000000000000000000000..7cb23076694ad17d72e8296d62b2b240083e36db --- /dev/null +++ b/tasks/format-code-task-000776/tests/test_command.sh @@ -0,0 +1 @@ +bash /testbed/mimo_test_command.sh \ No newline at end of file diff --git a/tasks/format-code-task-000778/environment/Dockerfile b/tasks/format-code-task-000778/environment/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..28b001dd1ef3d87addcb558fd839cf91343f431b --- /dev/null +++ b/tasks/format-code-task-000778/environment/Dockerfile @@ -0,0 +1,3 @@ +# The task's image, pinned by digest (the same as [environment].docker_image). +# Setup runs at start from [environment.healthcheck]; environment/setup/ is its readable copy. +FROM docker.io/xiaomimimo/mimo-v2.6-rl-oss@sha256:81f5c196aacaa23a6d2a034cda1628f04e38b94d5166c8eb0ad235fdadd89b39 diff --git a/tasks/format-code-task-000778/environment/setup/files/blocklist b/tasks/format-code-task-000778/environment/setup/files/blocklist new file mode 100644 index 0000000000000000000000000000000000000000..a8e4bdc4c7d9b739c047a3cb58ea72a1bb05bcbc --- /dev/null +++ b/tasks/format-code-task-000778/environment/setup/files/blocklist @@ -0,0 +1,33 @@ +# mimo answer-leak blocklist (mimoagent) +0.0.0.0 github.com +0.0.0.0 www.github.com +0.0.0.0 api.github.com +0.0.0.0 raw.githubusercontent.com +0.0.0.0 codeload.github.com +0.0.0.0 objects.githubusercontent.com +0.0.0.0 gist.github.com +0.0.0.0 gist.githubusercontent.com +0.0.0.0 gitlab.com +0.0.0.0 bitbucket.org +0.0.0.0 sourceforge.net +0.0.0.0 git.kernel.org +0.0.0.0 chromium.googlesource.com +0.0.0.0 android.googlesource.com +0.0.0.0 sourcegraph.com +0.0.0.0 bugs.chromium.org +0.0.0.0 issues.oss-fuzz.com +0.0.0.0 oss-fuzz.com +0.0.0.0 osv.dev +0.0.0.0 api.osv.dev +0.0.0.0 bugzilla.mozilla.org +0.0.0.0 proxy.golang.org +0.0.0.0 sum.golang.org +0.0.0.0 pkg.go.dev +0.0.0.0 google.com +0.0.0.0 www.google.com +0.0.0.0 bing.com +0.0.0.0 www.bing.com +0.0.0.0 duckduckgo.com +0.0.0.0 html.duckduckgo.com +0.0.0.0 search.brave.com +0.0.0.0 stackoverflow.com diff --git a/tasks/format-code-task-000778/environment/setup/setup.sh b/tasks/format-code-task-000778/environment/setup/setup.sh new file mode 100644 index 0000000000000000000000000000000000000000..d883db90cfcfb48f7a139861bbe9f6b5d95cad6f --- /dev/null +++ b/tasks/format-code-task-000778/environment/setup/setup.sh @@ -0,0 +1,34 @@ +#!/bin/bash +# Runs once, as root, before the agent starts: Harbor's [environment.healthcheck] unpacks this folder into +# /var/lib/mimo and runs it. Generated by mimo_harbor; see its README for how each step maps to Xiaomi's harness. +M=/var/lib/mimo +[ -f "$M/ready" ] && exit 0 +chmod 700 "$M" +fail() { echo "setup: $*" >&2; exit 1; } +# the answer-leak blocklist (mimoagent), applied to /etc/hosts by the agent right after it installs +write_blocklist() { cp "$M/files/blocklist" "$M/blocklist"; } + +# Code: mimoagent environments/datasets/opensource_code.py + base.py, as the explorer runs it (app/runner/domains.py Code). +CWD=/testbed +git config --global --add safe.directory "$CWD" +cd "$CWD" || fail "no working directory $CWD" +if ! git rev-parse --git-dir >/dev/null 2>&1; then # a bare source tree: give it a baseline commit + git init -q && git add -A && git -c user.name=mimo -c user.email=mimo@localhost commit -q -m baseline --allow-empty +fi +BASE=$(git rev-parse HEAD 2>/dev/null) +[ ${#BASE} -eq 40 ] || fail "could not resolve the base commit in $CWD" +echo "$BASE" > "$M/base" +# Images are built with history truncated at the base. If one is not, the fix could be read out of git log, +# so .git is hidden while the agent works and put back for grading. +LATER=$(git rev-list --all --not "$BASE" 2>/dev/null | head -n 5 | grep -c . || true) +rm -f /tmp/fail.log /tmp/pass.log /tmp/patch.diff /tmp/test_patch.diff /tmp/*.log 2>/dev/null; rm -rf /tmp/claude-0 /tmp/claude-* /tmp/testem-* /tmp/puppeteer_dev_chrome_profile-* 2>/dev/null; rm -f /tmp/test_files.json 2>/dev/null; rm -rf /tmp/jest_* /tmp/jest-* /tmp/build /tmp/build_env 2>/dev/null; rm -rf /tmp/pytest-of-root /tmp/pytest-* /tmp/.pytest_cache /tmp/__pycache__ 2>/dev/null; rm -rf /tmp/go-build* /tmp/standards /tmp/wordpress /tmp/zig-* /tmp/testbase /tmp/testbed 2>/dev/null; rm -f /tmp/tmp*.tmp /tmp/*.bak /tmp/expect* /tmp/butwas* 2>/dev/null; rm -rf /root/.cache/go-build 2>/dev/null; rm -rf /tests 2>/dev/null; find /logs -mindepth 1 -delete 2>/dev/null; mkdir -p /logs/agent /logs/verifier /logs/artifacts; chmod 777 /logs/agent /logs/verifier /logs/artifacts; find /var/log -type f -delete 2>/dev/null || true; rm -rf /var/lib/postgresql/*/*/log /var/lib/postgresql/*/*/pg_log 2>/dev/null || true; find /var/lib/mysql /var/lib/mongodb -type f -name '*.log' -delete 2>/dev/null || true; rm -rf /root/.npm/_logs /root/.babel.json /root/.pytest_cache 2>/dev/null || true; find / -maxdepth 4 -xdev -name task_description.md -path '*/.build_env/*' -delete 2>/dev/null || true; true +git clean -fdx --exclude=node_modules --exclude=bower_components --exclude=.husky --exclude=vendor --exclude=third_party --exclude=_deps --exclude=vcpkg_installed --exclude=.venv --exclude=venv --exclude=.gradle --exclude=target --exclude=.build --exclude=lib --exclude=.bundle --exclude=Manifest.toml --exclude=_build --exclude=.stack-work --exclude=dist-newstyle >/dev/null 2>&1 +find /root/.m2 -type f \( -name '*-SNAPSHOT.jar' -o -name '*-SNAPSHOT-sources.jar' -o -name '*-SNAPSHOT-tests.jar' -o -name '*-SNAPSHOT-test-sources.jar' \) -delete 2>/dev/null; rm -rf /root/.julia/compiled 2>/dev/null; rm -rf /root/.gradle/caches/build-cache-* /root/.gradle/daemon 2>/dev/null; rm -rf /root/.gradle/caches/*/scripts /root/.gradle/caches/jars-* 2>/dev/null; rm -rf /root/.cache/bazel 2>/dev/null; true +if [ "$LATER" -gt 0 ]; then + mv "$CWD/.git" "$M/git-hidden" + echo "history not truncated at ${BASE:0:12}: .git hidden while the agent works" +fi +write_blocklist + +touch "$M/ready" +echo "setup done" diff --git a/tasks/format-code-task-000778/tests/test.patch b/tasks/format-code-task-000778/tests/test.patch new file mode 100644 index 0000000000000000000000000000000000000000..5e72f76bb7eb2e49e83727824cf1d46ce32fd46e --- /dev/null +++ b/tasks/format-code-task-000778/tests/test.patch @@ -0,0 +1,61 @@ +diff --git a/global-hooks/create_endpoints_test.go b/global-hooks/create_endpoints_test.go +index e285889274d1..c1501b6c6508 100644 +--- a/global-hooks/create_endpoints_test.go ++++ b/global-hooks/create_endpoints_test.go +@@ -37,7 +37,26 @@ var _ = Describe("Global hooks :: create_endpoints ", func() { + os.Setenv("ADDON_OPERATOR_LISTEN_ADDRESS", "192.168.1.1") + os.Setenv("DECKHOUSE_NODE_NAME", "test-node") + os.Setenv("DECKHOUSE_POD", "deckhouse-test-1") +- f.KubeStateSet(oldEndpointSliceYaml) ++ f.KubeStateSet(oldEndpointSliceYaml + ` ++--- ++apiVersion: v1 ++kind: Service ++metadata: ++ name: deckhouse ++ namespace: d8-system ++spec: ++ ports: ++ - name: self ++ port: 8080 ++ protocol: TCP ++ targetPort: 9650 ++ - name: webhook ++ port: 9651 ++ protocol: TCP ++ targetPort: 9651 ++ selector: ++ app: deckhouse ++`) + generateEndpoints() + generateOldEndpointSlice() + f.BindingContexts.Set(f.GenerateOnStartupContext()) +@@ -64,6 +83,7 @@ var _ = Describe("Global hooks :: create_endpoints ", func() { + + It("Should remove old endpointslices", func() { + Expect(f.KubernetesResource("EndpointSlice", d8Namespace, "deckhouse-old").Exists()).To(BeFalse()) ++ Expect(f.KubernetesResource("Service", d8Namespace, d8Name).Field("spec.selector").Exists()).To(BeFalse()) + }) + }) + }) +diff --git a/mimo_build_env.tar.gz.b64 b/mimo_build_env.tar.gz.b64 +new file mode 100644 +--- /dev/null ++++ b/mimo_build_env.tar.gz.b64 +@@ -0,0 +1,5 @@ ++H4sIAAAAAAAAA+3SwWrDMAwGYJ/7FKL3OJYXL6c+S0lsLw1NoxE7ff6lgbIx2HppGaP/d5HABkv8 ++1u3cD2Efx3OpHsUsaufWuvhe156dZVvV1hhWhtnVL4rcwyb6Yk65mYjUJJJ/u3fr/J/Sn/nnmPLe ++y+nUjEGnw/3euJU/W77mz7WtlvyrV64UmfuN8LMnz98HWoNvY9h0QpeWdNkN0jZDcRA5ppIKL/OY ++d0zFmYquH4+d6Dfxc9pt/RSbHJfvE96lH3Pabv56IQAAAAAAAAAAAAAAAAAAAACAJ/IB9nu08QAo ++AAA= +diff --git a/mimo_test_command.sh b/mimo_test_command.sh +new file mode 100755 +--- /dev/null ++++ b/mimo_test_command.sh +@@ -0,0 +1,6 @@ ++#!/usr/bin/env bash ++ ++set -uo pipefail ++cd /testbed || exit 1 ++base64 -d mimo_build_env.tar.gz.b64 | tar -xzf - -C /testbed || exit 1 ++exec bash -lc 'cd /testbed && bash -eo pipefail /testbed/.build_env/test_command.sh' diff --git a/tasks/format-code-task-000778/tests/test.sh b/tasks/format-code-task-000778/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..5f027c424cfbf72944c19c83aec03b970b1fd802 --- /dev/null +++ b/tasks/format-code-task-000778/tests/test.sh @@ -0,0 +1,39 @@ +#!/bin/bash +# Code grading, mimoagent opensource_code.py: reset the files the hidden test patch touches, apply it, run the +# task's test command; reward 1 when it exits 0. A testbed failure (reset or apply) writes no reward: not scored. +M=/var/lib/mimo +CWD=/testbed +V=/logs/verifier +mkdir -p "$V" +BASE=$(cat "$M/base" 2>/dev/null) || { echo "setup never ran (no $M/base)" >&2; exit 1; } +cd "$CWD" || exit 1 +if [ -d "$M/git-hidden" ]; then rm -rf "$CWD/.git"; mv "$M/git-hidden" "$CWD/.git"; fi +# the agent's change against the base, so its own commits count too +git add -A >/dev/null 2>&1 && git -c core.fileMode=false diff --cached "$BASE" > "$V/agent.diff" +git reset -q +if ! ( +while IFS= read -r tf; do + [ -z "$tf" ] && continue + if git cat-file -e $BASE:"$tf" 2>/dev/null; then + git checkout $BASE -- "$tf" 2>/dev/null || true + else + git rm -f --cached "$tf" >/dev/null 2>&1 || true + rm -f "$tf" + fi +done <<'EOF_RESET_TEST_FILES' +global-hooks/create_endpoints_test.go +mimo_build_env.tar.gz.b64 +mimo_test_command.sh +EOF_RESET_TEST_FILES + +); then echo "could not reset the test files (testbed problem, not scored)" >&2; exit 1; fi +if ! git apply --verbose /tests/test.patch > "$V/apply.log" 2>&1; then + cat "$V/apply.log" >&2 + echo "the hidden tests could not be applied (testbed problem, not scored)" >&2 + exit 1 +fi +timeout 1800 sh -c "$(cat /tests/test_command.sh)" > "$V/test_output.log" 2>&1 +RC=$? +tail -c 12000 "$V/test_output.log" +if [ $RC -eq 0 ]; then echo 1 > "$V/reward.txt"; else echo 0 > "$V/reward.txt"; fi +echo "test command exited $RC" diff --git a/tasks/format-code-task-000778/tests/test_command.sh b/tasks/format-code-task-000778/tests/test_command.sh new file mode 100644 index 0000000000000000000000000000000000000000..7cb23076694ad17d72e8296d62b2b240083e36db --- /dev/null +++ b/tasks/format-code-task-000778/tests/test_command.sh @@ -0,0 +1 @@ +bash /testbed/mimo_test_command.sh \ No newline at end of file diff --git a/tasks/format-code-task-000785/environment/Dockerfile b/tasks/format-code-task-000785/environment/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..a62da71a7b60c89b7e5b0c6344e49fd8c89ef7ab --- /dev/null +++ b/tasks/format-code-task-000785/environment/Dockerfile @@ -0,0 +1,3 @@ +# The task's image, pinned by digest (the same as [environment].docker_image). +# Setup runs at start from [environment.healthcheck]; environment/setup/ is its readable copy. +FROM docker.io/xiaomimimo/mimo-v2.6-rl-oss@sha256:0dfb447ccce29e688dcf00c242ace0b748b60e0bb30816c476e9e25119a09f17 diff --git a/tasks/format-code-task-000785/environment/setup/files/blocklist b/tasks/format-code-task-000785/environment/setup/files/blocklist new file mode 100644 index 0000000000000000000000000000000000000000..a8e4bdc4c7d9b739c047a3cb58ea72a1bb05bcbc --- /dev/null +++ b/tasks/format-code-task-000785/environment/setup/files/blocklist @@ -0,0 +1,33 @@ +# mimo answer-leak blocklist (mimoagent) +0.0.0.0 github.com +0.0.0.0 www.github.com +0.0.0.0 api.github.com +0.0.0.0 raw.githubusercontent.com +0.0.0.0 codeload.github.com +0.0.0.0 objects.githubusercontent.com +0.0.0.0 gist.github.com +0.0.0.0 gist.githubusercontent.com +0.0.0.0 gitlab.com +0.0.0.0 bitbucket.org +0.0.0.0 sourceforge.net +0.0.0.0 git.kernel.org +0.0.0.0 chromium.googlesource.com +0.0.0.0 android.googlesource.com +0.0.0.0 sourcegraph.com +0.0.0.0 bugs.chromium.org +0.0.0.0 issues.oss-fuzz.com +0.0.0.0 oss-fuzz.com +0.0.0.0 osv.dev +0.0.0.0 api.osv.dev +0.0.0.0 bugzilla.mozilla.org +0.0.0.0 proxy.golang.org +0.0.0.0 sum.golang.org +0.0.0.0 pkg.go.dev +0.0.0.0 google.com +0.0.0.0 www.google.com +0.0.0.0 bing.com +0.0.0.0 www.bing.com +0.0.0.0 duckduckgo.com +0.0.0.0 html.duckduckgo.com +0.0.0.0 search.brave.com +0.0.0.0 stackoverflow.com diff --git a/tasks/format-code-task-000785/environment/setup/setup.sh b/tasks/format-code-task-000785/environment/setup/setup.sh new file mode 100644 index 0000000000000000000000000000000000000000..e9eb7daf39f9542bd095367feee457f3da77e492 --- /dev/null +++ b/tasks/format-code-task-000785/environment/setup/setup.sh @@ -0,0 +1,34 @@ +#!/bin/bash +# Runs once, as root, before the agent starts: Harbor's [environment.healthcheck] unpacks this folder into +# /var/lib/mimo and runs it. Generated by mimo_harbor; see its README for how each step maps to Xiaomi's harness. +M=/var/lib/mimo +[ -f "$M/ready" ] && exit 0 +chmod 700 "$M" +fail() { echo "setup: $*" >&2; exit 1; } +# the answer-leak blocklist (mimoagent), applied to /etc/hosts by the agent right after it installs +write_blocklist() { cp "$M/files/blocklist" "$M/blocklist"; } + +# Code: mimoagent environments/datasets/opensource_code.py + base.py, as the explorer runs it (app/runner/domains.py Code). +CWD=/workspace/repo +git config --global --add safe.directory "$CWD" +cd "$CWD" || fail "no working directory $CWD" +if ! git rev-parse --git-dir >/dev/null 2>&1; then # a bare source tree: give it a baseline commit + git init -q && git add -A && git -c user.name=mimo -c user.email=mimo@localhost commit -q -m baseline --allow-empty +fi +BASE=$(git rev-parse HEAD 2>/dev/null) +[ ${#BASE} -eq 40 ] || fail "could not resolve the base commit in $CWD" +echo "$BASE" > "$M/base" +# Images are built with history truncated at the base. If one is not, the fix could be read out of git log, +# so .git is hidden while the agent works and put back for grading. +LATER=$(git rev-list --all --not "$BASE" 2>/dev/null | head -n 5 | grep -c . || true) +rm -f /tmp/fail.log /tmp/pass.log /tmp/patch.diff /tmp/test_patch.diff /tmp/*.log 2>/dev/null; rm -rf /tmp/claude-0 /tmp/claude-* /tmp/testem-* /tmp/puppeteer_dev_chrome_profile-* 2>/dev/null; rm -f /tmp/test_files.json 2>/dev/null; rm -rf /tmp/jest_* /tmp/jest-* /tmp/build /tmp/build_env 2>/dev/null; rm -rf /tmp/pytest-of-root /tmp/pytest-* /tmp/.pytest_cache /tmp/__pycache__ 2>/dev/null; rm -rf /tmp/go-build* /tmp/standards /tmp/wordpress /tmp/zig-* /tmp/testbase /tmp/testbed 2>/dev/null; rm -f /tmp/tmp*.tmp /tmp/*.bak /tmp/expect* /tmp/butwas* 2>/dev/null; rm -rf /root/.cache/go-build 2>/dev/null; rm -rf /tests 2>/dev/null; find /logs -mindepth 1 -delete 2>/dev/null; mkdir -p /logs/agent /logs/verifier /logs/artifacts; chmod 777 /logs/agent /logs/verifier /logs/artifacts; find /var/log -type f -delete 2>/dev/null || true; rm -rf /var/lib/postgresql/*/*/log /var/lib/postgresql/*/*/pg_log 2>/dev/null || true; find /var/lib/mysql /var/lib/mongodb -type f -name '*.log' -delete 2>/dev/null || true; rm -rf /root/.npm/_logs /root/.babel.json /root/.pytest_cache 2>/dev/null || true; find / -maxdepth 4 -xdev -name task_description.md -path '*/.build_env/*' -delete 2>/dev/null || true; true +git clean -fdx --exclude=node_modules --exclude=bower_components --exclude=.husky --exclude=vendor --exclude=third_party --exclude=_deps --exclude=vcpkg_installed --exclude=.venv --exclude=venv --exclude=.gradle --exclude=target --exclude=.build --exclude=lib --exclude=.bundle --exclude=Manifest.toml --exclude=_build --exclude=.stack-work --exclude=dist-newstyle >/dev/null 2>&1 +find /root/.m2 -type f \( -name '*-SNAPSHOT.jar' -o -name '*-SNAPSHOT-sources.jar' -o -name '*-SNAPSHOT-tests.jar' -o -name '*-SNAPSHOT-test-sources.jar' \) -delete 2>/dev/null; rm -rf /root/.julia/compiled 2>/dev/null; rm -rf /root/.gradle/caches/build-cache-* /root/.gradle/daemon 2>/dev/null; rm -rf /root/.gradle/caches/*/scripts /root/.gradle/caches/jars-* 2>/dev/null; rm -rf /root/.cache/bazel 2>/dev/null; true +if [ "$LATER" -gt 0 ]; then + mv "$CWD/.git" "$M/git-hidden" + echo "history not truncated at ${BASE:0:12}: .git hidden while the agent works" +fi +write_blocklist + +touch "$M/ready" +echo "setup done" diff --git a/tasks/format-code-task-000785/tests/test.patch b/tasks/format-code-task-000785/tests/test.patch new file mode 100644 index 0000000000000000000000000000000000000000..8b1bd05180228c06d2e098940b0aab182d55e7cd --- /dev/null +++ b/tasks/format-code-task-000785/tests/test.patch @@ -0,0 +1,320 @@ +diff --git a/usercase-test-coderl/test_molecular_local_energy.py b/usercase-test-coderl/test_molecular_local_energy.py +new file mode 100644 +--- /dev/null ++++ b/usercase-test-coderl/test_molecular_local_energy.py +@@ -0,0 +1,289 @@ ++import os ++ ++os.environ.setdefault('JAX_ENABLE_X64', 'True') ++os.environ.setdefault('NVIDIA_TF32_OVERRIDE', '0') ++ ++from functools import partial ++ ++from jax import config ++ ++config.update('jax_enable_x64', True) ++ ++import jax ++import jax.numpy as jnp ++import numpy as np ++ ++from deepqmc.hamil import MolecularHamiltonian ++from deepqmc.molecule import Molecule ++from deepqmc.physics import electronic_potential, nuclear_energy ++from deepqmc.types import PhysicalConfiguration, Psi ++ ++ ++ ++ ++ ++ ++ ++ ++ ++EXPECTED_STAT_KEYS = [ ++ 'hamil/E_kin', ++ 'hamil/V_el', ++ 'hamil/V_loc', ++ 'hamil/V_nl', ++ 'hamil/lap', ++ 'hamil/quantum_force', ++] ++ ++ ++def deterministic_ansatz(params, phys_conf): ++ return Psi( ++ sign=jnp.array(1.0), ++ log=( ++ params['alpha'] * jnp.sum(phys_conf.r * params['weights']) ++ + params['beta'] * jnp.sum(phys_conf.r**2) ++ + params['gamma'] ++ * jnp.sum(phys_conf.R * jnp.array([0.05, -0.02, 0.03])) ++ ), ++ ) ++ ++ ++def params_fixture(): ++ return { ++ 'alpha': jnp.array(1.3), ++ 'beta': jnp.array(-0.031), ++ 'gamma': jnp.array(0.11), ++ 'weights': jnp.array([[1.2, -0.4, 0.9], [-0.8, 0.6, 1.1]]), ++ } ++ ++ ++def h2_hamiltonian_and_conf(nuclear_z): ++ mol = Molecule( ++ coords=[[0.0, 0.0, -nuclear_z], [0.0, 0.0, nuclear_z]], ++ charges=[1, 1], ++ charge=0, ++ spin=0, ++ ) ++ phys_conf = PhysicalConfiguration( ++ R=mol.coords, ++ r=jnp.array([[0.25, -0.30, 0.10], [-0.40, 0.20, 0.35]]), ++ mol_idx=jnp.array(0), ++ ) ++ return MolecularHamiltonian(mol=mol), phys_conf ++ ++ ++def lih_ecp_hamiltonian_and_conf(): ++ mol = Molecule( ++ coords=[[0.0, 0.0, 0.0], [0.0, 0.0, 3.0]], ++ charges=[3, 1], ++ charge=0, ++ spin=0, ++ ) ++ phys_conf = PhysicalConfiguration( ++ R=mol.coords, ++ r=jnp.array([[0.42, -0.31, 0.52], [-0.28, 0.37, 2.38]]), ++ mol_idx=jnp.array(0), ++ ) ++ return MolecularHamiltonian(mol=mol, ecp_type='ccECP'), phys_conf ++ ++ ++def expected_local_energy_components(hamil, rng, params, phys_conf): ++ wf = partial(deterministic_ansatz, params) ++ e_kin, lap, quantum_force = hamil.pot.kinetic_term( ++ phys_conf, wf, hamil.lap_factory ++ ) ++ v_el = electronic_potential(phys_conf) ++ v_loc = hamil.pot.local_potential(phys_conf) ++ v_nl = hamil.pot.nonloc_potential(rng, phys_conf, wf) ++ e_nuc = nuclear_energy(phys_conf, hamil.ns_valence) ++ stats = { ++ 'hamil/V_el': v_el, ++ 'hamil/E_kin': e_kin, ++ 'hamil/V_loc': v_loc, ++ 'hamil/V_nl': v_nl, ++ 'hamil/lap': lap, ++ 'hamil/quantum_force': quantum_force, ++ } ++ return e_kin + v_el + v_loc + v_nl + e_nuc, stats, e_nuc ++ ++ ++def assert_scalar_close(actual, expected): ++ ++ np.testing.assert_allclose( ++ np.asarray(actual), np.asarray(expected), rtol=1e-10, atol=1e-10 ++ ) ++ ++ ++def assert_stats_close(actual, expected): ++ assert sorted(actual.keys()) == EXPECTED_STAT_KEYS ++ for key, value in expected.items(): ++ assert_scalar_close(actual[key], value) ++ ++ ++def assert_params_literal(params): ++ expected = params_fixture() ++ assert sorted(params.keys()) == ['alpha', 'beta', 'gamma', 'weights'] ++ for key, value in expected.items(): ++ np.testing.assert_array_equal(np.asarray(params[key]), np.asarray(value)) ++ ++ ++def assert_h2_phys_conf_literal(phys_conf, nuclear_z): ++ np.testing.assert_array_equal( ++ np.asarray(phys_conf.R), ++ np.asarray([[0.0, 0.0, -nuclear_z], [0.0, 0.0, nuclear_z]]), ++ ) ++ np.testing.assert_array_equal( ++ np.asarray(phys_conf.r), ++ np.asarray([[0.25, -0.30, 0.10], [-0.40, 0.20, 0.35]]), ++ ) ++ assert_scalar_close(phys_conf.mol_idx, 0) ++ ++ ++def test_coulomb_local_energy_callable_is_bound_deterministic_and_non_mutating(): ++ ++ ++ ++ ++ hamil, phys_conf = h2_hamiltonian_and_conf(0.7) ++ params = params_fixture() ++ local_energy_fn = hamil.local_energy(deterministic_ansatz) ++ ++ rng_1 = jax.random.PRNGKey(1) ++ expected_energy_1, expected_stats_1, expected_e_nuc = ( ++ expected_local_energy_components(hamil, rng_1, params, phys_conf) ++ ) ++ energy_1, stats_1 = local_energy_fn(rng_1, params, phys_conf) ++ ++ ++ assert_scalar_close(energy_1, expected_energy_1) ++ assert_stats_close(stats_1, expected_stats_1) ++ assert_scalar_close( ++ energy_1 ++ - ( ++ stats_1['hamil/V_el'] ++ + stats_1['hamil/E_kin'] ++ + stats_1['hamil/V_loc'] ++ + stats_1['hamil/V_nl'] ++ ), ++ expected_e_nuc, ++ ) ++ ++ rng_2 = jax.random.PRNGKey(2) ++ expected_energy_2, expected_stats_2, _ = expected_local_energy_components( ++ hamil, rng_2, params, phys_conf ++ ) ++ energy_2, stats_2 = local_energy_fn(rng_2, params, phys_conf) ++ ++ ++ assert_scalar_close(energy_2, expected_energy_2) ++ assert_stats_close(stats_2, expected_stats_2) ++ assert_scalar_close(energy_2, energy_1) ++ assert_stats_close(stats_2, stats_1) ++ ++ energy_3, stats_3 = local_energy_fn(rng_1, params, phys_conf) ++ ++ ++ assert_scalar_close(energy_3, energy_1) ++ assert_stats_close(stats_3, stats_1) ++ assert_params_literal(params) ++ assert_h2_phys_conf_literal(phys_conf, 0.7) ++ ++ ++def test_nonlocal_ecp_callable_uses_rng_for_quadrature_contribution(): ++ ++ ++ ++ ++ hamil, phys_conf = lih_ecp_hamiltonian_and_conf() ++ params = params_fixture() ++ local_energy_fn = hamil.local_energy(deterministic_ansatz) ++ ++ rng_7 = jax.random.PRNGKey(7) ++ expected_energy_7, expected_stats_7, _ = expected_local_energy_components( ++ hamil, rng_7, params, phys_conf ++ ) ++ energy_7, stats_7 = local_energy_fn(rng_7, params, phys_conf) ++ ++ ++ assert_scalar_close(energy_7, expected_energy_7) ++ assert_stats_close(stats_7, expected_stats_7) ++ ++ rng_8 = jax.random.PRNGKey(8) ++ expected_energy_8, expected_stats_8, _ = expected_local_energy_components( ++ hamil, rng_8, params, phys_conf ++ ) ++ energy_8, stats_8 = local_energy_fn(rng_8, params, phys_conf) ++ ++ ++ assert_scalar_close(energy_8, expected_energy_8) ++ assert_stats_close(stats_8, expected_stats_8) ++ assert abs(np.asarray(stats_8['hamil/V_nl'] - stats_7['hamil/V_nl'])) > 1e-9 ++ assert abs(np.asarray(energy_8 - energy_7)) > 1e-9 ++ ++ repeat_energy_7, repeat_stats_7 = local_energy_fn(rng_7, params, phys_conf) ++ ++ ++ assert_scalar_close(repeat_energy_7, energy_7) ++ assert_stats_close(repeat_stats_7, stats_7) ++ assert_params_literal(params) ++ ++ ++def test_two_local_energy_callables_keep_hamiltonian_state_independent(): ++ ++ ++ ++ ++ compact_hamil, compact_conf = h2_hamiltonian_and_conf(0.7) ++ stretched_hamil, stretched_conf = h2_hamiltonian_and_conf(1.0) ++ params = params_fixture() ++ compact_fn = compact_hamil.local_energy(deterministic_ansatz) ++ stretched_fn = stretched_hamil.local_energy(deterministic_ansatz) ++ ++ stretched_energy, stretched_stats = stretched_fn( ++ jax.random.PRNGKey(1), params, stretched_conf ++ ) ++ expected_stretched_energy, expected_stretched_stats, _ = ( ++ expected_local_energy_components( ++ stretched_hamil, jax.random.PRNGKey(1), params, stretched_conf ++ ) ++ ) ++ ++ ++ assert_scalar_close(stretched_energy, expected_stretched_energy) ++ assert_stats_close(stretched_stats, expected_stretched_stats) ++ ++ compact_energy, compact_stats = compact_fn( ++ jax.random.PRNGKey(1), params, compact_conf ++ ) ++ expected_compact_energy, expected_compact_stats, _ = ( ++ expected_local_energy_components( ++ compact_hamil, jax.random.PRNGKey(1), params, compact_conf ++ ) ++ ) ++ ++ ++ assert_scalar_close(compact_energy, expected_compact_energy) ++ assert_stats_close(compact_stats, expected_compact_stats) ++ assert abs(np.asarray(compact_energy - stretched_energy)) > 1e-9 ++ ++ ++def test_nonlocal_ecp_callable_reports_component_energy_with_rng(): ++ ++ ++ ++ ++ hamil, phys_conf = lih_ecp_hamiltonian_and_conf() ++ params = params_fixture() ++ local_energy_fn = hamil.local_energy(deterministic_ansatz) ++ ++ rng = jax.random.PRNGKey(9) ++ expected_energy, expected_stats, _ = expected_local_energy_components( ++ hamil, rng, params, phys_conf ++ ) ++ energy, stats = local_energy_fn(rng, params, phys_conf) ++ ++ ++ ++ assert_scalar_close(energy, expected_energy) ++ assert_stats_close(stats, expected_stats) ++ assert abs(np.asarray(stats['hamil/V_nl'])) > 1e-9 +diff --git a/mimo_test_command.sh b/mimo_test_command.sh +new file mode 100755 +--- /dev/null ++++ b/mimo_test_command.sh +@@ -0,0 +1,21 @@ ++#!/usr/bin/env bash ++ ++ ++ ++ ++export NODE_OPTIONS="${NODE_OPTIONS:-} --max-old-space-size=4096" ++export MAVEN_OPTS="${MAVEN_OPTS:-} -Xmx3g -XX:+UseG1GC" ++export GRADLE_OPTS="${GRADLE_OPTS:-} -Xmx3g -XX:+UseG1GC" ++export TEST_JVM_OPTS="${TEST_JVM_OPTS:-} -Xmx3g" ++set -e ++cd /workspace/repo ++set -euo pipefail ++ ++cd /workspace/repo ++ ++export JAX_ENABLE_X64=True ++export NVIDIA_TF32_OVERRIDE=0 ++export PYTHONPATH=/workspace/repo/src:${PYTHONPATH:-} ++export PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 ++ ++exec python -m pytest /workspace/repo/usercase-test-coderl/test_molecular_local_energy.py -v diff --git a/tasks/format-code-task-000785/tests/test.sh b/tasks/format-code-task-000785/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..5a0ba038cc1fbd184045416e3e3022a2e338ddea --- /dev/null +++ b/tasks/format-code-task-000785/tests/test.sh @@ -0,0 +1,38 @@ +#!/bin/bash +# Code grading, mimoagent opensource_code.py: reset the files the hidden test patch touches, apply it, run the +# task's test command; reward 1 when it exits 0. A testbed failure (reset or apply) writes no reward: not scored. +M=/var/lib/mimo +CWD=/workspace/repo +V=/logs/verifier +mkdir -p "$V" +BASE=$(cat "$M/base" 2>/dev/null) || { echo "setup never ran (no $M/base)" >&2; exit 1; } +cd "$CWD" || exit 1 +if [ -d "$M/git-hidden" ]; then rm -rf "$CWD/.git"; mv "$M/git-hidden" "$CWD/.git"; fi +# the agent's change against the base, so its own commits count too +git add -A >/dev/null 2>&1 && git -c core.fileMode=false diff --cached "$BASE" > "$V/agent.diff" +git reset -q +if ! ( +while IFS= read -r tf; do + [ -z "$tf" ] && continue + if git cat-file -e $BASE:"$tf" 2>/dev/null; then + git checkout $BASE -- "$tf" 2>/dev/null || true + else + git rm -f --cached "$tf" >/dev/null 2>&1 || true + rm -f "$tf" + fi +done <<'EOF_RESET_TEST_FILES' +usercase-test-coderl/test_molecular_local_energy.py +mimo_test_command.sh +EOF_RESET_TEST_FILES + +); then echo "could not reset the test files (testbed problem, not scored)" >&2; exit 1; fi +if ! git apply --verbose /tests/test.patch > "$V/apply.log" 2>&1; then + cat "$V/apply.log" >&2 + echo "the hidden tests could not be applied (testbed problem, not scored)" >&2 + exit 1 +fi +timeout 1800 sh -c "$(cat /tests/test_command.sh)" > "$V/test_output.log" 2>&1 +RC=$? +tail -c 12000 "$V/test_output.log" +if [ $RC -eq 0 ]; then echo 1 > "$V/reward.txt"; else echo 0 > "$V/reward.txt"; fi +echo "test command exited $RC" diff --git a/tasks/format-code-task-000785/tests/test_command.sh b/tasks/format-code-task-000785/tests/test_command.sh new file mode 100644 index 0000000000000000000000000000000000000000..88cb7810b836396c4869db31aeac7d4d4b189685 --- /dev/null +++ b/tasks/format-code-task-000785/tests/test_command.sh @@ -0,0 +1 @@ +bash /workspace/repo/mimo_test_command.sh \ No newline at end of file diff --git a/tasks/format-code-task-000791/environment/Dockerfile b/tasks/format-code-task-000791/environment/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..3e411d4d8214f7fabbbad4ab377da22482c0e855 --- /dev/null +++ b/tasks/format-code-task-000791/environment/Dockerfile @@ -0,0 +1,3 @@ +# The task's image, pinned by digest (the same as [environment].docker_image). +# Setup runs at start from [environment.healthcheck]; environment/setup/ is its readable copy. +FROM docker.io/xiaomimimo/mimo-v2.6-rl-oss@sha256:a1d30af3c234e50c45cf4f980ec6dc86009ad543ae0e5dcfd00309cb8f7fc715 diff --git a/tasks/format-code-task-000791/environment/setup/files/blocklist b/tasks/format-code-task-000791/environment/setup/files/blocklist new file mode 100644 index 0000000000000000000000000000000000000000..a8e4bdc4c7d9b739c047a3cb58ea72a1bb05bcbc --- /dev/null +++ b/tasks/format-code-task-000791/environment/setup/files/blocklist @@ -0,0 +1,33 @@ +# mimo answer-leak blocklist (mimoagent) +0.0.0.0 github.com +0.0.0.0 www.github.com +0.0.0.0 api.github.com +0.0.0.0 raw.githubusercontent.com +0.0.0.0 codeload.github.com +0.0.0.0 objects.githubusercontent.com +0.0.0.0 gist.github.com +0.0.0.0 gist.githubusercontent.com +0.0.0.0 gitlab.com +0.0.0.0 bitbucket.org +0.0.0.0 sourceforge.net +0.0.0.0 git.kernel.org +0.0.0.0 chromium.googlesource.com +0.0.0.0 android.googlesource.com +0.0.0.0 sourcegraph.com +0.0.0.0 bugs.chromium.org +0.0.0.0 issues.oss-fuzz.com +0.0.0.0 oss-fuzz.com +0.0.0.0 osv.dev +0.0.0.0 api.osv.dev +0.0.0.0 bugzilla.mozilla.org +0.0.0.0 proxy.golang.org +0.0.0.0 sum.golang.org +0.0.0.0 pkg.go.dev +0.0.0.0 google.com +0.0.0.0 www.google.com +0.0.0.0 bing.com +0.0.0.0 www.bing.com +0.0.0.0 duckduckgo.com +0.0.0.0 html.duckduckgo.com +0.0.0.0 search.brave.com +0.0.0.0 stackoverflow.com diff --git a/tasks/format-code-task-000791/environment/setup/setup.sh b/tasks/format-code-task-000791/environment/setup/setup.sh new file mode 100644 index 0000000000000000000000000000000000000000..d883db90cfcfb48f7a139861bbe9f6b5d95cad6f --- /dev/null +++ b/tasks/format-code-task-000791/environment/setup/setup.sh @@ -0,0 +1,34 @@ +#!/bin/bash +# Runs once, as root, before the agent starts: Harbor's [environment.healthcheck] unpacks this folder into +# /var/lib/mimo and runs it. Generated by mimo_harbor; see its README for how each step maps to Xiaomi's harness. +M=/var/lib/mimo +[ -f "$M/ready" ] && exit 0 +chmod 700 "$M" +fail() { echo "setup: $*" >&2; exit 1; } +# the answer-leak blocklist (mimoagent), applied to /etc/hosts by the agent right after it installs +write_blocklist() { cp "$M/files/blocklist" "$M/blocklist"; } + +# Code: mimoagent environments/datasets/opensource_code.py + base.py, as the explorer runs it (app/runner/domains.py Code). +CWD=/testbed +git config --global --add safe.directory "$CWD" +cd "$CWD" || fail "no working directory $CWD" +if ! git rev-parse --git-dir >/dev/null 2>&1; then # a bare source tree: give it a baseline commit + git init -q && git add -A && git -c user.name=mimo -c user.email=mimo@localhost commit -q -m baseline --allow-empty +fi +BASE=$(git rev-parse HEAD 2>/dev/null) +[ ${#BASE} -eq 40 ] || fail "could not resolve the base commit in $CWD" +echo "$BASE" > "$M/base" +# Images are built with history truncated at the base. If one is not, the fix could be read out of git log, +# so .git is hidden while the agent works and put back for grading. +LATER=$(git rev-list --all --not "$BASE" 2>/dev/null | head -n 5 | grep -c . || true) +rm -f /tmp/fail.log /tmp/pass.log /tmp/patch.diff /tmp/test_patch.diff /tmp/*.log 2>/dev/null; rm -rf /tmp/claude-0 /tmp/claude-* /tmp/testem-* /tmp/puppeteer_dev_chrome_profile-* 2>/dev/null; rm -f /tmp/test_files.json 2>/dev/null; rm -rf /tmp/jest_* /tmp/jest-* /tmp/build /tmp/build_env 2>/dev/null; rm -rf /tmp/pytest-of-root /tmp/pytest-* /tmp/.pytest_cache /tmp/__pycache__ 2>/dev/null; rm -rf /tmp/go-build* /tmp/standards /tmp/wordpress /tmp/zig-* /tmp/testbase /tmp/testbed 2>/dev/null; rm -f /tmp/tmp*.tmp /tmp/*.bak /tmp/expect* /tmp/butwas* 2>/dev/null; rm -rf /root/.cache/go-build 2>/dev/null; rm -rf /tests 2>/dev/null; find /logs -mindepth 1 -delete 2>/dev/null; mkdir -p /logs/agent /logs/verifier /logs/artifacts; chmod 777 /logs/agent /logs/verifier /logs/artifacts; find /var/log -type f -delete 2>/dev/null || true; rm -rf /var/lib/postgresql/*/*/log /var/lib/postgresql/*/*/pg_log 2>/dev/null || true; find /var/lib/mysql /var/lib/mongodb -type f -name '*.log' -delete 2>/dev/null || true; rm -rf /root/.npm/_logs /root/.babel.json /root/.pytest_cache 2>/dev/null || true; find / -maxdepth 4 -xdev -name task_description.md -path '*/.build_env/*' -delete 2>/dev/null || true; true +git clean -fdx --exclude=node_modules --exclude=bower_components --exclude=.husky --exclude=vendor --exclude=third_party --exclude=_deps --exclude=vcpkg_installed --exclude=.venv --exclude=venv --exclude=.gradle --exclude=target --exclude=.build --exclude=lib --exclude=.bundle --exclude=Manifest.toml --exclude=_build --exclude=.stack-work --exclude=dist-newstyle >/dev/null 2>&1 +find /root/.m2 -type f \( -name '*-SNAPSHOT.jar' -o -name '*-SNAPSHOT-sources.jar' -o -name '*-SNAPSHOT-tests.jar' -o -name '*-SNAPSHOT-test-sources.jar' \) -delete 2>/dev/null; rm -rf /root/.julia/compiled 2>/dev/null; rm -rf /root/.gradle/caches/build-cache-* /root/.gradle/daemon 2>/dev/null; rm -rf /root/.gradle/caches/*/scripts /root/.gradle/caches/jars-* 2>/dev/null; rm -rf /root/.cache/bazel 2>/dev/null; true +if [ "$LATER" -gt 0 ]; then + mv "$CWD/.git" "$M/git-hidden" + echo "history not truncated at ${BASE:0:12}: .git hidden while the agent works" +fi +write_blocklist + +touch "$M/ready" +echo "setup done" diff --git a/tasks/format-code-task-000791/tests/test.patch b/tasks/format-code-task-000791/tests/test.patch new file mode 100644 index 0000000000000000000000000000000000000000..9a061d1aaebbbfe70e1aa68b7e8763bbf5a86b7a --- /dev/null +++ b/tasks/format-code-task-000791/tests/test.patch @@ -0,0 +1,68 @@ +diff --git a/gradle/spec/dependabot/gradle/file_parser/repositories_finder_spec.rb b/gradle/spec/dependabot/gradle/file_parser/repositories_finder_spec.rb +index 0496fc338ff..b73db8ec938 100644 +--- a/gradle/spec/dependabot/gradle/file_parser/repositories_finder_spec.rb ++++ b/gradle/spec/dependabot/gradle/file_parser/repositories_finder_spec.rb +@@ -116,6 +116,20 @@ + end + end + ++ context "that use an assignment operator and a strict URI" do ++ let(:buildfile_fixture_name) { "custom_repos_build_assignment_uri.gradle" } ++ ++ it "includes the additional declarations" do ++ expect(repository_urls).to match_array( ++ %w( ++ https://maven.google.com ++ https://uri-helper.com ++ https://java-constructor.com ++ ) ++ ) ++ end ++ end ++ + context "with kotlin" do + let(:buildfile_fixture_name) { "root_build.gradle.kts" } + +diff --git a/gradle/spec/fixtures/buildfiles/.gitignore b/gradle/spec/fixtures/buildfiles/.gitignore +new file mode 100644 +index 00000000000..da88288c09e +--- /dev/null ++++ b/gradle/spec/fixtures/buildfiles/.gitignore +@@ -0,0 +1 @@ ++/.gradle/ +diff --git a/gradle/spec/fixtures/buildfiles/custom_repos_build_assignment_uri.gradle b/gradle/spec/fixtures/buildfiles/custom_repos_build_assignment_uri.gradle +new file mode 100644 +index 00000000000..8a8ef893c87 +--- /dev/null ++++ b/gradle/spec/fixtures/buildfiles/custom_repos_build_assignment_uri.gradle +@@ -0,0 +1,9 @@ ++apply plugin: 'java' ++ ++repositories { ++ maven { url = uri('https://uri-helper.com') } ++ maven { url = new java.net.URI('https://java-constructor.com') } ++ ++ google() ++} ++ +diff --git a/mimo_build_env.tar.gz.b64 b/mimo_build_env.tar.gz.b64 +new file mode 100644 +--- /dev/null ++++ b/mimo_build_env.tar.gz.b64 +@@ -0,0 +1,5 @@ ++H4sIAAAAAAAAA+3R3WrDIBgG4BznKryCGNNoLkdi/LoJVoOassufzRgdg60nLWPb+xz4KSr+vJ3Z ++nLeawpk3j9JXk5R7rT7XvS/k0A9qlIdpanohlBgbJh92ow+2XObEWJNiLN+tuzX/S3XX/Avlopd4 ++Os3Bdvn5fmfcyl8odc3/MNb8RzXU/Pv7XeFr/zz/xbI9eEO2rf2nNFtPrdlCLcyF+jnevw/phRaW ++8lrbS8MtrRTsbGLhb/v40XnS65wyJZ5ojdmVmBxlfXTBUtKXbV0y7U+/GgAAAAAAAAAAAAAAAAAA ++AADgb3gFh+Y0mAAoAAA= +diff --git a/mimo_test_command.sh b/mimo_test_command.sh +new file mode 100755 +--- /dev/null ++++ b/mimo_test_command.sh +@@ -0,0 +1,6 @@ ++#!/usr/bin/env bash ++ ++set -uo pipefail ++cd /testbed || exit 1 ++base64 -d mimo_build_env.tar.gz.b64 | tar -xzf - -C /testbed || exit 1 ++exec bash -lc 'cd /testbed && bash -eo pipefail /testbed/.build_env/test_command.sh' diff --git a/tasks/format-code-task-000791/tests/test.sh b/tasks/format-code-task-000791/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..9b49fe4542aa8bff6d5cb44671dcaf2e93d139fb --- /dev/null +++ b/tasks/format-code-task-000791/tests/test.sh @@ -0,0 +1,41 @@ +#!/bin/bash +# Code grading, mimoagent opensource_code.py: reset the files the hidden test patch touches, apply it, run the +# task's test command; reward 1 when it exits 0. A testbed failure (reset or apply) writes no reward: not scored. +M=/var/lib/mimo +CWD=/testbed +V=/logs/verifier +mkdir -p "$V" +BASE=$(cat "$M/base" 2>/dev/null) || { echo "setup never ran (no $M/base)" >&2; exit 1; } +cd "$CWD" || exit 1 +if [ -d "$M/git-hidden" ]; then rm -rf "$CWD/.git"; mv "$M/git-hidden" "$CWD/.git"; fi +# the agent's change against the base, so its own commits count too +git add -A >/dev/null 2>&1 && git -c core.fileMode=false diff --cached "$BASE" > "$V/agent.diff" +git reset -q +if ! ( +while IFS= read -r tf; do + [ -z "$tf" ] && continue + if git cat-file -e $BASE:"$tf" 2>/dev/null; then + git checkout $BASE -- "$tf" 2>/dev/null || true + else + git rm -f --cached "$tf" >/dev/null 2>&1 || true + rm -f "$tf" + fi +done <<'EOF_RESET_TEST_FILES' +gradle/spec/dependabot/gradle/file_parser/repositories_finder_spec.rb +gradle/spec/fixtures/buildfiles/.gitignore +gradle/spec/fixtures/buildfiles/custom_repos_build_assignment_uri.gradle +mimo_build_env.tar.gz.b64 +mimo_test_command.sh +EOF_RESET_TEST_FILES + +); then echo "could not reset the test files (testbed problem, not scored)" >&2; exit 1; fi +if ! git apply --verbose /tests/test.patch > "$V/apply.log" 2>&1; then + cat "$V/apply.log" >&2 + echo "the hidden tests could not be applied (testbed problem, not scored)" >&2 + exit 1 +fi +timeout 1800 sh -c "$(cat /tests/test_command.sh)" > "$V/test_output.log" 2>&1 +RC=$? +tail -c 12000 "$V/test_output.log" +if [ $RC -eq 0 ]; then echo 1 > "$V/reward.txt"; else echo 0 > "$V/reward.txt"; fi +echo "test command exited $RC" diff --git a/tasks/format-code-task-000791/tests/test_command.sh b/tasks/format-code-task-000791/tests/test_command.sh new file mode 100644 index 0000000000000000000000000000000000000000..7cb23076694ad17d72e8296d62b2b240083e36db --- /dev/null +++ b/tasks/format-code-task-000791/tests/test_command.sh @@ -0,0 +1 @@ +bash /testbed/mimo_test_command.sh \ No newline at end of file diff --git a/tasks/format-code-task-000796/environment/Dockerfile b/tasks/format-code-task-000796/environment/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..c5456128f2ad73cb295c6e267e8e4085a96358e7 --- /dev/null +++ b/tasks/format-code-task-000796/environment/Dockerfile @@ -0,0 +1,3 @@ +# The task's image, pinned by digest (the same as [environment].docker_image). +# Setup runs at start from [environment.healthcheck]; environment/setup/ is its readable copy. +FROM docker.io/xiaomimimo/mimo-v2.6-rl-oss@sha256:54398a6a411db7cc75c89fa581a3984938a619fb86f637f3faf3b82e82d2d15c diff --git a/tasks/format-code-task-000796/environment/setup/files/blocklist b/tasks/format-code-task-000796/environment/setup/files/blocklist new file mode 100644 index 0000000000000000000000000000000000000000..a8e4bdc4c7d9b739c047a3cb58ea72a1bb05bcbc --- /dev/null +++ b/tasks/format-code-task-000796/environment/setup/files/blocklist @@ -0,0 +1,33 @@ +# mimo answer-leak blocklist (mimoagent) +0.0.0.0 github.com +0.0.0.0 www.github.com +0.0.0.0 api.github.com +0.0.0.0 raw.githubusercontent.com +0.0.0.0 codeload.github.com +0.0.0.0 objects.githubusercontent.com +0.0.0.0 gist.github.com +0.0.0.0 gist.githubusercontent.com +0.0.0.0 gitlab.com +0.0.0.0 bitbucket.org +0.0.0.0 sourceforge.net +0.0.0.0 git.kernel.org +0.0.0.0 chromium.googlesource.com +0.0.0.0 android.googlesource.com +0.0.0.0 sourcegraph.com +0.0.0.0 bugs.chromium.org +0.0.0.0 issues.oss-fuzz.com +0.0.0.0 oss-fuzz.com +0.0.0.0 osv.dev +0.0.0.0 api.osv.dev +0.0.0.0 bugzilla.mozilla.org +0.0.0.0 proxy.golang.org +0.0.0.0 sum.golang.org +0.0.0.0 pkg.go.dev +0.0.0.0 google.com +0.0.0.0 www.google.com +0.0.0.0 bing.com +0.0.0.0 www.bing.com +0.0.0.0 duckduckgo.com +0.0.0.0 html.duckduckgo.com +0.0.0.0 search.brave.com +0.0.0.0 stackoverflow.com diff --git a/tasks/format-code-task-000796/environment/setup/setup.sh b/tasks/format-code-task-000796/environment/setup/setup.sh new file mode 100644 index 0000000000000000000000000000000000000000..d883db90cfcfb48f7a139861bbe9f6b5d95cad6f --- /dev/null +++ b/tasks/format-code-task-000796/environment/setup/setup.sh @@ -0,0 +1,34 @@ +#!/bin/bash +# Runs once, as root, before the agent starts: Harbor's [environment.healthcheck] unpacks this folder into +# /var/lib/mimo and runs it. Generated by mimo_harbor; see its README for how each step maps to Xiaomi's harness. +M=/var/lib/mimo +[ -f "$M/ready" ] && exit 0 +chmod 700 "$M" +fail() { echo "setup: $*" >&2; exit 1; } +# the answer-leak blocklist (mimoagent), applied to /etc/hosts by the agent right after it installs +write_blocklist() { cp "$M/files/blocklist" "$M/blocklist"; } + +# Code: mimoagent environments/datasets/opensource_code.py + base.py, as the explorer runs it (app/runner/domains.py Code). +CWD=/testbed +git config --global --add safe.directory "$CWD" +cd "$CWD" || fail "no working directory $CWD" +if ! git rev-parse --git-dir >/dev/null 2>&1; then # a bare source tree: give it a baseline commit + git init -q && git add -A && git -c user.name=mimo -c user.email=mimo@localhost commit -q -m baseline --allow-empty +fi +BASE=$(git rev-parse HEAD 2>/dev/null) +[ ${#BASE} -eq 40 ] || fail "could not resolve the base commit in $CWD" +echo "$BASE" > "$M/base" +# Images are built with history truncated at the base. If one is not, the fix could be read out of git log, +# so .git is hidden while the agent works and put back for grading. +LATER=$(git rev-list --all --not "$BASE" 2>/dev/null | head -n 5 | grep -c . || true) +rm -f /tmp/fail.log /tmp/pass.log /tmp/patch.diff /tmp/test_patch.diff /tmp/*.log 2>/dev/null; rm -rf /tmp/claude-0 /tmp/claude-* /tmp/testem-* /tmp/puppeteer_dev_chrome_profile-* 2>/dev/null; rm -f /tmp/test_files.json 2>/dev/null; rm -rf /tmp/jest_* /tmp/jest-* /tmp/build /tmp/build_env 2>/dev/null; rm -rf /tmp/pytest-of-root /tmp/pytest-* /tmp/.pytest_cache /tmp/__pycache__ 2>/dev/null; rm -rf /tmp/go-build* /tmp/standards /tmp/wordpress /tmp/zig-* /tmp/testbase /tmp/testbed 2>/dev/null; rm -f /tmp/tmp*.tmp /tmp/*.bak /tmp/expect* /tmp/butwas* 2>/dev/null; rm -rf /root/.cache/go-build 2>/dev/null; rm -rf /tests 2>/dev/null; find /logs -mindepth 1 -delete 2>/dev/null; mkdir -p /logs/agent /logs/verifier /logs/artifacts; chmod 777 /logs/agent /logs/verifier /logs/artifacts; find /var/log -type f -delete 2>/dev/null || true; rm -rf /var/lib/postgresql/*/*/log /var/lib/postgresql/*/*/pg_log 2>/dev/null || true; find /var/lib/mysql /var/lib/mongodb -type f -name '*.log' -delete 2>/dev/null || true; rm -rf /root/.npm/_logs /root/.babel.json /root/.pytest_cache 2>/dev/null || true; find / -maxdepth 4 -xdev -name task_description.md -path '*/.build_env/*' -delete 2>/dev/null || true; true +git clean -fdx --exclude=node_modules --exclude=bower_components --exclude=.husky --exclude=vendor --exclude=third_party --exclude=_deps --exclude=vcpkg_installed --exclude=.venv --exclude=venv --exclude=.gradle --exclude=target --exclude=.build --exclude=lib --exclude=.bundle --exclude=Manifest.toml --exclude=_build --exclude=.stack-work --exclude=dist-newstyle >/dev/null 2>&1 +find /root/.m2 -type f \( -name '*-SNAPSHOT.jar' -o -name '*-SNAPSHOT-sources.jar' -o -name '*-SNAPSHOT-tests.jar' -o -name '*-SNAPSHOT-test-sources.jar' \) -delete 2>/dev/null; rm -rf /root/.julia/compiled 2>/dev/null; rm -rf /root/.gradle/caches/build-cache-* /root/.gradle/daemon 2>/dev/null; rm -rf /root/.gradle/caches/*/scripts /root/.gradle/caches/jars-* 2>/dev/null; rm -rf /root/.cache/bazel 2>/dev/null; true +if [ "$LATER" -gt 0 ]; then + mv "$CWD/.git" "$M/git-hidden" + echo "history not truncated at ${BASE:0:12}: .git hidden while the agent works" +fi +write_blocklist + +touch "$M/ready" +echo "setup done" diff --git a/tasks/format-code-task-000796/tests/test.patch b/tasks/format-code-task-000796/tests/test.patch new file mode 100644 index 0000000000000000000000000000000000000000..87ae6fdc2e1a9da7b364d5ceb0421d5b06b5feb9 --- /dev/null +++ b/tasks/format-code-task-000796/tests/test.patch @@ -0,0 +1,345 @@ +diff --git a/test/api/api-test.js b/test/api/api-test.js +index 6760673..2b74591 100644 +--- a/test/api/api-test.js ++++ b/test/api/api-test.js +@@ -2,33 +2,27 @@ import JsonApi from '../../index' + import mockResponse from '../helpers/mock-response' + import expect from 'expect.js' + +-let Context = { +- jsonApi: null +-} +- + describe('JsonApi', ()=> { + ++ var jsonApi = null + beforeEach(()=> { +- Context.jsonApi = JsonApi.getInstance() +- Context.jsonApi.setup('http://myapi.com') +- Context.jsonApi.resetMiddleware() ++ jsonApi = new JsonApi('http://myapi.com') + }) + + it('should set the apiUrl during setup', ()=> { +- expect(Context.jsonApi.apiUrl).to.eql('http://myapi.com') ++ expect(jsonApi.apiUrl).to.eql('http://myapi.com') + }) + + it('should expose the serialize and deserialize objects', ()=> { +- expect(Context.jsonApi.serialize.collection).to.be.a('function') +- expect(Context.jsonApi.serialize.resource).to.be.a('function') +- expect(Context.jsonApi.deserialize.collection).to.be.a('function') +- expect(Context.jsonApi.deserialize.resource).to.be.a('function') +- ++ expect(jsonApi.serialize.collection).to.be.a('function') ++ expect(jsonApi.serialize.resource).to.be.a('function') ++ expect(jsonApi.deserialize.collection).to.be.a('function') ++ expect(jsonApi.deserialize.resource).to.be.a('function') + }) + + it('should have a empty models and middleware properties after instantiation', ()=> { +- expect(Context.jsonApi.models).to.be.an('object') +- expect(Context.jsonApi.middleware).to.be.an('array') ++ expect(jsonApi.models).to.be.an('object') ++ expect(jsonApi.middleware).to.be.an('array') + }) + + it('should allow users to register middleware', ()=> { +@@ -41,74 +35,74 @@ describe('JsonApi', ()=> { + return res + } + } +- Context.jsonApi.middleware.unshift(catMiddleWare) +- expect(Context.jsonApi.middleware[0].name).to.eql('cat-middleware') ++ jsonApi.middleware.unshift(catMiddleWare) ++ expect(jsonApi.middleware[0].name).to.eql('cat-middleware') + }) + + it('should initialize with an empty headers object', ()=> { +- expect(Context.jsonApi.headers).to.be.an('object') +- expect(Context.jsonApi.headers).to.eql({}) ++ expect(jsonApi.headers).to.be.an('object') ++ expect(jsonApi.headers).to.eql({}) + }) + + it('should allow users to add headers', ()=> { +- Context.jsonApi.headers['A-Header-Name'] = 'a value' +- expect(Context.jsonApi.headers).to.eql({ ++ jsonApi.headers['A-Header-Name'] = 'a value' ++ expect(jsonApi.headers).to.eql({ + 'A-Header-Name':'a value' + }) + }) + + it('should allow users to register middleware before or after existing middleware', ()=> { +- let responseMiddleware = Context.jsonApi.middleware.filter(middleware => middleware.name === 'response')[0] ++ let responseMiddleware = jsonApi.middleware.filter(middleware => middleware.name === 'response')[0] + let beforeMiddleware = { + name: 'before' + } + let afterMiddleware = { + name: 'after' + } +- let index = Context.jsonApi.middleware.indexOf(responseMiddleware) +- Context.jsonApi.insertMiddlewareBefore('response', beforeMiddleware) +- Context.jsonApi.insertMiddlewareAfter('response', afterMiddleware) +- expect(Context.jsonApi.middleware.indexOf(beforeMiddleware)).to.eql(index) +- expect(Context.jsonApi.middleware.indexOf(afterMiddleware)).to.eql(index + 2) ++ let index = jsonApi.middleware.indexOf(responseMiddleware) ++ jsonApi.insertMiddlewareBefore('response', beforeMiddleware) ++ jsonApi.insertMiddlewareAfter('response', afterMiddleware) ++ expect(jsonApi.middleware.indexOf(beforeMiddleware)).to.eql(index) ++ expect(jsonApi.middleware.indexOf(afterMiddleware)).to.eql(index + 2) + }) + + it('should allow users to define models', ()=> { +- Context.jsonApi.define('product', { ++ jsonApi.define('product', { + id: '', + title: '' + }) +- expect(Context.jsonApi.models['product']).to.be.an('object') +- expect(Context.jsonApi.models['product']['attributes']).to.have.key('id') +- expect(Context.jsonApi.models['product']['attributes']).to.have.key('title') ++ expect(jsonApi.models['product']).to.be.an('object') ++ expect(jsonApi.models['product']['attributes']).to.have.key('id') ++ expect(jsonApi.models['product']['attributes']).to.have.key('title') + }) + + it('should construct collection paths for models', ()=> { +- Context.jsonApi.define('product', {}) +- expect(Context.jsonApi.collectionPathFor('product')).to.eql('products') ++ jsonApi.define('product', {}) ++ expect(jsonApi.collectionPathFor('product')).to.eql('products') + }) + + it('should allow overrides for collection paths', ()=> { +- Context.jsonApi.define('product', {}, {collectionPath: 'my-products'}) +- expect(Context.jsonApi.collectionPathFor('product')).to.eql('my-products') ++ jsonApi.define('product', {}, {collectionPath: 'my-products'}) ++ expect(jsonApi.collectionPathFor('product')).to.eql('my-products') + }) + + it('should construct single resource paths for models', ()=> { +- Context.jsonApi.define('product', {}) +- expect(Context.jsonApi.resourcePathFor('product', 1)).to.eql('products/1') ++ jsonApi.define('product', {}) ++ expect(jsonApi.resourcePathFor('product', 1)).to.eql('products/1') + }) + + it('should construct collection urls for models', ()=> { +- Context.jsonApi.define('product', {}) +- expect(Context.jsonApi.collectionUrlFor('product')).to.eql('http://myapi.com/products') ++ jsonApi.define('product', {}) ++ expect(jsonApi.collectionUrlFor('product')).to.eql('http://myapi.com/products') + }) + + it('should construct single resource urls for models', ()=> { +- Context.jsonApi.define('product', {}) +- expect(Context.jsonApi.resourceUrlFor('product', 1)).to.eql('http://myapi.com/products/1') ++ jsonApi.define('product', {}) ++ expect(jsonApi.resourceUrlFor('product', 1)).to.eql('http://myapi.com/products/1') + }) + + it('should make basic find calls', (done)=> { +- mockResponse(Context.jsonApi, { ++ mockResponse(jsonApi, { + data: { + data: { + id: '1', +@@ -119,10 +113,10 @@ describe('JsonApi', ()=> { + } + } + }) +- Context.jsonApi.define('product', { ++ jsonApi.define('product', { + title: '' + }) +- Context.jsonApi.find('product', 1).then((product)=> { ++ jsonApi.find('product', 1).then((product)=> { + expect(product.id).to.eql('1') + expect(product.title).to.eql('Some Title') + done() +@@ -130,7 +124,7 @@ describe('JsonApi', ()=> { + }) + + it('should make basic findAll calls', (done)=> { +- mockResponse(Context.jsonApi, { ++ mockResponse(jsonApi, { + data: { + data: [ + { +@@ -150,10 +144,10 @@ describe('JsonApi', ()=> { + ] + } + }) +- Context.jsonApi.define('product', { ++ jsonApi.define('product', { + title: '' + }) +- Context.jsonApi.findAll('product').then((products)=> { ++ jsonApi.findAll('product').then((products)=> { + expect(products[0].id).to.eql('1') + expect(products[0].title).to.eql('Some Title') + expect(products[1].id).to.eql('2') +@@ -163,7 +157,7 @@ describe('JsonApi', ()=> { + }) + + it('should include meta information on response objects', (done)=> { +- mockResponse(Context.jsonApi, { ++ mockResponse(jsonApi, { + data: { + meta: { + totalObjects: 1 +@@ -177,10 +171,10 @@ describe('JsonApi', ()=> { + }] + } + }) +- Context.jsonApi.define('product', { ++ jsonApi.define('product', { + title: '' + }) +- Context.jsonApi.findAll('product').then((products)=> { ++ jsonApi.findAll('product').then((products)=> { + expect(products.meta.totalObjects).to.eql(1) + expect(products[0].id).to.eql('1') + expect(products[0].title).to.eql('Some Title') +diff --git a/test/api/deserialize-test.js b/test/api/deserialize-test.js +index fd7cb7f..5e65b5d 100644 +--- a/test/api/deserialize-test.js ++++ b/test/api/deserialize-test.js +@@ -5,15 +5,12 @@ import expect from 'expect.js' + + describe('deserialize', ()=> { + +- afterEach(()=> { +- let jsonApi = JsonApi.getInstance() +- jsonApi.setup('http://myapi.com') +- jsonApi.resetMiddleware() ++ var jsonApi = null ++ before(()=> { ++ jsonApi = new JsonApi('http://myapi.com') + }) + + it('should deserialize single resource items', ()=> { +- let jsonApi = JsonApi.getInstance() +- jsonApi.setup('http://myapi.com') + jsonApi.define('product', { + title: '', + about: '' +@@ -35,8 +32,6 @@ describe('deserialize', ()=> { + }) + + it('should deserialize hasMany relations', ()=> { +- let jsonApi = JsonApi.getInstance() +- jsonApi.setup('http://myapi.com') + jsonApi.define('product', { + title: '', + tags: { +@@ -85,8 +80,6 @@ describe('deserialize', ()=> { + }) + + it('should deserialize collections of resource items', ()=> { +- let jsonApi = JsonApi.getInstance() +- jsonApi.setup('http://myapi.com') + jsonApi.define('product', { + title: '', + about: '' +diff --git a/test/api/serialize-test.js b/test/api/serialize-test.js +index bf3bfbb..e21836f 100644 +--- a/test/api/serialize-test.js ++++ b/test/api/serialize-test.js +@@ -5,15 +5,12 @@ import expect from 'expect.js' + + describe('serialize', ()=> { + +- afterEach(()=> { +- let jsonApi = JsonApi.getInstance() +- jsonApi.setup('http://myapi.com') +- jsonApi.resetMiddleware() ++ var jsonApi = null ++ beforeEach(()=> { ++ jsonApi = new JsonApi('http://myapi.com') + }) + + it('should serialize resource items', ()=> { +- let jsonApi = JsonApi.getInstance() +- jsonApi.setup('http://myapi.com') + jsonApi.define('product', { + title: '', + about: '' +@@ -25,8 +22,6 @@ describe('serialize', ()=> { + }) + + it('should serialize hasMany relationships', ()=> { +- let jsonApi = JsonApi.getInstance() +- jsonApi.setup('http://myapi.com') + jsonApi.define('product', { + title: '', + about: '', +@@ -57,8 +52,6 @@ describe('serialize', ()=> { + }) + + it('should serialize hasOne relationships', ()=> { +- let jsonApi = JsonApi.getInstance() +- jsonApi.setup('http://myapi.com') + jsonApi.define('product', { + title: '', + about: '', +@@ -81,8 +74,6 @@ describe('serialize', ()=> { + }) + + it('should not serialize read only attributes', ()=> { +- let jsonApi = JsonApi.getInstance() +- jsonApi.setup('http://myapi.com') + jsonApi.define('product', { + title: '', + about: '', +@@ -102,8 +93,6 @@ describe('serialize', ()=> { + }) + + it('should serialize collections of items', ()=> { +- let jsonApi = JsonApi.getInstance() +- jsonApi.setup('http://myapi.com') + jsonApi.define('product', { + title: '', + about: '' +@@ -120,8 +109,6 @@ describe('serialize', ()=> { + }) + + it('should serialize the id of items if present', ()=> { +- let jsonApi = JsonApi.getInstance() +- jsonApi.setup('http://myapi.com') + jsonApi.define('product', {title: ''}) + let serializedItem = serialize.resource.call(jsonApi, 'product', {id: '5', title: 'Hello'}) + expect(serializedItem.type).to.eql('products') +@@ -129,8 +116,6 @@ describe('serialize', ()=> { + }) + + it('should allow for custom serialization if present on the model', ()=> { +- let jsonApi = JsonApi.getInstance() +- jsonApi.setup('http://myapi.com') + jsonApi.define('product', {title: ''}, {serializer: ()=> { + return { + custom: true +diff --git a/mimo_build_env.tar.gz.b64 b/mimo_build_env.tar.gz.b64 +new file mode 100644 +--- /dev/null ++++ b/mimo_build_env.tar.gz.b64 +@@ -0,0 +1,5 @@ ++H4sIAAAAAAAAA+3S0UrDMBQG4F7vKc4LtF1a04IXvspIm6PLSNOSpEN8etMKThy6mw0V/w9KknMC ++CflbdLOxesfuWGa3sk1aKdcx+TyucyErUdVb0dapLoRs64zkzW70wRyi8kSZH8f43b5L/T+qOOUf ++OcRdPw6DcroI++udcSn/qqnf82/aKuV/1wiZ0fZ6V/jaP8+/17QG37HeuGkg49J7WEt57sZczdrE ++t+nj7DRVD6XmY+lma9PmZxrGfq9SP/00k7HsAx3Cfac6tqnkufT8ZEJkT8sJpZrM8uXLojiEU1Fz ++YG+UNS983jxrbX76yQAAAAAAAAAAAAAAAAAAAAAAfo1XquHBdQAoAAA= +diff --git a/mimo_test_command.sh b/mimo_test_command.sh +new file mode 100755 +--- /dev/null ++++ b/mimo_test_command.sh +@@ -0,0 +1,6 @@ ++#!/usr/bin/env bash ++ ++set -uo pipefail ++cd /testbed || exit 1 ++base64 -d mimo_build_env.tar.gz.b64 | tar -xzf - -C /testbed || exit 1 ++exec bash -lc 'cd /testbed && bash -eo pipefail /testbed/.build_env/test_command.sh' diff --git a/tasks/format-code-task-000796/tests/test.sh b/tasks/format-code-task-000796/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..d1da2c3bb56cdf6ff84be074e1c3aa52a0dbc0fd --- /dev/null +++ b/tasks/format-code-task-000796/tests/test.sh @@ -0,0 +1,41 @@ +#!/bin/bash +# Code grading, mimoagent opensource_code.py: reset the files the hidden test patch touches, apply it, run the +# task's test command; reward 1 when it exits 0. A testbed failure (reset or apply) writes no reward: not scored. +M=/var/lib/mimo +CWD=/testbed +V=/logs/verifier +mkdir -p "$V" +BASE=$(cat "$M/base" 2>/dev/null) || { echo "setup never ran (no $M/base)" >&2; exit 1; } +cd "$CWD" || exit 1 +if [ -d "$M/git-hidden" ]; then rm -rf "$CWD/.git"; mv "$M/git-hidden" "$CWD/.git"; fi +# the agent's change against the base, so its own commits count too +git add -A >/dev/null 2>&1 && git -c core.fileMode=false diff --cached "$BASE" > "$V/agent.diff" +git reset -q +if ! ( +while IFS= read -r tf; do + [ -z "$tf" ] && continue + if git cat-file -e $BASE:"$tf" 2>/dev/null; then + git checkout $BASE -- "$tf" 2>/dev/null || true + else + git rm -f --cached "$tf" >/dev/null 2>&1 || true + rm -f "$tf" + fi +done <<'EOF_RESET_TEST_FILES' +test/api/api-test.js +test/api/deserialize-test.js +test/api/serialize-test.js +mimo_build_env.tar.gz.b64 +mimo_test_command.sh +EOF_RESET_TEST_FILES + +); then echo "could not reset the test files (testbed problem, not scored)" >&2; exit 1; fi +if ! git apply --verbose /tests/test.patch > "$V/apply.log" 2>&1; then + cat "$V/apply.log" >&2 + echo "the hidden tests could not be applied (testbed problem, not scored)" >&2 + exit 1 +fi +timeout 1800 sh -c "$(cat /tests/test_command.sh)" > "$V/test_output.log" 2>&1 +RC=$? +tail -c 12000 "$V/test_output.log" +if [ $RC -eq 0 ]; then echo 1 > "$V/reward.txt"; else echo 0 > "$V/reward.txt"; fi +echo "test command exited $RC" diff --git a/tasks/format-code-task-000796/tests/test_command.sh b/tasks/format-code-task-000796/tests/test_command.sh new file mode 100644 index 0000000000000000000000000000000000000000..7cb23076694ad17d72e8296d62b2b240083e36db --- /dev/null +++ b/tasks/format-code-task-000796/tests/test_command.sh @@ -0,0 +1 @@ +bash /testbed/mimo_test_command.sh \ No newline at end of file diff --git a/tasks/format-code-task-000798/environment/Dockerfile b/tasks/format-code-task-000798/environment/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..97817f13ad4daa8767f3eb97b23e62d254ac1fb2 --- /dev/null +++ b/tasks/format-code-task-000798/environment/Dockerfile @@ -0,0 +1,3 @@ +# The task's image, pinned by digest (the same as [environment].docker_image). +# Setup runs at start from [environment.healthcheck]; environment/setup/ is its readable copy. +FROM docker.io/xiaomimimo/mimo-v2.6-rl-oss@sha256:b3546b05738281528e8b62c58599b9aa937ffa4f3b81e4137d9f867836489120 diff --git a/tasks/format-code-task-000798/environment/setup/files/blocklist b/tasks/format-code-task-000798/environment/setup/files/blocklist new file mode 100644 index 0000000000000000000000000000000000000000..a8e4bdc4c7d9b739c047a3cb58ea72a1bb05bcbc --- /dev/null +++ b/tasks/format-code-task-000798/environment/setup/files/blocklist @@ -0,0 +1,33 @@ +# mimo answer-leak blocklist (mimoagent) +0.0.0.0 github.com +0.0.0.0 www.github.com +0.0.0.0 api.github.com +0.0.0.0 raw.githubusercontent.com +0.0.0.0 codeload.github.com +0.0.0.0 objects.githubusercontent.com +0.0.0.0 gist.github.com +0.0.0.0 gist.githubusercontent.com +0.0.0.0 gitlab.com +0.0.0.0 bitbucket.org +0.0.0.0 sourceforge.net +0.0.0.0 git.kernel.org +0.0.0.0 chromium.googlesource.com +0.0.0.0 android.googlesource.com +0.0.0.0 sourcegraph.com +0.0.0.0 bugs.chromium.org +0.0.0.0 issues.oss-fuzz.com +0.0.0.0 oss-fuzz.com +0.0.0.0 osv.dev +0.0.0.0 api.osv.dev +0.0.0.0 bugzilla.mozilla.org +0.0.0.0 proxy.golang.org +0.0.0.0 sum.golang.org +0.0.0.0 pkg.go.dev +0.0.0.0 google.com +0.0.0.0 www.google.com +0.0.0.0 bing.com +0.0.0.0 www.bing.com +0.0.0.0 duckduckgo.com +0.0.0.0 html.duckduckgo.com +0.0.0.0 search.brave.com +0.0.0.0 stackoverflow.com diff --git a/tasks/format-code-task-000798/environment/setup/setup.sh b/tasks/format-code-task-000798/environment/setup/setup.sh new file mode 100644 index 0000000000000000000000000000000000000000..d883db90cfcfb48f7a139861bbe9f6b5d95cad6f --- /dev/null +++ b/tasks/format-code-task-000798/environment/setup/setup.sh @@ -0,0 +1,34 @@ +#!/bin/bash +# Runs once, as root, before the agent starts: Harbor's [environment.healthcheck] unpacks this folder into +# /var/lib/mimo and runs it. Generated by mimo_harbor; see its README for how each step maps to Xiaomi's harness. +M=/var/lib/mimo +[ -f "$M/ready" ] && exit 0 +chmod 700 "$M" +fail() { echo "setup: $*" >&2; exit 1; } +# the answer-leak blocklist (mimoagent), applied to /etc/hosts by the agent right after it installs +write_blocklist() { cp "$M/files/blocklist" "$M/blocklist"; } + +# Code: mimoagent environments/datasets/opensource_code.py + base.py, as the explorer runs it (app/runner/domains.py Code). +CWD=/testbed +git config --global --add safe.directory "$CWD" +cd "$CWD" || fail "no working directory $CWD" +if ! git rev-parse --git-dir >/dev/null 2>&1; then # a bare source tree: give it a baseline commit + git init -q && git add -A && git -c user.name=mimo -c user.email=mimo@localhost commit -q -m baseline --allow-empty +fi +BASE=$(git rev-parse HEAD 2>/dev/null) +[ ${#BASE} -eq 40 ] || fail "could not resolve the base commit in $CWD" +echo "$BASE" > "$M/base" +# Images are built with history truncated at the base. If one is not, the fix could be read out of git log, +# so .git is hidden while the agent works and put back for grading. +LATER=$(git rev-list --all --not "$BASE" 2>/dev/null | head -n 5 | grep -c . || true) +rm -f /tmp/fail.log /tmp/pass.log /tmp/patch.diff /tmp/test_patch.diff /tmp/*.log 2>/dev/null; rm -rf /tmp/claude-0 /tmp/claude-* /tmp/testem-* /tmp/puppeteer_dev_chrome_profile-* 2>/dev/null; rm -f /tmp/test_files.json 2>/dev/null; rm -rf /tmp/jest_* /tmp/jest-* /tmp/build /tmp/build_env 2>/dev/null; rm -rf /tmp/pytest-of-root /tmp/pytest-* /tmp/.pytest_cache /tmp/__pycache__ 2>/dev/null; rm -rf /tmp/go-build* /tmp/standards /tmp/wordpress /tmp/zig-* /tmp/testbase /tmp/testbed 2>/dev/null; rm -f /tmp/tmp*.tmp /tmp/*.bak /tmp/expect* /tmp/butwas* 2>/dev/null; rm -rf /root/.cache/go-build 2>/dev/null; rm -rf /tests 2>/dev/null; find /logs -mindepth 1 -delete 2>/dev/null; mkdir -p /logs/agent /logs/verifier /logs/artifacts; chmod 777 /logs/agent /logs/verifier /logs/artifacts; find /var/log -type f -delete 2>/dev/null || true; rm -rf /var/lib/postgresql/*/*/log /var/lib/postgresql/*/*/pg_log 2>/dev/null || true; find /var/lib/mysql /var/lib/mongodb -type f -name '*.log' -delete 2>/dev/null || true; rm -rf /root/.npm/_logs /root/.babel.json /root/.pytest_cache 2>/dev/null || true; find / -maxdepth 4 -xdev -name task_description.md -path '*/.build_env/*' -delete 2>/dev/null || true; true +git clean -fdx --exclude=node_modules --exclude=bower_components --exclude=.husky --exclude=vendor --exclude=third_party --exclude=_deps --exclude=vcpkg_installed --exclude=.venv --exclude=venv --exclude=.gradle --exclude=target --exclude=.build --exclude=lib --exclude=.bundle --exclude=Manifest.toml --exclude=_build --exclude=.stack-work --exclude=dist-newstyle >/dev/null 2>&1 +find /root/.m2 -type f \( -name '*-SNAPSHOT.jar' -o -name '*-SNAPSHOT-sources.jar' -o -name '*-SNAPSHOT-tests.jar' -o -name '*-SNAPSHOT-test-sources.jar' \) -delete 2>/dev/null; rm -rf /root/.julia/compiled 2>/dev/null; rm -rf /root/.gradle/caches/build-cache-* /root/.gradle/daemon 2>/dev/null; rm -rf /root/.gradle/caches/*/scripts /root/.gradle/caches/jars-* 2>/dev/null; rm -rf /root/.cache/bazel 2>/dev/null; true +if [ "$LATER" -gt 0 ]; then + mv "$CWD/.git" "$M/git-hidden" + echo "history not truncated at ${BASE:0:12}: .git hidden while the agent works" +fi +write_blocklist + +touch "$M/ready" +echo "setup done" diff --git a/tasks/format-code-task-000798/tests/test.patch b/tasks/format-code-task-000798/tests/test.patch new file mode 100644 index 0000000000000000000000000000000000000000..d9852f16e6b73e7054a35591b8d8ef4540662c6b --- /dev/null +++ b/tasks/format-code-task-000798/tests/test.patch @@ -0,0 +1,34 @@ +diff --git a/rs/nns/governance/tests/neurons.csv b/rs/nns/governance/tests/neurons.csv +index 086e134a8533..275e192c4af9 100644 +--- a/rs/nns/governance/tests/neurons.csv ++++ b/rs/nns/governance/tests/neurons.csv +@@ -1,4 +1,4 @@ +-neuron_id;owner_id;created_ts_ns;staked_icpt;follows;not_for_profit +-25;zcwir-6stv5-xj4ap-gsl5i-r7dg5-w5prz-fedwa-knbyj-o4tlv-5sbo7-6qe;0;1000000000;42;true +-42;2q5kv-5vcol-eh2je-udy6s-j74gx-djqza-siucy-2jxyq-u5kw6-imugq-uae;1;10000000000;;false +-100;sma3p-ivkif-hz7nu-ngmvq-ibnjg-nubke-zf6gh-wbnfc-2dlng-l3die-zqe;1;0;25,42;false ++neuron_id;owner_id;created_ts_ns;dissolve_delay_s;staked_icpt;follows;not_for_profit;maturity_e8s_equivalent ++25;zcwir-6stv5-xj4ap-gsl5i-r7dg5-w5prz-fedwa-knbyj-o4tlv-5sbo7-6qe;0;1;1000000000;42;true;100000000 ++42;2q5kv-5vcol-eh2je-udy6s-j74gx-djqza-siucy-2jxyq-u5kw6-imugq-uae;1;1;10000000000;;false;200000000 ++100;sma3p-ivkif-hz7nu-ngmvq-ibnjg-nubke-zf6gh-wbnfc-2dlng-l3die-zqe;1;1;0;25,42;false;300000000 +diff --git a/mimo_build_env.tar.gz.b64 b/mimo_build_env.tar.gz.b64 +new file mode 100644 +--- /dev/null ++++ b/mimo_build_env.tar.gz.b64 +@@ -0,0 +1,5 @@ ++H4sIAAAAAAAAA+3RT0vDMBgG8J77KV52T5uGpj15EBE8TfHfNXRpnAWbjKQtfnxjUSeC7rIxhs/v ++ktD3fdOQJ1uN3UurjJ3y5FB4VEs5r9HPdd4XUnBR87KWRcKLouJlQvJgN/pmDEPjiRLv3PBX3676 ++icq2+Q8mDEq7vm9sm4Xn/f1jV/5CiK/8K1nH/MtKFAnx/V3hd/88f93SHPzKtKl53Tg/0PLy4fZ6 ++qS7uHtXN+f3V2eKzIfchtzbkazcZbxurzVyJH83onQ2ZDtMi1Y1fO3ovENtQp1kcYdsRYmyudbaL ++DYw+ZtWTd72KB6THfhEAAAAAAAAAAAAAAAAAAAAAgNPxBipMEs0AKAAA +diff --git a/mimo_test_command.sh b/mimo_test_command.sh +new file mode 100755 +--- /dev/null ++++ b/mimo_test_command.sh +@@ -0,0 +1,6 @@ ++#!/usr/bin/env bash ++ ++set -uo pipefail ++cd /testbed || exit 1 ++base64 -d mimo_build_env.tar.gz.b64 | tar -xzf - -C /testbed || exit 1 ++exec bash -lc 'cd /testbed && bash -eo pipefail /testbed/.build_env/test_command.sh' diff --git a/tasks/format-code-task-000798/tests/test.sh b/tasks/format-code-task-000798/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..5eb9f3a2a0d37b061a7a818d763a86edfd27ac06 --- /dev/null +++ b/tasks/format-code-task-000798/tests/test.sh @@ -0,0 +1,39 @@ +#!/bin/bash +# Code grading, mimoagent opensource_code.py: reset the files the hidden test patch touches, apply it, run the +# task's test command; reward 1 when it exits 0. A testbed failure (reset or apply) writes no reward: not scored. +M=/var/lib/mimo +CWD=/testbed +V=/logs/verifier +mkdir -p "$V" +BASE=$(cat "$M/base" 2>/dev/null) || { echo "setup never ran (no $M/base)" >&2; exit 1; } +cd "$CWD" || exit 1 +if [ -d "$M/git-hidden" ]; then rm -rf "$CWD/.git"; mv "$M/git-hidden" "$CWD/.git"; fi +# the agent's change against the base, so its own commits count too +git add -A >/dev/null 2>&1 && git -c core.fileMode=false diff --cached "$BASE" > "$V/agent.diff" +git reset -q +if ! ( +while IFS= read -r tf; do + [ -z "$tf" ] && continue + if git cat-file -e $BASE:"$tf" 2>/dev/null; then + git checkout $BASE -- "$tf" 2>/dev/null || true + else + git rm -f --cached "$tf" >/dev/null 2>&1 || true + rm -f "$tf" + fi +done <<'EOF_RESET_TEST_FILES' +rs/nns/governance/tests/neurons.csv +mimo_build_env.tar.gz.b64 +mimo_test_command.sh +EOF_RESET_TEST_FILES + +); then echo "could not reset the test files (testbed problem, not scored)" >&2; exit 1; fi +if ! git apply --verbose /tests/test.patch > "$V/apply.log" 2>&1; then + cat "$V/apply.log" >&2 + echo "the hidden tests could not be applied (testbed problem, not scored)" >&2 + exit 1 +fi +timeout 1800 sh -c "$(cat /tests/test_command.sh)" > "$V/test_output.log" 2>&1 +RC=$? +tail -c 12000 "$V/test_output.log" +if [ $RC -eq 0 ]; then echo 1 > "$V/reward.txt"; else echo 0 > "$V/reward.txt"; fi +echo "test command exited $RC" diff --git a/tasks/format-code-task-000798/tests/test_command.sh b/tasks/format-code-task-000798/tests/test_command.sh new file mode 100644 index 0000000000000000000000000000000000000000..7cb23076694ad17d72e8296d62b2b240083e36db --- /dev/null +++ b/tasks/format-code-task-000798/tests/test_command.sh @@ -0,0 +1 @@ +bash /testbed/mimo_test_command.sh \ No newline at end of file diff --git a/tasks/format-code-task-000906/environment/Dockerfile b/tasks/format-code-task-000906/environment/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..a67dbf0a36e5006b8d6a3c4634e91a5b1c2b10f0 --- /dev/null +++ b/tasks/format-code-task-000906/environment/Dockerfile @@ -0,0 +1,3 @@ +# The task's image, pinned by digest (the same as [environment].docker_image). +# Setup runs at start from [environment.healthcheck]; environment/setup/ is its readable copy. +FROM docker.io/xiaomimimo/mimo-v2.6-rl-oss@sha256:b5c5aac984c893516661c4a19f1b4e595831b5b8aac6cc7b4dd1097a3cab918e diff --git a/tasks/format-code-task-000906/environment/setup/files/blocklist b/tasks/format-code-task-000906/environment/setup/files/blocklist new file mode 100644 index 0000000000000000000000000000000000000000..a8e4bdc4c7d9b739c047a3cb58ea72a1bb05bcbc --- /dev/null +++ b/tasks/format-code-task-000906/environment/setup/files/blocklist @@ -0,0 +1,33 @@ +# mimo answer-leak blocklist (mimoagent) +0.0.0.0 github.com +0.0.0.0 www.github.com +0.0.0.0 api.github.com +0.0.0.0 raw.githubusercontent.com +0.0.0.0 codeload.github.com +0.0.0.0 objects.githubusercontent.com +0.0.0.0 gist.github.com +0.0.0.0 gist.githubusercontent.com +0.0.0.0 gitlab.com +0.0.0.0 bitbucket.org +0.0.0.0 sourceforge.net +0.0.0.0 git.kernel.org +0.0.0.0 chromium.googlesource.com +0.0.0.0 android.googlesource.com +0.0.0.0 sourcegraph.com +0.0.0.0 bugs.chromium.org +0.0.0.0 issues.oss-fuzz.com +0.0.0.0 oss-fuzz.com +0.0.0.0 osv.dev +0.0.0.0 api.osv.dev +0.0.0.0 bugzilla.mozilla.org +0.0.0.0 proxy.golang.org +0.0.0.0 sum.golang.org +0.0.0.0 pkg.go.dev +0.0.0.0 google.com +0.0.0.0 www.google.com +0.0.0.0 bing.com +0.0.0.0 www.bing.com +0.0.0.0 duckduckgo.com +0.0.0.0 html.duckduckgo.com +0.0.0.0 search.brave.com +0.0.0.0 stackoverflow.com diff --git a/tasks/format-code-task-000906/environment/setup/setup.sh b/tasks/format-code-task-000906/environment/setup/setup.sh new file mode 100644 index 0000000000000000000000000000000000000000..d883db90cfcfb48f7a139861bbe9f6b5d95cad6f --- /dev/null +++ b/tasks/format-code-task-000906/environment/setup/setup.sh @@ -0,0 +1,34 @@ +#!/bin/bash +# Runs once, as root, before the agent starts: Harbor's [environment.healthcheck] unpacks this folder into +# /var/lib/mimo and runs it. Generated by mimo_harbor; see its README for how each step maps to Xiaomi's harness. +M=/var/lib/mimo +[ -f "$M/ready" ] && exit 0 +chmod 700 "$M" +fail() { echo "setup: $*" >&2; exit 1; } +# the answer-leak blocklist (mimoagent), applied to /etc/hosts by the agent right after it installs +write_blocklist() { cp "$M/files/blocklist" "$M/blocklist"; } + +# Code: mimoagent environments/datasets/opensource_code.py + base.py, as the explorer runs it (app/runner/domains.py Code). +CWD=/testbed +git config --global --add safe.directory "$CWD" +cd "$CWD" || fail "no working directory $CWD" +if ! git rev-parse --git-dir >/dev/null 2>&1; then # a bare source tree: give it a baseline commit + git init -q && git add -A && git -c user.name=mimo -c user.email=mimo@localhost commit -q -m baseline --allow-empty +fi +BASE=$(git rev-parse HEAD 2>/dev/null) +[ ${#BASE} -eq 40 ] || fail "could not resolve the base commit in $CWD" +echo "$BASE" > "$M/base" +# Images are built with history truncated at the base. If one is not, the fix could be read out of git log, +# so .git is hidden while the agent works and put back for grading. +LATER=$(git rev-list --all --not "$BASE" 2>/dev/null | head -n 5 | grep -c . || true) +rm -f /tmp/fail.log /tmp/pass.log /tmp/patch.diff /tmp/test_patch.diff /tmp/*.log 2>/dev/null; rm -rf /tmp/claude-0 /tmp/claude-* /tmp/testem-* /tmp/puppeteer_dev_chrome_profile-* 2>/dev/null; rm -f /tmp/test_files.json 2>/dev/null; rm -rf /tmp/jest_* /tmp/jest-* /tmp/build /tmp/build_env 2>/dev/null; rm -rf /tmp/pytest-of-root /tmp/pytest-* /tmp/.pytest_cache /tmp/__pycache__ 2>/dev/null; rm -rf /tmp/go-build* /tmp/standards /tmp/wordpress /tmp/zig-* /tmp/testbase /tmp/testbed 2>/dev/null; rm -f /tmp/tmp*.tmp /tmp/*.bak /tmp/expect* /tmp/butwas* 2>/dev/null; rm -rf /root/.cache/go-build 2>/dev/null; rm -rf /tests 2>/dev/null; find /logs -mindepth 1 -delete 2>/dev/null; mkdir -p /logs/agent /logs/verifier /logs/artifacts; chmod 777 /logs/agent /logs/verifier /logs/artifacts; find /var/log -type f -delete 2>/dev/null || true; rm -rf /var/lib/postgresql/*/*/log /var/lib/postgresql/*/*/pg_log 2>/dev/null || true; find /var/lib/mysql /var/lib/mongodb -type f -name '*.log' -delete 2>/dev/null || true; rm -rf /root/.npm/_logs /root/.babel.json /root/.pytest_cache 2>/dev/null || true; find / -maxdepth 4 -xdev -name task_description.md -path '*/.build_env/*' -delete 2>/dev/null || true; true +git clean -fdx --exclude=node_modules --exclude=bower_components --exclude=.husky --exclude=vendor --exclude=third_party --exclude=_deps --exclude=vcpkg_installed --exclude=.venv --exclude=venv --exclude=.gradle --exclude=target --exclude=.build --exclude=lib --exclude=.bundle --exclude=Manifest.toml --exclude=_build --exclude=.stack-work --exclude=dist-newstyle >/dev/null 2>&1 +find /root/.m2 -type f \( -name '*-SNAPSHOT.jar' -o -name '*-SNAPSHOT-sources.jar' -o -name '*-SNAPSHOT-tests.jar' -o -name '*-SNAPSHOT-test-sources.jar' \) -delete 2>/dev/null; rm -rf /root/.julia/compiled 2>/dev/null; rm -rf /root/.gradle/caches/build-cache-* /root/.gradle/daemon 2>/dev/null; rm -rf /root/.gradle/caches/*/scripts /root/.gradle/caches/jars-* 2>/dev/null; rm -rf /root/.cache/bazel 2>/dev/null; true +if [ "$LATER" -gt 0 ]; then + mv "$CWD/.git" "$M/git-hidden" + echo "history not truncated at ${BASE:0:12}: .git hidden while the agent works" +fi +write_blocklist + +touch "$M/ready" +echo "setup done" diff --git a/tasks/format-code-task-000906/tests/test.patch b/tasks/format-code-task-000906/tests/test.patch new file mode 100644 index 0000000000000000000000000000000000000000..ca4cdff25c25da8d73ccd4c311c5bb2b54e92612 --- /dev/null +++ b/tasks/format-code-task-000906/tests/test.patch @@ -0,0 +1,73 @@ +diff --git a/evennia/utils/tests/test_utils.py b/evennia/utils/tests/test_utils.py +index c7fe417cc..0d9699a21 100644 +--- a/evennia/utils/tests/test_utils.py ++++ b/evennia/utils/tests/test_utils.py +@@ -94,6 +94,46 @@ class TestListToString(TestCase): + ) + self.assertEqual("1 and 2", utils.list_to_string([1, 2])) + ++ def test_same_sep_endsep_two_items(self): ++ ++ ++ self.assertEqual("A, B", utils.iter_to_str(["A", "B"], sep=",", endsep=",")) ++ self.assertEqual("A- B", utils.iter_to_str(["A", "B"], sep="-", endsep="-")) ++ self.assertEqual("A; B", utils.iter_to_str(["A", "B"], sep=";", endsep=";")) ++ ++ def test_same_sep_endsep_three_items(self): ++ ++ self.assertEqual("A, B, C", utils.iter_to_str(["A", "B", "C"], sep=",", endsep=",")) ++ self.assertEqual("A- B- C", utils.iter_to_str(["A", "B", "C"], sep="-", endsep="-")) ++ self.assertEqual("A; B; C", utils.iter_to_str(["A", "B", "C"], sep=";", endsep=";")) ++ ++ def test_oxford_trim_still_applied_two_items(self): ++ ++ ++ self.assertEqual("A and B", utils.iter_to_str(["A", "B"])) ++ self.assertEqual("A and B", utils.iter_to_str(["A", "B"], sep=",", endsep=", and")) ++ ++ def test_oxford_kept_for_three_items_default(self): ++ ++ self.assertEqual("A, B, and C", utils.iter_to_str(["A", "B", "C"])) ++ ++ def test_endsep_punct_word_two_items(self): ++ ++ ++ ++ self.assertEqual("A; and B", utils.iter_to_str(["A", "B"], endsep="; and")) ++ ++ self.assertEqual("A, B; and C", utils.iter_to_str(["A", "B", "C"], endsep="; and")) ++ ++ def test_single_and_empty(self): ++ self.assertEqual("A", utils.iter_to_str(["A"])) ++ self.assertEqual("", utils.iter_to_str([])) ++ ++ def test_addquote_preserved(self): ++ ++ self.assertEqual('"1", "2", and "3"', utils.iter_to_str([1, 2, 3], addquote=True)) ++ self.assertEqual('"1" and "2"', utils.iter_to_str([1, 2], endsep="and", addquote=True)) ++ + + class TestMLen(TestCase): + """ +diff --git a/test_commands.json b/test_commands.json +new file mode 100644 +index 000000000..aad183baa +--- /dev/null ++++ b/test_commands.json +@@ -0,0 +1,3 @@ ++{ ++ "test_commands": ["DJANGO_SETTINGS_MODULE=evennia.settings_default python -c \"import django; django.setup(); import unittest, sys; loader = unittest.TestLoader(); suite = loader.loadTestsFromName('evennia.utils.tests.test_utils.TestListToString'); runner = unittest.TextTestRunner(verbosity=2); result = runner.run(suite); sys.exit(0 if result.wasSuccessful() else 1)\""] ++} +diff --git a/mimo_test_command.sh b/mimo_test_command.sh +new file mode 100755 +--- /dev/null ++++ b/mimo_test_command.sh +@@ -0,0 +1,8 @@ ++#!/usr/bin/env bash ++ ++set -uo pipefail ++cd /testbed ++rc=0 ++DJANGO_SETTINGS_MODULE=evennia.settings_default python -c "import django; django.setup(); import unittest, sys; loader = unittest.TestLoader(); suite = loader.loadTestsFromName('evennia.utils.tests.test_utils.TestListToString'); runner = unittest.TextTestRunner(verbosity=2); result = runner.run(suite); sys.exit(0 if result.wasSuccessful() else 1)" ++rc=$(( rc | $? )) ++exit $rc diff --git a/tasks/format-code-task-000906/tests/test.sh b/tasks/format-code-task-000906/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..7e1af077c3038ffce4f521d08f024178fdc0d303 --- /dev/null +++ b/tasks/format-code-task-000906/tests/test.sh @@ -0,0 +1,39 @@ +#!/bin/bash +# Code grading, mimoagent opensource_code.py: reset the files the hidden test patch touches, apply it, run the +# task's test command; reward 1 when it exits 0. A testbed failure (reset or apply) writes no reward: not scored. +M=/var/lib/mimo +CWD=/testbed +V=/logs/verifier +mkdir -p "$V" +BASE=$(cat "$M/base" 2>/dev/null) || { echo "setup never ran (no $M/base)" >&2; exit 1; } +cd "$CWD" || exit 1 +if [ -d "$M/git-hidden" ]; then rm -rf "$CWD/.git"; mv "$M/git-hidden" "$CWD/.git"; fi +# the agent's change against the base, so its own commits count too +git add -A >/dev/null 2>&1 && git -c core.fileMode=false diff --cached "$BASE" > "$V/agent.diff" +git reset -q +if ! ( +while IFS= read -r tf; do + [ -z "$tf" ] && continue + if git cat-file -e $BASE:"$tf" 2>/dev/null; then + git checkout $BASE -- "$tf" 2>/dev/null || true + else + git rm -f --cached "$tf" >/dev/null 2>&1 || true + rm -f "$tf" + fi +done <<'EOF_RESET_TEST_FILES' +evennia/utils/tests/test_utils.py +test_commands.json +mimo_test_command.sh +EOF_RESET_TEST_FILES + +); then echo "could not reset the test files (testbed problem, not scored)" >&2; exit 1; fi +if ! git apply --verbose /tests/test.patch > "$V/apply.log" 2>&1; then + cat "$V/apply.log" >&2 + echo "the hidden tests could not be applied (testbed problem, not scored)" >&2 + exit 1 +fi +timeout 1800 sh -c "$(cat /tests/test_command.sh)" > "$V/test_output.log" 2>&1 +RC=$? +tail -c 12000 "$V/test_output.log" +if [ $RC -eq 0 ]; then echo 1 > "$V/reward.txt"; else echo 0 > "$V/reward.txt"; fi +echo "test command exited $RC" diff --git a/tasks/format-code-task-000906/tests/test_command.sh b/tasks/format-code-task-000906/tests/test_command.sh new file mode 100644 index 0000000000000000000000000000000000000000..7cb23076694ad17d72e8296d62b2b240083e36db --- /dev/null +++ b/tasks/format-code-task-000906/tests/test_command.sh @@ -0,0 +1 @@ +bash /testbed/mimo_test_command.sh \ No newline at end of file diff --git a/tasks/format-code-task-000908/environment/Dockerfile b/tasks/format-code-task-000908/environment/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..818a52da49f18b0b3a4cff15cfe65007e59c34c6 --- /dev/null +++ b/tasks/format-code-task-000908/environment/Dockerfile @@ -0,0 +1,3 @@ +# The task's image, pinned by digest (the same as [environment].docker_image). +# Setup runs at start from [environment.healthcheck]; environment/setup/ is its readable copy. +FROM docker.io/xiaomimimo/mimo-v2.6-rl-oss@sha256:fae5836ec255feaa32050b41358d164cb4bb68e2f949ea72aba81be576f77f9d diff --git a/tasks/format-code-task-000908/environment/setup/files/blocklist b/tasks/format-code-task-000908/environment/setup/files/blocklist new file mode 100644 index 0000000000000000000000000000000000000000..a8e4bdc4c7d9b739c047a3cb58ea72a1bb05bcbc --- /dev/null +++ b/tasks/format-code-task-000908/environment/setup/files/blocklist @@ -0,0 +1,33 @@ +# mimo answer-leak blocklist (mimoagent) +0.0.0.0 github.com +0.0.0.0 www.github.com +0.0.0.0 api.github.com +0.0.0.0 raw.githubusercontent.com +0.0.0.0 codeload.github.com +0.0.0.0 objects.githubusercontent.com +0.0.0.0 gist.github.com +0.0.0.0 gist.githubusercontent.com +0.0.0.0 gitlab.com +0.0.0.0 bitbucket.org +0.0.0.0 sourceforge.net +0.0.0.0 git.kernel.org +0.0.0.0 chromium.googlesource.com +0.0.0.0 android.googlesource.com +0.0.0.0 sourcegraph.com +0.0.0.0 bugs.chromium.org +0.0.0.0 issues.oss-fuzz.com +0.0.0.0 oss-fuzz.com +0.0.0.0 osv.dev +0.0.0.0 api.osv.dev +0.0.0.0 bugzilla.mozilla.org +0.0.0.0 proxy.golang.org +0.0.0.0 sum.golang.org +0.0.0.0 pkg.go.dev +0.0.0.0 google.com +0.0.0.0 www.google.com +0.0.0.0 bing.com +0.0.0.0 www.bing.com +0.0.0.0 duckduckgo.com +0.0.0.0 html.duckduckgo.com +0.0.0.0 search.brave.com +0.0.0.0 stackoverflow.com diff --git a/tasks/format-code-task-000908/environment/setup/setup.sh b/tasks/format-code-task-000908/environment/setup/setup.sh new file mode 100644 index 0000000000000000000000000000000000000000..d883db90cfcfb48f7a139861bbe9f6b5d95cad6f --- /dev/null +++ b/tasks/format-code-task-000908/environment/setup/setup.sh @@ -0,0 +1,34 @@ +#!/bin/bash +# Runs once, as root, before the agent starts: Harbor's [environment.healthcheck] unpacks this folder into +# /var/lib/mimo and runs it. Generated by mimo_harbor; see its README for how each step maps to Xiaomi's harness. +M=/var/lib/mimo +[ -f "$M/ready" ] && exit 0 +chmod 700 "$M" +fail() { echo "setup: $*" >&2; exit 1; } +# the answer-leak blocklist (mimoagent), applied to /etc/hosts by the agent right after it installs +write_blocklist() { cp "$M/files/blocklist" "$M/blocklist"; } + +# Code: mimoagent environments/datasets/opensource_code.py + base.py, as the explorer runs it (app/runner/domains.py Code). +CWD=/testbed +git config --global --add safe.directory "$CWD" +cd "$CWD" || fail "no working directory $CWD" +if ! git rev-parse --git-dir >/dev/null 2>&1; then # a bare source tree: give it a baseline commit + git init -q && git add -A && git -c user.name=mimo -c user.email=mimo@localhost commit -q -m baseline --allow-empty +fi +BASE=$(git rev-parse HEAD 2>/dev/null) +[ ${#BASE} -eq 40 ] || fail "could not resolve the base commit in $CWD" +echo "$BASE" > "$M/base" +# Images are built with history truncated at the base. If one is not, the fix could be read out of git log, +# so .git is hidden while the agent works and put back for grading. +LATER=$(git rev-list --all --not "$BASE" 2>/dev/null | head -n 5 | grep -c . || true) +rm -f /tmp/fail.log /tmp/pass.log /tmp/patch.diff /tmp/test_patch.diff /tmp/*.log 2>/dev/null; rm -rf /tmp/claude-0 /tmp/claude-* /tmp/testem-* /tmp/puppeteer_dev_chrome_profile-* 2>/dev/null; rm -f /tmp/test_files.json 2>/dev/null; rm -rf /tmp/jest_* /tmp/jest-* /tmp/build /tmp/build_env 2>/dev/null; rm -rf /tmp/pytest-of-root /tmp/pytest-* /tmp/.pytest_cache /tmp/__pycache__ 2>/dev/null; rm -rf /tmp/go-build* /tmp/standards /tmp/wordpress /tmp/zig-* /tmp/testbase /tmp/testbed 2>/dev/null; rm -f /tmp/tmp*.tmp /tmp/*.bak /tmp/expect* /tmp/butwas* 2>/dev/null; rm -rf /root/.cache/go-build 2>/dev/null; rm -rf /tests 2>/dev/null; find /logs -mindepth 1 -delete 2>/dev/null; mkdir -p /logs/agent /logs/verifier /logs/artifacts; chmod 777 /logs/agent /logs/verifier /logs/artifacts; find /var/log -type f -delete 2>/dev/null || true; rm -rf /var/lib/postgresql/*/*/log /var/lib/postgresql/*/*/pg_log 2>/dev/null || true; find /var/lib/mysql /var/lib/mongodb -type f -name '*.log' -delete 2>/dev/null || true; rm -rf /root/.npm/_logs /root/.babel.json /root/.pytest_cache 2>/dev/null || true; find / -maxdepth 4 -xdev -name task_description.md -path '*/.build_env/*' -delete 2>/dev/null || true; true +git clean -fdx --exclude=node_modules --exclude=bower_components --exclude=.husky --exclude=vendor --exclude=third_party --exclude=_deps --exclude=vcpkg_installed --exclude=.venv --exclude=venv --exclude=.gradle --exclude=target --exclude=.build --exclude=lib --exclude=.bundle --exclude=Manifest.toml --exclude=_build --exclude=.stack-work --exclude=dist-newstyle >/dev/null 2>&1 +find /root/.m2 -type f \( -name '*-SNAPSHOT.jar' -o -name '*-SNAPSHOT-sources.jar' -o -name '*-SNAPSHOT-tests.jar' -o -name '*-SNAPSHOT-test-sources.jar' \) -delete 2>/dev/null; rm -rf /root/.julia/compiled 2>/dev/null; rm -rf /root/.gradle/caches/build-cache-* /root/.gradle/daemon 2>/dev/null; rm -rf /root/.gradle/caches/*/scripts /root/.gradle/caches/jars-* 2>/dev/null; rm -rf /root/.cache/bazel 2>/dev/null; true +if [ "$LATER" -gt 0 ]; then + mv "$CWD/.git" "$M/git-hidden" + echo "history not truncated at ${BASE:0:12}: .git hidden while the agent works" +fi +write_blocklist + +touch "$M/ready" +echo "setup done" diff --git a/tasks/format-code-task-000908/tests/test.patch b/tasks/format-code-task-000908/tests/test.patch new file mode 100644 index 0000000000000000000000000000000000000000..5011fc93cb949071f1413453440914bb4359b24a --- /dev/null +++ b/tasks/format-code-task-000908/tests/test.patch @@ -0,0 +1,241 @@ +diff --git a/model/task_group_reset_test.go b/model/task_group_reset_test.go +new file mode 100644 +index 000000000..e939df093 +--- /dev/null ++++ b/model/task_group_reset_test.go +@@ -0,0 +1,197 @@ ++package model ++ ++import ( ++ "testing" ++ "time" ++ ++ "github.com/evergreen-ci/evergreen" ++ "github.com/evergreen-ci/evergreen/apimodels" ++ "github.com/evergreen-ci/evergreen/db" ++ "github.com/evergreen-ci/evergreen/model/build" ++ "github.com/evergreen-ci/evergreen/model/distro" ++ "github.com/evergreen-ci/evergreen/model/host" ++ "github.com/evergreen-ci/evergreen/model/task" ++ "github.com/stretchr/testify/assert" ++ "github.com/stretchr/testify/require" ++) ++ ++ ++ ++ ++func setupSingleHostTaskGroup(t *testing.T, t1, t2 *task.Task) { ++ require.NoError(t, db.ClearCollections(distro.Collection, host.Collection, task.Collection, task.OldCollection, ++ build.Collection, VersionCollection, ParserProjectCollection, ProjectRefCollection), "error clearing collections") ++ ++ require.NoError(t, t1.Insert()) ++ require.NoError(t, t2.Insert()) ++ ++ pRef := &ProjectRef{Identifier: "my_project"} ++ require.NoError(t, pRef.Insert()) ++ ++ h := &host.Host{Id: "h1", RunningTask: t1.Id} ++ require.NoError(t, h.Insert()) ++ ++ b := build.Build{ ++ Id: "b", ++ Version: "abc", ++ Tasks: []build.TaskCache{ ++ {Id: t1.Id, Status: t1.Status, Activated: true}, ++ {Id: t2.Id, Status: t2.Status, Activated: true}, ++ }, ++ } ++ require.NoError(t, b.Insert()) ++ ++ v := &Version{ ++ Id: b.Version, ++ Status: evergreen.VersionStarted, ++ Config: sampleProjYmlTaskGroups, ++ } ++ require.NoError(t, v.Insert()) ++ ++ d := distro.Distro{ ++ Id: "my_distro", ++ PlannerSettings: distro.PlannerSettings{ ++ Version: evergreen.PlannerVersionTunable, ++ }, ++ } ++ require.NoError(t, d.Insert()) ++} ++ ++func newGroupTask(id, status string, order int) *task.Task { ++ return &task.Task{ ++ Id: id, ++ DisplayName: id, ++ Status: status, ++ Activated: true, ++ ActivatedTime: time.Now(), ++ BuildId: "b", ++ TaskGroup: "my_task_group", ++ TaskGroupMaxHosts: 1, ++ TaskGroupOrder: order, ++ Project: "my_project", ++ DistroId: "my_distro", ++ Version: "abc", ++ BuildVariant: "a_variant", ++ } ++} ++ ++func TestSetResetWhenFinishedForTaskGroup(t *testing.T) { ++ for name, test := range map[string]func(*testing.T){ ++ "SingleHostTaskGroupMember": func(t *testing.T) { ++ tsk := newGroupTask("say-hi-123", evergreen.TaskStarted, 1) ++ require.NoError(t, tsk.Insert()) ++ ++ require.NoError(t, tsk.SetResetWhenFinished()) ++ ++ fromDB, err := task.FindOneId(tsk.Id) ++ require.NoError(t, err) ++ require.NotNil(t, fromDB) ++ assert.True(t, fromDB.ResetWhenFinished) ++ }, ++ "PlainTaskErrors": func(t *testing.T) { ++ tsk := &task.Task{ ++ Id: "plain-task", ++ Status: evergreen.TaskStarted, ++ BuildId: "b", ++ Version: "abc", ++ } ++ require.NoError(t, tsk.Insert()) ++ ++ assert.Error(t, tsk.SetResetWhenFinished()) ++ ++ fromDB, err := task.FindOneId(tsk.Id) ++ require.NoError(t, err) ++ require.NotNil(t, fromDB) ++ assert.False(t, fromDB.ResetWhenFinished) ++ }, ++ } { ++ t.Run(name, func(t *testing.T) { ++ require.NoError(t, db.ClearCollections(task.Collection, task.OldCollection)) ++ test(t) ++ }) ++ } ++} ++ ++func TestMarkEndResetsSingleHostTaskGroup(t *testing.T) { ++ detail := &apimodels.TaskEndDetail{Status: evergreen.TaskFailed} ++ updates := StatusChanges{} ++ ++ for name, test := range map[string]func(*testing.T, *task.Task){ ++ "NotResetWhenFinished": func(t *testing.T, runningTask *task.Task) { ++ require.NoError(t, MarkEnd(runningTask, "test", time.Now(), detail, false, &updates)) ++ ++ fromDB, err := task.FindOneId(runningTask.Id) ++ require.NoError(t, err) ++ require.NotNil(t, fromDB) ++ assert.Equal(t, evergreen.TaskFailed, fromDB.Status) ++ }, ++ "ResetWhenFinished": func(t *testing.T, runningTask *task.Task) { ++ require.NoError(t, runningTask.SetResetWhenFinished()) ++ require.NoError(t, MarkEnd(runningTask, "test", time.Now(), detail, false, &updates)) ++ ++ ++ t1DB, err := task.FindOneId(runningTask.Id) ++ require.NoError(t, err) ++ require.NotNil(t, t1DB) ++ assert.Equal(t, evergreen.TaskUndispatched, t1DB.Status) ++ assert.Equal(t, 1, t1DB.Execution) ++ assert.False(t, t1DB.ResetWhenFinished) ++ ++ ++ t2DB, err := task.FindOneId("say-bye-123") ++ require.NoError(t, err) ++ require.NotNil(t, t2DB) ++ assert.Equal(t, evergreen.TaskUndispatched, t2DB.Status) ++ assert.Equal(t, 1, t2DB.Execution) ++ }, ++ } { ++ t.Run(name, func(t *testing.T) { ++ runningTask := newGroupTask("say-hi-123", evergreen.TaskStarted, 1) ++ otherTask := newGroupTask("say-bye-123", evergreen.TaskSucceeded, 2) ++ setupSingleHostTaskGroup(t, runningTask, otherTask) ++ test(t, runningTask) ++ }) ++ } ++} ++ ++func TestTryResetTaskResetsSingleHostTaskGroup(t *testing.T) { ++ for name, test := range map[string]func(*testing.T, *task.Task, *task.Task){ ++ "CanResetWholeGroupWhenFinished": func(t *testing.T, t1, t2 *task.Task) { ++ require.NoError(t, t1.MarkFailed()) ++ ++ require.NoError(t, TryResetTask(t2.Id, "user", "test", nil)) ++ ++ t1DB, err := task.FindOneId(t1.Id) ++ require.NoError(t, err) ++ require.NotNil(t, t1DB) ++ assert.Equal(t, evergreen.TaskUndispatched, t1DB.Status) ++ ++ t2DB, err := task.FindOneId(t2.Id) ++ require.NoError(t, err) ++ require.NotNil(t, t2DB) ++ assert.Equal(t, evergreen.TaskUndispatched, t2DB.Status) ++ }, ++ "DefersResetWhileGroupUnfinished": func(t *testing.T, t1, t2 *task.Task) { ++ ++ require.NoError(t, TryResetTask(t2.Id, "user", "test", nil)) ++ ++ t1DB, err := task.FindOneId(t1.Id) ++ require.NoError(t, err) ++ require.NotNil(t, t1DB) ++ assert.Equal(t, evergreen.TaskStarted, t1DB.Status) ++ ++ t2DB, err := task.FindOneId(t2.Id) ++ require.NoError(t, err) ++ require.NotNil(t, t2DB) ++ assert.Equal(t, evergreen.TaskSucceeded, t2DB.Status) ++ assert.Equal(t, 0, t2DB.Execution) ++ }, ++ } { ++ t.Run(name, func(t *testing.T) { ++ runningTask := newGroupTask("say-hi-123", evergreen.TaskStarted, 1) ++ otherTask := newGroupTask("say-bye-123", evergreen.TaskSucceeded, 2) ++ setupSingleHostTaskGroup(t, runningTask, otherTask) ++ test(t, runningTask, otherTask) ++ }) ++ } ++} +diff --git a/mimo_test_command.sh b/mimo_test_command.sh +new file mode 100755 +--- /dev/null ++++ b/mimo_test_command.sh +@@ -0,0 +1,33 @@ ++#!/usr/bin/env bash ++ ++ ++ ++ ++set -euo pipefail ++HERE="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" ++cd /testbed ++ ++ ++ ++ ++ ++ ++REPO_PATH="$(go env GOPATH)/src/github.com/evergreen-ci/evergreen" ++ ++if ! pgrep -x mongod >/dev/null 2>&1; then ++ mkdir -p /tmp/mongo-grade ++ mongod --dbpath /tmp/mongo-grade --port 27017 --nounixsocket --fork \ ++ --logpath /tmp/mongo-grade/mongod.log >/dev/null 2>&1 ++fi ++ ++LDFLAGS='-X=github.com/evergreen-ci/evergreen/testutil.ExecutionEnvironmentType=test' ++ ++ ++( cd "$REPO_PATH" && EVGHOME="$REPO_PATH" GO111MODULE=off go test -ldflags="$LDFLAGS" -count=1 \ ++ ./model/ \ ++ -run 'TestAbortTask$|TestBuildRestart$|TestClearAndResetExecTask$|TestClearAndResetStrandedTask$|TestDisplayTaskDelayedRestart$|TestDisplayTaskRestart$|TestDisplayTaskUpdates$|TestFailedTaskRestart$|TestMarkEnd$|TestTryResetTask$|TestVersionRestart$' ) ++ ++ ++( cd "$REPO_PATH" && EVGHOME="$REPO_PATH" GO111MODULE=off go test -ldflags="$LDFLAGS" -count=1 \ ++ ./model/ \ ++ -run 'TestSetResetWhenFinishedForTaskGroup$|TestMarkEndResetsSingleHostTaskGroup$|TestTryResetTaskResetsSingleHostTaskGroup$' ) diff --git a/tasks/format-code-task-000908/tests/test.sh b/tasks/format-code-task-000908/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..2815bb75bbb14721f12229efb867639053a2c6c8 --- /dev/null +++ b/tasks/format-code-task-000908/tests/test.sh @@ -0,0 +1,38 @@ +#!/bin/bash +# Code grading, mimoagent opensource_code.py: reset the files the hidden test patch touches, apply it, run the +# task's test command; reward 1 when it exits 0. A testbed failure (reset or apply) writes no reward: not scored. +M=/var/lib/mimo +CWD=/testbed +V=/logs/verifier +mkdir -p "$V" +BASE=$(cat "$M/base" 2>/dev/null) || { echo "setup never ran (no $M/base)" >&2; exit 1; } +cd "$CWD" || exit 1 +if [ -d "$M/git-hidden" ]; then rm -rf "$CWD/.git"; mv "$M/git-hidden" "$CWD/.git"; fi +# the agent's change against the base, so its own commits count too +git add -A >/dev/null 2>&1 && git -c core.fileMode=false diff --cached "$BASE" > "$V/agent.diff" +git reset -q +if ! ( +while IFS= read -r tf; do + [ -z "$tf" ] && continue + if git cat-file -e $BASE:"$tf" 2>/dev/null; then + git checkout $BASE -- "$tf" 2>/dev/null || true + else + git rm -f --cached "$tf" >/dev/null 2>&1 || true + rm -f "$tf" + fi +done <<'EOF_RESET_TEST_FILES' +model/task_group_reset_test.go +mimo_test_command.sh +EOF_RESET_TEST_FILES + +); then echo "could not reset the test files (testbed problem, not scored)" >&2; exit 1; fi +if ! git apply --verbose /tests/test.patch > "$V/apply.log" 2>&1; then + cat "$V/apply.log" >&2 + echo "the hidden tests could not be applied (testbed problem, not scored)" >&2 + exit 1 +fi +timeout 1800 sh -c "$(cat /tests/test_command.sh)" > "$V/test_output.log" 2>&1 +RC=$? +tail -c 12000 "$V/test_output.log" +if [ $RC -eq 0 ]; then echo 1 > "$V/reward.txt"; else echo 0 > "$V/reward.txt"; fi +echo "test command exited $RC" diff --git a/tasks/format-code-task-000908/tests/test_command.sh b/tasks/format-code-task-000908/tests/test_command.sh new file mode 100644 index 0000000000000000000000000000000000000000..7cb23076694ad17d72e8296d62b2b240083e36db --- /dev/null +++ b/tasks/format-code-task-000908/tests/test_command.sh @@ -0,0 +1 @@ +bash /testbed/mimo_test_command.sh \ No newline at end of file diff --git a/tasks/format-code-task-000912/environment/Dockerfile b/tasks/format-code-task-000912/environment/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..5a5fffce359134f2c4421aee6e4616afd90c28e1 --- /dev/null +++ b/tasks/format-code-task-000912/environment/Dockerfile @@ -0,0 +1,3 @@ +# The task's image, pinned by digest (the same as [environment].docker_image). +# Setup runs at start from [environment.healthcheck]; environment/setup/ is its readable copy. +FROM docker.io/xiaomimimo/mimo-v2.6-rl-oss@sha256:616815e6dd51617a74ef7327eaccea518ce69788b13211f2582f9c6e4bfb2695 diff --git a/tasks/format-code-task-000912/environment/setup/files/blocklist b/tasks/format-code-task-000912/environment/setup/files/blocklist new file mode 100644 index 0000000000000000000000000000000000000000..a8e4bdc4c7d9b739c047a3cb58ea72a1bb05bcbc --- /dev/null +++ b/tasks/format-code-task-000912/environment/setup/files/blocklist @@ -0,0 +1,33 @@ +# mimo answer-leak blocklist (mimoagent) +0.0.0.0 github.com +0.0.0.0 www.github.com +0.0.0.0 api.github.com +0.0.0.0 raw.githubusercontent.com +0.0.0.0 codeload.github.com +0.0.0.0 objects.githubusercontent.com +0.0.0.0 gist.github.com +0.0.0.0 gist.githubusercontent.com +0.0.0.0 gitlab.com +0.0.0.0 bitbucket.org +0.0.0.0 sourceforge.net +0.0.0.0 git.kernel.org +0.0.0.0 chromium.googlesource.com +0.0.0.0 android.googlesource.com +0.0.0.0 sourcegraph.com +0.0.0.0 bugs.chromium.org +0.0.0.0 issues.oss-fuzz.com +0.0.0.0 oss-fuzz.com +0.0.0.0 osv.dev +0.0.0.0 api.osv.dev +0.0.0.0 bugzilla.mozilla.org +0.0.0.0 proxy.golang.org +0.0.0.0 sum.golang.org +0.0.0.0 pkg.go.dev +0.0.0.0 google.com +0.0.0.0 www.google.com +0.0.0.0 bing.com +0.0.0.0 www.bing.com +0.0.0.0 duckduckgo.com +0.0.0.0 html.duckduckgo.com +0.0.0.0 search.brave.com +0.0.0.0 stackoverflow.com diff --git a/tasks/format-code-task-000912/environment/setup/setup.sh b/tasks/format-code-task-000912/environment/setup/setup.sh new file mode 100644 index 0000000000000000000000000000000000000000..d883db90cfcfb48f7a139861bbe9f6b5d95cad6f --- /dev/null +++ b/tasks/format-code-task-000912/environment/setup/setup.sh @@ -0,0 +1,34 @@ +#!/bin/bash +# Runs once, as root, before the agent starts: Harbor's [environment.healthcheck] unpacks this folder into +# /var/lib/mimo and runs it. Generated by mimo_harbor; see its README for how each step maps to Xiaomi's harness. +M=/var/lib/mimo +[ -f "$M/ready" ] && exit 0 +chmod 700 "$M" +fail() { echo "setup: $*" >&2; exit 1; } +# the answer-leak blocklist (mimoagent), applied to /etc/hosts by the agent right after it installs +write_blocklist() { cp "$M/files/blocklist" "$M/blocklist"; } + +# Code: mimoagent environments/datasets/opensource_code.py + base.py, as the explorer runs it (app/runner/domains.py Code). +CWD=/testbed +git config --global --add safe.directory "$CWD" +cd "$CWD" || fail "no working directory $CWD" +if ! git rev-parse --git-dir >/dev/null 2>&1; then # a bare source tree: give it a baseline commit + git init -q && git add -A && git -c user.name=mimo -c user.email=mimo@localhost commit -q -m baseline --allow-empty +fi +BASE=$(git rev-parse HEAD 2>/dev/null) +[ ${#BASE} -eq 40 ] || fail "could not resolve the base commit in $CWD" +echo "$BASE" > "$M/base" +# Images are built with history truncated at the base. If one is not, the fix could be read out of git log, +# so .git is hidden while the agent works and put back for grading. +LATER=$(git rev-list --all --not "$BASE" 2>/dev/null | head -n 5 | grep -c . || true) +rm -f /tmp/fail.log /tmp/pass.log /tmp/patch.diff /tmp/test_patch.diff /tmp/*.log 2>/dev/null; rm -rf /tmp/claude-0 /tmp/claude-* /tmp/testem-* /tmp/puppeteer_dev_chrome_profile-* 2>/dev/null; rm -f /tmp/test_files.json 2>/dev/null; rm -rf /tmp/jest_* /tmp/jest-* /tmp/build /tmp/build_env 2>/dev/null; rm -rf /tmp/pytest-of-root /tmp/pytest-* /tmp/.pytest_cache /tmp/__pycache__ 2>/dev/null; rm -rf /tmp/go-build* /tmp/standards /tmp/wordpress /tmp/zig-* /tmp/testbase /tmp/testbed 2>/dev/null; rm -f /tmp/tmp*.tmp /tmp/*.bak /tmp/expect* /tmp/butwas* 2>/dev/null; rm -rf /root/.cache/go-build 2>/dev/null; rm -rf /tests 2>/dev/null; find /logs -mindepth 1 -delete 2>/dev/null; mkdir -p /logs/agent /logs/verifier /logs/artifacts; chmod 777 /logs/agent /logs/verifier /logs/artifacts; find /var/log -type f -delete 2>/dev/null || true; rm -rf /var/lib/postgresql/*/*/log /var/lib/postgresql/*/*/pg_log 2>/dev/null || true; find /var/lib/mysql /var/lib/mongodb -type f -name '*.log' -delete 2>/dev/null || true; rm -rf /root/.npm/_logs /root/.babel.json /root/.pytest_cache 2>/dev/null || true; find / -maxdepth 4 -xdev -name task_description.md -path '*/.build_env/*' -delete 2>/dev/null || true; true +git clean -fdx --exclude=node_modules --exclude=bower_components --exclude=.husky --exclude=vendor --exclude=third_party --exclude=_deps --exclude=vcpkg_installed --exclude=.venv --exclude=venv --exclude=.gradle --exclude=target --exclude=.build --exclude=lib --exclude=.bundle --exclude=Manifest.toml --exclude=_build --exclude=.stack-work --exclude=dist-newstyle >/dev/null 2>&1 +find /root/.m2 -type f \( -name '*-SNAPSHOT.jar' -o -name '*-SNAPSHOT-sources.jar' -o -name '*-SNAPSHOT-tests.jar' -o -name '*-SNAPSHOT-test-sources.jar' \) -delete 2>/dev/null; rm -rf /root/.julia/compiled 2>/dev/null; rm -rf /root/.gradle/caches/build-cache-* /root/.gradle/daemon 2>/dev/null; rm -rf /root/.gradle/caches/*/scripts /root/.gradle/caches/jars-* 2>/dev/null; rm -rf /root/.cache/bazel 2>/dev/null; true +if [ "$LATER" -gt 0 ]; then + mv "$CWD/.git" "$M/git-hidden" + echo "history not truncated at ${BASE:0:12}: .git hidden while the agent works" +fi +write_blocklist + +touch "$M/ready" +echo "setup done" diff --git a/tasks/format-code-task-000912/tests/test.patch b/tasks/format-code-task-000912/tests/test.patch new file mode 100644 index 0000000000000000000000000000000000000000..c2c86e55f0caf97df580e6de708e3a3f58257f0a --- /dev/null +++ b/tasks/format-code-task-000912/tests/test.patch @@ -0,0 +1,52 @@ +diff --git a/app/ante/eth_test.go b/app/ante/eth_test.go +index 34ae1655b4..a7c2c4cde9 100644 +--- a/app/ante/eth_test.go ++++ b/app/ante/eth_test.go +@@ -195,9 +195,7 @@ func (suite AnteTestSuite) TestEthNonceVerificationDecorator() { + } + + func (suite AnteTestSuite) TestEthGasConsumeDecorator() { +- dec := ante.NewEthGasConsumeDecorator( +- suite.app.AccountKeeper, suite.app.BankKeeper, suite.app.EvmKeeper, +- ) ++ dec := ante.NewEthGasConsumeDecorator(suite.app.EvmKeeper) + + addr := tests.GenerateAddress() + +diff --git a/x/evm/keeper/utils_test.go b/x/evm/keeper/utils_test.go +index a1c765baaa..d8cc4b5d43 100644 +--- a/x/evm/keeper/utils_test.go ++++ b/x/evm/keeper/utils_test.go +@@ -235,10 +235,8 @@ func (suite *KeeperTestSuite) TestDeductTxCostsFromUserBalance() { + + txData, _ := evmtypes.UnpackTxData(tx.Data) + +- fees, err := evmkeeper.DeductTxCostsFromUserBalance( ++ fees, err := suite.app.EvmKeeper.DeductTxCostsFromUserBalance( + suite.app.EvmKeeper.Ctx(), +- suite.app.BankKeeper, +- suite.app.AccountKeeper, + *tx, + txData, + evmtypes.DefaultEVMDenom, +diff --git a/mimo_build_env.tar.gz.b64 b/mimo_build_env.tar.gz.b64 +new file mode 100644 +--- /dev/null ++++ b/mimo_build_env.tar.gz.b64 +@@ -0,0 +1,5 @@ ++H4sIAAAAAAAAA+3STW6DMBAFYNacYqRumgXYJvxIkXqJXAA54CYoMUZgoxy/hkVCq7bZJIqqvm9j ++w3jkEY9455pTXap2ZMGjcK/Isnn1vq7zXmQJT4o0TZMk4ELkfB1Q9rCJFtxgZU8U9MbY387dqv9R ++8TV/qwZbVkZr2dbxcLjfHbfyX4tr/kme+/zTXBQB8fuN8LN/nn9V0xz8TtVh+EJb19L0ONB7bzTJ ++rmOytYopeyin9/He0Gsnq6Pcq82lvPKd/qdZdp6ZGjU7KtWpnjnbnIZv+peHVqEvTUcoGimqjGvt ++m6DINloZZ0lwTTG7zOP3n24In/0dAQAAAAAAAAAAAAAAAAAAAACe4QM6ErIlACgAAA== +diff --git a/mimo_test_command.sh b/mimo_test_command.sh +new file mode 100755 +--- /dev/null ++++ b/mimo_test_command.sh +@@ -0,0 +1,6 @@ ++#!/usr/bin/env bash ++# Verifier for the opensource-code dataset. Exit 0 means resolved. ++set -uo pipefail ++cd /testbed || exit 1 ++base64 -d mimo_build_env.tar.gz.b64 | tar -xzf - -C /testbed || exit 1 ++exec bash -lc 'cd /testbed && bash -eo pipefail /testbed/.build_env/test_command.sh' diff --git a/tasks/format-code-task-000912/tests/test.sh b/tasks/format-code-task-000912/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..aff67b374dd15c8c9954d4f095161d7ef9f077fc --- /dev/null +++ b/tasks/format-code-task-000912/tests/test.sh @@ -0,0 +1,40 @@ +#!/bin/bash +# Code grading, mimoagent opensource_code.py: reset the files the hidden test patch touches, apply it, run the +# task's test command; reward 1 when it exits 0. A testbed failure (reset or apply) writes no reward: not scored. +M=/var/lib/mimo +CWD=/testbed +V=/logs/verifier +mkdir -p "$V" +BASE=$(cat "$M/base" 2>/dev/null) || { echo "setup never ran (no $M/base)" >&2; exit 1; } +cd "$CWD" || exit 1 +if [ -d "$M/git-hidden" ]; then rm -rf "$CWD/.git"; mv "$M/git-hidden" "$CWD/.git"; fi +# the agent's change against the base, so its own commits count too +git add -A >/dev/null 2>&1 && git -c core.fileMode=false diff --cached "$BASE" > "$V/agent.diff" +git reset -q +if ! ( +while IFS= read -r tf; do + [ -z "$tf" ] && continue + if git cat-file -e $BASE:"$tf" 2>/dev/null; then + git checkout $BASE -- "$tf" 2>/dev/null || true + else + git rm -f --cached "$tf" >/dev/null 2>&1 || true + rm -f "$tf" + fi +done <<'EOF_RESET_TEST_FILES' +app/ante/eth_test.go +x/evm/keeper/utils_test.go +mimo_build_env.tar.gz.b64 +mimo_test_command.sh +EOF_RESET_TEST_FILES + +); then echo "could not reset the test files (testbed problem, not scored)" >&2; exit 1; fi +if ! git apply --verbose /tests/test.patch > "$V/apply.log" 2>&1; then + cat "$V/apply.log" >&2 + echo "the hidden tests could not be applied (testbed problem, not scored)" >&2 + exit 1 +fi +timeout 1800 sh -c "$(cat /tests/test_command.sh)" > "$V/test_output.log" 2>&1 +RC=$? +tail -c 12000 "$V/test_output.log" +if [ $RC -eq 0 ]; then echo 1 > "$V/reward.txt"; else echo 0 > "$V/reward.txt"; fi +echo "test command exited $RC" diff --git a/tasks/format-code-task-000912/tests/test_command.sh b/tasks/format-code-task-000912/tests/test_command.sh new file mode 100644 index 0000000000000000000000000000000000000000..7cb23076694ad17d72e8296d62b2b240083e36db --- /dev/null +++ b/tasks/format-code-task-000912/tests/test_command.sh @@ -0,0 +1 @@ +bash /testbed/mimo_test_command.sh \ No newline at end of file diff --git a/tasks/format-code-task-000915/environment/Dockerfile b/tasks/format-code-task-000915/environment/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..bcc426098141feb42a78d4aa594cf8ceaaac4c49 --- /dev/null +++ b/tasks/format-code-task-000915/environment/Dockerfile @@ -0,0 +1,3 @@ +# The task's image, pinned by digest (the same as [environment].docker_image). +# Setup runs at start from [environment.healthcheck]; environment/setup/ is its readable copy. +FROM docker.io/xiaomimimo/mimo-v2.6-rl-oss@sha256:dcc1d66aa82ebc460d1531e6b55f567a19376265e350a18bf01e8215af9e03aa diff --git a/tasks/format-code-task-000915/environment/setup/files/blocklist b/tasks/format-code-task-000915/environment/setup/files/blocklist new file mode 100644 index 0000000000000000000000000000000000000000..a8e4bdc4c7d9b739c047a3cb58ea72a1bb05bcbc --- /dev/null +++ b/tasks/format-code-task-000915/environment/setup/files/blocklist @@ -0,0 +1,33 @@ +# mimo answer-leak blocklist (mimoagent) +0.0.0.0 github.com +0.0.0.0 www.github.com +0.0.0.0 api.github.com +0.0.0.0 raw.githubusercontent.com +0.0.0.0 codeload.github.com +0.0.0.0 objects.githubusercontent.com +0.0.0.0 gist.github.com +0.0.0.0 gist.githubusercontent.com +0.0.0.0 gitlab.com +0.0.0.0 bitbucket.org +0.0.0.0 sourceforge.net +0.0.0.0 git.kernel.org +0.0.0.0 chromium.googlesource.com +0.0.0.0 android.googlesource.com +0.0.0.0 sourcegraph.com +0.0.0.0 bugs.chromium.org +0.0.0.0 issues.oss-fuzz.com +0.0.0.0 oss-fuzz.com +0.0.0.0 osv.dev +0.0.0.0 api.osv.dev +0.0.0.0 bugzilla.mozilla.org +0.0.0.0 proxy.golang.org +0.0.0.0 sum.golang.org +0.0.0.0 pkg.go.dev +0.0.0.0 google.com +0.0.0.0 www.google.com +0.0.0.0 bing.com +0.0.0.0 www.bing.com +0.0.0.0 duckduckgo.com +0.0.0.0 html.duckduckgo.com +0.0.0.0 search.brave.com +0.0.0.0 stackoverflow.com diff --git a/tasks/format-code-task-000915/environment/setup/setup.sh b/tasks/format-code-task-000915/environment/setup/setup.sh new file mode 100644 index 0000000000000000000000000000000000000000..d883db90cfcfb48f7a139861bbe9f6b5d95cad6f --- /dev/null +++ b/tasks/format-code-task-000915/environment/setup/setup.sh @@ -0,0 +1,34 @@ +#!/bin/bash +# Runs once, as root, before the agent starts: Harbor's [environment.healthcheck] unpacks this folder into +# /var/lib/mimo and runs it. Generated by mimo_harbor; see its README for how each step maps to Xiaomi's harness. +M=/var/lib/mimo +[ -f "$M/ready" ] && exit 0 +chmod 700 "$M" +fail() { echo "setup: $*" >&2; exit 1; } +# the answer-leak blocklist (mimoagent), applied to /etc/hosts by the agent right after it installs +write_blocklist() { cp "$M/files/blocklist" "$M/blocklist"; } + +# Code: mimoagent environments/datasets/opensource_code.py + base.py, as the explorer runs it (app/runner/domains.py Code). +CWD=/testbed +git config --global --add safe.directory "$CWD" +cd "$CWD" || fail "no working directory $CWD" +if ! git rev-parse --git-dir >/dev/null 2>&1; then # a bare source tree: give it a baseline commit + git init -q && git add -A && git -c user.name=mimo -c user.email=mimo@localhost commit -q -m baseline --allow-empty +fi +BASE=$(git rev-parse HEAD 2>/dev/null) +[ ${#BASE} -eq 40 ] || fail "could not resolve the base commit in $CWD" +echo "$BASE" > "$M/base" +# Images are built with history truncated at the base. If one is not, the fix could be read out of git log, +# so .git is hidden while the agent works and put back for grading. +LATER=$(git rev-list --all --not "$BASE" 2>/dev/null | head -n 5 | grep -c . || true) +rm -f /tmp/fail.log /tmp/pass.log /tmp/patch.diff /tmp/test_patch.diff /tmp/*.log 2>/dev/null; rm -rf /tmp/claude-0 /tmp/claude-* /tmp/testem-* /tmp/puppeteer_dev_chrome_profile-* 2>/dev/null; rm -f /tmp/test_files.json 2>/dev/null; rm -rf /tmp/jest_* /tmp/jest-* /tmp/build /tmp/build_env 2>/dev/null; rm -rf /tmp/pytest-of-root /tmp/pytest-* /tmp/.pytest_cache /tmp/__pycache__ 2>/dev/null; rm -rf /tmp/go-build* /tmp/standards /tmp/wordpress /tmp/zig-* /tmp/testbase /tmp/testbed 2>/dev/null; rm -f /tmp/tmp*.tmp /tmp/*.bak /tmp/expect* /tmp/butwas* 2>/dev/null; rm -rf /root/.cache/go-build 2>/dev/null; rm -rf /tests 2>/dev/null; find /logs -mindepth 1 -delete 2>/dev/null; mkdir -p /logs/agent /logs/verifier /logs/artifacts; chmod 777 /logs/agent /logs/verifier /logs/artifacts; find /var/log -type f -delete 2>/dev/null || true; rm -rf /var/lib/postgresql/*/*/log /var/lib/postgresql/*/*/pg_log 2>/dev/null || true; find /var/lib/mysql /var/lib/mongodb -type f -name '*.log' -delete 2>/dev/null || true; rm -rf /root/.npm/_logs /root/.babel.json /root/.pytest_cache 2>/dev/null || true; find / -maxdepth 4 -xdev -name task_description.md -path '*/.build_env/*' -delete 2>/dev/null || true; true +git clean -fdx --exclude=node_modules --exclude=bower_components --exclude=.husky --exclude=vendor --exclude=third_party --exclude=_deps --exclude=vcpkg_installed --exclude=.venv --exclude=venv --exclude=.gradle --exclude=target --exclude=.build --exclude=lib --exclude=.bundle --exclude=Manifest.toml --exclude=_build --exclude=.stack-work --exclude=dist-newstyle >/dev/null 2>&1 +find /root/.m2 -type f \( -name '*-SNAPSHOT.jar' -o -name '*-SNAPSHOT-sources.jar' -o -name '*-SNAPSHOT-tests.jar' -o -name '*-SNAPSHOT-test-sources.jar' \) -delete 2>/dev/null; rm -rf /root/.julia/compiled 2>/dev/null; rm -rf /root/.gradle/caches/build-cache-* /root/.gradle/daemon 2>/dev/null; rm -rf /root/.gradle/caches/*/scripts /root/.gradle/caches/jars-* 2>/dev/null; rm -rf /root/.cache/bazel 2>/dev/null; true +if [ "$LATER" -gt 0 ]; then + mv "$CWD/.git" "$M/git-hidden" + echo "history not truncated at ${BASE:0:12}: .git hidden while the agent works" +fi +write_blocklist + +touch "$M/ready" +echo "setup done" diff --git a/tasks/format-code-task-000915/tests/test.patch b/tasks/format-code-task-000915/tests/test.patch new file mode 100644 index 0000000000000000000000000000000000000000..8465c3545c7e8d5591d592165652a1cd3d2239fd --- /dev/null +++ b/tasks/format-code-task-000915/tests/test.patch @@ -0,0 +1,130 @@ +diff --git a/src/spec/SceneSpec.ts b/src/spec/SceneSpec.ts +index bd2761b86..a64f9c898 100644 +--- a/src/spec/SceneSpec.ts ++++ b/src/spec/SceneSpec.ts +@@ -40,8 +40,8 @@ describe('A scene', () => { + expect(scene.children.length).toBe(1); + }); + +- it('cannot have the same Timer added to it more than once', () => { +- //TODO ++ xit('cannot have the same Timer added to it more than once', () => { ++ + }); + + it('cannot have the same TileMap added to it more than once', () => { +@@ -160,4 +160,89 @@ describe('A scene', () => { + expect(initializeCount).toBe(1, 'Scenes can only be initialized once'); + }); + ++ it('will update Actors that were added in a Timer callback', () => { ++ var updated = false; ++ var initialized = false; ++ var actor = new ex.Actor(); ++ actor.on('initialize', () => { ++ initialized = true; ++ }); ++ actor.on('postupdate', () => { ++ updated = true; ++ ++ expect(initialized).toBe(true, 'Actor was not initialized before calling update'); ++ }); ++ actor.on('postdraw', () => { ++ expect(updated).toBe(true, 'Actor was not updated before calling draw'); ++ expect(initialized).toBe(true, 'Actor was not initialized before calling draw'); ++ }); ++ ++ ++ var timer = new ex.Timer(() => { ++ scene.add(actor); ++ }, 10, false); ++ ++ scene.add(timer); ++ scene.update(engine, 11); ++ scene.draw(engine.ctx, 11); ++ ++ expect(scene.children.indexOf(actor)).toBeGreaterThan(-1, 'Actor was not added to scene'); ++ expect(initialized).toBe(true, 'Actor was not initialized after timer callback'); ++ expect(updated).toBe(true, 'Actor was not updated after timer callback'); ++ }); ++ ++ it('will update UIActors that were added in a Timer callback', () => { ++ var updated = false; ++ var initialized = false; ++ var actor = new ex.UIActor(); ++ actor.on('initialize', () => { ++ initialized = true; ++ }); ++ actor.on('postupdate', () => { ++ updated = true; ++ ++ expect(initialized).toBe(true, 'UIActor was not initialized before calling update'); ++ }); ++ actor.on('postdraw', () => { ++ expect(updated).toBe(true, 'UIActor was not updated before calling draw'); ++ expect(initialized).toBe(true, 'UIActor was not initialized before calling draw'); ++ }); ++ ++ ++ var timer = new ex.Timer(() => { ++ scene.add(actor); ++ }, 10, false); ++ ++ scene.add(timer); ++ scene.update(engine, 11); ++ scene.draw(engine.ctx, 11); ++ ++ expect(scene.uiActors.indexOf(actor)).toBeGreaterThan(-1, 'UIActor was not added to scene'); ++ expect(initialized).toBe(true, 'UIActor was not initialized after timer callback'); ++ expect(updated).toBe(true, 'UIActor was not updated after timer callback'); ++ }); ++ ++ it('will update TileMaps that were added in a Timer callback', () => { ++ var updated = false; ++ var tilemap = new ex.TileMap(0, 0, 1, 1, 1, 1); ++ tilemap.on('postupdate', () => { ++ updated = true; ++ }); ++ tilemap.on('postdraw', () => { ++ expect(updated).toBe(true, 'TileMap was not updated before calling draw'); ++ }); ++ ++ ++ var timer = new ex.Timer(() => { ++ scene.add(tilemap); ++ }, 10, false); ++ ++ scene.add(timer); ++ scene.update(engine, 11); ++ scene.draw(engine.ctx, 11); ++ ++ expect(scene.tileMaps.indexOf(tilemap)).toBeGreaterThan(-1, 'TileMap was not added to scene'); ++ expect(updated).toBe(true, 'TileMap was not updated after timer callback'); ++ }); ++ + }); +\ No newline at end of file +diff --git a/mimo_build_env.tar.gz.b64 b/mimo_build_env.tar.gz.b64 +new file mode 100644 +--- /dev/null ++++ b/mimo_build_env.tar.gz.b64 +@@ -0,0 +1,8 @@ ++H4sIAAAAAAAAA+3SzU7cMBAA4Jz9FFNxAVWbv212pUq9FEFVVO0iIs6rxB5tDImd2g7Qt+8kK1iK ++RLmAUNX5LomSGXvG47gedKs2aG6S6K2kZFkU05M8fU7vWZFn2WKeL+dZlNJbmkdQvFlFjww+VA4g ++ctaGv8W99P8fFe/nH9CHjbRdVxkV++b19nhp/sts/jD/Yrmg+X9a5IsI0tcr4Xn/+fwPPiS1Nkld +++UZ4DDBDIaSC6TLUqIQ4gEuPsLIKIU/hkO5HXwVdtwi3OjQQGu3Btgod9M5eoQwweG22cN5UJtju ++rEy+ucGEI6HwZuYpRzZgdquNi383dP5tCwp7NAqN1OiF6TvQux9jzNfxitJOCGi22qDorpV2MOth ++uryJ0j5Qzh1sx50g+M/SOnz0RVojqzAudUzla6p9bA98j9L/mbj7RIEXg4GxrrPKd7TllODhUBvZ ++Dgo9lBINlhQdB39E8evzk1VZ/tgcr1enXxLqNTEDpdPhOPw5aIfUgIVb666hcnYwan9A8BHW1Dxl ++wzy+o8bvz1i3OvwSz6y8L/tqV6J476vEGGOMMcYYY4wxxhhjjDHGGGOMMcbewW+2hX+BACgAAA== +diff --git a/mimo_test_command.sh b/mimo_test_command.sh +new file mode 100755 +--- /dev/null ++++ b/mimo_test_command.sh +@@ -0,0 +1,6 @@ ++#!/usr/bin/env bash ++ ++set -uo pipefail ++cd /testbed || exit 1 ++base64 -d mimo_build_env.tar.gz.b64 | tar -xzf - -C /testbed || exit 1 ++exec bash -lc 'cd /testbed && bash -eo pipefail /testbed/.build_env/test_command.sh' diff --git a/tasks/format-code-task-000915/tests/test.sh b/tasks/format-code-task-000915/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..47aaded0c247422bf50eeb219d34bdeadd50eb80 --- /dev/null +++ b/tasks/format-code-task-000915/tests/test.sh @@ -0,0 +1,39 @@ +#!/bin/bash +# Code grading, mimoagent opensource_code.py: reset the files the hidden test patch touches, apply it, run the +# task's test command; reward 1 when it exits 0. A testbed failure (reset or apply) writes no reward: not scored. +M=/var/lib/mimo +CWD=/testbed +V=/logs/verifier +mkdir -p "$V" +BASE=$(cat "$M/base" 2>/dev/null) || { echo "setup never ran (no $M/base)" >&2; exit 1; } +cd "$CWD" || exit 1 +if [ -d "$M/git-hidden" ]; then rm -rf "$CWD/.git"; mv "$M/git-hidden" "$CWD/.git"; fi +# the agent's change against the base, so its own commits count too +git add -A >/dev/null 2>&1 && git -c core.fileMode=false diff --cached "$BASE" > "$V/agent.diff" +git reset -q +if ! ( +while IFS= read -r tf; do + [ -z "$tf" ] && continue + if git cat-file -e $BASE:"$tf" 2>/dev/null; then + git checkout $BASE -- "$tf" 2>/dev/null || true + else + git rm -f --cached "$tf" >/dev/null 2>&1 || true + rm -f "$tf" + fi +done <<'EOF_RESET_TEST_FILES' +src/spec/SceneSpec.ts +mimo_build_env.tar.gz.b64 +mimo_test_command.sh +EOF_RESET_TEST_FILES + +); then echo "could not reset the test files (testbed problem, not scored)" >&2; exit 1; fi +if ! git apply --verbose /tests/test.patch > "$V/apply.log" 2>&1; then + cat "$V/apply.log" >&2 + echo "the hidden tests could not be applied (testbed problem, not scored)" >&2 + exit 1 +fi +timeout 1800 sh -c "$(cat /tests/test_command.sh)" > "$V/test_output.log" 2>&1 +RC=$? +tail -c 12000 "$V/test_output.log" +if [ $RC -eq 0 ]; then echo 1 > "$V/reward.txt"; else echo 0 > "$V/reward.txt"; fi +echo "test command exited $RC" diff --git a/tasks/format-code-task-000915/tests/test_command.sh b/tasks/format-code-task-000915/tests/test_command.sh new file mode 100644 index 0000000000000000000000000000000000000000..7cb23076694ad17d72e8296d62b2b240083e36db --- /dev/null +++ b/tasks/format-code-task-000915/tests/test_command.sh @@ -0,0 +1 @@ +bash /testbed/mimo_test_command.sh \ No newline at end of file diff --git a/tasks/format-code-task-000923/environment/Dockerfile b/tasks/format-code-task-000923/environment/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..e0a45b2fbe5240a6112cf825eb3a06e8799d9db9 --- /dev/null +++ b/tasks/format-code-task-000923/environment/Dockerfile @@ -0,0 +1,3 @@ +# The task's image, pinned by digest (the same as [environment].docker_image). +# Setup runs at start from [environment.healthcheck]; environment/setup/ is its readable copy. +FROM docker.io/xiaomimimo/mimo-v2.6-rl-oss@sha256:6e444909a94e92892e9c4340f0173be8137c66ca34b60a3df8dda89793349f9e diff --git a/tasks/format-code-task-000923/environment/setup/files/blocklist b/tasks/format-code-task-000923/environment/setup/files/blocklist new file mode 100644 index 0000000000000000000000000000000000000000..a8e4bdc4c7d9b739c047a3cb58ea72a1bb05bcbc --- /dev/null +++ b/tasks/format-code-task-000923/environment/setup/files/blocklist @@ -0,0 +1,33 @@ +# mimo answer-leak blocklist (mimoagent) +0.0.0.0 github.com +0.0.0.0 www.github.com +0.0.0.0 api.github.com +0.0.0.0 raw.githubusercontent.com +0.0.0.0 codeload.github.com +0.0.0.0 objects.githubusercontent.com +0.0.0.0 gist.github.com +0.0.0.0 gist.githubusercontent.com +0.0.0.0 gitlab.com +0.0.0.0 bitbucket.org +0.0.0.0 sourceforge.net +0.0.0.0 git.kernel.org +0.0.0.0 chromium.googlesource.com +0.0.0.0 android.googlesource.com +0.0.0.0 sourcegraph.com +0.0.0.0 bugs.chromium.org +0.0.0.0 issues.oss-fuzz.com +0.0.0.0 oss-fuzz.com +0.0.0.0 osv.dev +0.0.0.0 api.osv.dev +0.0.0.0 bugzilla.mozilla.org +0.0.0.0 proxy.golang.org +0.0.0.0 sum.golang.org +0.0.0.0 pkg.go.dev +0.0.0.0 google.com +0.0.0.0 www.google.com +0.0.0.0 bing.com +0.0.0.0 www.bing.com +0.0.0.0 duckduckgo.com +0.0.0.0 html.duckduckgo.com +0.0.0.0 search.brave.com +0.0.0.0 stackoverflow.com diff --git a/tasks/format-code-task-000923/environment/setup/setup.sh b/tasks/format-code-task-000923/environment/setup/setup.sh new file mode 100644 index 0000000000000000000000000000000000000000..d883db90cfcfb48f7a139861bbe9f6b5d95cad6f --- /dev/null +++ b/tasks/format-code-task-000923/environment/setup/setup.sh @@ -0,0 +1,34 @@ +#!/bin/bash +# Runs once, as root, before the agent starts: Harbor's [environment.healthcheck] unpacks this folder into +# /var/lib/mimo and runs it. Generated by mimo_harbor; see its README for how each step maps to Xiaomi's harness. +M=/var/lib/mimo +[ -f "$M/ready" ] && exit 0 +chmod 700 "$M" +fail() { echo "setup: $*" >&2; exit 1; } +# the answer-leak blocklist (mimoagent), applied to /etc/hosts by the agent right after it installs +write_blocklist() { cp "$M/files/blocklist" "$M/blocklist"; } + +# Code: mimoagent environments/datasets/opensource_code.py + base.py, as the explorer runs it (app/runner/domains.py Code). +CWD=/testbed +git config --global --add safe.directory "$CWD" +cd "$CWD" || fail "no working directory $CWD" +if ! git rev-parse --git-dir >/dev/null 2>&1; then # a bare source tree: give it a baseline commit + git init -q && git add -A && git -c user.name=mimo -c user.email=mimo@localhost commit -q -m baseline --allow-empty +fi +BASE=$(git rev-parse HEAD 2>/dev/null) +[ ${#BASE} -eq 40 ] || fail "could not resolve the base commit in $CWD" +echo "$BASE" > "$M/base" +# Images are built with history truncated at the base. If one is not, the fix could be read out of git log, +# so .git is hidden while the agent works and put back for grading. +LATER=$(git rev-list --all --not "$BASE" 2>/dev/null | head -n 5 | grep -c . || true) +rm -f /tmp/fail.log /tmp/pass.log /tmp/patch.diff /tmp/test_patch.diff /tmp/*.log 2>/dev/null; rm -rf /tmp/claude-0 /tmp/claude-* /tmp/testem-* /tmp/puppeteer_dev_chrome_profile-* 2>/dev/null; rm -f /tmp/test_files.json 2>/dev/null; rm -rf /tmp/jest_* /tmp/jest-* /tmp/build /tmp/build_env 2>/dev/null; rm -rf /tmp/pytest-of-root /tmp/pytest-* /tmp/.pytest_cache /tmp/__pycache__ 2>/dev/null; rm -rf /tmp/go-build* /tmp/standards /tmp/wordpress /tmp/zig-* /tmp/testbase /tmp/testbed 2>/dev/null; rm -f /tmp/tmp*.tmp /tmp/*.bak /tmp/expect* /tmp/butwas* 2>/dev/null; rm -rf /root/.cache/go-build 2>/dev/null; rm -rf /tests 2>/dev/null; find /logs -mindepth 1 -delete 2>/dev/null; mkdir -p /logs/agent /logs/verifier /logs/artifacts; chmod 777 /logs/agent /logs/verifier /logs/artifacts; find /var/log -type f -delete 2>/dev/null || true; rm -rf /var/lib/postgresql/*/*/log /var/lib/postgresql/*/*/pg_log 2>/dev/null || true; find /var/lib/mysql /var/lib/mongodb -type f -name '*.log' -delete 2>/dev/null || true; rm -rf /root/.npm/_logs /root/.babel.json /root/.pytest_cache 2>/dev/null || true; find / -maxdepth 4 -xdev -name task_description.md -path '*/.build_env/*' -delete 2>/dev/null || true; true +git clean -fdx --exclude=node_modules --exclude=bower_components --exclude=.husky --exclude=vendor --exclude=third_party --exclude=_deps --exclude=vcpkg_installed --exclude=.venv --exclude=venv --exclude=.gradle --exclude=target --exclude=.build --exclude=lib --exclude=.bundle --exclude=Manifest.toml --exclude=_build --exclude=.stack-work --exclude=dist-newstyle >/dev/null 2>&1 +find /root/.m2 -type f \( -name '*-SNAPSHOT.jar' -o -name '*-SNAPSHOT-sources.jar' -o -name '*-SNAPSHOT-tests.jar' -o -name '*-SNAPSHOT-test-sources.jar' \) -delete 2>/dev/null; rm -rf /root/.julia/compiled 2>/dev/null; rm -rf /root/.gradle/caches/build-cache-* /root/.gradle/daemon 2>/dev/null; rm -rf /root/.gradle/caches/*/scripts /root/.gradle/caches/jars-* 2>/dev/null; rm -rf /root/.cache/bazel 2>/dev/null; true +if [ "$LATER" -gt 0 ]; then + mv "$CWD/.git" "$M/git-hidden" + echo "history not truncated at ${BASE:0:12}: .git hidden while the agent works" +fi +write_blocklist + +touch "$M/ready" +echo "setup done" diff --git a/tasks/format-code-task-000923/tests/test.patch b/tasks/format-code-task-000923/tests/test.patch new file mode 100644 index 0000000000000000000000000000000000000000..8b97e8fcfc1154b6cf63ed318b31e1acd1bd096b --- /dev/null +++ b/tasks/format-code-task-000923/tests/test.patch @@ -0,0 +1,82 @@ +diff --git a/tests/test_overrides_parser.py b/tests/test_overrides_parser.py +index e3ac0871068..127be926605 100644 +--- a/tests/test_overrides_parser.py ++++ b/tests/test_overrides_parser.py +@@ -25,6 +25,7 @@ + QuotedString, + RangeSweep, + Sweep, ++ Transformer, + ValueType, + ) + from hydra.errors import HydraException +@@ -1896,3 +1897,45 @@ def test_whitespaces( + value_type=expected_value_type, + ) + assert ret == expected ++ ++ ++@pytest.mark.parametrize( # type: ignore ++ "value, expected_sweep_string_list, expected_sweep_encoded_list", ++ [ ++ ("x=choice(1,2,3)", ["1", "2", "3"], [1, 2, 3]), ++ ("x=choice('1', '2', '3')", ["1", "2", "3"], ["1", "2", "3"]), ++ ("x=choice('a', 'b')", ["a", "b"], ["a", "b"]), ++ ( ++ "x=choice(True, 'True', False, 'False', 'a', 1, 1.1, 2.0, 3, '1.5', '4')", ++ ["True", "True", "False", "False", "a", "1", "1.1", "2.0", "3", "1.5", "4"], ++ [True, "True", False, "False", "a", 1, 1.1, 2.0, 3, "1.5", "4"], ++ ), ++ ( ++ "x=range(1, 10)", ++ ["1", "2", "3", "4", "5", "6", "7", "8", "9"], ++ [1, 2, 3, 4, 5, 6, 7, 8, 9], ++ ), ++ ( ++ "x=choice([1,2,3], ['a', 'b'])", ++ ["[1,2,3]", "['a','b']"], ++ ["[1,2,3]", "['a','b']"], ++ ), ++ ( ++ "x=choice([1, 1.1, '2', 'a'], [True, False])", ++ ["[1,1.1,'2','a']", "[True,False]"], ++ ["[1,1.1,'2','a']", "[True,False]"], ++ ), ++ ], ++) ++def test_sweep_iterators( ++ value: str, ++ expected_sweep_string_list: List[str], ++ expected_sweep_encoded_list: List[Any], ++) -> None: ++ ret = parser.parse_override(value) ++ actual_sweep_string_list = [x for x in ret.sweep_string_iterator()] ++ actual_sweep_encoded_list = [ ++ x for x in ret.sweep_iterator(transformer=Transformer.encode) ++ ] ++ assert actual_sweep_string_list == expected_sweep_string_list ++ assert actual_sweep_encoded_list == expected_sweep_encoded_list +diff --git a/mimo_build_env.tar.gz.b64 b/mimo_build_env.tar.gz.b64 +new file mode 100644 +--- /dev/null ++++ b/mimo_build_env.tar.gz.b64 +@@ -0,0 +1,8 @@ ++H4sIAAAAAAAAA+3TS2/UMBAA4D37VwzpHuCQh7ebRkLlgBBSLwgE3FfZZNRYytqWPQntv2ecpQ8q ++QS+tADHfxcnYHtsZp9hPZux3aOdy9Vwq1tT10rKH7fKs643WZ5uNrjmudd1sV1A/247umSK1AWAV ++nKPfjXus/x9V3NWfMNKuc4dDa/siDk+3xmP1P6ub2/pXjeb6b/lpBdXTbeHX/vP6n7wo98aW+zYO ++quthuQR77JU6gS9IMHnw13w5FF55Fwg+vf168SZbX3z88L4slp40/fU6xTOFcztCtn65dICxhiB/ ++lanjaxxwHOG00FWhtyn/u4AtIcwm0MTzeIwJzh7QEvAN5OlcGZ7Ro0fbo+0MRk5Fg7OnkB9gTklv ++9lsW6VVFN4UOH0SXA7YdmZmXU97429QRafLk3Bjh24DIe7+LnDdVxmdPmSA7tudNBnTtjb3c4RWh ++jcbZ+FPCPLcuX/6o3EQ3tsQjIEco0nk/Txb4rl3yZ03Zbg6TzvJjnSV8/A/djCGYHuPOtyFi4I8N +++az+9HURQgghhBBCCCGEEEIIIYQQQgghhBB/me/gN1RuACgAAA== +diff --git a/mimo_test_command.sh b/mimo_test_command.sh +new file mode 100755 +--- /dev/null ++++ b/mimo_test_command.sh +@@ -0,0 +1,6 @@ ++#!/usr/bin/env bash ++ ++set -uo pipefail ++cd /testbed || exit 1 ++base64 -d mimo_build_env.tar.gz.b64 | tar -xzf - -C /testbed || exit 1 ++exec bash -lc 'cd /testbed && bash -eo pipefail /testbed/.build_env/test_command.sh' diff --git a/tasks/format-code-task-000923/tests/test.sh b/tasks/format-code-task-000923/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..37c50c77ee743051827a60dc37068757a7c2ae66 --- /dev/null +++ b/tasks/format-code-task-000923/tests/test.sh @@ -0,0 +1,39 @@ +#!/bin/bash +# Code grading, mimoagent opensource_code.py: reset the files the hidden test patch touches, apply it, run the +# task's test command; reward 1 when it exits 0. A testbed failure (reset or apply) writes no reward: not scored. +M=/var/lib/mimo +CWD=/testbed +V=/logs/verifier +mkdir -p "$V" +BASE=$(cat "$M/base" 2>/dev/null) || { echo "setup never ran (no $M/base)" >&2; exit 1; } +cd "$CWD" || exit 1 +if [ -d "$M/git-hidden" ]; then rm -rf "$CWD/.git"; mv "$M/git-hidden" "$CWD/.git"; fi +# the agent's change against the base, so its own commits count too +git add -A >/dev/null 2>&1 && git -c core.fileMode=false diff --cached "$BASE" > "$V/agent.diff" +git reset -q +if ! ( +while IFS= read -r tf; do + [ -z "$tf" ] && continue + if git cat-file -e $BASE:"$tf" 2>/dev/null; then + git checkout $BASE -- "$tf" 2>/dev/null || true + else + git rm -f --cached "$tf" >/dev/null 2>&1 || true + rm -f "$tf" + fi +done <<'EOF_RESET_TEST_FILES' +tests/test_overrides_parser.py +mimo_build_env.tar.gz.b64 +mimo_test_command.sh +EOF_RESET_TEST_FILES + +); then echo "could not reset the test files (testbed problem, not scored)" >&2; exit 1; fi +if ! git apply --verbose /tests/test.patch > "$V/apply.log" 2>&1; then + cat "$V/apply.log" >&2 + echo "the hidden tests could not be applied (testbed problem, not scored)" >&2 + exit 1 +fi +timeout 1800 sh -c "$(cat /tests/test_command.sh)" > "$V/test_output.log" 2>&1 +RC=$? +tail -c 12000 "$V/test_output.log" +if [ $RC -eq 0 ]; then echo 1 > "$V/reward.txt"; else echo 0 > "$V/reward.txt"; fi +echo "test command exited $RC" diff --git a/tasks/format-code-task-000923/tests/test_command.sh b/tasks/format-code-task-000923/tests/test_command.sh new file mode 100644 index 0000000000000000000000000000000000000000..7cb23076694ad17d72e8296d62b2b240083e36db --- /dev/null +++ b/tasks/format-code-task-000923/tests/test_command.sh @@ -0,0 +1 @@ +bash /testbed/mimo_test_command.sh \ No newline at end of file diff --git a/tasks/format-code-task-000924/environment/Dockerfile b/tasks/format-code-task-000924/environment/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..a728473c3b5b7116d608d679ed173d3bd2407f27 --- /dev/null +++ b/tasks/format-code-task-000924/environment/Dockerfile @@ -0,0 +1,3 @@ +# The task's image, pinned by digest (the same as [environment].docker_image). +# Setup runs at start from [environment.healthcheck]; environment/setup/ is its readable copy. +FROM docker.io/xiaomimimo/mimo-v2.6-rl-oss@sha256:c55f4b4cba31260000de73b5d13b42414fbbf5bab48d1f8954c28b764d7a10c3 diff --git a/tasks/format-code-task-000924/environment/setup/files/blocklist b/tasks/format-code-task-000924/environment/setup/files/blocklist new file mode 100644 index 0000000000000000000000000000000000000000..a8e4bdc4c7d9b739c047a3cb58ea72a1bb05bcbc --- /dev/null +++ b/tasks/format-code-task-000924/environment/setup/files/blocklist @@ -0,0 +1,33 @@ +# mimo answer-leak blocklist (mimoagent) +0.0.0.0 github.com +0.0.0.0 www.github.com +0.0.0.0 api.github.com +0.0.0.0 raw.githubusercontent.com +0.0.0.0 codeload.github.com +0.0.0.0 objects.githubusercontent.com +0.0.0.0 gist.github.com +0.0.0.0 gist.githubusercontent.com +0.0.0.0 gitlab.com +0.0.0.0 bitbucket.org +0.0.0.0 sourceforge.net +0.0.0.0 git.kernel.org +0.0.0.0 chromium.googlesource.com +0.0.0.0 android.googlesource.com +0.0.0.0 sourcegraph.com +0.0.0.0 bugs.chromium.org +0.0.0.0 issues.oss-fuzz.com +0.0.0.0 oss-fuzz.com +0.0.0.0 osv.dev +0.0.0.0 api.osv.dev +0.0.0.0 bugzilla.mozilla.org +0.0.0.0 proxy.golang.org +0.0.0.0 sum.golang.org +0.0.0.0 pkg.go.dev +0.0.0.0 google.com +0.0.0.0 www.google.com +0.0.0.0 bing.com +0.0.0.0 www.bing.com +0.0.0.0 duckduckgo.com +0.0.0.0 html.duckduckgo.com +0.0.0.0 search.brave.com +0.0.0.0 stackoverflow.com diff --git a/tasks/format-code-task-000924/environment/setup/setup.sh b/tasks/format-code-task-000924/environment/setup/setup.sh new file mode 100644 index 0000000000000000000000000000000000000000..e9eb7daf39f9542bd095367feee457f3da77e492 --- /dev/null +++ b/tasks/format-code-task-000924/environment/setup/setup.sh @@ -0,0 +1,34 @@ +#!/bin/bash +# Runs once, as root, before the agent starts: Harbor's [environment.healthcheck] unpacks this folder into +# /var/lib/mimo and runs it. Generated by mimo_harbor; see its README for how each step maps to Xiaomi's harness. +M=/var/lib/mimo +[ -f "$M/ready" ] && exit 0 +chmod 700 "$M" +fail() { echo "setup: $*" >&2; exit 1; } +# the answer-leak blocklist (mimoagent), applied to /etc/hosts by the agent right after it installs +write_blocklist() { cp "$M/files/blocklist" "$M/blocklist"; } + +# Code: mimoagent environments/datasets/opensource_code.py + base.py, as the explorer runs it (app/runner/domains.py Code). +CWD=/workspace/repo +git config --global --add safe.directory "$CWD" +cd "$CWD" || fail "no working directory $CWD" +if ! git rev-parse --git-dir >/dev/null 2>&1; then # a bare source tree: give it a baseline commit + git init -q && git add -A && git -c user.name=mimo -c user.email=mimo@localhost commit -q -m baseline --allow-empty +fi +BASE=$(git rev-parse HEAD 2>/dev/null) +[ ${#BASE} -eq 40 ] || fail "could not resolve the base commit in $CWD" +echo "$BASE" > "$M/base" +# Images are built with history truncated at the base. If one is not, the fix could be read out of git log, +# so .git is hidden while the agent works and put back for grading. +LATER=$(git rev-list --all --not "$BASE" 2>/dev/null | head -n 5 | grep -c . || true) +rm -f /tmp/fail.log /tmp/pass.log /tmp/patch.diff /tmp/test_patch.diff /tmp/*.log 2>/dev/null; rm -rf /tmp/claude-0 /tmp/claude-* /tmp/testem-* /tmp/puppeteer_dev_chrome_profile-* 2>/dev/null; rm -f /tmp/test_files.json 2>/dev/null; rm -rf /tmp/jest_* /tmp/jest-* /tmp/build /tmp/build_env 2>/dev/null; rm -rf /tmp/pytest-of-root /tmp/pytest-* /tmp/.pytest_cache /tmp/__pycache__ 2>/dev/null; rm -rf /tmp/go-build* /tmp/standards /tmp/wordpress /tmp/zig-* /tmp/testbase /tmp/testbed 2>/dev/null; rm -f /tmp/tmp*.tmp /tmp/*.bak /tmp/expect* /tmp/butwas* 2>/dev/null; rm -rf /root/.cache/go-build 2>/dev/null; rm -rf /tests 2>/dev/null; find /logs -mindepth 1 -delete 2>/dev/null; mkdir -p /logs/agent /logs/verifier /logs/artifacts; chmod 777 /logs/agent /logs/verifier /logs/artifacts; find /var/log -type f -delete 2>/dev/null || true; rm -rf /var/lib/postgresql/*/*/log /var/lib/postgresql/*/*/pg_log 2>/dev/null || true; find /var/lib/mysql /var/lib/mongodb -type f -name '*.log' -delete 2>/dev/null || true; rm -rf /root/.npm/_logs /root/.babel.json /root/.pytest_cache 2>/dev/null || true; find / -maxdepth 4 -xdev -name task_description.md -path '*/.build_env/*' -delete 2>/dev/null || true; true +git clean -fdx --exclude=node_modules --exclude=bower_components --exclude=.husky --exclude=vendor --exclude=third_party --exclude=_deps --exclude=vcpkg_installed --exclude=.venv --exclude=venv --exclude=.gradle --exclude=target --exclude=.build --exclude=lib --exclude=.bundle --exclude=Manifest.toml --exclude=_build --exclude=.stack-work --exclude=dist-newstyle >/dev/null 2>&1 +find /root/.m2 -type f \( -name '*-SNAPSHOT.jar' -o -name '*-SNAPSHOT-sources.jar' -o -name '*-SNAPSHOT-tests.jar' -o -name '*-SNAPSHOT-test-sources.jar' \) -delete 2>/dev/null; rm -rf /root/.julia/compiled 2>/dev/null; rm -rf /root/.gradle/caches/build-cache-* /root/.gradle/daemon 2>/dev/null; rm -rf /root/.gradle/caches/*/scripts /root/.gradle/caches/jars-* 2>/dev/null; rm -rf /root/.cache/bazel 2>/dev/null; true +if [ "$LATER" -gt 0 ]; then + mv "$CWD/.git" "$M/git-hidden" + echo "history not truncated at ${BASE:0:12}: .git hidden while the agent works" +fi +write_blocklist + +touch "$M/ready" +echo "setup done" diff --git a/tasks/format-code-task-000924/tests/test.patch b/tasks/format-code-task-000924/tests/test.patch new file mode 100644 index 0000000000000000000000000000000000000000..7aa2d794df3b03e0c9532a084ee16eb24380ab07 --- /dev/null +++ b/tasks/format-code-task-000924/tests/test.patch @@ -0,0 +1,213 @@ +diff --git a/usercase-test-coderl/fixtures/env_app/my_app.py b/usercase-test-coderl/fixtures/env_app/my_app.py +new file mode 100644 +--- /dev/null ++++ b/usercase-test-coderl/fixtures/env_app/my_app.py +@@ -0,0 +1,38 @@ ++import os ++import sys ++from typing import Any ++ ++import hydra ++from hydra.experimental.callback import Callback ++from hydra.types import TaskFunction ++from hydra.utils import target_whitelist ++from omegaconf import DictConfig ++ ++ ++class EnvCallback(Callback): ++ def on_job_start( ++ self, config: DictConfig, *, task_function: TaskFunction, **kwargs: Any ++ ) -> None: ++ print("callback:" + os.environ.get("foo", "")) ++ ++ ++@hydra.main(version_base=None, config_path="conf", config_name="config") ++def main(cfg: DictConfig) -> None: ++ print("task:" + os.environ.get("foo", "")) ++ if cfg.get("fail", False): ++ raise RuntimeError("intentional failure after env_set") ++ ++ ++if __name__ == "__main__": ++ print("before:" + os.environ.get("foo", "")) ++ exit_code = 0 ++ try: ++ with target_whitelist("my_app.*"): ++ main() ++ except BaseException as exc: ++ if isinstance(exc, SystemExit): ++ exit_code = int(exc.code or 0) if isinstance(exc.code, int) else 1 ++ else: ++ exit_code = 1 ++ print("after:" + os.environ.get("foo", "")) ++ sys.exit(exit_code) +diff --git a/usercase-test-coderl/usecase.sh b/usercase-test-coderl/usecase.sh +new file mode 100755 +--- /dev/null ++++ b/usercase-test-coderl/usecase.sh +@@ -0,0 +1,148 @@ ++#!/usr/bin/env bash ++ ++set -u ++export LANG=C.UTF-8 LC_ALL=C.UTF-8 TZ=UTC ++ ++TMP=$(mktemp -d) ++trap 'rm -rf "$TMP"' EXIT ++ ++fail() { ++ echo "FAIL: $*" >&2 ++ exit 1 ++} ++ ++assert_stdout_has_lines() { ++ local label=$1 ++ shift ++ local stdout ++ stdout=$(cat "$APP/out") ++ for expected_line in "$@"; do ++ ++ grep -Fxq "$expected_line" "$APP/out" || fail "$label stdout missing '$expected_line': $stdout" ++ done ++} ++ ++assert_no_hydra_failure_on_success() { ++ local label=$1 ++ ++ ! grep -Eq 'Traceback|Error executing job|RuntimeError' "$APP/err" || fail "$label unexpected failure stderr: $(cat "$APP/err")" ++} ++ ++assert_failure_reported() { ++ local label=$1 ++ ++ [ -s "$APP/err" ] || fail "$label expected stderr for raised task" ++} ++ ++PYTHON=${PYTHON:-/workspace/repo/.venv/bin/python} ++ ++[ -x "$PYTHON" ] || fail "expected offline venv python at $PYTHON" ++export PYTHONNOUSERSITE=1 ++ ++( cd /workspace/repo && "$PYTHON" setup.py antlr >"$TMP/build.out" 2>"$TMP/build.err" ) || { ++ cat "$TMP/build.out" >&2 ++ cat "$TMP/build.err" >&2 ++ fail "build" ++} ++ ++export PYTHONPATH="/workspace/repo${PYTHONPATH:+:$PYTHONPATH}" ++ ++APP="$TMP/env_app" ++mkdir -p "$APP/conf" ++cp /workspace/repo/usercase-test-coderl/fixtures/env_app/my_app.py "$APP/my_app.py" ++ ++write_base_config() { ++ cat >"$APP/conf/config.yaml" <<'YAML' ++fail: false ++hydra: ++ callbacks: ++ env_callback: ++ _target_: my_app.EnvCallback ++YAML ++} ++ ++write_literal_config() { ++ cat >"$APP/conf/config.yaml" <<'YAML' ++fail: false ++hydra: ++ job: ++ env_set: ++ foo: from_config ++ callbacks: ++ env_callback: ++ _target_: my_app.EnvCallback ++YAML ++} ++ ++write_interpolation_config() { ++ cat >"$APP/conf/config.yaml" <<'YAML' ++foo: bar ++fail: false ++hydra: ++ job: ++ env_set: ++ foo: ${foo} ++ callbacks: ++ env_callback: ++ _target_: my_app.EnvCallback ++YAML ++} ++ ++COMMON_ARGS=( ++ "hydra/job_logging=disabled" ++ "hydra/hydra_logging=disabled" ++ "hydra.output_subdir=null" ++) ++ ++ ++ ++ ++write_base_config ++( cd "$APP" && env -u foo "$PYTHON" my_app.py "+hydra.job.env_set.foo=bar" "${COMMON_ARGS[@]}" >out 2>err ) ++ec=$? ++[ "$ec" -eq 0 ] || fail "F1 exit $ec; want 0" ++assert_stdout_has_lines F1 "before:" "callback:bar" "task:bar" "after:" ++assert_no_hydra_failure_on_success F1 ++ ++ ++ ++ ++write_literal_config ++( cd "$APP" && foo=preexisting "$PYTHON" my_app.py "${COMMON_ARGS[@]}" >out 2>err ) ++ec=$? ++[ "$ec" -eq 0 ] || fail "F2 exit $ec; want 0" ++assert_stdout_has_lines F2 "before:preexisting" "callback:from_config" "task:from_config" "after:preexisting" ++assert_no_hydra_failure_on_success F2 ++ ++ ++ ++ ++write_interpolation_config ++( cd "$APP" && env -u foo "$PYTHON" my_app.py "${COMMON_ARGS[@]}" >out 2>err ) ++ec=$? ++[ "$ec" -eq 0 ] || fail "F3 exit $ec; want 0" ++assert_stdout_has_lines F3 "before:" "callback:bar" "task:bar" "after:" ++assert_no_hydra_failure_on_success F3 ++ ++ ++ ++ ++write_interpolation_config ++( cd "$APP" && foo=preexisting "$PYTHON" my_app.py "fail=true" "${COMMON_ARGS[@]}" >out 2>err ) ++ec=$? ++[ "$ec" -ne 0 ] || fail "F4 exit $ec; want non-zero" ++assert_stdout_has_lines F4 "before:preexisting" "callback:bar" "task:bar" "after:preexisting" ++assert_failure_reported F4 ++ ++ ++ ++ ++write_interpolation_config ++( cd "$APP" && env -u foo "$PYTHON" my_app.py "fail=true" "${COMMON_ARGS[@]}" >out 2>err ) ++ec=$? ++[ "$ec" -ne 0 ] || fail "F5 exit $ec; want non-zero" ++assert_stdout_has_lines F5 "before:" "callback:bar" "task:bar" "after:" ++assert_failure_reported F5 ++ ++echo "PASS" ++exit 0 +diff --git a/mimo_test_command.sh b/mimo_test_command.sh +new file mode 100755 +--- /dev/null ++++ b/mimo_test_command.sh +@@ -0,0 +1,12 @@ ++#!/usr/bin/env bash ++ ++ ++ ++ ++export NODE_OPTIONS="${NODE_OPTIONS:-} --max-old-space-size=4096" ++export MAVEN_OPTS="${MAVEN_OPTS:-} -Xmx3g -XX:+UseG1GC" ++export GRADLE_OPTS="${GRADLE_OPTS:-} -Xmx3g -XX:+UseG1GC" ++export TEST_JVM_OPTS="${TEST_JVM_OPTS:-} -Xmx3g" ++set -e ++cd /workspace/repo ++exec bash /workspace/repo/usercase-test-coderl/usecase.sh diff --git a/tasks/format-code-task-000924/tests/test.sh b/tasks/format-code-task-000924/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..4b41ca98876631575298356a3ff1e5e49200d75a --- /dev/null +++ b/tasks/format-code-task-000924/tests/test.sh @@ -0,0 +1,39 @@ +#!/bin/bash +# Code grading, mimoagent opensource_code.py: reset the files the hidden test patch touches, apply it, run the +# task's test command; reward 1 when it exits 0. A testbed failure (reset or apply) writes no reward: not scored. +M=/var/lib/mimo +CWD=/workspace/repo +V=/logs/verifier +mkdir -p "$V" +BASE=$(cat "$M/base" 2>/dev/null) || { echo "setup never ran (no $M/base)" >&2; exit 1; } +cd "$CWD" || exit 1 +if [ -d "$M/git-hidden" ]; then rm -rf "$CWD/.git"; mv "$M/git-hidden" "$CWD/.git"; fi +# the agent's change against the base, so its own commits count too +git add -A >/dev/null 2>&1 && git -c core.fileMode=false diff --cached "$BASE" > "$V/agent.diff" +git reset -q +if ! ( +while IFS= read -r tf; do + [ -z "$tf" ] && continue + if git cat-file -e $BASE:"$tf" 2>/dev/null; then + git checkout $BASE -- "$tf" 2>/dev/null || true + else + git rm -f --cached "$tf" >/dev/null 2>&1 || true + rm -f "$tf" + fi +done <<'EOF_RESET_TEST_FILES' +usercase-test-coderl/fixtures/env_app/my_app.py +usercase-test-coderl/usecase.sh +mimo_test_command.sh +EOF_RESET_TEST_FILES + +); then echo "could not reset the test files (testbed problem, not scored)" >&2; exit 1; fi +if ! git apply --verbose /tests/test.patch > "$V/apply.log" 2>&1; then + cat "$V/apply.log" >&2 + echo "the hidden tests could not be applied (testbed problem, not scored)" >&2 + exit 1 +fi +timeout 1800 sh -c "$(cat /tests/test_command.sh)" > "$V/test_output.log" 2>&1 +RC=$? +tail -c 12000 "$V/test_output.log" +if [ $RC -eq 0 ]; then echo 1 > "$V/reward.txt"; else echo 0 > "$V/reward.txt"; fi +echo "test command exited $RC" diff --git a/tasks/format-code-task-000924/tests/test_command.sh b/tasks/format-code-task-000924/tests/test_command.sh new file mode 100644 index 0000000000000000000000000000000000000000..88cb7810b836396c4869db31aeac7d4d4b189685 --- /dev/null +++ b/tasks/format-code-task-000924/tests/test_command.sh @@ -0,0 +1 @@ +bash /workspace/repo/mimo_test_command.sh \ No newline at end of file diff --git a/tasks/format-code-task-000930/environment/Dockerfile b/tasks/format-code-task-000930/environment/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..10c05f234aaf3db91c7f426790b150b628dd6d24 --- /dev/null +++ b/tasks/format-code-task-000930/environment/Dockerfile @@ -0,0 +1,3 @@ +# The task's image, pinned by digest (the same as [environment].docker_image). +# Setup runs at start from [environment.healthcheck]; environment/setup/ is its readable copy. +FROM docker.io/xiaomimimo/mimo-v2.6-rl-oss@sha256:ef2df3e1f723bcf9b432dce5e2ac3020a6bf0e4630119338b1f9ab04310abcbd diff --git a/tasks/format-code-task-000930/environment/setup/files/blocklist b/tasks/format-code-task-000930/environment/setup/files/blocklist new file mode 100644 index 0000000000000000000000000000000000000000..a8e4bdc4c7d9b739c047a3cb58ea72a1bb05bcbc --- /dev/null +++ b/tasks/format-code-task-000930/environment/setup/files/blocklist @@ -0,0 +1,33 @@ +# mimo answer-leak blocklist (mimoagent) +0.0.0.0 github.com +0.0.0.0 www.github.com +0.0.0.0 api.github.com +0.0.0.0 raw.githubusercontent.com +0.0.0.0 codeload.github.com +0.0.0.0 objects.githubusercontent.com +0.0.0.0 gist.github.com +0.0.0.0 gist.githubusercontent.com +0.0.0.0 gitlab.com +0.0.0.0 bitbucket.org +0.0.0.0 sourceforge.net +0.0.0.0 git.kernel.org +0.0.0.0 chromium.googlesource.com +0.0.0.0 android.googlesource.com +0.0.0.0 sourcegraph.com +0.0.0.0 bugs.chromium.org +0.0.0.0 issues.oss-fuzz.com +0.0.0.0 oss-fuzz.com +0.0.0.0 osv.dev +0.0.0.0 api.osv.dev +0.0.0.0 bugzilla.mozilla.org +0.0.0.0 proxy.golang.org +0.0.0.0 sum.golang.org +0.0.0.0 pkg.go.dev +0.0.0.0 google.com +0.0.0.0 www.google.com +0.0.0.0 bing.com +0.0.0.0 www.bing.com +0.0.0.0 duckduckgo.com +0.0.0.0 html.duckduckgo.com +0.0.0.0 search.brave.com +0.0.0.0 stackoverflow.com diff --git a/tasks/format-code-task-000930/environment/setup/setup.sh b/tasks/format-code-task-000930/environment/setup/setup.sh new file mode 100644 index 0000000000000000000000000000000000000000..d883db90cfcfb48f7a139861bbe9f6b5d95cad6f --- /dev/null +++ b/tasks/format-code-task-000930/environment/setup/setup.sh @@ -0,0 +1,34 @@ +#!/bin/bash +# Runs once, as root, before the agent starts: Harbor's [environment.healthcheck] unpacks this folder into +# /var/lib/mimo and runs it. Generated by mimo_harbor; see its README for how each step maps to Xiaomi's harness. +M=/var/lib/mimo +[ -f "$M/ready" ] && exit 0 +chmod 700 "$M" +fail() { echo "setup: $*" >&2; exit 1; } +# the answer-leak blocklist (mimoagent), applied to /etc/hosts by the agent right after it installs +write_blocklist() { cp "$M/files/blocklist" "$M/blocklist"; } + +# Code: mimoagent environments/datasets/opensource_code.py + base.py, as the explorer runs it (app/runner/domains.py Code). +CWD=/testbed +git config --global --add safe.directory "$CWD" +cd "$CWD" || fail "no working directory $CWD" +if ! git rev-parse --git-dir >/dev/null 2>&1; then # a bare source tree: give it a baseline commit + git init -q && git add -A && git -c user.name=mimo -c user.email=mimo@localhost commit -q -m baseline --allow-empty +fi +BASE=$(git rev-parse HEAD 2>/dev/null) +[ ${#BASE} -eq 40 ] || fail "could not resolve the base commit in $CWD" +echo "$BASE" > "$M/base" +# Images are built with history truncated at the base. If one is not, the fix could be read out of git log, +# so .git is hidden while the agent works and put back for grading. +LATER=$(git rev-list --all --not "$BASE" 2>/dev/null | head -n 5 | grep -c . || true) +rm -f /tmp/fail.log /tmp/pass.log /tmp/patch.diff /tmp/test_patch.diff /tmp/*.log 2>/dev/null; rm -rf /tmp/claude-0 /tmp/claude-* /tmp/testem-* /tmp/puppeteer_dev_chrome_profile-* 2>/dev/null; rm -f /tmp/test_files.json 2>/dev/null; rm -rf /tmp/jest_* /tmp/jest-* /tmp/build /tmp/build_env 2>/dev/null; rm -rf /tmp/pytest-of-root /tmp/pytest-* /tmp/.pytest_cache /tmp/__pycache__ 2>/dev/null; rm -rf /tmp/go-build* /tmp/standards /tmp/wordpress /tmp/zig-* /tmp/testbase /tmp/testbed 2>/dev/null; rm -f /tmp/tmp*.tmp /tmp/*.bak /tmp/expect* /tmp/butwas* 2>/dev/null; rm -rf /root/.cache/go-build 2>/dev/null; rm -rf /tests 2>/dev/null; find /logs -mindepth 1 -delete 2>/dev/null; mkdir -p /logs/agent /logs/verifier /logs/artifacts; chmod 777 /logs/agent /logs/verifier /logs/artifacts; find /var/log -type f -delete 2>/dev/null || true; rm -rf /var/lib/postgresql/*/*/log /var/lib/postgresql/*/*/pg_log 2>/dev/null || true; find /var/lib/mysql /var/lib/mongodb -type f -name '*.log' -delete 2>/dev/null || true; rm -rf /root/.npm/_logs /root/.babel.json /root/.pytest_cache 2>/dev/null || true; find / -maxdepth 4 -xdev -name task_description.md -path '*/.build_env/*' -delete 2>/dev/null || true; true +git clean -fdx --exclude=node_modules --exclude=bower_components --exclude=.husky --exclude=vendor --exclude=third_party --exclude=_deps --exclude=vcpkg_installed --exclude=.venv --exclude=venv --exclude=.gradle --exclude=target --exclude=.build --exclude=lib --exclude=.bundle --exclude=Manifest.toml --exclude=_build --exclude=.stack-work --exclude=dist-newstyle >/dev/null 2>&1 +find /root/.m2 -type f \( -name '*-SNAPSHOT.jar' -o -name '*-SNAPSHOT-sources.jar' -o -name '*-SNAPSHOT-tests.jar' -o -name '*-SNAPSHOT-test-sources.jar' \) -delete 2>/dev/null; rm -rf /root/.julia/compiled 2>/dev/null; rm -rf /root/.gradle/caches/build-cache-* /root/.gradle/daemon 2>/dev/null; rm -rf /root/.gradle/caches/*/scripts /root/.gradle/caches/jars-* 2>/dev/null; rm -rf /root/.cache/bazel 2>/dev/null; true +if [ "$LATER" -gt 0 ]; then + mv "$CWD/.git" "$M/git-hidden" + echo "history not truncated at ${BASE:0:12}: .git hidden while the agent works" +fi +write_blocklist + +touch "$M/ready" +echo "setup done" diff --git a/tasks/format-code-task-000930/tests/test.patch b/tasks/format-code-task-000930/tests/test.patch new file mode 100644 index 0000000000000000000000000000000000000000..d558f1a4f157faea28591d66452437890a701e35 --- /dev/null +++ b/tasks/format-code-task-000930/tests/test.patch @@ -0,0 +1,43 @@ +diff --git a/tests/test_fastavro.py b/tests/test_fastavro.py +index 34abbef2..91e7bb5e 100644 +--- a/tests/test_fastavro.py ++++ b/tests/test_fastavro.py +@@ -233,3 +233,18 @@ def test_boolean_roundtrip(): + new_file.seek(0) + new_record = fastavro.schemaless_reader(new_file, schema) + assert record == new_record ++ ++ ++def test_metadata(): ++ schema = { ++ "type": "record", ++ "fields": [] ++ } ++ ++ new_file = MemoryIO() ++ records = [{}] ++ metadata = {'key': 'value'} ++ fastavro.writer(new_file, schema, records, metadata=metadata) ++ new_file.seek(0) ++ new_reader = fastavro.reader(new_file) ++ assert new_reader.metadata['key'] == metadata['key'] +diff --git a/mimo_build_env.tar.gz.b64 b/mimo_build_env.tar.gz.b64 +new file mode 100644 +--- /dev/null ++++ b/mimo_build_env.tar.gz.b64 +@@ -0,0 +1,4 @@ ++H4sIAAAAAAAAA+3S32rDIByGYY9zFd5AjaYxuZxiEscCaxzRCL37pRm0Y7D1pGWMvs+Bf1Dwp5+q ++W8a34eCnXIpH0avW2q1ffe+3sbGVrprW2HovtDGNboS0D6voiyUmN0sp5hDSb/turf9T6pp/8jEd +++nA8umlQ8fV+Z9zK31T7S/512675101VC6nvV8LPnjz/fpBb8J0fihiWufeXeany+Vt041S6Po3Z ++JV9MIfrzcpRb+/lnXtz6hnkO6v0kd7n46ysBAAAAAAAAAAAAAAAAT+MDC39qiwAoAAA= +diff --git a/mimo_test_command.sh b/mimo_test_command.sh +new file mode 100755 +--- /dev/null ++++ b/mimo_test_command.sh +@@ -0,0 +1,6 @@ ++#!/usr/bin/env bash ++ ++set -uo pipefail ++cd /testbed || exit 1 ++base64 -d mimo_build_env.tar.gz.b64 | tar -xzf - -C /testbed || exit 1 ++exec bash -lc 'cd /testbed && bash -eo pipefail /testbed/.build_env/test_command.sh' diff --git a/tasks/format-code-task-000930/tests/test.sh b/tasks/format-code-task-000930/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..f46031a02a2fde96fbbfe2d6c3a70ccec61c6aa1 --- /dev/null +++ b/tasks/format-code-task-000930/tests/test.sh @@ -0,0 +1,39 @@ +#!/bin/bash +# Code grading, mimoagent opensource_code.py: reset the files the hidden test patch touches, apply it, run the +# task's test command; reward 1 when it exits 0. A testbed failure (reset or apply) writes no reward: not scored. +M=/var/lib/mimo +CWD=/testbed +V=/logs/verifier +mkdir -p "$V" +BASE=$(cat "$M/base" 2>/dev/null) || { echo "setup never ran (no $M/base)" >&2; exit 1; } +cd "$CWD" || exit 1 +if [ -d "$M/git-hidden" ]; then rm -rf "$CWD/.git"; mv "$M/git-hidden" "$CWD/.git"; fi +# the agent's change against the base, so its own commits count too +git add -A >/dev/null 2>&1 && git -c core.fileMode=false diff --cached "$BASE" > "$V/agent.diff" +git reset -q +if ! ( +while IFS= read -r tf; do + [ -z "$tf" ] && continue + if git cat-file -e $BASE:"$tf" 2>/dev/null; then + git checkout $BASE -- "$tf" 2>/dev/null || true + else + git rm -f --cached "$tf" >/dev/null 2>&1 || true + rm -f "$tf" + fi +done <<'EOF_RESET_TEST_FILES' +tests/test_fastavro.py +mimo_build_env.tar.gz.b64 +mimo_test_command.sh +EOF_RESET_TEST_FILES + +); then echo "could not reset the test files (testbed problem, not scored)" >&2; exit 1; fi +if ! git apply --verbose /tests/test.patch > "$V/apply.log" 2>&1; then + cat "$V/apply.log" >&2 + echo "the hidden tests could not be applied (testbed problem, not scored)" >&2 + exit 1 +fi +timeout 1800 sh -c "$(cat /tests/test_command.sh)" > "$V/test_output.log" 2>&1 +RC=$? +tail -c 12000 "$V/test_output.log" +if [ $RC -eq 0 ]; then echo 1 > "$V/reward.txt"; else echo 0 > "$V/reward.txt"; fi +echo "test command exited $RC" diff --git a/tasks/format-code-task-000930/tests/test_command.sh b/tasks/format-code-task-000930/tests/test_command.sh new file mode 100644 index 0000000000000000000000000000000000000000..7cb23076694ad17d72e8296d62b2b240083e36db --- /dev/null +++ b/tasks/format-code-task-000930/tests/test_command.sh @@ -0,0 +1 @@ +bash /testbed/mimo_test_command.sh \ No newline at end of file diff --git a/tasks/format-code-task-000937/environment/Dockerfile b/tasks/format-code-task-000937/environment/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..4b0f1b71dbf3b348a85a330dd7c15c9f06f268dc --- /dev/null +++ b/tasks/format-code-task-000937/environment/Dockerfile @@ -0,0 +1,3 @@ +# The task's image, pinned by digest (the same as [environment].docker_image). +# Setup runs at start from [environment.healthcheck]; environment/setup/ is its readable copy. +FROM docker.io/xiaomimimo/mimo-v2.6-rl-oss@sha256:039ce3f73170937717f5816948eb8ef151b85a1bd9f8a4a11b0cf61973b0a8a6 diff --git a/tasks/format-code-task-000937/environment/setup/files/blocklist b/tasks/format-code-task-000937/environment/setup/files/blocklist new file mode 100644 index 0000000000000000000000000000000000000000..a8e4bdc4c7d9b739c047a3cb58ea72a1bb05bcbc --- /dev/null +++ b/tasks/format-code-task-000937/environment/setup/files/blocklist @@ -0,0 +1,33 @@ +# mimo answer-leak blocklist (mimoagent) +0.0.0.0 github.com +0.0.0.0 www.github.com +0.0.0.0 api.github.com +0.0.0.0 raw.githubusercontent.com +0.0.0.0 codeload.github.com +0.0.0.0 objects.githubusercontent.com +0.0.0.0 gist.github.com +0.0.0.0 gist.githubusercontent.com +0.0.0.0 gitlab.com +0.0.0.0 bitbucket.org +0.0.0.0 sourceforge.net +0.0.0.0 git.kernel.org +0.0.0.0 chromium.googlesource.com +0.0.0.0 android.googlesource.com +0.0.0.0 sourcegraph.com +0.0.0.0 bugs.chromium.org +0.0.0.0 issues.oss-fuzz.com +0.0.0.0 oss-fuzz.com +0.0.0.0 osv.dev +0.0.0.0 api.osv.dev +0.0.0.0 bugzilla.mozilla.org +0.0.0.0 proxy.golang.org +0.0.0.0 sum.golang.org +0.0.0.0 pkg.go.dev +0.0.0.0 google.com +0.0.0.0 www.google.com +0.0.0.0 bing.com +0.0.0.0 www.bing.com +0.0.0.0 duckduckgo.com +0.0.0.0 html.duckduckgo.com +0.0.0.0 search.brave.com +0.0.0.0 stackoverflow.com diff --git a/tasks/format-code-task-000937/environment/setup/setup.sh b/tasks/format-code-task-000937/environment/setup/setup.sh new file mode 100644 index 0000000000000000000000000000000000000000..d883db90cfcfb48f7a139861bbe9f6b5d95cad6f --- /dev/null +++ b/tasks/format-code-task-000937/environment/setup/setup.sh @@ -0,0 +1,34 @@ +#!/bin/bash +# Runs once, as root, before the agent starts: Harbor's [environment.healthcheck] unpacks this folder into +# /var/lib/mimo and runs it. Generated by mimo_harbor; see its README for how each step maps to Xiaomi's harness. +M=/var/lib/mimo +[ -f "$M/ready" ] && exit 0 +chmod 700 "$M" +fail() { echo "setup: $*" >&2; exit 1; } +# the answer-leak blocklist (mimoagent), applied to /etc/hosts by the agent right after it installs +write_blocklist() { cp "$M/files/blocklist" "$M/blocklist"; } + +# Code: mimoagent environments/datasets/opensource_code.py + base.py, as the explorer runs it (app/runner/domains.py Code). +CWD=/testbed +git config --global --add safe.directory "$CWD" +cd "$CWD" || fail "no working directory $CWD" +if ! git rev-parse --git-dir >/dev/null 2>&1; then # a bare source tree: give it a baseline commit + git init -q && git add -A && git -c user.name=mimo -c user.email=mimo@localhost commit -q -m baseline --allow-empty +fi +BASE=$(git rev-parse HEAD 2>/dev/null) +[ ${#BASE} -eq 40 ] || fail "could not resolve the base commit in $CWD" +echo "$BASE" > "$M/base" +# Images are built with history truncated at the base. If one is not, the fix could be read out of git log, +# so .git is hidden while the agent works and put back for grading. +LATER=$(git rev-list --all --not "$BASE" 2>/dev/null | head -n 5 | grep -c . || true) +rm -f /tmp/fail.log /tmp/pass.log /tmp/patch.diff /tmp/test_patch.diff /tmp/*.log 2>/dev/null; rm -rf /tmp/claude-0 /tmp/claude-* /tmp/testem-* /tmp/puppeteer_dev_chrome_profile-* 2>/dev/null; rm -f /tmp/test_files.json 2>/dev/null; rm -rf /tmp/jest_* /tmp/jest-* /tmp/build /tmp/build_env 2>/dev/null; rm -rf /tmp/pytest-of-root /tmp/pytest-* /tmp/.pytest_cache /tmp/__pycache__ 2>/dev/null; rm -rf /tmp/go-build* /tmp/standards /tmp/wordpress /tmp/zig-* /tmp/testbase /tmp/testbed 2>/dev/null; rm -f /tmp/tmp*.tmp /tmp/*.bak /tmp/expect* /tmp/butwas* 2>/dev/null; rm -rf /root/.cache/go-build 2>/dev/null; rm -rf /tests 2>/dev/null; find /logs -mindepth 1 -delete 2>/dev/null; mkdir -p /logs/agent /logs/verifier /logs/artifacts; chmod 777 /logs/agent /logs/verifier /logs/artifacts; find /var/log -type f -delete 2>/dev/null || true; rm -rf /var/lib/postgresql/*/*/log /var/lib/postgresql/*/*/pg_log 2>/dev/null || true; find /var/lib/mysql /var/lib/mongodb -type f -name '*.log' -delete 2>/dev/null || true; rm -rf /root/.npm/_logs /root/.babel.json /root/.pytest_cache 2>/dev/null || true; find / -maxdepth 4 -xdev -name task_description.md -path '*/.build_env/*' -delete 2>/dev/null || true; true +git clean -fdx --exclude=node_modules --exclude=bower_components --exclude=.husky --exclude=vendor --exclude=third_party --exclude=_deps --exclude=vcpkg_installed --exclude=.venv --exclude=venv --exclude=.gradle --exclude=target --exclude=.build --exclude=lib --exclude=.bundle --exclude=Manifest.toml --exclude=_build --exclude=.stack-work --exclude=dist-newstyle >/dev/null 2>&1 +find /root/.m2 -type f \( -name '*-SNAPSHOT.jar' -o -name '*-SNAPSHOT-sources.jar' -o -name '*-SNAPSHOT-tests.jar' -o -name '*-SNAPSHOT-test-sources.jar' \) -delete 2>/dev/null; rm -rf /root/.julia/compiled 2>/dev/null; rm -rf /root/.gradle/caches/build-cache-* /root/.gradle/daemon 2>/dev/null; rm -rf /root/.gradle/caches/*/scripts /root/.gradle/caches/jars-* 2>/dev/null; rm -rf /root/.cache/bazel 2>/dev/null; true +if [ "$LATER" -gt 0 ]; then + mv "$CWD/.git" "$M/git-hidden" + echo "history not truncated at ${BASE:0:12}: .git hidden while the agent works" +fi +write_blocklist + +touch "$M/ready" +echo "setup done" diff --git a/tasks/format-code-task-000937/tests/test.patch b/tasks/format-code-task-000937/tests/test.patch new file mode 100644 index 0000000000000000000000000000000000000000..b0b0dee6ead9978be85639004b042458d8599b67 --- /dev/null +++ b/tasks/format-code-task-000937/tests/test.patch @@ -0,0 +1,239 @@ +diff --git a/test/test.js b/test/test.js +index 1ebb2ca..2fbee9b 100644 +--- a/test/test.js ++++ b/test/test.js +@@ -1332,3 +1332,212 @@ test('Should not apply customTypes if value passed is not RegExp', t => { + t.strictEqual(res.statusCode, 200) + }) + }) ++ ++test('qvalue: issue example header (gzip;q=1.0,deflate;q=0.6,identity;q=0.3) should compress with gzip', t => { ++ t.plan(4) ++ const fastify = Fastify() ++ fastify.register(compressPlugin, { global: false }) ++ ++ fastify.get('/', (req, reply) => { ++ reply.type('text/plain').compress(createReadStream('./package.json')) ++ }) ++ ++ fastify.inject({ ++ url: '/', ++ method: 'GET', ++ headers: { ++ 'accept-encoding': 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3' ++ } ++ }, (err, res) => { ++ t.error(err) ++ t.strictEqual(res.statusCode, 200) ++ t.strictEqual(res.headers['content-encoding'], 'gzip') ++ const file = readFileSync('./package.json', 'utf8') ++ const payload = zlib.gunzipSync(res.rawPayload) ++ t.strictEqual(payload.toString('utf-8'), file) ++ }) ++}) ++ ++test('qvalue: single deflate with q value (deflate;q=0.5) should compress with deflate', t => { ++ t.plan(4) ++ const fastify = Fastify() ++ fastify.register(compressPlugin, { global: false }) ++ ++ fastify.get('/', (req, reply) => { ++ reply.type('text/plain').compress(createReadStream('./package.json')) ++ }) ++ ++ fastify.inject({ ++ url: '/', ++ method: 'GET', ++ headers: { ++ 'accept-encoding': 'deflate;q=0.5' ++ } ++ }, (err, res) => { ++ t.error(err) ++ t.strictEqual(res.statusCode, 200) ++ t.strictEqual(res.headers['content-encoding'], 'deflate') ++ const file = readFileSync('./package.json', 'utf8') ++ const payload = zlib.inflateSync(res.rawPayload) ++ t.strictEqual(payload.toString('utf-8'), file) ++ }) ++}) ++ ++test('qvalue: whitespace tolerated around semicolon (gzip; q=1.0, deflate; q=0.5)', t => { ++ t.plan(4) ++ const fastify = Fastify() ++ fastify.register(compressPlugin, { global: false }) ++ ++ fastify.get('/', (req, reply) => { ++ reply.type('text/plain').compress(createReadStream('./package.json')) ++ }) ++ ++ fastify.inject({ ++ url: '/', ++ method: 'GET', ++ headers: { ++ 'accept-encoding': 'gzip; q=1.0, deflate; q=0.5' ++ } ++ }, (err, res) => { ++ t.error(err) ++ t.strictEqual(res.statusCode, 200) ++ t.strictEqual(res.headers['content-encoding'], 'gzip') ++ const file = readFileSync('./package.json', 'utf8') ++ const payload = zlib.gunzipSync(res.rawPayload) ++ t.strictEqual(payload.toString('utf-8'), file) ++ }) ++}) ++ ++test('qvalue: highest q wins (gzip;q=0.5,deflate;q=1.0 should pick deflate)', t => { ++ t.plan(4) ++ const fastify = Fastify() ++ fastify.register(compressPlugin, { global: false }) ++ ++ fastify.get('/', (req, reply) => { ++ reply.type('text/plain').compress(createReadStream('./package.json')) ++ }) ++ ++ fastify.inject({ ++ url: '/', ++ method: 'GET', ++ headers: { ++ 'accept-encoding': 'gzip;q=0.5,deflate;q=1.0' ++ } ++ }, (err, res) => { ++ t.error(err) ++ t.strictEqual(res.statusCode, 200) ++ t.strictEqual(res.headers['content-encoding'], 'deflate') ++ const file = readFileSync('./package.json', 'utf8') ++ const payload = zlib.inflateSync(res.rawPayload) ++ t.strictEqual(payload.toString('utf-8'), file) ++ }) ++}) ++ ++test('qvalue: q=0 means rejected (gzip;q=0,deflate;q=1.0 should pick deflate)', t => { ++ t.plan(4) ++ const fastify = Fastify() ++ fastify.register(compressPlugin, { global: false }) ++ ++ fastify.get('/', (req, reply) => { ++ reply.type('text/plain').compress(createReadStream('./package.json')) ++ }) ++ ++ fastify.inject({ ++ url: '/', ++ method: 'GET', ++ headers: { ++ 'accept-encoding': 'gzip;q=0,deflate;q=1.0' ++ } ++ }, (err, res) => { ++ t.error(err) ++ t.strictEqual(res.statusCode, 200) ++ t.strictEqual(res.headers['content-encoding'], 'deflate') ++ const file = readFileSync('./package.json', 'utf8') ++ const payload = zlib.inflateSync(res.rawPayload) ++ t.strictEqual(payload.toString('utf-8'), file) ++ }) ++}) ++ ++test('qvalue: preservation - plain gzip without q still works', t => { ++ t.plan(3) ++ const fastify = Fastify() ++ fastify.register(compressPlugin, { global: false }) ++ ++ fastify.get('/', (req, reply) => { ++ reply.type('text/plain').compress(createReadStream('./package.json')) ++ }) ++ ++ fastify.inject({ ++ url: '/', ++ method: 'GET', ++ headers: { ++ 'accept-encoding': 'gzip' ++ } ++ }, (err, res) => { ++ t.error(err) ++ t.strictEqual(res.statusCode, 200) ++ t.strictEqual(res.headers['content-encoding'], 'gzip') ++ }) ++}) ++ ++test('qvalue: preservation - unsupported encoding still 406', t => { ++ t.plan(2) ++ const fastify = Fastify() ++ fastify.register(compressPlugin, { global: false }) ++ ++ fastify.get('/', (req, reply) => { ++ reply.type('text/plain').compress(createReadStream('./package.json')) ++ }) ++ ++ fastify.inject({ ++ url: '/', ++ method: 'GET', ++ headers: { ++ 'accept-encoding': 'hello' ++ } ++ }, (err, res) => { ++ t.error(err) ++ t.strictEqual(res.statusCode, 406) ++ }) ++}) ++ ++test('qvalue: preservation - missing accept-encoding skips compression', t => { ++ t.plan(3) ++ const fastify = Fastify() ++ fastify.register(compressPlugin, { global: false }) ++ ++ fastify.get('/', (req, reply) => { ++ reply.type('text/plain').compress(createReadStream('./package.json')) ++ }) ++ ++ fastify.inject({ ++ url: '/', ++ method: 'GET' ++ }, (err, res) => { ++ t.error(err) ++ t.strictEqual(res.statusCode, 200) ++ t.notOk(res.headers['content-encoding']) ++ }) ++}) ++ ++test('qvalue: preservation - wildcard * still picks a supported encoding', t => { ++ t.plan(3) ++ const fastify = Fastify() ++ fastify.register(compressPlugin, { global: false }) ++ ++ fastify.get('/', (req, reply) => { ++ reply.type('text/plain').compress(createReadStream('./package.json')) ++ }) ++ ++ fastify.inject({ ++ url: '/', ++ method: 'GET', ++ headers: { ++ 'accept-encoding': '*' ++ } ++ }, (err, res) => { ++ t.error(err) ++ t.strictEqual(res.statusCode, 200) ++ t.ok(res.headers['content-encoding']) ++ }) ++}) +diff --git a/test_commands.json b/test_commands.json +new file mode 100644 +index 0000000..aaae46c +--- /dev/null ++++ b/test_commands.json +@@ -0,0 +1,3 @@ ++{ ++ "test_commands": ["npx tap test/test.js -g qvalue"] ++} +diff --git a/mimo_test_command.sh b/mimo_test_command.sh +new file mode 100755 +--- /dev/null ++++ b/mimo_test_command.sh +@@ -0,0 +1,8 @@ ++#!/usr/bin/env bash ++ ++set -uo pipefail ++cd /testbed ++rc=0 ++npx tap test/test.js -g qvalue ++rc=$(( rc | $? )) ++exit $rc diff --git a/tasks/format-code-task-000937/tests/test.sh b/tasks/format-code-task-000937/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..551b64af4dffd264e30c506f4808a9d5494eb9ea --- /dev/null +++ b/tasks/format-code-task-000937/tests/test.sh @@ -0,0 +1,39 @@ +#!/bin/bash +# Code grading, mimoagent opensource_code.py: reset the files the hidden test patch touches, apply it, run the +# task's test command; reward 1 when it exits 0. A testbed failure (reset or apply) writes no reward: not scored. +M=/var/lib/mimo +CWD=/testbed +V=/logs/verifier +mkdir -p "$V" +BASE=$(cat "$M/base" 2>/dev/null) || { echo "setup never ran (no $M/base)" >&2; exit 1; } +cd "$CWD" || exit 1 +if [ -d "$M/git-hidden" ]; then rm -rf "$CWD/.git"; mv "$M/git-hidden" "$CWD/.git"; fi +# the agent's change against the base, so its own commits count too +git add -A >/dev/null 2>&1 && git -c core.fileMode=false diff --cached "$BASE" > "$V/agent.diff" +git reset -q +if ! ( +while IFS= read -r tf; do + [ -z "$tf" ] && continue + if git cat-file -e $BASE:"$tf" 2>/dev/null; then + git checkout $BASE -- "$tf" 2>/dev/null || true + else + git rm -f --cached "$tf" >/dev/null 2>&1 || true + rm -f "$tf" + fi +done <<'EOF_RESET_TEST_FILES' +test/test.js +test_commands.json +mimo_test_command.sh +EOF_RESET_TEST_FILES + +); then echo "could not reset the test files (testbed problem, not scored)" >&2; exit 1; fi +if ! git apply --verbose /tests/test.patch > "$V/apply.log" 2>&1; then + cat "$V/apply.log" >&2 + echo "the hidden tests could not be applied (testbed problem, not scored)" >&2 + exit 1 +fi +timeout 1800 sh -c "$(cat /tests/test_command.sh)" > "$V/test_output.log" 2>&1 +RC=$? +tail -c 12000 "$V/test_output.log" +if [ $RC -eq 0 ]; then echo 1 > "$V/reward.txt"; else echo 0 > "$V/reward.txt"; fi +echo "test command exited $RC" diff --git a/tasks/format-code-task-000937/tests/test_command.sh b/tasks/format-code-task-000937/tests/test_command.sh new file mode 100644 index 0000000000000000000000000000000000000000..7cb23076694ad17d72e8296d62b2b240083e36db --- /dev/null +++ b/tasks/format-code-task-000937/tests/test_command.sh @@ -0,0 +1 @@ +bash /testbed/mimo_test_command.sh \ No newline at end of file diff --git a/tasks/format-code-task-000948/environment/Dockerfile b/tasks/format-code-task-000948/environment/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..38fd95e137befbd78c6391339007a3a95692bb0f --- /dev/null +++ b/tasks/format-code-task-000948/environment/Dockerfile @@ -0,0 +1,3 @@ +# The task's image, pinned by digest (the same as [environment].docker_image). +# Setup runs at start from [environment.healthcheck]; environment/setup/ is its readable copy. +FROM docker.io/xiaomimimo/mimo-v2.6-rl-oss@sha256:bbfe8eb60a607d21dceb5a9e9419f46d4507eeb6073f0263668dc4703f4909a3 diff --git a/tasks/format-code-task-000948/environment/setup/files/blocklist b/tasks/format-code-task-000948/environment/setup/files/blocklist new file mode 100644 index 0000000000000000000000000000000000000000..a8e4bdc4c7d9b739c047a3cb58ea72a1bb05bcbc --- /dev/null +++ b/tasks/format-code-task-000948/environment/setup/files/blocklist @@ -0,0 +1,33 @@ +# mimo answer-leak blocklist (mimoagent) +0.0.0.0 github.com +0.0.0.0 www.github.com +0.0.0.0 api.github.com +0.0.0.0 raw.githubusercontent.com +0.0.0.0 codeload.github.com +0.0.0.0 objects.githubusercontent.com +0.0.0.0 gist.github.com +0.0.0.0 gist.githubusercontent.com +0.0.0.0 gitlab.com +0.0.0.0 bitbucket.org +0.0.0.0 sourceforge.net +0.0.0.0 git.kernel.org +0.0.0.0 chromium.googlesource.com +0.0.0.0 android.googlesource.com +0.0.0.0 sourcegraph.com +0.0.0.0 bugs.chromium.org +0.0.0.0 issues.oss-fuzz.com +0.0.0.0 oss-fuzz.com +0.0.0.0 osv.dev +0.0.0.0 api.osv.dev +0.0.0.0 bugzilla.mozilla.org +0.0.0.0 proxy.golang.org +0.0.0.0 sum.golang.org +0.0.0.0 pkg.go.dev +0.0.0.0 google.com +0.0.0.0 www.google.com +0.0.0.0 bing.com +0.0.0.0 www.bing.com +0.0.0.0 duckduckgo.com +0.0.0.0 html.duckduckgo.com +0.0.0.0 search.brave.com +0.0.0.0 stackoverflow.com diff --git a/tasks/format-code-task-000948/environment/setup/setup.sh b/tasks/format-code-task-000948/environment/setup/setup.sh new file mode 100644 index 0000000000000000000000000000000000000000..d883db90cfcfb48f7a139861bbe9f6b5d95cad6f --- /dev/null +++ b/tasks/format-code-task-000948/environment/setup/setup.sh @@ -0,0 +1,34 @@ +#!/bin/bash +# Runs once, as root, before the agent starts: Harbor's [environment.healthcheck] unpacks this folder into +# /var/lib/mimo and runs it. Generated by mimo_harbor; see its README for how each step maps to Xiaomi's harness. +M=/var/lib/mimo +[ -f "$M/ready" ] && exit 0 +chmod 700 "$M" +fail() { echo "setup: $*" >&2; exit 1; } +# the answer-leak blocklist (mimoagent), applied to /etc/hosts by the agent right after it installs +write_blocklist() { cp "$M/files/blocklist" "$M/blocklist"; } + +# Code: mimoagent environments/datasets/opensource_code.py + base.py, as the explorer runs it (app/runner/domains.py Code). +CWD=/testbed +git config --global --add safe.directory "$CWD" +cd "$CWD" || fail "no working directory $CWD" +if ! git rev-parse --git-dir >/dev/null 2>&1; then # a bare source tree: give it a baseline commit + git init -q && git add -A && git -c user.name=mimo -c user.email=mimo@localhost commit -q -m baseline --allow-empty +fi +BASE=$(git rev-parse HEAD 2>/dev/null) +[ ${#BASE} -eq 40 ] || fail "could not resolve the base commit in $CWD" +echo "$BASE" > "$M/base" +# Images are built with history truncated at the base. If one is not, the fix could be read out of git log, +# so .git is hidden while the agent works and put back for grading. +LATER=$(git rev-list --all --not "$BASE" 2>/dev/null | head -n 5 | grep -c . || true) +rm -f /tmp/fail.log /tmp/pass.log /tmp/patch.diff /tmp/test_patch.diff /tmp/*.log 2>/dev/null; rm -rf /tmp/claude-0 /tmp/claude-* /tmp/testem-* /tmp/puppeteer_dev_chrome_profile-* 2>/dev/null; rm -f /tmp/test_files.json 2>/dev/null; rm -rf /tmp/jest_* /tmp/jest-* /tmp/build /tmp/build_env 2>/dev/null; rm -rf /tmp/pytest-of-root /tmp/pytest-* /tmp/.pytest_cache /tmp/__pycache__ 2>/dev/null; rm -rf /tmp/go-build* /tmp/standards /tmp/wordpress /tmp/zig-* /tmp/testbase /tmp/testbed 2>/dev/null; rm -f /tmp/tmp*.tmp /tmp/*.bak /tmp/expect* /tmp/butwas* 2>/dev/null; rm -rf /root/.cache/go-build 2>/dev/null; rm -rf /tests 2>/dev/null; find /logs -mindepth 1 -delete 2>/dev/null; mkdir -p /logs/agent /logs/verifier /logs/artifacts; chmod 777 /logs/agent /logs/verifier /logs/artifacts; find /var/log -type f -delete 2>/dev/null || true; rm -rf /var/lib/postgresql/*/*/log /var/lib/postgresql/*/*/pg_log 2>/dev/null || true; find /var/lib/mysql /var/lib/mongodb -type f -name '*.log' -delete 2>/dev/null || true; rm -rf /root/.npm/_logs /root/.babel.json /root/.pytest_cache 2>/dev/null || true; find / -maxdepth 4 -xdev -name task_description.md -path '*/.build_env/*' -delete 2>/dev/null || true; true +git clean -fdx --exclude=node_modules --exclude=bower_components --exclude=.husky --exclude=vendor --exclude=third_party --exclude=_deps --exclude=vcpkg_installed --exclude=.venv --exclude=venv --exclude=.gradle --exclude=target --exclude=.build --exclude=lib --exclude=.bundle --exclude=Manifest.toml --exclude=_build --exclude=.stack-work --exclude=dist-newstyle >/dev/null 2>&1 +find /root/.m2 -type f \( -name '*-SNAPSHOT.jar' -o -name '*-SNAPSHOT-sources.jar' -o -name '*-SNAPSHOT-tests.jar' -o -name '*-SNAPSHOT-test-sources.jar' \) -delete 2>/dev/null; rm -rf /root/.julia/compiled 2>/dev/null; rm -rf /root/.gradle/caches/build-cache-* /root/.gradle/daemon 2>/dev/null; rm -rf /root/.gradle/caches/*/scripts /root/.gradle/caches/jars-* 2>/dev/null; rm -rf /root/.cache/bazel 2>/dev/null; true +if [ "$LATER" -gt 0 ]; then + mv "$CWD/.git" "$M/git-hidden" + echo "history not truncated at ${BASE:0:12}: .git hidden while the agent works" +fi +write_blocklist + +touch "$M/ready" +echo "setup done" diff --git a/tasks/format-code-task-000948/tests/test.patch b/tasks/format-code-task-000948/tests/test.patch new file mode 100644 index 0000000000000000000000000000000000000000..f2bbb4868ff0afa29622b2f4396d6ea9edd1ae95 --- /dev/null +++ b/tasks/format-code-task-000948/tests/test.patch @@ -0,0 +1,106 @@ +diff --git a/cmd/address_integration_test.go b/cmd/address_integration_test.go +index 30c9165144..e933cfc640 100644 +--- a/cmd/address_integration_test.go ++++ b/cmd/address_integration_test.go +@@ -4,10 +4,12 @@ import ( + "context" + "encoding/hex" + "encoding/json" +- "github.com/filecoin-project/venus/pkg/crypto" + "os" ++ "strings" + "testing" + ++ "github.com/filecoin-project/venus/pkg/crypto" ++ + "github.com/filecoin-project/go-address" + "github.com/filecoin-project/go-state-types/abi" + "github.com/stretchr/testify/assert" +@@ -66,7 +68,7 @@ func TestWalletBalance(t *testing.T) { + + t.Log("[success] newly generated one") + var addrNew cmd.AddressResult +- cmdClient.RunMarshaledJSON(ctx, &addrNew, "wallet", "new") ++ cmdClient.RunSuccessFirstLine(ctx, "wallet", "new") + cmdClient.RunMarshaledJSON(ctx, &balance, "wallet", "balance", addrNew.Address.String()) + assert.Equal(t, "0", balance.String()) + } +@@ -86,12 +88,10 @@ func TestWalletLoadFromFile(t *testing.T) { + cmdClient.RunSuccess(ctx, "wallet", "import", p) + } + +- var addrs cmd.AddressLsResult +- cmdClient.RunMarshaledJSON(ctx, &addrs, "wallet", "ls") +- ++ list := cmdClient.RunSuccess(ctx, "wallet", "ls").ReadStdout() + for _, addr := range fortest.TestAddresses { + // assert we loaded the test address from the file +- assert.Contains(t, addrs.Addresses, addr) ++ assert.Contains(t, list, addr.String()) + } + + // assert default amount of funds were allocated to address during genesis +@@ -109,11 +109,16 @@ func TestWalletExportImportRoundTrip(t *testing.T) { + _, cmdClient, done := builder.BuildAndStartAPI(ctx) + defer done() + +- var lsResult cmd.AddressLsResult +- cmdClient.RunMarshaledJSON(ctx, &lsResult, "wallet", "ls") +- require.Len(t, lsResult.Addresses, 1) ++ ++ ++ ++ ++ result := cmdClient.RunSuccessLines(ctx, "wallet", "ls") ++ require.Len(t, result, 2) ++ ++ resultAddr := strings.Split(result[1], " ")[0] + +- exportJSON := cmdClient.RunSuccess(ctx, "wallet", "export", lsResult.Addresses[0].String()).ReadStdout() ++ exportJSON := cmdClient.RunSuccess(ctx, "wallet", "export", resultAddr).ReadStdoutTrimNewlines() + data, err := hex.DecodeString(exportJSON) + require.NoError(t, err) + var exportResult crypto.KeyInfo +@@ -132,7 +137,6 @@ func TestWalletExportImportRoundTrip(t *testing.T) { + require.NoError(t, err) + require.NoError(t, wf.Close()) + +- var importResult address.Address +- cmdClient.RunMarshaledJSON(ctx, &importResult, "wallet", "import", wf.Name()) +- assert.Equal(t, lsResult.Addresses[0], importResult) ++ importResult := cmdClient.RunSuccessFirstLine(ctx, "wallet", "import", wf.Name()) ++ assert.Equal(t, resultAddr, importResult) + } +diff --git a/mimo_build_env.tar.gz.b64 b/mimo_build_env.tar.gz.b64 +new file mode 100644 +--- /dev/null ++++ b/mimo_build_env.tar.gz.b64 +@@ -0,0 +1,17 @@ ++H4sIAAAAAAAAA+2VW2/bNhTH/axPceoWc1KAomXH8UPhAokbu8bcOnAadMMyGLRIy1xlUiApJwby ++4XckObHjNetLi20Yf75IOrydy59UOM9lymdCrWntR9FEup1OeUUOr+V91GlFrWa31Ym6tWYUnTbb ++Nej8MI/2yK1jBqBmtHZ/1+9b7f9Rwl39nbBuFuvViike2uX3W+Mb9W+ddtuP9T85OcX6n5y2mzVo ++fj8Xnud/Xv+XL+hcKjpndhnEHEoRzAUPgpcwUpiaNIVSIcBFJhQXKpbCBixzJBEO5LYL2UAq58vb ++VMeEizXoOCUy5kTjGLwtTNierLLytvWW4oWqPE2Lda5upYuX4DQMNURhqw1HqMKMOTlPBWDjEuap ++dYB+cqkSC27JHPqzkErASril5ha0AqUVQQdYCm6TCXsc4CLEVpMn1czFcpesMBh2S+IslxyYtcI4 ++iRMsmExzIzAqiLVyDOc3gDtDGq1WQrlgevZ51r+8Hr2bDUbji96rI3QBc5ZbQ8uFacxMoqkRibTO ++bIBgEEuov6aPq5Fu2Azb1JqYYkJCY+v72YB7WArGgUTHgVzAb0AU1F89XbUOv7/BDAgVAGIF9pbQ ++sLQK48WREfYmFOwOej1oHr+hN/iBvcb9tsZfZw8Wsqq9dGDz+UrzPMWCJ/uPkGecOQGEyKIbwaJm ++GGdUDDwvxbKQqYi1VGSxkLAwegVW5yYW+xKja9STNpbudw4Gg9Hs/Ho0Rnemkw+zq8n1tH/Ri2DF ++vghM1U/RoUqrBUuBKJTMWhRKM8xsnluLFH1p8ReEtNQ2HnZfnXooUABFoIUNY7pzqA4LR4lQ4R8W ++BYMHJXwRmzJcCwtt4BP2/Iw7QrixZnyAkQ+w7TjoDyez/mB8Nrzq1Yl1vJeoPIrqMJxcTie//Nrj ++0ojY4ePHydX1h3fnvcbrxsNT//1F/+etoZqiQbAQPfw14KaUAcq72qVE4z7SqaXoI363FwjpE2tw ++8LztRUgZFSEYU6nch5DLpKAdd8VCJjuzFS7Pwu0gnbtq/JNR9DFZb2Gn8zLbxdbHMwQ3GKyZqfJX ++RVHktRgciLtMGwfPZO+h+WkSd9a9XB4YH1O6sx9mtnBvmivAt0N10jmRoBiKc6JwDbeErnRB1oCJ ++yZVDlRKDI+qFCM44xxTYj+L2TPExHgf3O2mcs5SpWNx/XSx75ovSudGq+J/iEvyTkVkdqxmvOA3+ ++6VeHx+PxeDwej8fj8Xg8Ho/H4/F4PB6Px+PxeP5F/Am/d10CACgAAA== +diff --git a/mimo_test_command.sh b/mimo_test_command.sh +new file mode 100755 +--- /dev/null ++++ b/mimo_test_command.sh +@@ -0,0 +1,6 @@ ++#!/usr/bin/env bash ++ ++set -uo pipefail ++cd /testbed || exit 1 ++base64 -d mimo_build_env.tar.gz.b64 | tar -xzf - -C /testbed || exit 1 ++exec bash -lc 'cd /testbed && bash -eo pipefail /testbed/.build_env/test_command.sh' diff --git a/tasks/format-code-task-000948/tests/test.sh b/tasks/format-code-task-000948/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..af32d63dd857f42f23be847e0fe9767f1fc26423 --- /dev/null +++ b/tasks/format-code-task-000948/tests/test.sh @@ -0,0 +1,39 @@ +#!/bin/bash +# Code grading, mimoagent opensource_code.py: reset the files the hidden test patch touches, apply it, run the +# task's test command; reward 1 when it exits 0. A testbed failure (reset or apply) writes no reward: not scored. +M=/var/lib/mimo +CWD=/testbed +V=/logs/verifier +mkdir -p "$V" +BASE=$(cat "$M/base" 2>/dev/null) || { echo "setup never ran (no $M/base)" >&2; exit 1; } +cd "$CWD" || exit 1 +if [ -d "$M/git-hidden" ]; then rm -rf "$CWD/.git"; mv "$M/git-hidden" "$CWD/.git"; fi +# the agent's change against the base, so its own commits count too +git add -A >/dev/null 2>&1 && git -c core.fileMode=false diff --cached "$BASE" > "$V/agent.diff" +git reset -q +if ! ( +while IFS= read -r tf; do + [ -z "$tf" ] && continue + if git cat-file -e $BASE:"$tf" 2>/dev/null; then + git checkout $BASE -- "$tf" 2>/dev/null || true + else + git rm -f --cached "$tf" >/dev/null 2>&1 || true + rm -f "$tf" + fi +done <<'EOF_RESET_TEST_FILES' +cmd/address_integration_test.go +mimo_build_env.tar.gz.b64 +mimo_test_command.sh +EOF_RESET_TEST_FILES + +); then echo "could not reset the test files (testbed problem, not scored)" >&2; exit 1; fi +if ! git apply --verbose /tests/test.patch > "$V/apply.log" 2>&1; then + cat "$V/apply.log" >&2 + echo "the hidden tests could not be applied (testbed problem, not scored)" >&2 + exit 1 +fi +timeout 1800 sh -c "$(cat /tests/test_command.sh)" > "$V/test_output.log" 2>&1 +RC=$? +tail -c 12000 "$V/test_output.log" +if [ $RC -eq 0 ]; then echo 1 > "$V/reward.txt"; else echo 0 > "$V/reward.txt"; fi +echo "test command exited $RC" diff --git a/tasks/format-code-task-000948/tests/test_command.sh b/tasks/format-code-task-000948/tests/test_command.sh new file mode 100644 index 0000000000000000000000000000000000000000..7cb23076694ad17d72e8296d62b2b240083e36db --- /dev/null +++ b/tasks/format-code-task-000948/tests/test_command.sh @@ -0,0 +1 @@ +bash /testbed/mimo_test_command.sh \ No newline at end of file diff --git a/tasks/format-code-task-000970/environment/Dockerfile b/tasks/format-code-task-000970/environment/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..5246cd97385cb29556a16dd0ea940dd4592a673c --- /dev/null +++ b/tasks/format-code-task-000970/environment/Dockerfile @@ -0,0 +1,3 @@ +# The task's image, pinned by digest (the same as [environment].docker_image). +# Setup runs at start from [environment.healthcheck]; environment/setup/ is its readable copy. +FROM docker.io/xiaomimimo/mimo-v2.6-rl-oss@sha256:1eeee71d2c0f5c3b5c115f29b2b05768469c75941622d3fd435ecd852b10cb57 diff --git a/tasks/format-code-task-000970/environment/setup/files/blocklist b/tasks/format-code-task-000970/environment/setup/files/blocklist new file mode 100644 index 0000000000000000000000000000000000000000..a8e4bdc4c7d9b739c047a3cb58ea72a1bb05bcbc --- /dev/null +++ b/tasks/format-code-task-000970/environment/setup/files/blocklist @@ -0,0 +1,33 @@ +# mimo answer-leak blocklist (mimoagent) +0.0.0.0 github.com +0.0.0.0 www.github.com +0.0.0.0 api.github.com +0.0.0.0 raw.githubusercontent.com +0.0.0.0 codeload.github.com +0.0.0.0 objects.githubusercontent.com +0.0.0.0 gist.github.com +0.0.0.0 gist.githubusercontent.com +0.0.0.0 gitlab.com +0.0.0.0 bitbucket.org +0.0.0.0 sourceforge.net +0.0.0.0 git.kernel.org +0.0.0.0 chromium.googlesource.com +0.0.0.0 android.googlesource.com +0.0.0.0 sourcegraph.com +0.0.0.0 bugs.chromium.org +0.0.0.0 issues.oss-fuzz.com +0.0.0.0 oss-fuzz.com +0.0.0.0 osv.dev +0.0.0.0 api.osv.dev +0.0.0.0 bugzilla.mozilla.org +0.0.0.0 proxy.golang.org +0.0.0.0 sum.golang.org +0.0.0.0 pkg.go.dev +0.0.0.0 google.com +0.0.0.0 www.google.com +0.0.0.0 bing.com +0.0.0.0 www.bing.com +0.0.0.0 duckduckgo.com +0.0.0.0 html.duckduckgo.com +0.0.0.0 search.brave.com +0.0.0.0 stackoverflow.com diff --git a/tasks/format-code-task-000970/environment/setup/setup.sh b/tasks/format-code-task-000970/environment/setup/setup.sh new file mode 100644 index 0000000000000000000000000000000000000000..d883db90cfcfb48f7a139861bbe9f6b5d95cad6f --- /dev/null +++ b/tasks/format-code-task-000970/environment/setup/setup.sh @@ -0,0 +1,34 @@ +#!/bin/bash +# Runs once, as root, before the agent starts: Harbor's [environment.healthcheck] unpacks this folder into +# /var/lib/mimo and runs it. Generated by mimo_harbor; see its README for how each step maps to Xiaomi's harness. +M=/var/lib/mimo +[ -f "$M/ready" ] && exit 0 +chmod 700 "$M" +fail() { echo "setup: $*" >&2; exit 1; } +# the answer-leak blocklist (mimoagent), applied to /etc/hosts by the agent right after it installs +write_blocklist() { cp "$M/files/blocklist" "$M/blocklist"; } + +# Code: mimoagent environments/datasets/opensource_code.py + base.py, as the explorer runs it (app/runner/domains.py Code). +CWD=/testbed +git config --global --add safe.directory "$CWD" +cd "$CWD" || fail "no working directory $CWD" +if ! git rev-parse --git-dir >/dev/null 2>&1; then # a bare source tree: give it a baseline commit + git init -q && git add -A && git -c user.name=mimo -c user.email=mimo@localhost commit -q -m baseline --allow-empty +fi +BASE=$(git rev-parse HEAD 2>/dev/null) +[ ${#BASE} -eq 40 ] || fail "could not resolve the base commit in $CWD" +echo "$BASE" > "$M/base" +# Images are built with history truncated at the base. If one is not, the fix could be read out of git log, +# so .git is hidden while the agent works and put back for grading. +LATER=$(git rev-list --all --not "$BASE" 2>/dev/null | head -n 5 | grep -c . || true) +rm -f /tmp/fail.log /tmp/pass.log /tmp/patch.diff /tmp/test_patch.diff /tmp/*.log 2>/dev/null; rm -rf /tmp/claude-0 /tmp/claude-* /tmp/testem-* /tmp/puppeteer_dev_chrome_profile-* 2>/dev/null; rm -f /tmp/test_files.json 2>/dev/null; rm -rf /tmp/jest_* /tmp/jest-* /tmp/build /tmp/build_env 2>/dev/null; rm -rf /tmp/pytest-of-root /tmp/pytest-* /tmp/.pytest_cache /tmp/__pycache__ 2>/dev/null; rm -rf /tmp/go-build* /tmp/standards /tmp/wordpress /tmp/zig-* /tmp/testbase /tmp/testbed 2>/dev/null; rm -f /tmp/tmp*.tmp /tmp/*.bak /tmp/expect* /tmp/butwas* 2>/dev/null; rm -rf /root/.cache/go-build 2>/dev/null; rm -rf /tests 2>/dev/null; find /logs -mindepth 1 -delete 2>/dev/null; mkdir -p /logs/agent /logs/verifier /logs/artifacts; chmod 777 /logs/agent /logs/verifier /logs/artifacts; find /var/log -type f -delete 2>/dev/null || true; rm -rf /var/lib/postgresql/*/*/log /var/lib/postgresql/*/*/pg_log 2>/dev/null || true; find /var/lib/mysql /var/lib/mongodb -type f -name '*.log' -delete 2>/dev/null || true; rm -rf /root/.npm/_logs /root/.babel.json /root/.pytest_cache 2>/dev/null || true; find / -maxdepth 4 -xdev -name task_description.md -path '*/.build_env/*' -delete 2>/dev/null || true; true +git clean -fdx --exclude=node_modules --exclude=bower_components --exclude=.husky --exclude=vendor --exclude=third_party --exclude=_deps --exclude=vcpkg_installed --exclude=.venv --exclude=venv --exclude=.gradle --exclude=target --exclude=.build --exclude=lib --exclude=.bundle --exclude=Manifest.toml --exclude=_build --exclude=.stack-work --exclude=dist-newstyle >/dev/null 2>&1 +find /root/.m2 -type f \( -name '*-SNAPSHOT.jar' -o -name '*-SNAPSHOT-sources.jar' -o -name '*-SNAPSHOT-tests.jar' -o -name '*-SNAPSHOT-test-sources.jar' \) -delete 2>/dev/null; rm -rf /root/.julia/compiled 2>/dev/null; rm -rf /root/.gradle/caches/build-cache-* /root/.gradle/daemon 2>/dev/null; rm -rf /root/.gradle/caches/*/scripts /root/.gradle/caches/jars-* 2>/dev/null; rm -rf /root/.cache/bazel 2>/dev/null; true +if [ "$LATER" -gt 0 ]; then + mv "$CWD/.git" "$M/git-hidden" + echo "history not truncated at ${BASE:0:12}: .git hidden while the agent works" +fi +write_blocklist + +touch "$M/ready" +echo "setup done" diff --git a/tasks/format-code-task-000970/tests/test.patch b/tasks/format-code-task-000970/tests/test.patch new file mode 100644 index 0000000000000000000000000000000000000000..9c857f069ad0e628eba63f28f8bb1782b2f47e6e --- /dev/null +++ b/tasks/format-code-task-000970/tests/test.patch @@ -0,0 +1,183 @@ +diff --git a/pkg/artifactory/resource/user/password_policy_validation_test.go b/pkg/artifactory/resource/user/password_policy_validation_test.go +new file mode 100644 +index 00000000..72ae3e64 +--- /dev/null ++++ b/pkg/artifactory/resource/user/password_policy_validation_test.go +@@ -0,0 +1,167 @@ ++package user ++ ++import ( ++ "context" ++ "testing" ++ ++ "github.com/hashicorp/terraform-plugin-framework/attr" ++ "github.com/hashicorp/terraform-plugin-framework/resource" ++ "github.com/hashicorp/terraform-plugin-framework/tfsdk" ++ "github.com/hashicorp/terraform-plugin-framework/types" ++) ++ ++func passwordPolicyConfig(t *testing.T, password attr.Value, policy attr.Value) tfsdk.Config { ++ t.Helper() ++ ctx := context.Background() ++ r := NewManagedUserResource() ++ var schemaResp resource.SchemaResponse ++ r.Schema(ctx, resource.SchemaRequest{}, &schemaResp) ++ objectType := schemaResp.Schema.Type().(types.ObjectType) ++ attrs := map[string]attr.Value{ ++ "id": types.StringNull(), "name": types.StringNull(), "email": types.StringNull(), ++ "password": types.StringNull(), "password_policy": types.ObjectNull(objectType.AttrTypes["password_policy"].(types.ObjectType).AttrTypes), ++ "admin": types.BoolNull(), "profile_updatable": types.BoolNull(), "disable_ui_access": types.BoolNull(), ++ "internal_password_disabled": types.BoolNull(), "groups": types.SetNull(types.StringType), ++ } ++ attrs["name"] = types.StringValue("validator-user") ++ attrs["email"] = types.StringValue("validator@example.com") ++ attrs["password"] = password ++ attrs["password_policy"] = policy ++ obj, diags := types.ObjectValue(objectType.AttrTypes, attrs) ++ if diags.HasError() { ++ t.Fatalf("build object: %v", diags) ++ } ++ raw, err := obj.ToTerraformValue(ctx) ++ if err != nil { ++ t.Fatalf("build config: %v", err) ++ } ++ return tfsdk.Config{Raw: raw, Schema: schemaResp.Schema} ++} ++ ++func policyObject(values map[string]attr.Value) attr.Value { ++ typesByName := map[string]attr.Type{ ++ "uppercase": types.Int64Type, ++ "lowercase": types.Int64Type, ++ "special_char": types.Int64Type, ++ "digit": types.Int64Type, ++ "length": types.Int64Type, ++ } ++ for name := range typesByName { ++ if _, ok := values[name]; !ok { ++ values[name] = types.Int64Null() ++ } ++ } ++ return types.ObjectValueMust(typesByName, values) ++} ++ ++func validatePasswordConfig(t *testing.T, password attr.Value, policy attr.Value) resource.ValidateConfigResponse { ++ t.Helper() ++ res := NewManagedUserResource() ++ resp := resource.ValidateConfigResponse{} ++ res.(interface { ++ ValidateConfig(context.Context, resource.ValidateConfigRequest, *resource.ValidateConfigResponse) ++ }).ValidateConfig(context.Background(), resource.ValidateConfigRequest{Config: passwordPolicyConfig(t, password, policy)}, &resp) ++ return resp ++} ++ ++func validatePasswordConfigSafely(t *testing.T, password attr.Value, policy attr.Value) (resp resource.ValidateConfigResponse, panicked bool) { ++ t.Helper() ++ defer func() { ++ if recover() != nil { ++ panicked = true ++ } ++ }() ++ return validatePasswordConfig(t, password, policy), false ++} ++ ++func TestValidateConfigDefersUnknownPassword(t *testing.T) { ++ resp := validatePasswordConfig(t, types.StringUnknown(), types.ObjectNull(map[string]attr.Type{ ++ "uppercase": types.Int64Type, "lowercase": types.Int64Type, "special_char": types.Int64Type, "digit": types.Int64Type, "length": types.Int64Type, ++ })) ++ if resp.Diagnostics.HasError() { ++ t.Fatalf("unknown password should defer validation, got %v", resp.Diagnostics) ++ } ++} ++ ++func TestValidateConfigStillRejectsKnownInvalidPassword(t *testing.T) { ++ policyTypes := map[string]attr.Type{ ++ "uppercase": types.Int64Type, "lowercase": types.Int64Type, "special_char": types.Int64Type, "digit": types.Int64Type, "length": types.Int64Type, ++ } ++ resp := validatePasswordConfig(t, types.StringValue("abcdefgh"), types.ObjectNull(policyTypes)) ++ if !resp.Diagnostics.HasError() { ++ t.Fatal("known password that violates default uppercase and digit requirements must be rejected") ++ } ++} ++ ++func TestValidateConfigAcceptsPasswordMeetingDefaultPolicy(t *testing.T) { ++ policyTypes := map[string]attr.Type{ ++ "uppercase": types.Int64Type, "lowercase": types.Int64Type, "special_char": types.Int64Type, "digit": types.Int64Type, "length": types.Int64Type, ++ } ++ resp := validatePasswordConfig(t, types.StringValue("Abcdef1!"), types.ObjectNull(policyTypes)) ++ if resp.Diagnostics.HasError() { ++ t.Fatalf("password meeting the default policy should be accepted: %v", resp.Diagnostics) ++ } ++} ++ ++func TestValidateConfigAllowsPasswordMeetingPolicy(t *testing.T) { ++ policy := policyObject(map[string]attr.Value{"length": types.Int64Value(8)}) ++ resp := validatePasswordConfig(t, types.StringValue("Abcdef1!"), policy) ++ if resp.Diagnostics.HasError() { ++ t.Fatalf("password meeting policy should be accepted: %v", resp.Diagnostics) ++ } ++} ++ ++func TestValidateConfigUsesDefaultsForOmittedPolicyFields(t *testing.T) { ++ policy := policyObject(map[string]attr.Value{"length": types.Int64Value(10)}) ++ resp := validatePasswordConfig(t, types.StringValue("abcdefghij"), policy) ++ if !resp.Diagnostics.HasError() { ++ t.Fatal("password missing default uppercase and digit requirements should be rejected") ++ } ++} ++ ++func TestValidateConfigDefersUnknownPolicy(t *testing.T) { ++ policyTypes := map[string]attr.Type{ ++ "uppercase": types.Int64Type, "lowercase": types.Int64Type, "special_char": types.Int64Type, "digit": types.Int64Type, "length": types.Int64Type, ++ } ++ resp, panicked := validatePasswordConfigSafely(t, types.StringValue("Abcdef1!"), types.ObjectUnknown(policyTypes)) ++ if panicked { ++ t.Fatal("unknown password policy must not panic during validation") ++ } ++ if resp.Diagnostics.HasError() { ++ t.Fatalf("unknown password policy should defer validation, got %v", resp.Diagnostics) ++ } ++} ++ ++func TestValidateConfigDefersUnknownPolicyField(t *testing.T) { ++ policy := policyObject(map[string]attr.Value{"length": types.Int64Unknown()}) ++ resp := validatePasswordConfig(t, types.StringValue("Abcdef1!"), policy) ++ if resp.Diagnostics.HasError() { ++ t.Fatalf("unknown policy fields should defer validation, got %v", resp.Diagnostics) ++ } ++} ++ ++func TestValidateConfigHonorsExplicitZeroPolicy(t *testing.T) { ++ policy := policyObject(map[string]attr.Value{ ++ "length": types.Int64Value(4), "uppercase": types.Int64Value(0), "lowercase": types.Int64Value(0), ++ "special_char": types.Int64Value(0), "digit": types.Int64Value(0), ++ }) ++ resp := validatePasswordConfig(t, types.StringValue("abcd"), policy) ++ if resp.Diagnostics.HasError() { ++ t.Fatalf("explicit zero requirements should be honored: %v", resp.Diagnostics) ++ } ++} ++ ++func TestValidateConfigRejectsNegativePolicyWithoutPanic(t *testing.T) { ++ for _, field := range []string{"length", "uppercase", "lowercase", "special_char", "digit"} { ++ t.Run(field, func(t *testing.T) { ++ policy := policyObject(map[string]attr.Value{field: types.Int64Value(-1)}) ++ resp, panicked := validatePasswordConfigSafely(t, types.StringValue("Abcd1234"), policy) ++ if panicked { ++ t.Fatal("negative policy values must not panic during validation") ++ } ++ if !resp.Diagnostics.HasError() { ++ t.Fatal("negative policy values must produce a validation diagnostic") ++ } ++ }) ++ } ++} +diff --git a/mimo_test_command.sh b/mimo_test_command.sh +new file mode 100755 +--- /dev/null ++++ b/mimo_test_command.sh +@@ -0,0 +1,5 @@ ++#!/bin/bash ++set -euo pipefail ++ ++ ++go test ./pkg/artifactory/resource/user -run 'TestValidateConfig(DefersUnknownPassword|StillRejectsKnownInvalidPassword|AcceptsPasswordMeetingDefaultPolicy|AllowsPasswordMeetingPolicy|UsesDefaultsForOmittedPolicyFields|DefersUnknownPolicy|DefersUnknownPolicyField|HonorsExplicitZeroPolicy|RejectsNegativePolicyWithoutPanic)$' diff --git a/tasks/format-code-task-000970/tests/test.sh b/tasks/format-code-task-000970/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..d14a32a0467f8d0018f21647725e94ee7503090a --- /dev/null +++ b/tasks/format-code-task-000970/tests/test.sh @@ -0,0 +1,38 @@ +#!/bin/bash +# Code grading, mimoagent opensource_code.py: reset the files the hidden test patch touches, apply it, run the +# task's test command; reward 1 when it exits 0. A testbed failure (reset or apply) writes no reward: not scored. +M=/var/lib/mimo +CWD=/testbed +V=/logs/verifier +mkdir -p "$V" +BASE=$(cat "$M/base" 2>/dev/null) || { echo "setup never ran (no $M/base)" >&2; exit 1; } +cd "$CWD" || exit 1 +if [ -d "$M/git-hidden" ]; then rm -rf "$CWD/.git"; mv "$M/git-hidden" "$CWD/.git"; fi +# the agent's change against the base, so its own commits count too +git add -A >/dev/null 2>&1 && git -c core.fileMode=false diff --cached "$BASE" > "$V/agent.diff" +git reset -q +if ! ( +while IFS= read -r tf; do + [ -z "$tf" ] && continue + if git cat-file -e $BASE:"$tf" 2>/dev/null; then + git checkout $BASE -- "$tf" 2>/dev/null || true + else + git rm -f --cached "$tf" >/dev/null 2>&1 || true + rm -f "$tf" + fi +done <<'EOF_RESET_TEST_FILES' +pkg/artifactory/resource/user/password_policy_validation_test.go +mimo_test_command.sh +EOF_RESET_TEST_FILES + +); then echo "could not reset the test files (testbed problem, not scored)" >&2; exit 1; fi +if ! git apply --verbose /tests/test.patch > "$V/apply.log" 2>&1; then + cat "$V/apply.log" >&2 + echo "the hidden tests could not be applied (testbed problem, not scored)" >&2 + exit 1 +fi +timeout 1800 sh -c "$(cat /tests/test_command.sh)" > "$V/test_output.log" 2>&1 +RC=$? +tail -c 12000 "$V/test_output.log" +if [ $RC -eq 0 ]; then echo 1 > "$V/reward.txt"; else echo 0 > "$V/reward.txt"; fi +echo "test command exited $RC" diff --git a/tasks/format-code-task-000970/tests/test_command.sh b/tasks/format-code-task-000970/tests/test_command.sh new file mode 100644 index 0000000000000000000000000000000000000000..7cb23076694ad17d72e8296d62b2b240083e36db --- /dev/null +++ b/tasks/format-code-task-000970/tests/test_command.sh @@ -0,0 +1 @@ +bash /testbed/mimo_test_command.sh \ No newline at end of file diff --git a/tasks/format-code-task-000977/environment/Dockerfile b/tasks/format-code-task-000977/environment/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..0aff2430000a224bfc407611625b805d33b1cc75 --- /dev/null +++ b/tasks/format-code-task-000977/environment/Dockerfile @@ -0,0 +1,3 @@ +# The task's image, pinned by digest (the same as [environment].docker_image). +# Setup runs at start from [environment.healthcheck]; environment/setup/ is its readable copy. +FROM docker.io/xiaomimimo/mimo-v2.6-rl-oss@sha256:477dcbc842dbe8d1ac30253cd93276c7a866c50324ffe176a389099548d3f2e3 diff --git a/tasks/format-code-task-000977/environment/setup/files/blocklist b/tasks/format-code-task-000977/environment/setup/files/blocklist new file mode 100644 index 0000000000000000000000000000000000000000..a8e4bdc4c7d9b739c047a3cb58ea72a1bb05bcbc --- /dev/null +++ b/tasks/format-code-task-000977/environment/setup/files/blocklist @@ -0,0 +1,33 @@ +# mimo answer-leak blocklist (mimoagent) +0.0.0.0 github.com +0.0.0.0 www.github.com +0.0.0.0 api.github.com +0.0.0.0 raw.githubusercontent.com +0.0.0.0 codeload.github.com +0.0.0.0 objects.githubusercontent.com +0.0.0.0 gist.github.com +0.0.0.0 gist.githubusercontent.com +0.0.0.0 gitlab.com +0.0.0.0 bitbucket.org +0.0.0.0 sourceforge.net +0.0.0.0 git.kernel.org +0.0.0.0 chromium.googlesource.com +0.0.0.0 android.googlesource.com +0.0.0.0 sourcegraph.com +0.0.0.0 bugs.chromium.org +0.0.0.0 issues.oss-fuzz.com +0.0.0.0 oss-fuzz.com +0.0.0.0 osv.dev +0.0.0.0 api.osv.dev +0.0.0.0 bugzilla.mozilla.org +0.0.0.0 proxy.golang.org +0.0.0.0 sum.golang.org +0.0.0.0 pkg.go.dev +0.0.0.0 google.com +0.0.0.0 www.google.com +0.0.0.0 bing.com +0.0.0.0 www.bing.com +0.0.0.0 duckduckgo.com +0.0.0.0 html.duckduckgo.com +0.0.0.0 search.brave.com +0.0.0.0 stackoverflow.com diff --git a/tasks/format-code-task-000977/environment/setup/setup.sh b/tasks/format-code-task-000977/environment/setup/setup.sh new file mode 100644 index 0000000000000000000000000000000000000000..d883db90cfcfb48f7a139861bbe9f6b5d95cad6f --- /dev/null +++ b/tasks/format-code-task-000977/environment/setup/setup.sh @@ -0,0 +1,34 @@ +#!/bin/bash +# Runs once, as root, before the agent starts: Harbor's [environment.healthcheck] unpacks this folder into +# /var/lib/mimo and runs it. Generated by mimo_harbor; see its README for how each step maps to Xiaomi's harness. +M=/var/lib/mimo +[ -f "$M/ready" ] && exit 0 +chmod 700 "$M" +fail() { echo "setup: $*" >&2; exit 1; } +# the answer-leak blocklist (mimoagent), applied to /etc/hosts by the agent right after it installs +write_blocklist() { cp "$M/files/blocklist" "$M/blocklist"; } + +# Code: mimoagent environments/datasets/opensource_code.py + base.py, as the explorer runs it (app/runner/domains.py Code). +CWD=/testbed +git config --global --add safe.directory "$CWD" +cd "$CWD" || fail "no working directory $CWD" +if ! git rev-parse --git-dir >/dev/null 2>&1; then # a bare source tree: give it a baseline commit + git init -q && git add -A && git -c user.name=mimo -c user.email=mimo@localhost commit -q -m baseline --allow-empty +fi +BASE=$(git rev-parse HEAD 2>/dev/null) +[ ${#BASE} -eq 40 ] || fail "could not resolve the base commit in $CWD" +echo "$BASE" > "$M/base" +# Images are built with history truncated at the base. If one is not, the fix could be read out of git log, +# so .git is hidden while the agent works and put back for grading. +LATER=$(git rev-list --all --not "$BASE" 2>/dev/null | head -n 5 | grep -c . || true) +rm -f /tmp/fail.log /tmp/pass.log /tmp/patch.diff /tmp/test_patch.diff /tmp/*.log 2>/dev/null; rm -rf /tmp/claude-0 /tmp/claude-* /tmp/testem-* /tmp/puppeteer_dev_chrome_profile-* 2>/dev/null; rm -f /tmp/test_files.json 2>/dev/null; rm -rf /tmp/jest_* /tmp/jest-* /tmp/build /tmp/build_env 2>/dev/null; rm -rf /tmp/pytest-of-root /tmp/pytest-* /tmp/.pytest_cache /tmp/__pycache__ 2>/dev/null; rm -rf /tmp/go-build* /tmp/standards /tmp/wordpress /tmp/zig-* /tmp/testbase /tmp/testbed 2>/dev/null; rm -f /tmp/tmp*.tmp /tmp/*.bak /tmp/expect* /tmp/butwas* 2>/dev/null; rm -rf /root/.cache/go-build 2>/dev/null; rm -rf /tests 2>/dev/null; find /logs -mindepth 1 -delete 2>/dev/null; mkdir -p /logs/agent /logs/verifier /logs/artifacts; chmod 777 /logs/agent /logs/verifier /logs/artifacts; find /var/log -type f -delete 2>/dev/null || true; rm -rf /var/lib/postgresql/*/*/log /var/lib/postgresql/*/*/pg_log 2>/dev/null || true; find /var/lib/mysql /var/lib/mongodb -type f -name '*.log' -delete 2>/dev/null || true; rm -rf /root/.npm/_logs /root/.babel.json /root/.pytest_cache 2>/dev/null || true; find / -maxdepth 4 -xdev -name task_description.md -path '*/.build_env/*' -delete 2>/dev/null || true; true +git clean -fdx --exclude=node_modules --exclude=bower_components --exclude=.husky --exclude=vendor --exclude=third_party --exclude=_deps --exclude=vcpkg_installed --exclude=.venv --exclude=venv --exclude=.gradle --exclude=target --exclude=.build --exclude=lib --exclude=.bundle --exclude=Manifest.toml --exclude=_build --exclude=.stack-work --exclude=dist-newstyle >/dev/null 2>&1 +find /root/.m2 -type f \( -name '*-SNAPSHOT.jar' -o -name '*-SNAPSHOT-sources.jar' -o -name '*-SNAPSHOT-tests.jar' -o -name '*-SNAPSHOT-test-sources.jar' \) -delete 2>/dev/null; rm -rf /root/.julia/compiled 2>/dev/null; rm -rf /root/.gradle/caches/build-cache-* /root/.gradle/daemon 2>/dev/null; rm -rf /root/.gradle/caches/*/scripts /root/.gradle/caches/jars-* 2>/dev/null; rm -rf /root/.cache/bazel 2>/dev/null; true +if [ "$LATER" -gt 0 ]; then + mv "$CWD/.git" "$M/git-hidden" + echo "history not truncated at ${BASE:0:12}: .git hidden while the agent works" +fi +write_blocklist + +touch "$M/ready" +echo "setup done" diff --git a/tasks/format-code-task-000977/tests/test.patch b/tasks/format-code-task-000977/tests/test.patch new file mode 100644 index 0000000000000000000000000000000000000000..ea85ebb9864c6d39c684ef01a350a5639ccdefd8 --- /dev/null +++ b/tasks/format-code-task-000977/tests/test.patch @@ -0,0 +1,283 @@ +diff --git a/safehttp/plugins/collector/collector_hardening_verifier_test.go b/safehttp/plugins/collector/collector_hardening_verifier_test.go +new file mode 100644 +index 0000000..6f5e3cc +--- /dev/null ++++ b/safehttp/plugins/collector/collector_hardening_verifier_test.go +@@ -0,0 +1,267 @@ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++package collector_test ++ ++import ( ++ "io" ++ "net/http/httptest" ++ "strconv" ++ "strings" ++ "testing" ++ ++ "github.com/google/go-safeweb/safehttp" ++ "github.com/google/go-safeweb/safehttp/plugins/collector" ++ "github.com/google/go-safeweb/safehttp/safehttptest" ++) ++ ++const verifierMaxCollectorBody = 1 << 20 ++ ++var _ func(func(collector.Report), func(collector.CSPReport)) safehttp.Handler = collector.Handler ++ ++type verifierTrackingBody struct { ++ r *strings.Reader ++ reads int ++} ++ ++func newVerifierTrackingBody(s string) *verifierTrackingBody { ++ return &verifierTrackingBody{r: strings.NewReader(s)} ++} ++ ++func (b *verifierTrackingBody) Read(p []byte) (int, error) { ++ n, err := b.r.Read(p) ++ b.reads += n ++ return n, err ++} ++ ++func (b *verifierTrackingBody) Close() error { return nil } ++ ++func verifierRequest(method, contentType string, body io.ReadCloser, contentLength int64) *safehttp.IncomingRequest { ++ req := httptest.NewRequest(method, "/collector", nil) ++ req.Header.Set("Content-Type", contentType) ++ req.Body = body ++ req.ContentLength = contentLength ++ return safehttp.NewIncomingRequest(req) ++} ++ ++func verifierBatch(n int) string { ++ var b strings.Builder ++ b.WriteByte('[') ++ for i := 0; i < n; i++ { ++ if i > 0 { ++ b.WriteByte(',') ++ } ++ b.WriteString(`{"type":"item-`) ++ b.WriteString(strconv.Itoa(i)) ++ b.WriteString(`","body":{"index":`) ++ b.WriteString(strconv.Itoa(i)) ++ b.WriteString(`}}`) ++ } ++ b.WriteByte(']') ++ return b.String() ++} ++ ++func TestCollectorVerifierMediaTypesAndValidationPrecedence(t *testing.T) { ++ t.Run("media type matching is case insensitive and allows parameters", func(t *testing.T) { ++ var generic, deprecated int ++ h := collector.Handler(func(collector.Report) { generic++ }, func(collector.CSPReport) { deprecated++ }) ++ ++ genericReq := safehttptest.NewRequest(safehttp.MethodPost, "/collector", strings.NewReader(`[{"type":"custom","body":{}}]`)) ++ genericReq.Header.Set("Content-Type", `Application/Reports+JSON; Charset="UTF-8"`) ++ genericRR := safehttptest.NewResponseRecorder() ++ h.ServeHTTP(genericRR.ResponseWriter, genericReq) ++ if got, want := genericRR.Status(), safehttp.StatusNoContent; got != want { ++ t.Errorf("parameterized generic report status got %v, want %v", got, want) ++ } ++ ++ deprecatedReq := safehttptest.NewRequest(safehttp.MethodPost, "/collector", strings.NewReader(`{"blocked-uri":"https://blocked.example/"}`)) ++ deprecatedReq.Header.Set("Content-Type", `APPLICATION/CSP-REPORT; profile=legacy`) ++ deprecatedRR := safehttptest.NewResponseRecorder() ++ h.ServeHTTP(deprecatedRR.ResponseWriter, deprecatedReq) ++ if got, want := deprecatedRR.Status(), safehttp.StatusNoContent; got != want { ++ t.Errorf("parameterized CSP report status got %v, want %v", got, want) ++ } ++ if generic != 1 || deprecated != 1 { ++ t.Errorf("callback counts got generic=%d deprecated=%d, want 1 and 1", generic, deprecated) ++ } ++ }) ++ ++ for _, tc := range []struct { ++ name string ++ method string ++ contentType string ++ contentLen int64 ++ want safehttp.StatusCode ++ }{ ++ {name: "method rejected before media type", method: safehttp.MethodGet, contentType: "text/plain", want: safehttp.StatusMethodNotAllowed}, ++ {name: "unsupported media type rejected before body", method: safehttp.MethodPost, contentType: "text/plain", want: safehttp.StatusUnsupportedMediaType}, ++ {name: "unsupported media type precedes declared body limit", method: safehttp.MethodPost, contentType: "text/plain", contentLen: verifierMaxCollectorBody + 1, want: safehttp.StatusUnsupportedMediaType}, ++ {name: "malformed media type rejected before body", method: safehttp.MethodPost, contentType: `application/reports+json; charset`, want: safehttp.StatusUnsupportedMediaType}, ++ } { ++ t.Run(tc.name, func(t *testing.T) { ++ body := newVerifierTrackingBody(`[{"type":"custom","body":{}}]`) ++ contentLen := tc.contentLen ++ if contentLen == 0 { ++ contentLen = int64(body.r.Len()) ++ } ++ called := false ++ h := collector.Handler(func(collector.Report) { called = true }, func(collector.CSPReport) { called = true }) ++ rr := safehttptest.NewResponseRecorder() ++ h.ServeHTTP(rr.ResponseWriter, verifierRequest(tc.method, tc.contentType, body, contentLen)) ++ if got := rr.Status(); got != tc.want { ++ t.Errorf("status got %v, want %v", got, tc.want) ++ } ++ if body.reads != 0 { ++ t.Errorf("body bytes read got %d, want 0", body.reads) ++ } ++ if called { ++ t.Error("callback was called for a rejected request") ++ } ++ }) ++ } ++} ++ ++func TestCollectorVerifierBodyLimitBoundaries(t *testing.T) { ++ base := `[{"type":"custom","body":{}}]` ++ exact := base + strings.Repeat(" ", verifierMaxCollectorBody-len(base)) ++ var calls int ++ h := collector.Handler(func(collector.Report) { calls++ }, func(collector.CSPReport) { calls++ }) ++ ++ exactReq := safehttptest.NewRequest(safehttp.MethodPost, "/collector", strings.NewReader(exact)) ++ exactReq.Header.Set("Content-Type", "application/reports+json") ++ exactRR := safehttptest.NewResponseRecorder() ++ h.ServeHTTP(exactRR.ResponseWriter, exactReq) ++ if got, want := exactRR.Status(), safehttp.StatusNoContent; got != want { ++ t.Errorf("exact-limit status got %v, want %v", got, want) ++ } ++ if calls != 1 { ++ t.Errorf("exact-limit callback count got %d, want 1", calls) ++ } ++ ++ t.Run("known oversized body is rejected without reading", func(t *testing.T) { ++ body := newVerifierTrackingBody(exact + " ") ++ rr := safehttptest.NewResponseRecorder() ++ h.ServeHTTP(rr.ResponseWriter, verifierRequest(safehttp.MethodPost, "application/reports+json", body, verifierMaxCollectorBody+1)) ++ if got, want := rr.Status(), safehttp.StatusRequestEntityTooLarge; got != want { ++ t.Errorf("status got %v, want %v", got, want) ++ } ++ if body.reads != 0 { ++ t.Errorf("body bytes read got %d, want 0", body.reads) ++ } ++ }) ++ ++ t.Run("unknown-length oversized body stops at first excess byte", func(t *testing.T) { ++ body := newVerifierTrackingBody(exact + strings.Repeat(" ", 4096)) ++ rr := safehttptest.NewResponseRecorder() ++ h.ServeHTTP(rr.ResponseWriter, verifierRequest(safehttp.MethodPost, "application/reports+json", body, -1)) ++ if got, want := rr.Status(), safehttp.StatusRequestEntityTooLarge; got != want { ++ t.Errorf("status got %v, want %v", got, want) ++ } ++ if body.reads > verifierMaxCollectorBody+1 { ++ t.Errorf("body bytes read got %d, want at most %d", body.reads, verifierMaxCollectorBody+1) ++ } ++ }) ++ ++ if calls != 1 { ++ t.Errorf("oversized requests changed callback count to %d, want 1", calls) ++ } ++} ++ ++func TestCollectorVerifierBatchLimitAndOrder(t *testing.T) { ++ var gotTypes []string ++ h := collector.Handler(func(r collector.Report) { gotTypes = append(gotTypes, r.Type) }, func(collector.CSPReport) { ++ t.Error("deprecated callback called for generic batch") ++ }) ++ ++ exactReq := safehttptest.NewRequest(safehttp.MethodPost, "/collector", strings.NewReader(verifierBatch(100))) ++ exactReq.Header.Set("Content-Type", "application/reports+json") ++ exactRR := safehttptest.NewResponseRecorder() ++ h.ServeHTTP(exactRR.ResponseWriter, exactReq) ++ if got, want := exactRR.Status(), safehttp.StatusNoContent; got != want { ++ t.Errorf("100-report status got %v, want %v", got, want) ++ } ++ if len(gotTypes) != 100 { ++ t.Fatalf("100-report callback count got %d, want 100", len(gotTypes)) ++ } ++ for i, got := range gotTypes { ++ if want := "item-" + strconv.Itoa(i); got != want { ++ t.Fatalf("callback %d type got %q, want %q", i, got, want) ++ } ++ } ++ ++ gotTypes = nil ++ overReq := safehttptest.NewRequest(safehttp.MethodPost, "/collector", strings.NewReader(verifierBatch(101))) ++ overReq.Header.Set("Content-Type", "application/reports+json") ++ overRR := safehttptest.NewResponseRecorder() ++ h.ServeHTTP(overRR.ResponseWriter, overReq) ++ if got, want := overRR.Status(), safehttp.StatusRequestEntityTooLarge; got != want { ++ t.Errorf("101-report status got %v, want %v", got, want) ++ } ++ if len(gotTypes) != 0 { ++ t.Errorf("101-report callback count got %d, want 0", len(gotTypes)) ++ } ++} ++ ++func TestCollectorVerifierBatchDeliveryIsAtomic(t *testing.T) { ++ for _, tc := range []struct { ++ name string ++ body string ++ }{ ++ {name: "null report element", body: `[{"type":"valid","body":{}},null]`}, ++ {name: "null report body", body: `[{"type":"valid","body":{}},{"type":"invalid","body":null}]`}, ++ {name: "null CSP violation body", body: `[{"type":"valid","body":{}},{"type":"csp-violation","body":null}]`}, ++ {name: "scalar report body", body: `[{"type":"valid","body":{}},{"type":"invalid","body":7}]`}, ++ } { ++ t.Run(tc.name, func(t *testing.T) { ++ var calls int ++ h := collector.Handler(func(collector.Report) { calls++ }, func(collector.CSPReport) { calls++ }) ++ req := safehttptest.NewRequest(safehttp.MethodPost, "/collector", strings.NewReader(tc.body)) ++ req.Header.Set("Content-Type", "application/reports+json") ++ rr := safehttptest.NewResponseRecorder() ++ h.ServeHTTP(rr.ResponseWriter, req) ++ if got, want := rr.Status(), safehttp.StatusBadRequest; got != want { ++ t.Errorf("status got %v, want %v", got, want) ++ } ++ if calls != 0 { ++ t.Errorf("callback count got %d, want 0", calls) ++ } ++ }) ++ } ++} ++ ++func TestCollectorVerifierDeprecatedCSPObjectShapes(t *testing.T) { ++ for _, tc := range []struct { ++ name string ++ body string ++ }{ ++ {name: "null top level", body: `null`}, ++ {name: "null wrapped report", body: `{"csp-report":null}`}, ++ {name: "array wrapped report", body: `{"csp-report":[]}`}, ++ } { ++ t.Run(tc.name, func(t *testing.T) { ++ var calls int ++ h := collector.Handler(func(collector.Report) { calls++ }, func(collector.CSPReport) { calls++ }) ++ req := safehttptest.NewRequest(safehttp.MethodPost, "/collector", strings.NewReader(tc.body)) ++ req.Header.Set("Content-Type", "application/csp-report") ++ rr := safehttptest.NewResponseRecorder() ++ h.ServeHTTP(rr.ResponseWriter, req) ++ if got, want := rr.Status(), safehttp.StatusBadRequest; got != want { ++ t.Errorf("status got %v, want %v", got, want) ++ } ++ if calls != 0 { ++ t.Errorf("callback count got %d, want 0", calls) ++ } ++ }) ++ } ++} +diff --git a/mimo_test_command.sh b/mimo_test_command.sh +new file mode 100755 +--- /dev/null ++++ b/mimo_test_command.sh +@@ -0,0 +1,5 @@ ++#!/bin/bash ++set -euo pipefail ++ ++ ++go test ./safehttp/plugins/collector -count=1 diff --git a/tasks/format-code-task-000977/tests/test.sh b/tasks/format-code-task-000977/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..e6a0e0c66a2b22804a40a0f9346865d691ed073c --- /dev/null +++ b/tasks/format-code-task-000977/tests/test.sh @@ -0,0 +1,38 @@ +#!/bin/bash +# Code grading, mimoagent opensource_code.py: reset the files the hidden test patch touches, apply it, run the +# task's test command; reward 1 when it exits 0. A testbed failure (reset or apply) writes no reward: not scored. +M=/var/lib/mimo +CWD=/testbed +V=/logs/verifier +mkdir -p "$V" +BASE=$(cat "$M/base" 2>/dev/null) || { echo "setup never ran (no $M/base)" >&2; exit 1; } +cd "$CWD" || exit 1 +if [ -d "$M/git-hidden" ]; then rm -rf "$CWD/.git"; mv "$M/git-hidden" "$CWD/.git"; fi +# the agent's change against the base, so its own commits count too +git add -A >/dev/null 2>&1 && git -c core.fileMode=false diff --cached "$BASE" > "$V/agent.diff" +git reset -q +if ! ( +while IFS= read -r tf; do + [ -z "$tf" ] && continue + if git cat-file -e $BASE:"$tf" 2>/dev/null; then + git checkout $BASE -- "$tf" 2>/dev/null || true + else + git rm -f --cached "$tf" >/dev/null 2>&1 || true + rm -f "$tf" + fi +done <<'EOF_RESET_TEST_FILES' +safehttp/plugins/collector/collector_hardening_verifier_test.go +mimo_test_command.sh +EOF_RESET_TEST_FILES + +); then echo "could not reset the test files (testbed problem, not scored)" >&2; exit 1; fi +if ! git apply --verbose /tests/test.patch > "$V/apply.log" 2>&1; then + cat "$V/apply.log" >&2 + echo "the hidden tests could not be applied (testbed problem, not scored)" >&2 + exit 1 +fi +timeout 1800 sh -c "$(cat /tests/test_command.sh)" > "$V/test_output.log" 2>&1 +RC=$? +tail -c 12000 "$V/test_output.log" +if [ $RC -eq 0 ]; then echo 1 > "$V/reward.txt"; else echo 0 > "$V/reward.txt"; fi +echo "test command exited $RC" diff --git a/tasks/format-code-task-000977/tests/test_command.sh b/tasks/format-code-task-000977/tests/test_command.sh new file mode 100644 index 0000000000000000000000000000000000000000..7cb23076694ad17d72e8296d62b2b240083e36db --- /dev/null +++ b/tasks/format-code-task-000977/tests/test_command.sh @@ -0,0 +1 @@ +bash /testbed/mimo_test_command.sh \ No newline at end of file diff --git a/tasks/format-code-task-000983/environment/Dockerfile b/tasks/format-code-task-000983/environment/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..66913db053425572409b42cd8b91542332b6ea10 --- /dev/null +++ b/tasks/format-code-task-000983/environment/Dockerfile @@ -0,0 +1,3 @@ +# The task's image, pinned by digest (the same as [environment].docker_image). +# Setup runs at start from [environment.healthcheck]; environment/setup/ is its readable copy. +FROM docker.io/xiaomimimo/mimo-v2.6-rl-oss@sha256:b6bd633b1864005d03176cac53fc6a88a92fde1f722cdeecc343341e3092a0d6 diff --git a/tasks/format-code-task-000983/environment/setup/files/blocklist b/tasks/format-code-task-000983/environment/setup/files/blocklist new file mode 100644 index 0000000000000000000000000000000000000000..a8e4bdc4c7d9b739c047a3cb58ea72a1bb05bcbc --- /dev/null +++ b/tasks/format-code-task-000983/environment/setup/files/blocklist @@ -0,0 +1,33 @@ +# mimo answer-leak blocklist (mimoagent) +0.0.0.0 github.com +0.0.0.0 www.github.com +0.0.0.0 api.github.com +0.0.0.0 raw.githubusercontent.com +0.0.0.0 codeload.github.com +0.0.0.0 objects.githubusercontent.com +0.0.0.0 gist.github.com +0.0.0.0 gist.githubusercontent.com +0.0.0.0 gitlab.com +0.0.0.0 bitbucket.org +0.0.0.0 sourceforge.net +0.0.0.0 git.kernel.org +0.0.0.0 chromium.googlesource.com +0.0.0.0 android.googlesource.com +0.0.0.0 sourcegraph.com +0.0.0.0 bugs.chromium.org +0.0.0.0 issues.oss-fuzz.com +0.0.0.0 oss-fuzz.com +0.0.0.0 osv.dev +0.0.0.0 api.osv.dev +0.0.0.0 bugzilla.mozilla.org +0.0.0.0 proxy.golang.org +0.0.0.0 sum.golang.org +0.0.0.0 pkg.go.dev +0.0.0.0 google.com +0.0.0.0 www.google.com +0.0.0.0 bing.com +0.0.0.0 www.bing.com +0.0.0.0 duckduckgo.com +0.0.0.0 html.duckduckgo.com +0.0.0.0 search.brave.com +0.0.0.0 stackoverflow.com diff --git a/tasks/format-code-task-000983/environment/setup/setup.sh b/tasks/format-code-task-000983/environment/setup/setup.sh new file mode 100644 index 0000000000000000000000000000000000000000..d883db90cfcfb48f7a139861bbe9f6b5d95cad6f --- /dev/null +++ b/tasks/format-code-task-000983/environment/setup/setup.sh @@ -0,0 +1,34 @@ +#!/bin/bash +# Runs once, as root, before the agent starts: Harbor's [environment.healthcheck] unpacks this folder into +# /var/lib/mimo and runs it. Generated by mimo_harbor; see its README for how each step maps to Xiaomi's harness. +M=/var/lib/mimo +[ -f "$M/ready" ] && exit 0 +chmod 700 "$M" +fail() { echo "setup: $*" >&2; exit 1; } +# the answer-leak blocklist (mimoagent), applied to /etc/hosts by the agent right after it installs +write_blocklist() { cp "$M/files/blocklist" "$M/blocklist"; } + +# Code: mimoagent environments/datasets/opensource_code.py + base.py, as the explorer runs it (app/runner/domains.py Code). +CWD=/testbed +git config --global --add safe.directory "$CWD" +cd "$CWD" || fail "no working directory $CWD" +if ! git rev-parse --git-dir >/dev/null 2>&1; then # a bare source tree: give it a baseline commit + git init -q && git add -A && git -c user.name=mimo -c user.email=mimo@localhost commit -q -m baseline --allow-empty +fi +BASE=$(git rev-parse HEAD 2>/dev/null) +[ ${#BASE} -eq 40 ] || fail "could not resolve the base commit in $CWD" +echo "$BASE" > "$M/base" +# Images are built with history truncated at the base. If one is not, the fix could be read out of git log, +# so .git is hidden while the agent works and put back for grading. +LATER=$(git rev-list --all --not "$BASE" 2>/dev/null | head -n 5 | grep -c . || true) +rm -f /tmp/fail.log /tmp/pass.log /tmp/patch.diff /tmp/test_patch.diff /tmp/*.log 2>/dev/null; rm -rf /tmp/claude-0 /tmp/claude-* /tmp/testem-* /tmp/puppeteer_dev_chrome_profile-* 2>/dev/null; rm -f /tmp/test_files.json 2>/dev/null; rm -rf /tmp/jest_* /tmp/jest-* /tmp/build /tmp/build_env 2>/dev/null; rm -rf /tmp/pytest-of-root /tmp/pytest-* /tmp/.pytest_cache /tmp/__pycache__ 2>/dev/null; rm -rf /tmp/go-build* /tmp/standards /tmp/wordpress /tmp/zig-* /tmp/testbase /tmp/testbed 2>/dev/null; rm -f /tmp/tmp*.tmp /tmp/*.bak /tmp/expect* /tmp/butwas* 2>/dev/null; rm -rf /root/.cache/go-build 2>/dev/null; rm -rf /tests 2>/dev/null; find /logs -mindepth 1 -delete 2>/dev/null; mkdir -p /logs/agent /logs/verifier /logs/artifacts; chmod 777 /logs/agent /logs/verifier /logs/artifacts; find /var/log -type f -delete 2>/dev/null || true; rm -rf /var/lib/postgresql/*/*/log /var/lib/postgresql/*/*/pg_log 2>/dev/null || true; find /var/lib/mysql /var/lib/mongodb -type f -name '*.log' -delete 2>/dev/null || true; rm -rf /root/.npm/_logs /root/.babel.json /root/.pytest_cache 2>/dev/null || true; find / -maxdepth 4 -xdev -name task_description.md -path '*/.build_env/*' -delete 2>/dev/null || true; true +git clean -fdx --exclude=node_modules --exclude=bower_components --exclude=.husky --exclude=vendor --exclude=third_party --exclude=_deps --exclude=vcpkg_installed --exclude=.venv --exclude=venv --exclude=.gradle --exclude=target --exclude=.build --exclude=lib --exclude=.bundle --exclude=Manifest.toml --exclude=_build --exclude=.stack-work --exclude=dist-newstyle >/dev/null 2>&1 +find /root/.m2 -type f \( -name '*-SNAPSHOT.jar' -o -name '*-SNAPSHOT-sources.jar' -o -name '*-SNAPSHOT-tests.jar' -o -name '*-SNAPSHOT-test-sources.jar' \) -delete 2>/dev/null; rm -rf /root/.julia/compiled 2>/dev/null; rm -rf /root/.gradle/caches/build-cache-* /root/.gradle/daemon 2>/dev/null; rm -rf /root/.gradle/caches/*/scripts /root/.gradle/caches/jars-* 2>/dev/null; rm -rf /root/.cache/bazel 2>/dev/null; true +if [ "$LATER" -gt 0 ]; then + mv "$CWD/.git" "$M/git-hidden" + echo "history not truncated at ${BASE:0:12}: .git hidden while the agent works" +fi +write_blocklist + +touch "$M/ready" +echo "setup done" diff --git a/tasks/format-code-task-000983/tests/test.patch b/tasks/format-code-task-000983/tests/test.patch new file mode 100644 index 0000000000000000000000000000000000000000..889505e451ef3bbf7618640f3fc89e8470421c46 --- /dev/null +++ b/tasks/format-code-task-000983/tests/test.patch @@ -0,0 +1,243 @@ +diff --git a/pkg/client/simple/vfsclientset/codespec_instancegroup_test.go b/pkg/client/simple/vfsclientset/codespec_instancegroup_test.go +new file mode 100644 +index 0000000000..65bcb8eafa +--- /dev/null ++++ b/pkg/client/simple/vfsclientset/codespec_instancegroup_test.go +@@ -0,0 +1,227 @@ ++package vfsclientset ++ ++import ( ++ "context" ++ "reflect" ++ "testing" ++ ++ apierrors "k8s.io/apimachinery/pkg/api/errors" ++ metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ++ "k8s.io/apimachinery/pkg/types" ++ "k8s.io/kops/pkg/apis/kops" ++ "k8s.io/kops/pkg/client/simple" ++ "k8s.io/kops/upup/pkg/fi" ++ "k8s.io/kops/util/pkg/vfs" ++) ++ ++func newInstanceGroupTestClient(t *testing.T) (context.Context, simple.Clientset, *kops.Cluster) { ++ t.Helper() ++ vfs.Context.ResetMemfsContext(true) ++ base, err := vfs.Context.BuildVfsPath("memfs://codespec-vfs") ++ if err != nil { ++ t.Fatalf("build test path: %v", err) ++ } ++ return context.Background(), NewVFSClientset(base), &kops.Cluster{ObjectMeta: metav1.ObjectMeta{Name: "demo"}} ++} ++ ++func createTestInstanceGroups(t *testing.T, ctx context.Context, client simple.Clientset, cluster *kops.Cluster) { ++ t.Helper() ++ groups := []struct { ++ name string ++ env string ++ }{ ++ {name: "alpha", env: "prod"}, ++ {name: "beta", env: "dev"}, ++ {name: "gamma", env: "prod"}, ++ } ++ for _, group := range groups { ++ ig := &kops.InstanceGroup{ ++ ObjectMeta: metav1.ObjectMeta{Name: group.name, Labels: map[string]string{"env": group.env}}, ++ Spec: kops.InstanceGroupSpec{Role: kops.InstanceGroupRoleNode, MinSize: fi.Int32(1)}, ++ } ++ if _, err := client.InstanceGroupsFor(cluster).Create(ctx, ig, metav1.CreateOptions{}); err != nil { ++ t.Fatalf("create %s: %v", group.name, err) ++ } ++ } ++} ++ ++func instanceGroupNames(list *kops.InstanceGroupList) []string { ++ names := make([]string, 0, len(list.Items)) ++ for _, item := range list.Items { ++ names = append(names, item.Name) ++ } ++ return names ++} ++ ++func TestVFSInstanceGroupListSelectors(t *testing.T) { ++ ctx, client, cluster := newInstanceGroupTestClient(t) ++ createTestInstanceGroups(t, ctx, client, cluster) ++ groups := client.InstanceGroupsFor(cluster) ++ ++ prod, err := groups.List(ctx, metav1.ListOptions{LabelSelector: "env in (prod)"}) ++ if err != nil { ++ t.Fatalf("label selector: %v", err) ++ } ++ if got, want := instanceGroupNames(prod), []string{"alpha", "gamma"}; !reflect.DeepEqual(got, want) { ++ t.Fatalf("label selector returned %v, want %v", got, want) ++ } ++ clusterLabeled, err := groups.List(ctx, metav1.ListOptions{LabelSelector: kops.LabelClusterName + "=demo"}) ++ if err != nil { ++ t.Fatalf("synthesized cluster label selector: %v", err) ++ } ++ if got, want := instanceGroupNames(clusterLabeled), []string{"alpha", "beta", "gamma"}; !reflect.DeepEqual(got, want) { ++ t.Fatalf("synthesized label selector returned %v, want %v", got, want) ++ } ++ ++ byName, err := groups.List(ctx, metav1.ListOptions{LabelSelector: "env=prod", FieldSelector: "metadata.name=gamma"}) ++ if err != nil { ++ t.Fatalf("field selector: %v", err) ++ } ++ if got, want := instanceGroupNames(byName), []string{"gamma"}; !reflect.DeepEqual(got, want) { ++ t.Fatalf("field selector returned %v, want %v", got, want) ++ } ++ notBeta, err := groups.List(ctx, metav1.ListOptions{FieldSelector: "metadata.name!=beta"}) ++ if err != nil { ++ t.Fatalf("negative field selector: %v", err) ++ } ++ if got, want := instanceGroupNames(notBeta), []string{"alpha", "gamma"}; !reflect.DeepEqual(got, want) { ++ t.Fatalf("negative field selector returned %v, want %v", got, want) ++ } ++ ++ if _, err := groups.List(ctx, metav1.ListOptions{LabelSelector: "env in"}); err == nil { ++ t.Fatal("malformed label selector unexpectedly succeeded") ++ } ++ if _, err := groups.List(ctx, metav1.ListOptions{FieldSelector: "metadata.name in (beta)"}); err == nil { ++ t.Fatal("malformed field selector unexpectedly succeeded") ++ } ++} ++ ++func TestVFSInstanceGroupPatchSemantics(t *testing.T) { ++ ctx, client, cluster := newInstanceGroupTestClient(t) ++ groups := client.InstanceGroupsFor(cluster) ++ created := &kops.InstanceGroup{ ++ ObjectMeta: metav1.ObjectMeta{Name: "worker", Labels: map[string]string{"env": "prod"}}, ++ Spec: kops.InstanceGroupSpec{Role: kops.InstanceGroupRoleNode, MinSize: fi.Int32(1)}, ++ } ++ if _, err := groups.Create(ctx, created, metav1.CreateOptions{}); err != nil { ++ t.Fatalf("create: %v", err) ++ } ++ ++ metadata, err := groups.Patch(ctx, "worker", types.MergePatchType, []byte(`{"metadata":{"annotations":{"owner":"test"}}}`), metav1.PatchOptions{}) ++ if err != nil { ++ t.Fatalf("metadata merge patch: %v", err) ++ } ++ if metadata.Annotations["owner"] != "test" || metadata.Labels["env"] != "prod" || metadata.Spec.MinSize == nil || *metadata.Spec.MinSize != 1 || metadata.Generation != 0 { ++ t.Fatalf("metadata patch did not preserve the object: %#v", metadata) ++ } ++ ++ updated, err := groups.Patch(ctx, "worker", types.MergePatchType, []byte(`{"spec":{"minSize":3}}`), metav1.PatchOptions{}) ++ if err != nil { ++ t.Fatalf("spec merge patch: %v", err) ++ } ++ if updated.Spec.MinSize == nil || *updated.Spec.MinSize != 3 || updated.Spec.Role != kops.InstanceGroupRoleNode || updated.Annotations["owner"] != "test" || updated.Generation != 1 { ++ t.Fatalf("spec patch did not preserve the object: %#v", updated) ++ } ++ ++ jsonPatched, err := groups.Patch(ctx, "worker", types.JSONPatchType, []byte(`[{"op":"add","path":"/metadata/labels/tier","value":"api"}]`), metav1.PatchOptions{}) ++ if err != nil { ++ t.Fatalf("json patch: %v", err) ++ } ++ if jsonPatched.Labels["tier"] != "api" || jsonPatched.Generation != 1 { ++ t.Fatalf("json patch returned labels=%v generation=%d", jsonPatched.Labels, jsonPatched.Generation) ++ } ++ persisted, err := groups.Get(ctx, "worker", metav1.GetOptions{}) ++ if err != nil { ++ t.Fatalf("get patched object: %v", err) ++ } ++ if persisted.Annotations["owner"] != "test" || persisted.Labels["tier"] != "api" || persisted.Spec.MinSize == nil || *persisted.Spec.MinSize != 3 || persisted.Generation != 1 { ++ t.Fatalf("patch result was not persisted: %#v", persisted) ++ } ++ ++ if _, err := groups.Patch(ctx, "worker", types.MergePatchType, []byte(`{"spec":{"minSize":5,"maxSize":1}}`), metav1.PatchOptions{}); err == nil { ++ t.Fatal("invalid spec patch unexpectedly succeeded") ++ } ++ if _, err := groups.Patch(ctx, "worker", types.MergePatchType, []byte(`{"spec":`), metav1.PatchOptions{}); err == nil { ++ t.Fatal("malformed patch unexpectedly succeeded") ++ } ++ if _, err := groups.Patch(ctx, "worker", types.JSONPatchType, []byte(`[{"op":`), metav1.PatchOptions{}); err == nil { ++ t.Fatal("malformed JSON patch unexpectedly succeeded") ++ } ++ if _, err := groups.Patch(ctx, "worker", types.JSONPatchType, []byte(`[{"op":"replace","path":"/metadata/name","value":"renamed"}]`), metav1.PatchOptions{}); err == nil { ++ t.Fatal("rename patch unexpectedly succeeded") ++ } ++ if _, err := groups.Patch(ctx, "worker", types.MergePatchType, []byte(`{"metadata":{"name":"renamed"}}`), metav1.PatchOptions{}); err == nil { ++ t.Fatal("merge rename patch unexpectedly succeeded") ++ } ++ persisted, err = groups.Get(ctx, "worker", metav1.GetOptions{}) ++ if err != nil { ++ t.Fatalf("get after rejected patch: %v", err) ++ } ++ if persisted.Name != "worker" || persisted.Spec.MinSize == nil || *persisted.Spec.MinSize != 3 || persisted.Spec.MaxSize != nil || persisted.Generation != 1 { ++ t.Fatalf("rejected patch changed persisted object: %#v", persisted) ++ } ++ listed, err := groups.List(ctx, metav1.ListOptions{}) ++ if err != nil || !reflect.DeepEqual(instanceGroupNames(listed), []string{"worker"}) { ++ t.Fatalf("rejected rename changed collection: names=%v err=%v", instanceGroupNames(listed), err) ++ } ++} ++ ++func TestVFSInstanceGroupPatchErrors(t *testing.T) { ++ ctx, client, cluster := newInstanceGroupTestClient(t) ++ groups := client.InstanceGroupsFor(cluster) ++ if _, err := groups.Patch(ctx, "missing", types.MergePatchType, []byte(`{"metadata":{"labels":{"x":"y"}}}`), metav1.PatchOptions{}); !apierrors.IsNotFound(err) { ++ t.Fatalf("patch of missing instance group returned %v, want NotFound", err) ++ } ++ existing := &kops.InstanceGroup{ObjectMeta: metav1.ObjectMeta{Name: "worker"}, Spec: kops.InstanceGroupSpec{Role: kops.InstanceGroupRoleNode}} ++ if _, err := groups.Create(ctx, existing, metav1.CreateOptions{}); err != nil { ++ t.Fatalf("create: %v", err) ++ } ++ for _, patchType := range []types.PatchType{types.ApplyPatchType, types.StrategicMergePatchType} { ++ if _, err := groups.Patch(ctx, "worker", patchType, []byte(`{}`), metav1.PatchOptions{}); err == nil { ++ t.Fatalf("unsupported patch type %q unexpectedly succeeded", patchType) ++ } ++ } ++ if _, err := groups.Patch(ctx, "worker", types.MergePatchType, []byte(`{}`), metav1.PatchOptions{}, "status"); err == nil { ++ t.Fatal("patch subresource unexpectedly succeeded") ++ } ++} ++ ++func TestVFSInstanceGroupDeleteCollectionSelectors(t *testing.T) { ++ ctx, client, cluster := newInstanceGroupTestClient(t) ++ createTestInstanceGroups(t, ctx, client, cluster) ++ groups := client.InstanceGroupsFor(cluster) ++ ++ if err := groups.DeleteCollection(ctx, metav1.DeleteOptions{}, metav1.ListOptions{LabelSelector: "env=prod", FieldSelector: "metadata.name=gamma"}); err != nil { ++ t.Fatalf("delete collection: %v", err) ++ } ++ remaining, err := groups.List(ctx, metav1.ListOptions{}) ++ if err != nil { ++ t.Fatalf("list after delete collection: %v", err) ++ } ++ if got, want := instanceGroupNames(remaining), []string{"alpha", "beta"}; !reflect.DeepEqual(got, want) { ++ t.Fatalf("remaining groups %v, want %v", got, want) ++ } ++ if err := groups.DeleteCollection(ctx, metav1.DeleteOptions{}, metav1.ListOptions{LabelSelector: "env=does-not-exist"}); err != nil { ++ t.Fatalf("delete collection with no matches: %v", err) ++ } ++ if _, err := groups.Get(ctx, "alpha", metav1.GetOptions{}); err != nil { ++ t.Fatalf("unmatched group was deleted: %v", err) ++ } ++ if err := groups.DeleteCollection(ctx, metav1.DeleteOptions{}, metav1.ListOptions{LabelSelector: "env in"}); err == nil { ++ t.Fatal("malformed delete selector unexpectedly succeeded") ++ } ++ if err := groups.DeleteCollection(ctx, metav1.DeleteOptions{}, metav1.ListOptions{FieldSelector: "metadata.name in (alpha)"}); err == nil { ++ t.Fatal("malformed delete field selector unexpectedly succeeded") ++ } ++ remaining, err = groups.List(ctx, metav1.ListOptions{}) ++ if err != nil || !reflect.DeepEqual(instanceGroupNames(remaining), []string{"alpha", "beta"}) { ++ t.Fatalf("malformed selector changed collection: names=%v err=%v", instanceGroupNames(remaining), err) ++ } ++ if err := groups.DeleteCollection(ctx, metav1.DeleteOptions{}, metav1.ListOptions{}); err != nil { ++ t.Fatalf("delete all: %v", err) ++ } ++ remaining, err = groups.List(ctx, metav1.ListOptions{}) ++ if err != nil || len(remaining.Items) != 0 { ++ t.Fatalf("delete all left names=%v err=%v", instanceGroupNames(remaining), err) ++ } ++} +diff --git a/mimo_test_command.sh b/mimo_test_command.sh +new file mode 100755 +--- /dev/null ++++ b/mimo_test_command.sh +@@ -0,0 +1,5 @@ ++#!/bin/bash ++set -euo pipefail ++ ++ ++go test ./pkg/client/simple/vfsclientset -run '^Test(VFSInstanceGroup|SSHCredentialStore)' -count=1 diff --git a/tasks/format-code-task-000983/tests/test.sh b/tasks/format-code-task-000983/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..f44cac34fcd04ed429f9e6bf3f4cb6012e4c2a24 --- /dev/null +++ b/tasks/format-code-task-000983/tests/test.sh @@ -0,0 +1,38 @@ +#!/bin/bash +# Code grading, mimoagent opensource_code.py: reset the files the hidden test patch touches, apply it, run the +# task's test command; reward 1 when it exits 0. A testbed failure (reset or apply) writes no reward: not scored. +M=/var/lib/mimo +CWD=/testbed +V=/logs/verifier +mkdir -p "$V" +BASE=$(cat "$M/base" 2>/dev/null) || { echo "setup never ran (no $M/base)" >&2; exit 1; } +cd "$CWD" || exit 1 +if [ -d "$M/git-hidden" ]; then rm -rf "$CWD/.git"; mv "$M/git-hidden" "$CWD/.git"; fi +# the agent's change against the base, so its own commits count too +git add -A >/dev/null 2>&1 && git -c core.fileMode=false diff --cached "$BASE" > "$V/agent.diff" +git reset -q +if ! ( +while IFS= read -r tf; do + [ -z "$tf" ] && continue + if git cat-file -e $BASE:"$tf" 2>/dev/null; then + git checkout $BASE -- "$tf" 2>/dev/null || true + else + git rm -f --cached "$tf" >/dev/null 2>&1 || true + rm -f "$tf" + fi +done <<'EOF_RESET_TEST_FILES' +pkg/client/simple/vfsclientset/codespec_instancegroup_test.go +mimo_test_command.sh +EOF_RESET_TEST_FILES + +); then echo "could not reset the test files (testbed problem, not scored)" >&2; exit 1; fi +if ! git apply --verbose /tests/test.patch > "$V/apply.log" 2>&1; then + cat "$V/apply.log" >&2 + echo "the hidden tests could not be applied (testbed problem, not scored)" >&2 + exit 1 +fi +timeout 1800 sh -c "$(cat /tests/test_command.sh)" > "$V/test_output.log" 2>&1 +RC=$? +tail -c 12000 "$V/test_output.log" +if [ $RC -eq 0 ]; then echo 1 > "$V/reward.txt"; else echo 0 > "$V/reward.txt"; fi +echo "test command exited $RC" diff --git a/tasks/format-code-task-000983/tests/test_command.sh b/tasks/format-code-task-000983/tests/test_command.sh new file mode 100644 index 0000000000000000000000000000000000000000..7cb23076694ad17d72e8296d62b2b240083e36db --- /dev/null +++ b/tasks/format-code-task-000983/tests/test_command.sh @@ -0,0 +1 @@ +bash /testbed/mimo_test_command.sh \ No newline at end of file diff --git a/tasks/format-code-task-000984/environment/Dockerfile b/tasks/format-code-task-000984/environment/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..04a666ba6238684f940e86490f86249d4160b6b5 --- /dev/null +++ b/tasks/format-code-task-000984/environment/Dockerfile @@ -0,0 +1,3 @@ +# The task's image, pinned by digest (the same as [environment].docker_image). +# Setup runs at start from [environment.healthcheck]; environment/setup/ is its readable copy. +FROM docker.io/xiaomimimo/mimo-v2.6-rl-oss@sha256:5b4607fde343e4a06e96a0089ab0d939819ab26d29b458afc065622b21f80a9a diff --git a/tasks/format-code-task-000984/environment/setup/files/blocklist b/tasks/format-code-task-000984/environment/setup/files/blocklist new file mode 100644 index 0000000000000000000000000000000000000000..a8e4bdc4c7d9b739c047a3cb58ea72a1bb05bcbc --- /dev/null +++ b/tasks/format-code-task-000984/environment/setup/files/blocklist @@ -0,0 +1,33 @@ +# mimo answer-leak blocklist (mimoagent) +0.0.0.0 github.com +0.0.0.0 www.github.com +0.0.0.0 api.github.com +0.0.0.0 raw.githubusercontent.com +0.0.0.0 codeload.github.com +0.0.0.0 objects.githubusercontent.com +0.0.0.0 gist.github.com +0.0.0.0 gist.githubusercontent.com +0.0.0.0 gitlab.com +0.0.0.0 bitbucket.org +0.0.0.0 sourceforge.net +0.0.0.0 git.kernel.org +0.0.0.0 chromium.googlesource.com +0.0.0.0 android.googlesource.com +0.0.0.0 sourcegraph.com +0.0.0.0 bugs.chromium.org +0.0.0.0 issues.oss-fuzz.com +0.0.0.0 oss-fuzz.com +0.0.0.0 osv.dev +0.0.0.0 api.osv.dev +0.0.0.0 bugzilla.mozilla.org +0.0.0.0 proxy.golang.org +0.0.0.0 sum.golang.org +0.0.0.0 pkg.go.dev +0.0.0.0 google.com +0.0.0.0 www.google.com +0.0.0.0 bing.com +0.0.0.0 www.bing.com +0.0.0.0 duckduckgo.com +0.0.0.0 html.duckduckgo.com +0.0.0.0 search.brave.com +0.0.0.0 stackoverflow.com diff --git a/tasks/format-code-task-000984/environment/setup/setup.sh b/tasks/format-code-task-000984/environment/setup/setup.sh new file mode 100644 index 0000000000000000000000000000000000000000..d883db90cfcfb48f7a139861bbe9f6b5d95cad6f --- /dev/null +++ b/tasks/format-code-task-000984/environment/setup/setup.sh @@ -0,0 +1,34 @@ +#!/bin/bash +# Runs once, as root, before the agent starts: Harbor's [environment.healthcheck] unpacks this folder into +# /var/lib/mimo and runs it. Generated by mimo_harbor; see its README for how each step maps to Xiaomi's harness. +M=/var/lib/mimo +[ -f "$M/ready" ] && exit 0 +chmod 700 "$M" +fail() { echo "setup: $*" >&2; exit 1; } +# the answer-leak blocklist (mimoagent), applied to /etc/hosts by the agent right after it installs +write_blocklist() { cp "$M/files/blocklist" "$M/blocklist"; } + +# Code: mimoagent environments/datasets/opensource_code.py + base.py, as the explorer runs it (app/runner/domains.py Code). +CWD=/testbed +git config --global --add safe.directory "$CWD" +cd "$CWD" || fail "no working directory $CWD" +if ! git rev-parse --git-dir >/dev/null 2>&1; then # a bare source tree: give it a baseline commit + git init -q && git add -A && git -c user.name=mimo -c user.email=mimo@localhost commit -q -m baseline --allow-empty +fi +BASE=$(git rev-parse HEAD 2>/dev/null) +[ ${#BASE} -eq 40 ] || fail "could not resolve the base commit in $CWD" +echo "$BASE" > "$M/base" +# Images are built with history truncated at the base. If one is not, the fix could be read out of git log, +# so .git is hidden while the agent works and put back for grading. +LATER=$(git rev-list --all --not "$BASE" 2>/dev/null | head -n 5 | grep -c . || true) +rm -f /tmp/fail.log /tmp/pass.log /tmp/patch.diff /tmp/test_patch.diff /tmp/*.log 2>/dev/null; rm -rf /tmp/claude-0 /tmp/claude-* /tmp/testem-* /tmp/puppeteer_dev_chrome_profile-* 2>/dev/null; rm -f /tmp/test_files.json 2>/dev/null; rm -rf /tmp/jest_* /tmp/jest-* /tmp/build /tmp/build_env 2>/dev/null; rm -rf /tmp/pytest-of-root /tmp/pytest-* /tmp/.pytest_cache /tmp/__pycache__ 2>/dev/null; rm -rf /tmp/go-build* /tmp/standards /tmp/wordpress /tmp/zig-* /tmp/testbase /tmp/testbed 2>/dev/null; rm -f /tmp/tmp*.tmp /tmp/*.bak /tmp/expect* /tmp/butwas* 2>/dev/null; rm -rf /root/.cache/go-build 2>/dev/null; rm -rf /tests 2>/dev/null; find /logs -mindepth 1 -delete 2>/dev/null; mkdir -p /logs/agent /logs/verifier /logs/artifacts; chmod 777 /logs/agent /logs/verifier /logs/artifacts; find /var/log -type f -delete 2>/dev/null || true; rm -rf /var/lib/postgresql/*/*/log /var/lib/postgresql/*/*/pg_log 2>/dev/null || true; find /var/lib/mysql /var/lib/mongodb -type f -name '*.log' -delete 2>/dev/null || true; rm -rf /root/.npm/_logs /root/.babel.json /root/.pytest_cache 2>/dev/null || true; find / -maxdepth 4 -xdev -name task_description.md -path '*/.build_env/*' -delete 2>/dev/null || true; true +git clean -fdx --exclude=node_modules --exclude=bower_components --exclude=.husky --exclude=vendor --exclude=third_party --exclude=_deps --exclude=vcpkg_installed --exclude=.venv --exclude=venv --exclude=.gradle --exclude=target --exclude=.build --exclude=lib --exclude=.bundle --exclude=Manifest.toml --exclude=_build --exclude=.stack-work --exclude=dist-newstyle >/dev/null 2>&1 +find /root/.m2 -type f \( -name '*-SNAPSHOT.jar' -o -name '*-SNAPSHOT-sources.jar' -o -name '*-SNAPSHOT-tests.jar' -o -name '*-SNAPSHOT-test-sources.jar' \) -delete 2>/dev/null; rm -rf /root/.julia/compiled 2>/dev/null; rm -rf /root/.gradle/caches/build-cache-* /root/.gradle/daemon 2>/dev/null; rm -rf /root/.gradle/caches/*/scripts /root/.gradle/caches/jars-* 2>/dev/null; rm -rf /root/.cache/bazel 2>/dev/null; true +if [ "$LATER" -gt 0 ]; then + mv "$CWD/.git" "$M/git-hidden" + echo "history not truncated at ${BASE:0:12}: .git hidden while the agent works" +fi +write_blocklist + +touch "$M/ready" +echo "setup done" diff --git a/tasks/format-code-task-000984/tests/test.patch b/tasks/format-code-task-000984/tests/test.patch new file mode 100644 index 0000000000000000000000000000000000000000..599c14614ad2586b9e5b6c3c40f12139983dd91e --- /dev/null +++ b/tasks/format-code-task-000984/tests/test.patch @@ -0,0 +1,348 @@ +diff --git a/socorro/unittest/signature/test_offline_replay_codespec.py b/socorro/unittest/signature/test_offline_replay_codespec.py +new file mode 100644 +index 0000000..93a8501 +--- /dev/null ++++ b/socorro/unittest/signature/test_offline_replay_codespec.py +@@ -0,0 +1,326 @@ ++ ++ ++ ++ ++from __future__ import unicode_literals ++ ++import copy ++import json ++import os ++import sys ++from StringIO import StringIO ++ ++import pytest ++ ++from socorro.signature import SignatureGenerator ++from socorro.signature import __main__ as signature_cli ++ ++ ++class DeterministicReplayRule(object): ++ def predicate(self, raw_crash, processed_crash): ++ return raw_crash.get('enabled', True) ++ ++ def action(self, raw_crash, processed_crash, notes): ++ raw_crash.setdefault('nested', {})['visited'] = True ++ processed_crash.setdefault('nested', {})['visited'] = True ++ processed_crash['signature'] = raw_crash.get('next_signature', 'generated') ++ notes.append('deterministic replay rule ran') ++ return True ++ ++ ++def make_generator(): ++ return SignatureGenerator(pipeline=[DeterministicReplayRule()]) ++ ++ ++def run_cli(monkeypatch, capsys, arguments, stdin=''): ++ monkeypatch.setattr(sys, 'argv', ['python -m socorro.signature'] + arguments) ++ monkeypatch.setattr(sys, 'stdin', StringIO(stdin)) ++ ++ def network_must_not_be_used(*args, **kwargs): ++ raise AssertionError('offline replay attempted an HTTP fetch') ++ ++ monkeypatch.setattr(signature_cli, 'fetch', network_must_not_be_used) ++ status = signature_cli.main(arguments) ++ if status is None: ++ status = 0 ++ out, err = capsys.readouterr() ++ return status, out, err ++ ++ ++def parse_json_lines(output): ++ return [json.loads(line) for line in output.splitlines() if line.strip()] ++ ++ ++def write_lines(path, values): ++ path.write('\n'.join(values) + '\n') ++ ++ ++def replay_record(crash_id=None, old_signature='old'): ++ record = { ++ 'raw_crash': {}, ++ 'processed_crash': {'signature': old_signature}, ++ } ++ if crash_id is not None: ++ record['crash_id'] = crash_id ++ return record ++ ++ ++def test_compare_reports_result_and_does_not_mutate_inputs(): ++ raw_crash = { ++ 'uuid': 'raw-id', ++ 'enabled': True, ++ 'next_signature': 'new signature', ++ 'nested': {'raw': ['kept']}, ++ } ++ processed_crash = { ++ 'crash_id': 'processed-id', ++ 'signature': 'old signature', ++ 'nested': {'processed': ['kept']}, ++ } ++ original_raw = copy.deepcopy(raw_crash) ++ original_processed = copy.deepcopy(processed_crash) ++ ++ result = make_generator().compare(raw_crash, processed_crash, crash_id='explicit-id') ++ ++ assert result == { ++ 'crash_id': 'explicit-id', ++ 'old_signature': 'old signature', ++ 'new_signature': 'new signature', ++ 'changed': True, ++ 'notes': ['deterministic replay rule ran'], ++ } ++ assert raw_crash == original_raw ++ assert processed_crash == original_processed ++ ++ ++def test_compare_id_precedence_preserves_explicit_empty_values(): ++ generator = make_generator() ++ ++ explicit = generator.compare( ++ {'uuid': 'raw-id'}, ++ {'crash_id': 'processed-id', 'signature': 'old'}, ++ crash_id='', ++ ) ++ raw = generator.compare( ++ {'uuid': 'raw-id'}, ++ {'crash_id': 'processed-id', 'signature': 'old'}, ++ ) ++ raw_empty = generator.compare( ++ {'uuid': ''}, ++ {'crash_id': 'processed-id', 'signature': 'old'}, ++ ) ++ processed = generator.compare({}, {'crash_id': 'processed-id', 'signature': 'old'}) ++ processed_empty = generator.compare({}, {'crash_id': '', 'signature': 'old'}) ++ missing = generator.compare({}, {'signature': 'old'}) ++ ++ assert explicit['crash_id'] == '' ++ assert raw['crash_id'] == 'raw-id' ++ assert raw_empty['crash_id'] == '' ++ assert processed['crash_id'] == 'processed-id' ++ assert processed_empty['crash_id'] == '' ++ assert missing['crash_id'] is None ++ ++ ++def test_compare_uses_empty_old_signature_and_reports_unchanged(): ++ result = make_generator().compare( ++ {'next_signature': ''}, ++ {}, ++ ) ++ ++ assert result['old_signature'] == '' ++ assert result['new_signature'] == '' ++ assert result['changed'] is False ++ ++ ++def test_cli_replays_repeated_files_in_input_order_as_json_lines( ++ tmpdir, monkeypatch, capsys ++): ++ first_path = tmpdir.join('first.ndjson') ++ second_path = tmpdir.join('second.ndjson') ++ write_lines(first_path, [ ++ '', ++ json.dumps(replay_record('first', 'old')), ++ json.dumps({ ++ 'raw_crash': {'uuid': 'raw-second'}, ++ 'processed_crash': {'signature': 'EMPTY: no crashing thread identified'}, ++ }), ++ ]) ++ write_lines(second_path, [json.dumps({ ++ 'raw_crash': {'OOMAllocationSize': '123'}, ++ 'processed_crash': {'crash_id': 'processed-third', 'signature': 'old'}, ++ })]) ++ ++ status, out, err = run_cli( ++ monkeypatch, ++ capsys, ++ ['--input', str(first_path), '--input', str(second_path), '--format', 'json'], ++ ) ++ rows = parse_json_lines(out) ++ ++ assert status == 0 ++ assert err == '' ++ assert [row['crash_id'] for row in rows] == [ ++ 'first', 'raw-second', 'processed-third' ++ ] ++ assert [row['changed'] for row in rows] == [True, False, True] ++ assert set(rows[0]) == { ++ 'crash_id', 'old_signature', 'new_signature', 'changed', 'notes' ++ } ++ assert rows[0]['old_signature'] == 'old' ++ assert rows[0]['new_signature'] == 'EMPTY: no crashing thread identified' ++ assert isinstance(rows[0]['notes'], list) ++ assert rows[2]['new_signature'] == 'OOM | small' ++ ++ ++def test_cli_different_only_filters_after_comparison_and_keeps_empty_id( ++ tmpdir, monkeypatch, capsys ++): ++ input_path = tmpdir.join('filter.ndjson') ++ unchanged = replay_record('unchanged', 'EMPTY: no crashing thread identified') ++ changed = replay_record(None, 'old') ++ changed['crash_id'] = '' ++ write_lines(input_path, [json.dumps(unchanged), json.dumps(changed)]) ++ ++ status, out, err = run_cli( ++ monkeypatch, ++ capsys, ++ ['--input', str(input_path), '--format', 'json', '--different-only'], ++ ) ++ rows = parse_json_lines(out) ++ ++ assert status == 0 ++ assert err == '' ++ assert len(rows) == 1 ++ assert rows[0]['crash_id'] == '' ++ assert rows[0]['changed'] is True ++ ++ ++def test_cli_reports_bad_lines_but_continues_valid_records( ++ tmpdir, monkeypatch, capsys ++): ++ input_path = tmpdir.join('mixed.ndjson') ++ write_lines(input_path, [ ++ json.dumps(replay_record('before')), ++ '{broken json', ++ json.dumps([]), ++ json.dumps({'raw_crash': {}, 'crash_id': 'missing-processed'}), ++ '', ++ json.dumps(replay_record('after')), ++ ]) ++ ++ status, out, err = run_cli( ++ monkeypatch, ++ capsys, ++ ['--input', str(input_path), '--format', 'json'], ++ ) ++ rows = parse_json_lines(out) ++ ++ assert status == 1 ++ assert [row['crash_id'] for row in rows] == ['before', 'after'] ++ assert '%s:2' % input_path.basename in err ++ assert '%s:3' % input_path.basename in err ++ assert '%s:4' % input_path.basename in err ++ assert 'Traceback' not in err ++ ++ ++def test_cli_validates_record_member_types_and_continues( ++ tmpdir, monkeypatch, capsys ++): ++ input_path = tmpdir.join('types.ndjson') ++ write_lines(input_path, [ ++ json.dumps({'raw_crash': [], 'processed_crash': {}}), ++ json.dumps({'raw_crash': {}, 'processed_crash': [], 'crash_id': 'bad'}), ++ json.dumps({'raw_crash': {}, 'processed_crash': {}, 'crash_id': 27}), ++ json.dumps(replay_record('valid')), ++ ]) ++ ++ status, out, err = run_cli( ++ monkeypatch, ++ capsys, ++ ['--input', str(input_path), '--format', 'json'], ++ ) ++ ++ assert status == 1 ++ assert [row['crash_id'] for row in parse_json_lines(out)] == ['valid'] ++ assert '%s:1' % input_path.basename in err ++ assert '%s:2' % input_path.basename in err ++ assert '%s:3' % input_path.basename in err ++ ++ ++def test_cli_supports_explicit_stdin_and_rejects_ids_with_input( ++ monkeypatch, capsys ++): ++ record = replay_record('stdin-record') ++ status, out, err = run_cli( ++ monkeypatch, ++ capsys, ++ ['--input', '-', '--format', 'json'], ++ stdin=json.dumps(record) + '\n', ++ ) ++ ++ assert status == 0 ++ assert err == '' ++ assert [row['crash_id'] for row in parse_json_lines(out)] == ['stdin-record'] ++ ++ monkeypatch.setattr( ++ sys, ++ 'argv', ++ ['python -m socorro.signature', '--input', '-', 'remote-crash-id'], ++ ) ++ with pytest.raises(SystemExit) as exc_info: ++ signature_cli.main(['--input', '-', 'remote-crash-id']) ++ assert exc_info.value.code == 2 ++ ++ ++def test_cli_unreadable_source_is_a_clean_error_and_other_sources_continue( ++ tmpdir, monkeypatch, capsys ++): ++ missing_path = os.path.join(str(tmpdir), 'does-not-exist.ndjson') ++ valid_path = tmpdir.join('valid.ndjson') ++ write_lines(valid_path, [json.dumps(replay_record('still-ran'))]) ++ ++ status, out, err = run_cli( ++ monkeypatch, ++ capsys, ++ ['--input', missing_path, '--input', str(valid_path), '--format', 'json'], ++ ) ++ ++ assert status == 1 ++ assert [row['crash_id'] for row in parse_json_lines(out)] == ['still-ran'] ++ assert missing_path in err ++ assert 'Traceback' not in err ++ ++ ++def test_cli_remote_crash_id_mode_keeps_text_output(monkeypatch, capsys): ++ class Response(object): ++ status_code = 200 ++ content = '' ++ ++ def __init__(self, payload): ++ self.payload = payload ++ ++ def json(self): ++ return copy.deepcopy(self.payload) ++ ++ payloads = { ++ '/RawCrash/': {'uuid': 'remote-id'}, ++ '/ProcessedCrash/': {'crash_id': 'remote-id', 'signature': 'old signature'}, ++ } ++ ++ def fake_fetch(endpoint, crash_id, api_token=None): ++ assert crash_id == 'remote-id' ++ return Response(payloads[endpoint]) ++ ++ monkeypatch.setattr(signature_cli, 'fetch', fake_fetch) ++ monkeypatch.setattr( ++ sys, ++ 'argv', ++ ['python -m socorro.signature', 'remote-id'], ++ ) ++ status = signature_cli.main(['remote-id']) ++ if status is None: ++ status = 0 ++ out, err = capsys.readouterr() ++ ++ assert status == 0 ++ assert err == '' ++ assert 'Crash id: remote-id' in out ++ assert 'Original: old signature' in out ++ assert 'New: EMPTY: no crashing thread identified' in out +diff --git a/mimo_test_command.sh b/mimo_test_command.sh +new file mode 100755 +--- /dev/null ++++ b/mimo_test_command.sh +@@ -0,0 +1,8 @@ ++#!/bin/bash ++set -euo pipefail ++ ++ ++pytest -q \ ++ socorro/unittest/signature/test_offline_replay_codespec.py \ ++ socorro/unittest/signature/test_signature_generator.py \ ++ socorro/unittest/signature/test_rules.py diff --git a/tasks/format-code-task-000984/tests/test.sh b/tasks/format-code-task-000984/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..ad4f95c1f4c178630971adde20da7468909d2a64 --- /dev/null +++ b/tasks/format-code-task-000984/tests/test.sh @@ -0,0 +1,38 @@ +#!/bin/bash +# Code grading, mimoagent opensource_code.py: reset the files the hidden test patch touches, apply it, run the +# task's test command; reward 1 when it exits 0. A testbed failure (reset or apply) writes no reward: not scored. +M=/var/lib/mimo +CWD=/testbed +V=/logs/verifier +mkdir -p "$V" +BASE=$(cat "$M/base" 2>/dev/null) || { echo "setup never ran (no $M/base)" >&2; exit 1; } +cd "$CWD" || exit 1 +if [ -d "$M/git-hidden" ]; then rm -rf "$CWD/.git"; mv "$M/git-hidden" "$CWD/.git"; fi +# the agent's change against the base, so its own commits count too +git add -A >/dev/null 2>&1 && git -c core.fileMode=false diff --cached "$BASE" > "$V/agent.diff" +git reset -q +if ! ( +while IFS= read -r tf; do + [ -z "$tf" ] && continue + if git cat-file -e $BASE:"$tf" 2>/dev/null; then + git checkout $BASE -- "$tf" 2>/dev/null || true + else + git rm -f --cached "$tf" >/dev/null 2>&1 || true + rm -f "$tf" + fi +done <<'EOF_RESET_TEST_FILES' +socorro/unittest/signature/test_offline_replay_codespec.py +mimo_test_command.sh +EOF_RESET_TEST_FILES + +); then echo "could not reset the test files (testbed problem, not scored)" >&2; exit 1; fi +if ! git apply --verbose /tests/test.patch > "$V/apply.log" 2>&1; then + cat "$V/apply.log" >&2 + echo "the hidden tests could not be applied (testbed problem, not scored)" >&2 + exit 1 +fi +timeout 1800 sh -c "$(cat /tests/test_command.sh)" > "$V/test_output.log" 2>&1 +RC=$? +tail -c 12000 "$V/test_output.log" +if [ $RC -eq 0 ]; then echo 1 > "$V/reward.txt"; else echo 0 > "$V/reward.txt"; fi +echo "test command exited $RC" diff --git a/tasks/format-code-task-000984/tests/test_command.sh b/tasks/format-code-task-000984/tests/test_command.sh new file mode 100644 index 0000000000000000000000000000000000000000..7cb23076694ad17d72e8296d62b2b240083e36db --- /dev/null +++ b/tasks/format-code-task-000984/tests/test_command.sh @@ -0,0 +1 @@ +bash /testbed/mimo_test_command.sh \ No newline at end of file diff --git a/tasks/format-code-task-001001/environment/Dockerfile b/tasks/format-code-task-001001/environment/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..0297fdff8bcc5eb3bbd7c25e92dc6d9010e1c804 --- /dev/null +++ b/tasks/format-code-task-001001/environment/Dockerfile @@ -0,0 +1,3 @@ +# The task's image, pinned by digest (the same as [environment].docker_image). +# Setup runs at start from [environment.healthcheck]; environment/setup/ is its readable copy. +FROM docker.io/xiaomimimo/mimo-v2.6-rl-oss@sha256:dcc04ed30bbb8c582c28d2c3d02a78b333f70b54839983e01cb53218ce9add77 diff --git a/tasks/format-code-task-001001/environment/setup/files/blocklist b/tasks/format-code-task-001001/environment/setup/files/blocklist new file mode 100644 index 0000000000000000000000000000000000000000..a8e4bdc4c7d9b739c047a3cb58ea72a1bb05bcbc --- /dev/null +++ b/tasks/format-code-task-001001/environment/setup/files/blocklist @@ -0,0 +1,33 @@ +# mimo answer-leak blocklist (mimoagent) +0.0.0.0 github.com +0.0.0.0 www.github.com +0.0.0.0 api.github.com +0.0.0.0 raw.githubusercontent.com +0.0.0.0 codeload.github.com +0.0.0.0 objects.githubusercontent.com +0.0.0.0 gist.github.com +0.0.0.0 gist.githubusercontent.com +0.0.0.0 gitlab.com +0.0.0.0 bitbucket.org +0.0.0.0 sourceforge.net +0.0.0.0 git.kernel.org +0.0.0.0 chromium.googlesource.com +0.0.0.0 android.googlesource.com +0.0.0.0 sourcegraph.com +0.0.0.0 bugs.chromium.org +0.0.0.0 issues.oss-fuzz.com +0.0.0.0 oss-fuzz.com +0.0.0.0 osv.dev +0.0.0.0 api.osv.dev +0.0.0.0 bugzilla.mozilla.org +0.0.0.0 proxy.golang.org +0.0.0.0 sum.golang.org +0.0.0.0 pkg.go.dev +0.0.0.0 google.com +0.0.0.0 www.google.com +0.0.0.0 bing.com +0.0.0.0 www.bing.com +0.0.0.0 duckduckgo.com +0.0.0.0 html.duckduckgo.com +0.0.0.0 search.brave.com +0.0.0.0 stackoverflow.com diff --git a/tasks/format-code-task-001001/environment/setup/setup.sh b/tasks/format-code-task-001001/environment/setup/setup.sh new file mode 100644 index 0000000000000000000000000000000000000000..d883db90cfcfb48f7a139861bbe9f6b5d95cad6f --- /dev/null +++ b/tasks/format-code-task-001001/environment/setup/setup.sh @@ -0,0 +1,34 @@ +#!/bin/bash +# Runs once, as root, before the agent starts: Harbor's [environment.healthcheck] unpacks this folder into +# /var/lib/mimo and runs it. Generated by mimo_harbor; see its README for how each step maps to Xiaomi's harness. +M=/var/lib/mimo +[ -f "$M/ready" ] && exit 0 +chmod 700 "$M" +fail() { echo "setup: $*" >&2; exit 1; } +# the answer-leak blocklist (mimoagent), applied to /etc/hosts by the agent right after it installs +write_blocklist() { cp "$M/files/blocklist" "$M/blocklist"; } + +# Code: mimoagent environments/datasets/opensource_code.py + base.py, as the explorer runs it (app/runner/domains.py Code). +CWD=/testbed +git config --global --add safe.directory "$CWD" +cd "$CWD" || fail "no working directory $CWD" +if ! git rev-parse --git-dir >/dev/null 2>&1; then # a bare source tree: give it a baseline commit + git init -q && git add -A && git -c user.name=mimo -c user.email=mimo@localhost commit -q -m baseline --allow-empty +fi +BASE=$(git rev-parse HEAD 2>/dev/null) +[ ${#BASE} -eq 40 ] || fail "could not resolve the base commit in $CWD" +echo "$BASE" > "$M/base" +# Images are built with history truncated at the base. If one is not, the fix could be read out of git log, +# so .git is hidden while the agent works and put back for grading. +LATER=$(git rev-list --all --not "$BASE" 2>/dev/null | head -n 5 | grep -c . || true) +rm -f /tmp/fail.log /tmp/pass.log /tmp/patch.diff /tmp/test_patch.diff /tmp/*.log 2>/dev/null; rm -rf /tmp/claude-0 /tmp/claude-* /tmp/testem-* /tmp/puppeteer_dev_chrome_profile-* 2>/dev/null; rm -f /tmp/test_files.json 2>/dev/null; rm -rf /tmp/jest_* /tmp/jest-* /tmp/build /tmp/build_env 2>/dev/null; rm -rf /tmp/pytest-of-root /tmp/pytest-* /tmp/.pytest_cache /tmp/__pycache__ 2>/dev/null; rm -rf /tmp/go-build* /tmp/standards /tmp/wordpress /tmp/zig-* /tmp/testbase /tmp/testbed 2>/dev/null; rm -f /tmp/tmp*.tmp /tmp/*.bak /tmp/expect* /tmp/butwas* 2>/dev/null; rm -rf /root/.cache/go-build 2>/dev/null; rm -rf /tests 2>/dev/null; find /logs -mindepth 1 -delete 2>/dev/null; mkdir -p /logs/agent /logs/verifier /logs/artifacts; chmod 777 /logs/agent /logs/verifier /logs/artifacts; find /var/log -type f -delete 2>/dev/null || true; rm -rf /var/lib/postgresql/*/*/log /var/lib/postgresql/*/*/pg_log 2>/dev/null || true; find /var/lib/mysql /var/lib/mongodb -type f -name '*.log' -delete 2>/dev/null || true; rm -rf /root/.npm/_logs /root/.babel.json /root/.pytest_cache 2>/dev/null || true; find / -maxdepth 4 -xdev -name task_description.md -path '*/.build_env/*' -delete 2>/dev/null || true; true +git clean -fdx --exclude=node_modules --exclude=bower_components --exclude=.husky --exclude=vendor --exclude=third_party --exclude=_deps --exclude=vcpkg_installed --exclude=.venv --exclude=venv --exclude=.gradle --exclude=target --exclude=.build --exclude=lib --exclude=.bundle --exclude=Manifest.toml --exclude=_build --exclude=.stack-work --exclude=dist-newstyle >/dev/null 2>&1 +find /root/.m2 -type f \( -name '*-SNAPSHOT.jar' -o -name '*-SNAPSHOT-sources.jar' -o -name '*-SNAPSHOT-tests.jar' -o -name '*-SNAPSHOT-test-sources.jar' \) -delete 2>/dev/null; rm -rf /root/.julia/compiled 2>/dev/null; rm -rf /root/.gradle/caches/build-cache-* /root/.gradle/daemon 2>/dev/null; rm -rf /root/.gradle/caches/*/scripts /root/.gradle/caches/jars-* 2>/dev/null; rm -rf /root/.cache/bazel 2>/dev/null; true +if [ "$LATER" -gt 0 ]; then + mv "$CWD/.git" "$M/git-hidden" + echo "history not truncated at ${BASE:0:12}: .git hidden while the agent works" +fi +write_blocklist + +touch "$M/ready" +echo "setup done" diff --git a/tasks/format-code-task-001001/tests/test.patch b/tasks/format-code-task-001001/tests/test.patch new file mode 100644 index 0000000000000000000000000000000000000000..8237ac4f29cdb740ee4efae0aefd34ea000c88a9 --- /dev/null +++ b/tasks/format-code-task-001001/tests/test.patch @@ -0,0 +1,94 @@ +diff --git a/web/src/search/input/codespec_filter_normalization.test.ts b/web/src/search/input/codespec_filter_normalization.test.ts +new file mode 100644 +index 00000000000..f2c81fe919d +--- /dev/null ++++ b/web/src/search/input/codespec_filter_normalization.test.ts +@@ -0,0 +1,78 @@ ++import { FilterType, isNegatedFilter, resolveNegatedFilter } from '../../../../shared/src/search/interactive/util' ++import { isFiniteFilter, isTextFilter } from './interactive/filters' ++import { convertPlainTextToInteractiveQuery } from './helpers' ++import { isSingularFilter } from '../../../../shared/src/search/parser/filters' ++ ++describe('interactive filter normalization', () => { ++ test('classifies filter names case-insensitively', () => { ++ expect(isSingularFilter('CASE')).toBe(true) ++ expect(isSingularFilter('Case')).toBe(true) ++ expect(isFiniteFilter('ARCHIVED' as FilterType)).toBe(true) ++ expect(isTextFilter('RePo' as FilterType)).toBe(true) ++ }) ++ ++ test('canonicalizes filter types and preserves aliases and negation', () => { ++ const result = convertPlainTextToInteractiveQuery('needle RePo:^acme/one$ CASE:no -F:^generated/') ++ expect(result.navbarQuery).toBe('needle') ++ expect(result.filtersInQuery).toEqual( ++ expect.objectContaining({ ++ case: { ++ type: FilterType.case, ++ value: 'no', ++ editable: false, ++ negated: false, ++ }, ++ }) ++ ) ++ ++ const filters = Object.values(result.filtersInQuery) ++ expect(filters).toEqual( ++ expect.arrayContaining([ ++ { ++ type: FilterType.repo, ++ value: '^acme/one$', ++ editable: false, ++ negated: false, ++ }, ++ { ++ type: FilterType.file, ++ value: '^generated/', ++ editable: false, ++ negated: true, ++ }, ++ ]) ++ ) ++ ++ const repeated = convertPlainTextToInteractiveQuery('repo:one r:two') ++ expect(Object.values(repeated.filtersInQuery)).toEqual( ++ expect.arrayContaining([ ++ expect.objectContaining({ type: FilterType.repo, value: 'one' }), ++ expect.objectContaining({ type: FilterType.repo, value: 'two' }), ++ ]) ++ ) ++ expect(Object.keys(repeated.filtersInQuery)).toHaveLength(2) ++ }) ++ ++ test('later occurrences replace earlier singular filters regardless of spelling', () => { ++ const result = convertPlainTextToInteractiveQuery('case:no CASE:yes') ++ expect(Object.keys(result.filtersInQuery)).toEqual(['case']) ++ expect(result.filtersInQuery.case).toEqual({ ++ type: FilterType.case, ++ value: 'yes', ++ editable: false, ++ negated: false, ++ }) ++ }) ++ ++ test('invalid filters remain in the navbar query', () => { ++ const result = convertPlainTextToInteractiveQuery('RePoS:foo UNKNOWN:bar') ++ expect(result.filtersInQuery).toEqual({}) ++ expect(result.navbarQuery).toBe('RePoS:foo UNKNOWN:bar') ++ }) ++ ++ test('negated filter detection accepts case-insensitive spellings', () => { ++ expect(isNegatedFilter('-REPO')).toBe(true) ++ expect(isNegatedFilter('-f')).toBe(true) ++ expect(resolveNegatedFilter('-REPO' as any)).toBe(FilterType.repo) ++ }) ++}) +diff --git a/mimo_test_command.sh b/mimo_test_command.sh +new file mode 100755 +--- /dev/null ++++ b/mimo_test_command.sh +@@ -0,0 +1,5 @@ ++#!/bin/bash ++set -euo pipefail ++ ++ ++./node_modules/.bin/jest web/src/search/input/codespec_filter_normalization.test.ts --runInBand diff --git a/tasks/format-code-task-001001/tests/test.sh b/tasks/format-code-task-001001/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..917ff6c860a6e50a6b07067d607132d9394586e6 --- /dev/null +++ b/tasks/format-code-task-001001/tests/test.sh @@ -0,0 +1,38 @@ +#!/bin/bash +# Code grading, mimoagent opensource_code.py: reset the files the hidden test patch touches, apply it, run the +# task's test command; reward 1 when it exits 0. A testbed failure (reset or apply) writes no reward: not scored. +M=/var/lib/mimo +CWD=/testbed +V=/logs/verifier +mkdir -p "$V" +BASE=$(cat "$M/base" 2>/dev/null) || { echo "setup never ran (no $M/base)" >&2; exit 1; } +cd "$CWD" || exit 1 +if [ -d "$M/git-hidden" ]; then rm -rf "$CWD/.git"; mv "$M/git-hidden" "$CWD/.git"; fi +# the agent's change against the base, so its own commits count too +git add -A >/dev/null 2>&1 && git -c core.fileMode=false diff --cached "$BASE" > "$V/agent.diff" +git reset -q +if ! ( +while IFS= read -r tf; do + [ -z "$tf" ] && continue + if git cat-file -e $BASE:"$tf" 2>/dev/null; then + git checkout $BASE -- "$tf" 2>/dev/null || true + else + git rm -f --cached "$tf" >/dev/null 2>&1 || true + rm -f "$tf" + fi +done <<'EOF_RESET_TEST_FILES' +web/src/search/input/codespec_filter_normalization.test.ts +mimo_test_command.sh +EOF_RESET_TEST_FILES + +); then echo "could not reset the test files (testbed problem, not scored)" >&2; exit 1; fi +if ! git apply --verbose /tests/test.patch > "$V/apply.log" 2>&1; then + cat "$V/apply.log" >&2 + echo "the hidden tests could not be applied (testbed problem, not scored)" >&2 + exit 1 +fi +timeout 1800 sh -c "$(cat /tests/test_command.sh)" > "$V/test_output.log" 2>&1 +RC=$? +tail -c 12000 "$V/test_output.log" +if [ $RC -eq 0 ]; then echo 1 > "$V/reward.txt"; else echo 0 > "$V/reward.txt"; fi +echo "test command exited $RC" diff --git a/tasks/format-code-task-001001/tests/test_command.sh b/tasks/format-code-task-001001/tests/test_command.sh new file mode 100644 index 0000000000000000000000000000000000000000..7cb23076694ad17d72e8296d62b2b240083e36db --- /dev/null +++ b/tasks/format-code-task-001001/tests/test_command.sh @@ -0,0 +1 @@ +bash /testbed/mimo_test_command.sh \ No newline at end of file diff --git a/tasks/format-code-task-001006/environment/Dockerfile b/tasks/format-code-task-001006/environment/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..1bbb171ead701224a9ce33d26c0e9be35e41c72f --- /dev/null +++ b/tasks/format-code-task-001006/environment/Dockerfile @@ -0,0 +1,3 @@ +# The task's image, pinned by digest (the same as [environment].docker_image). +# Setup runs at start from [environment.healthcheck]; environment/setup/ is its readable copy. +FROM docker.io/xiaomimimo/mimo-v2.6-rl-oss@sha256:5a256257d4a5f0c2085b773c25e5259bbeee10e708bb39a873e5edbb31749fd0 diff --git a/tasks/format-code-task-001006/environment/setup/files/blocklist b/tasks/format-code-task-001006/environment/setup/files/blocklist new file mode 100644 index 0000000000000000000000000000000000000000..a8e4bdc4c7d9b739c047a3cb58ea72a1bb05bcbc --- /dev/null +++ b/tasks/format-code-task-001006/environment/setup/files/blocklist @@ -0,0 +1,33 @@ +# mimo answer-leak blocklist (mimoagent) +0.0.0.0 github.com +0.0.0.0 www.github.com +0.0.0.0 api.github.com +0.0.0.0 raw.githubusercontent.com +0.0.0.0 codeload.github.com +0.0.0.0 objects.githubusercontent.com +0.0.0.0 gist.github.com +0.0.0.0 gist.githubusercontent.com +0.0.0.0 gitlab.com +0.0.0.0 bitbucket.org +0.0.0.0 sourceforge.net +0.0.0.0 git.kernel.org +0.0.0.0 chromium.googlesource.com +0.0.0.0 android.googlesource.com +0.0.0.0 sourcegraph.com +0.0.0.0 bugs.chromium.org +0.0.0.0 issues.oss-fuzz.com +0.0.0.0 oss-fuzz.com +0.0.0.0 osv.dev +0.0.0.0 api.osv.dev +0.0.0.0 bugzilla.mozilla.org +0.0.0.0 proxy.golang.org +0.0.0.0 sum.golang.org +0.0.0.0 pkg.go.dev +0.0.0.0 google.com +0.0.0.0 www.google.com +0.0.0.0 bing.com +0.0.0.0 www.bing.com +0.0.0.0 duckduckgo.com +0.0.0.0 html.duckduckgo.com +0.0.0.0 search.brave.com +0.0.0.0 stackoverflow.com diff --git a/tasks/format-code-task-001006/environment/setup/setup.sh b/tasks/format-code-task-001006/environment/setup/setup.sh new file mode 100644 index 0000000000000000000000000000000000000000..d883db90cfcfb48f7a139861bbe9f6b5d95cad6f --- /dev/null +++ b/tasks/format-code-task-001006/environment/setup/setup.sh @@ -0,0 +1,34 @@ +#!/bin/bash +# Runs once, as root, before the agent starts: Harbor's [environment.healthcheck] unpacks this folder into +# /var/lib/mimo and runs it. Generated by mimo_harbor; see its README for how each step maps to Xiaomi's harness. +M=/var/lib/mimo +[ -f "$M/ready" ] && exit 0 +chmod 700 "$M" +fail() { echo "setup: $*" >&2; exit 1; } +# the answer-leak blocklist (mimoagent), applied to /etc/hosts by the agent right after it installs +write_blocklist() { cp "$M/files/blocklist" "$M/blocklist"; } + +# Code: mimoagent environments/datasets/opensource_code.py + base.py, as the explorer runs it (app/runner/domains.py Code). +CWD=/testbed +git config --global --add safe.directory "$CWD" +cd "$CWD" || fail "no working directory $CWD" +if ! git rev-parse --git-dir >/dev/null 2>&1; then # a bare source tree: give it a baseline commit + git init -q && git add -A && git -c user.name=mimo -c user.email=mimo@localhost commit -q -m baseline --allow-empty +fi +BASE=$(git rev-parse HEAD 2>/dev/null) +[ ${#BASE} -eq 40 ] || fail "could not resolve the base commit in $CWD" +echo "$BASE" > "$M/base" +# Images are built with history truncated at the base. If one is not, the fix could be read out of git log, +# so .git is hidden while the agent works and put back for grading. +LATER=$(git rev-list --all --not "$BASE" 2>/dev/null | head -n 5 | grep -c . || true) +rm -f /tmp/fail.log /tmp/pass.log /tmp/patch.diff /tmp/test_patch.diff /tmp/*.log 2>/dev/null; rm -rf /tmp/claude-0 /tmp/claude-* /tmp/testem-* /tmp/puppeteer_dev_chrome_profile-* 2>/dev/null; rm -f /tmp/test_files.json 2>/dev/null; rm -rf /tmp/jest_* /tmp/jest-* /tmp/build /tmp/build_env 2>/dev/null; rm -rf /tmp/pytest-of-root /tmp/pytest-* /tmp/.pytest_cache /tmp/__pycache__ 2>/dev/null; rm -rf /tmp/go-build* /tmp/standards /tmp/wordpress /tmp/zig-* /tmp/testbase /tmp/testbed 2>/dev/null; rm -f /tmp/tmp*.tmp /tmp/*.bak /tmp/expect* /tmp/butwas* 2>/dev/null; rm -rf /root/.cache/go-build 2>/dev/null; rm -rf /tests 2>/dev/null; find /logs -mindepth 1 -delete 2>/dev/null; mkdir -p /logs/agent /logs/verifier /logs/artifacts; chmod 777 /logs/agent /logs/verifier /logs/artifacts; find /var/log -type f -delete 2>/dev/null || true; rm -rf /var/lib/postgresql/*/*/log /var/lib/postgresql/*/*/pg_log 2>/dev/null || true; find /var/lib/mysql /var/lib/mongodb -type f -name '*.log' -delete 2>/dev/null || true; rm -rf /root/.npm/_logs /root/.babel.json /root/.pytest_cache 2>/dev/null || true; find / -maxdepth 4 -xdev -name task_description.md -path '*/.build_env/*' -delete 2>/dev/null || true; true +git clean -fdx --exclude=node_modules --exclude=bower_components --exclude=.husky --exclude=vendor --exclude=third_party --exclude=_deps --exclude=vcpkg_installed --exclude=.venv --exclude=venv --exclude=.gradle --exclude=target --exclude=.build --exclude=lib --exclude=.bundle --exclude=Manifest.toml --exclude=_build --exclude=.stack-work --exclude=dist-newstyle >/dev/null 2>&1 +find /root/.m2 -type f \( -name '*-SNAPSHOT.jar' -o -name '*-SNAPSHOT-sources.jar' -o -name '*-SNAPSHOT-tests.jar' -o -name '*-SNAPSHOT-test-sources.jar' \) -delete 2>/dev/null; rm -rf /root/.julia/compiled 2>/dev/null; rm -rf /root/.gradle/caches/build-cache-* /root/.gradle/daemon 2>/dev/null; rm -rf /root/.gradle/caches/*/scripts /root/.gradle/caches/jars-* 2>/dev/null; rm -rf /root/.cache/bazel 2>/dev/null; true +if [ "$LATER" -gt 0 ]; then + mv "$CWD/.git" "$M/git-hidden" + echo "history not truncated at ${BASE:0:12}: .git hidden while the agent works" +fi +write_blocklist + +touch "$M/ready" +echo "setup done" diff --git a/tasks/format-code-task-001006/tests/test.patch b/tasks/format-code-task-001006/tests/test.patch new file mode 100644 index 0000000000000000000000000000000000000000..b3463b904827bc5af35034f1b180c8f57fedec2f --- /dev/null +++ b/tasks/format-code-task-001006/tests/test.patch @@ -0,0 +1,141 @@ +diff --git a/scanner/internal/httputil/transport_mux_contract_test.go b/scanner/internal/httputil/transport_mux_contract_test.go +new file mode 100644 +index 0000000000..7aa3214575 +--- /dev/null ++++ b/scanner/internal/httputil/transport_mux_contract_test.go +@@ -0,0 +1,125 @@ ++package httputil ++ ++import ( ++ "context" ++ "errors" ++ "fmt" ++ "io" ++ "net/http" ++ "net/url" ++ "strings" ++ "testing" ++ ++ "github.com/stackrox/rox/pkg/env" ++ roothttputil "github.com/stackrox/rox/pkg/httputil" ++ mtlstestutils "github.com/stackrox/rox/pkg/mtls/testutils" ++ "github.com/stretchr/testify/assert" ++ "github.com/stretchr/testify/require" ++) ++ ++func TestTransportMux_ServiceDNSFormsAreDenied(t *testing.T) { ++ t.Setenv(env.Namespace.EnvVar(), "rhacs") ++ defaultTransport := roothttputil.RoundTripperFunc(func(req *http.Request) (*http.Response, error) { ++ return &http.Response{StatusCode: http.StatusOK, Body: io.NopCloser(strings.NewReader("default"))}, nil ++ }) ++ ++ tr, err := TransportMux(defaultTransport, WithDenyStackRoxServices(true)) ++ require.NoError(t, err) ++ client := &http.Client{Transport: tr} ++ ++ for _, tc := range []struct { ++ name string ++ url string ++ }{ ++ {name: "central short", url: "https://central.rhacs/health"}, ++ {name: "central service", url: "https://central.rhacs.svc:443/health"}, ++ {name: "central fully qualified", url: "https://CENTRAL.RHACS.SVC.CLUSTER.LOCAL./health"}, ++ {name: "sensor short", url: "https://sensor.rhacs:8443/health"}, ++ {name: "sensor fully qualified", url: "https://sensor.rhacs.svc.cluster.local.:8443/health"}, ++ } { ++ t.Run(tc.name, func(t *testing.T) { ++ assertDenied(t, client, tc.url) ++ }) ++ } ++} ++ ++func TestTransportMux_ServiceNameBoundariesAndExternalTraffic(t *testing.T) { ++ t.Setenv(env.Namespace.EnvVar(), "rhacs") ++ defaultTransport := roothttputil.RoundTripperFunc(func(req *http.Request) (*http.Response, error) { ++ return &http.Response{StatusCode: http.StatusOK, Body: io.NopCloser(strings.NewReader(req.URL.Host))}, nil ++ }) ++ ++ tr, err := TransportMux(defaultTransport, WithDenyStackRoxServices(true)) ++ require.NoError(t, err) ++ client := &http.Client{Transport: tr} ++ ++ for _, tc := range []struct { ++ name string ++ url string ++ }{ ++ {name: "other service", url: "https://central.rhacs-extra.svc/health"}, ++ {name: "other namespace", url: "https://sensor.other.svc/health"}, ++ {name: "service prefix", url: "https://central-api.rhacs.svc/health"}, ++ {name: "external host", url: "https://quay.io/v2/"}, ++ } { ++ t.Run(tc.name, func(t *testing.T) { ++ resp, err := client.Get(tc.url) ++ require.NoError(t, err) ++ defer resp.Body.Close() ++ body, err := io.ReadAll(resp.Body) ++ require.NoError(t, err) ++ assert.Equal(t, http.StatusOK, resp.StatusCode) ++ parsed, err := url.Parse(tc.url) ++ require.NoError(t, err) ++ assert.Equal(t, parsed.Host, string(body)) ++ }) ++ } ++} ++ ++func TestTransportMux_DenyOptionsRemainIndependent(t *testing.T) { ++ t.Setenv(env.Namespace.EnvVar(), "rhacs") ++ require.NoError(t, mtlstestutils.LoadTestMTLSCerts(t)) ++ defaultErr := errors.New("default transport used") ++ defaultTransport := roothttputil.RoundTripperFunc(func(req *http.Request) (*http.Response, error) { ++ return nil, defaultErr ++ }) ++ ++ for _, tc := range []struct { ++ name string ++ option TransportOption ++ deniedURL string ++ allowedURL string ++ }{ ++ {name: "central only", option: WithDenyCentral(true), deniedURL: "https://central.rhacs.svc.cluster.local./health", allowedURL: "https://sensor.rhacs.svc/health"}, ++ {name: "sensor only", option: WithDenySensor(true), deniedURL: "https://sensor.rhacs.svc.cluster.local.:8443/health", allowedURL: "https://central.rhacs.svc/health"}, ++ } { ++ t.Run(tc.name, func(t *testing.T) { ++ tr, err := TransportMux(defaultTransport, tc.option) ++ require.NoError(t, err) ++ assertDenied(t, &http.Client{Transport: tr}, tc.deniedURL) ++ ++ ctx, cancel := context.WithCancel(context.Background()) ++ cancel() ++ req, err := http.NewRequestWithContext(ctx, http.MethodGet, tc.allowedURL, nil) ++ require.NoError(t, err) ++ _, err = tr.RoundTrip(req) ++ assert.ErrorIs(t, err, context.Canceled) ++ assert.NotErrorIs(t, err, defaultErr) ++ }) ++ } ++} ++ ++func assertDenied(t *testing.T, client *http.Client, url string) { ++ t.Helper() ++ assert.True(t, requestWasDenied(client, url), "service request was not denied: %s", url) ++} ++ ++func requestWasDenied(client *http.Client, url string) (denied bool) { ++ defer func() { ++ if recovered := recover(); recovered != nil { ++ denied = strings.Contains(fmt.Sprint(recovered), "HTTP traffic denied") ++ } ++ }() ++ _, err := client.Get(url) ++ return err != nil && strings.Contains(err.Error(), "HTTP traffic denied") ++} +diff --git a/mimo_test_command.sh b/mimo_test_command.sh +new file mode 100755 +--- /dev/null ++++ b/mimo_test_command.sh +@@ -0,0 +1,5 @@ ++#!/bin/bash ++set -euo pipefail ++ ++ ++go test ./scanner/internal/httputil -run 'TestTransportMux($|_(ServiceDNSFormsAreDenied|ServiceNameBoundariesAndExternalTraffic|DenyOptionsRemainIndependent)$)' -count=1 diff --git a/tasks/format-code-task-001006/tests/test.sh b/tasks/format-code-task-001006/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..568103ee6366498c1d0404ed2af71c687268e343 --- /dev/null +++ b/tasks/format-code-task-001006/tests/test.sh @@ -0,0 +1,38 @@ +#!/bin/bash +# Code grading, mimoagent opensource_code.py: reset the files the hidden test patch touches, apply it, run the +# task's test command; reward 1 when it exits 0. A testbed failure (reset or apply) writes no reward: not scored. +M=/var/lib/mimo +CWD=/testbed +V=/logs/verifier +mkdir -p "$V" +BASE=$(cat "$M/base" 2>/dev/null) || { echo "setup never ran (no $M/base)" >&2; exit 1; } +cd "$CWD" || exit 1 +if [ -d "$M/git-hidden" ]; then rm -rf "$CWD/.git"; mv "$M/git-hidden" "$CWD/.git"; fi +# the agent's change against the base, so its own commits count too +git add -A >/dev/null 2>&1 && git -c core.fileMode=false diff --cached "$BASE" > "$V/agent.diff" +git reset -q +if ! ( +while IFS= read -r tf; do + [ -z "$tf" ] && continue + if git cat-file -e $BASE:"$tf" 2>/dev/null; then + git checkout $BASE -- "$tf" 2>/dev/null || true + else + git rm -f --cached "$tf" >/dev/null 2>&1 || true + rm -f "$tf" + fi +done <<'EOF_RESET_TEST_FILES' +scanner/internal/httputil/transport_mux_contract_test.go +mimo_test_command.sh +EOF_RESET_TEST_FILES + +); then echo "could not reset the test files (testbed problem, not scored)" >&2; exit 1; fi +if ! git apply --verbose /tests/test.patch > "$V/apply.log" 2>&1; then + cat "$V/apply.log" >&2 + echo "the hidden tests could not be applied (testbed problem, not scored)" >&2 + exit 1 +fi +timeout 1800 sh -c "$(cat /tests/test_command.sh)" > "$V/test_output.log" 2>&1 +RC=$? +tail -c 12000 "$V/test_output.log" +if [ $RC -eq 0 ]; then echo 1 > "$V/reward.txt"; else echo 0 > "$V/reward.txt"; fi +echo "test command exited $RC" diff --git a/tasks/format-code-task-001006/tests/test_command.sh b/tasks/format-code-task-001006/tests/test_command.sh new file mode 100644 index 0000000000000000000000000000000000000000..7cb23076694ad17d72e8296d62b2b240083e36db --- /dev/null +++ b/tasks/format-code-task-001006/tests/test_command.sh @@ -0,0 +1 @@ +bash /testbed/mimo_test_command.sh \ No newline at end of file diff --git a/tasks/format-code-task-001008/environment/Dockerfile b/tasks/format-code-task-001008/environment/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..bde5b8fd0356446d12905f40d40cca1e0eb05658 --- /dev/null +++ b/tasks/format-code-task-001008/environment/Dockerfile @@ -0,0 +1,3 @@ +# The task's image, pinned by digest (the same as [environment].docker_image). +# Setup runs at start from [environment.healthcheck]; environment/setup/ is its readable copy. +FROM docker.io/xiaomimimo/mimo-v2.6-rl-oss@sha256:2ac982782934115dacdb3a2722f14335d2ee78fb60c7fc5c0da55ba5f15f7c8a diff --git a/tasks/format-code-task-001008/environment/setup/files/blocklist b/tasks/format-code-task-001008/environment/setup/files/blocklist new file mode 100644 index 0000000000000000000000000000000000000000..a8e4bdc4c7d9b739c047a3cb58ea72a1bb05bcbc --- /dev/null +++ b/tasks/format-code-task-001008/environment/setup/files/blocklist @@ -0,0 +1,33 @@ +# mimo answer-leak blocklist (mimoagent) +0.0.0.0 github.com +0.0.0.0 www.github.com +0.0.0.0 api.github.com +0.0.0.0 raw.githubusercontent.com +0.0.0.0 codeload.github.com +0.0.0.0 objects.githubusercontent.com +0.0.0.0 gist.github.com +0.0.0.0 gist.githubusercontent.com +0.0.0.0 gitlab.com +0.0.0.0 bitbucket.org +0.0.0.0 sourceforge.net +0.0.0.0 git.kernel.org +0.0.0.0 chromium.googlesource.com +0.0.0.0 android.googlesource.com +0.0.0.0 sourcegraph.com +0.0.0.0 bugs.chromium.org +0.0.0.0 issues.oss-fuzz.com +0.0.0.0 oss-fuzz.com +0.0.0.0 osv.dev +0.0.0.0 api.osv.dev +0.0.0.0 bugzilla.mozilla.org +0.0.0.0 proxy.golang.org +0.0.0.0 sum.golang.org +0.0.0.0 pkg.go.dev +0.0.0.0 google.com +0.0.0.0 www.google.com +0.0.0.0 bing.com +0.0.0.0 www.bing.com +0.0.0.0 duckduckgo.com +0.0.0.0 html.duckduckgo.com +0.0.0.0 search.brave.com +0.0.0.0 stackoverflow.com diff --git a/tasks/format-code-task-001008/environment/setup/setup.sh b/tasks/format-code-task-001008/environment/setup/setup.sh new file mode 100644 index 0000000000000000000000000000000000000000..d883db90cfcfb48f7a139861bbe9f6b5d95cad6f --- /dev/null +++ b/tasks/format-code-task-001008/environment/setup/setup.sh @@ -0,0 +1,34 @@ +#!/bin/bash +# Runs once, as root, before the agent starts: Harbor's [environment.healthcheck] unpacks this folder into +# /var/lib/mimo and runs it. Generated by mimo_harbor; see its README for how each step maps to Xiaomi's harness. +M=/var/lib/mimo +[ -f "$M/ready" ] && exit 0 +chmod 700 "$M" +fail() { echo "setup: $*" >&2; exit 1; } +# the answer-leak blocklist (mimoagent), applied to /etc/hosts by the agent right after it installs +write_blocklist() { cp "$M/files/blocklist" "$M/blocklist"; } + +# Code: mimoagent environments/datasets/opensource_code.py + base.py, as the explorer runs it (app/runner/domains.py Code). +CWD=/testbed +git config --global --add safe.directory "$CWD" +cd "$CWD" || fail "no working directory $CWD" +if ! git rev-parse --git-dir >/dev/null 2>&1; then # a bare source tree: give it a baseline commit + git init -q && git add -A && git -c user.name=mimo -c user.email=mimo@localhost commit -q -m baseline --allow-empty +fi +BASE=$(git rev-parse HEAD 2>/dev/null) +[ ${#BASE} -eq 40 ] || fail "could not resolve the base commit in $CWD" +echo "$BASE" > "$M/base" +# Images are built with history truncated at the base. If one is not, the fix could be read out of git log, +# so .git is hidden while the agent works and put back for grading. +LATER=$(git rev-list --all --not "$BASE" 2>/dev/null | head -n 5 | grep -c . || true) +rm -f /tmp/fail.log /tmp/pass.log /tmp/patch.diff /tmp/test_patch.diff /tmp/*.log 2>/dev/null; rm -rf /tmp/claude-0 /tmp/claude-* /tmp/testem-* /tmp/puppeteer_dev_chrome_profile-* 2>/dev/null; rm -f /tmp/test_files.json 2>/dev/null; rm -rf /tmp/jest_* /tmp/jest-* /tmp/build /tmp/build_env 2>/dev/null; rm -rf /tmp/pytest-of-root /tmp/pytest-* /tmp/.pytest_cache /tmp/__pycache__ 2>/dev/null; rm -rf /tmp/go-build* /tmp/standards /tmp/wordpress /tmp/zig-* /tmp/testbase /tmp/testbed 2>/dev/null; rm -f /tmp/tmp*.tmp /tmp/*.bak /tmp/expect* /tmp/butwas* 2>/dev/null; rm -rf /root/.cache/go-build 2>/dev/null; rm -rf /tests 2>/dev/null; find /logs -mindepth 1 -delete 2>/dev/null; mkdir -p /logs/agent /logs/verifier /logs/artifacts; chmod 777 /logs/agent /logs/verifier /logs/artifacts; find /var/log -type f -delete 2>/dev/null || true; rm -rf /var/lib/postgresql/*/*/log /var/lib/postgresql/*/*/pg_log 2>/dev/null || true; find /var/lib/mysql /var/lib/mongodb -type f -name '*.log' -delete 2>/dev/null || true; rm -rf /root/.npm/_logs /root/.babel.json /root/.pytest_cache 2>/dev/null || true; find / -maxdepth 4 -xdev -name task_description.md -path '*/.build_env/*' -delete 2>/dev/null || true; true +git clean -fdx --exclude=node_modules --exclude=bower_components --exclude=.husky --exclude=vendor --exclude=third_party --exclude=_deps --exclude=vcpkg_installed --exclude=.venv --exclude=venv --exclude=.gradle --exclude=target --exclude=.build --exclude=lib --exclude=.bundle --exclude=Manifest.toml --exclude=_build --exclude=.stack-work --exclude=dist-newstyle >/dev/null 2>&1 +find /root/.m2 -type f \( -name '*-SNAPSHOT.jar' -o -name '*-SNAPSHOT-sources.jar' -o -name '*-SNAPSHOT-tests.jar' -o -name '*-SNAPSHOT-test-sources.jar' \) -delete 2>/dev/null; rm -rf /root/.julia/compiled 2>/dev/null; rm -rf /root/.gradle/caches/build-cache-* /root/.gradle/daemon 2>/dev/null; rm -rf /root/.gradle/caches/*/scripts /root/.gradle/caches/jars-* 2>/dev/null; rm -rf /root/.cache/bazel 2>/dev/null; true +if [ "$LATER" -gt 0 ]; then + mv "$CWD/.git" "$M/git-hidden" + echo "history not truncated at ${BASE:0:12}: .git hidden while the agent works" +fi +write_blocklist + +touch "$M/ready" +echo "setup done" diff --git a/tasks/format-code-task-001008/tests/test.patch b/tasks/format-code-task-001008/tests/test.patch new file mode 100644 index 0000000000000000000000000000000000000000..7019b70057807c6333a5a999013684d07fe0c85b --- /dev/null +++ b/tasks/format-code-task-001008/tests/test.patch @@ -0,0 +1,248 @@ +diff --git a/tests/providers/amazon/aws/test_s3_keys_unchanged_deferrable_contract.py b/tests/providers/amazon/aws/test_s3_keys_unchanged_deferrable_contract.py +new file mode 100644 +index 0000000000..17a40458e3 +--- /dev/null ++++ b/tests/providers/amazon/aws/test_s3_keys_unchanged_deferrable_contract.py +@@ -0,0 +1,231 @@ ++from __future__ import annotations ++ ++import asyncio ++from datetime import datetime ++from unittest import mock ++ ++import pytest ++ ++from airflow.exceptions import TaskDeferred ++from airflow.providers.amazon.aws.hooks.s3 import S3Hook ++from airflow.providers.amazon.aws.sensors.s3 import S3KeysUnchangedSensor ++from airflow.providers.amazon.aws.triggers.s3 import S3KeysUnchangedTrigger ++from airflow.triggers.base import TriggerEvent ++ ++ ++def _run(coro): ++ return asyncio.run(coro) ++ ++ ++class _AsyncPages: ++ def __init__(self, pages): ++ self.pages = pages ++ ++ def __aiter__(self): ++ return self._iterate() ++ ++ async def _iterate(self): ++ for page in self.pages: ++ yield page ++ ++ ++class _Paginator: ++ def __init__(self, keys): ++ self.keys = keys ++ ++ def paginate(self, **kwargs): ++ return _AsyncPages([{"Contents": [{"Key": key} for key in self.keys]}]) ++ ++ ++class _Client: ++ def __init__(self, keys): ++ self.keys = keys ++ ++ def get_paginator(self, name): ++ assert name == "list_objects_v2" ++ return _Paginator(self.keys) ++ ++ ++def _check_state(hook: S3Hook, current_objects: set[str], **kwargs): ++ async def check(): ++ return await hook.is_keys_unchanged_async( ++ client=_Client(sorted(current_objects)), ++ bucket_name="contract-bucket", ++ prefix="incoming/", ++ **kwargs, ++ ) ++ ++ return _run(check()) ++ ++ ++def test_deferral_preserves_polling_and_connection_configuration(): ++ last_activity = datetime(2023, 2, 3, 4, 5, 6) ++ sensor = S3KeysUnchangedSensor( ++ task_id="contract_deferrable_sensor", ++ bucket_name="contract-bucket", ++ prefix="incoming/", ++ inactivity_period=90, ++ min_objects=3, ++ previous_objects={"incoming/old.csv"}, ++ allow_delete=False, ++ aws_conn_id="contract-aws", ++ verify=False, ++ poke_interval=17, ++ deferrable=True, ++ ) ++ sensor.last_activity_time = last_activity ++ sensor.inactivity_seconds = 11 ++ ++ with mock.patch.object(sensor, "poke", return_value=False), pytest.raises(TaskDeferred) as raised: ++ sensor.execute(context={}) ++ ++ trigger = raised.value.trigger ++ classpath, payload = trigger.serialize() ++ assert classpath == "airflow.providers.amazon.aws.triggers.s3.S3KeysUnchangedTrigger" ++ assert payload["polling_period_seconds"] == 17 ++ assert payload["previous_objects"] == {"incoming/old.csv"} ++ assert payload["last_activity_time"] == last_activity ++ assert payload["inactivity_seconds"] == 11 ++ assert payload["allow_delete"] is False ++ assert payload["aws_conn_id"] == "contract-aws" ++ assert payload["verify"] is False ++ ++ reconstructed = S3KeysUnchangedTrigger(**payload) ++ assert reconstructed.serialize()[1]["polling_period_seconds"] == 17 ++ assert reconstructed.hook.verify is False ++ ++ ++def test_trigger_reuses_pending_state_and_configured_poll_interval(): ++ first_activity = datetime(2023, 3, 4, 5, 6, 7) ++ hook = mock.MagicMock() ++ hook.async_conn = mock.MagicMock() ++ hook.async_conn.__aenter__ = mock.AsyncMock(return_value=object()) ++ hook.async_conn.__aexit__ = mock.AsyncMock(return_value=None) ++ hook.is_keys_unchanged_async = mock.AsyncMock( ++ side_effect=[ ++ { ++ "status": "pending", ++ "previous_objects": {"incoming/new.csv"}, ++ "last_activity_time": first_activity, ++ "inactivity_seconds": 0, ++ }, ++ {"status": "success", "message": "complete"}, ++ ] ++ ) ++ trigger = S3KeysUnchangedTrigger( ++ bucket_name="contract-bucket", ++ prefix="incoming/", ++ previous_objects={"incoming/old.csv"}, ++ inactivity_seconds=8, ++ last_activity_time=datetime(2023, 3, 4, 5, 0, 0), ++ poke_interval=17, ++ ) ++ trigger.__dict__["hook"] = hook ++ ++ async def run_trigger(): ++ with mock.patch( ++ "airflow.providers.amazon.aws.triggers.s3.asyncio.sleep", new=mock.AsyncMock() ++ ) as sleep: ++ event = await trigger.run().__anext__() ++ return event, sleep ++ ++ event, sleep = _run(run_trigger()) ++ assert event == TriggerEvent({"status": "success", "message": "complete"}) ++ assert sleep.await_args_list[0].args == (17,) ++ assert hook.is_keys_unchanged_async.await_count == 2 ++ second_poll = hook.is_keys_unchanged_async.await_args_list[1].kwargs ++ assert second_poll["previous_objects"] == {"incoming/new.csv"} ++ assert second_poll["last_activity_time"] == first_activity ++ assert second_poll["inactivity_seconds"] == 0 ++ ++ ++def test_equal_cardinality_replacement_obeys_deletion_policy(): ++ hook = S3Hook(aws_conn_id=None) ++ common = { ++ "inactivity_period": 300, ++ "min_objects": 1, ++ "previous_objects": {"incoming/a.csv", "incoming/b.csv"}, ++ "inactivity_seconds": 42, ++ "last_activity_time": datetime(2023, 1, 1, 0, 0, 0), ++ } ++ ++ allowed = _check_state( ++ hook, ++ {"incoming/a.csv", "incoming/c.csv"}, ++ allow_delete=True, ++ **common, ++ ) ++ assert allowed["status"] == "pending" ++ assert allowed["previous_objects"] == {"incoming/a.csv", "incoming/c.csv"} ++ assert allowed["inactivity_seconds"] == 0 ++ ++ rejected = _check_state( ++ hook, ++ {"incoming/a.csv", "incoming/c.csv"}, ++ allow_delete=False, ++ **common, ++ ) ++ assert rejected["status"] == "error" ++ assert "contract-bucket/incoming/" in rejected["message"] ++ ++ ++def test_additions_and_allowed_deletions_restart_inactivity_window(): ++ hook = S3Hook(aws_conn_id=None) ++ old_activity = datetime(2023, 1, 1, 0, 0, 0) ++ ++ addition = _check_state( ++ hook, ++ {"incoming/a.csv", "incoming/b.csv"}, ++ inactivity_period=60, ++ min_objects=1, ++ previous_objects={"incoming/a.csv"}, ++ inactivity_seconds=120, ++ allow_delete=False, ++ last_activity_time=old_activity, ++ ) ++ assert addition["status"] == "pending" ++ assert addition["previous_objects"] == {"incoming/a.csv", "incoming/b.csv"} ++ assert addition["inactivity_seconds"] == 0 ++ ++ deletion = _check_state( ++ hook, ++ {"incoming/a.csv"}, ++ inactivity_period=60, ++ min_objects=1, ++ previous_objects={"incoming/a.csv", "incoming/b.csv"}, ++ inactivity_seconds=120, ++ allow_delete=True, ++ last_activity_time=old_activity, ++ ) ++ assert deletion["status"] == "pending" ++ assert deletion["previous_objects"] == {"incoming/a.csv"} ++ assert deletion["inactivity_seconds"] == 0 ++ assert deletion["last_activity_time"] is not None ++ ++ ++def test_unchanged_snapshot_applies_inactivity_and_minimum_object_rules(): ++ hook = S3Hook(aws_conn_id=None) ++ common = { ++ "inactivity_period": 30, ++ "previous_objects": {"incoming/a.csv", "incoming/b.csv"}, ++ "inactivity_seconds": 0, ++ "allow_delete": False, ++ "last_activity_time": datetime(2023, 1, 1, 0, 0, 0), ++ } ++ ++ success = _check_state( ++ hook, ++ {"incoming/a.csv", "incoming/b.csv"}, ++ min_objects=2, ++ **common, ++ ) ++ assert success["status"] == "success" ++ ++ insufficient = _check_state( ++ hook, ++ {"incoming/a.csv", "incoming/b.csv"}, ++ min_objects=3, ++ **common, ++ ) ++ assert insufficient["status"] == "error" ++ assert "not enough objects" in insufficient["message"].lower() +diff --git a/mimo_test_command.sh b/mimo_test_command.sh +new file mode 100755 +--- /dev/null ++++ b/mimo_test_command.sh +@@ -0,0 +1,6 @@ ++#!/bin/bash ++set -euo pipefail ++ ++ ++./.build_env/venv/bin/pytest -q -o addopts='' \ ++ tests/providers/amazon/aws/test_s3_keys_unchanged_deferrable_contract.py diff --git a/tasks/format-code-task-001008/tests/test.sh b/tasks/format-code-task-001008/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..e418c40a8ef9f643dd6f872e155ef1b5d1d276b5 --- /dev/null +++ b/tasks/format-code-task-001008/tests/test.sh @@ -0,0 +1,38 @@ +#!/bin/bash +# Code grading, mimoagent opensource_code.py: reset the files the hidden test patch touches, apply it, run the +# task's test command; reward 1 when it exits 0. A testbed failure (reset or apply) writes no reward: not scored. +M=/var/lib/mimo +CWD=/testbed +V=/logs/verifier +mkdir -p "$V" +BASE=$(cat "$M/base" 2>/dev/null) || { echo "setup never ran (no $M/base)" >&2; exit 1; } +cd "$CWD" || exit 1 +if [ -d "$M/git-hidden" ]; then rm -rf "$CWD/.git"; mv "$M/git-hidden" "$CWD/.git"; fi +# the agent's change against the base, so its own commits count too +git add -A >/dev/null 2>&1 && git -c core.fileMode=false diff --cached "$BASE" > "$V/agent.diff" +git reset -q +if ! ( +while IFS= read -r tf; do + [ -z "$tf" ] && continue + if git cat-file -e $BASE:"$tf" 2>/dev/null; then + git checkout $BASE -- "$tf" 2>/dev/null || true + else + git rm -f --cached "$tf" >/dev/null 2>&1 || true + rm -f "$tf" + fi +done <<'EOF_RESET_TEST_FILES' +tests/providers/amazon/aws/test_s3_keys_unchanged_deferrable_contract.py +mimo_test_command.sh +EOF_RESET_TEST_FILES + +); then echo "could not reset the test files (testbed problem, not scored)" >&2; exit 1; fi +if ! git apply --verbose /tests/test.patch > "$V/apply.log" 2>&1; then + cat "$V/apply.log" >&2 + echo "the hidden tests could not be applied (testbed problem, not scored)" >&2 + exit 1 +fi +timeout 1800 sh -c "$(cat /tests/test_command.sh)" > "$V/test_output.log" 2>&1 +RC=$? +tail -c 12000 "$V/test_output.log" +if [ $RC -eq 0 ]; then echo 1 > "$V/reward.txt"; else echo 0 > "$V/reward.txt"; fi +echo "test command exited $RC" diff --git a/tasks/format-code-task-001008/tests/test_command.sh b/tasks/format-code-task-001008/tests/test_command.sh new file mode 100644 index 0000000000000000000000000000000000000000..7cb23076694ad17d72e8296d62b2b240083e36db --- /dev/null +++ b/tasks/format-code-task-001008/tests/test_command.sh @@ -0,0 +1 @@ +bash /testbed/mimo_test_command.sh \ No newline at end of file diff --git a/tasks/format-code-task-001015/environment/Dockerfile b/tasks/format-code-task-001015/environment/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..5180e39c88af1477467321d9a754fb513263dc88 --- /dev/null +++ b/tasks/format-code-task-001015/environment/Dockerfile @@ -0,0 +1,3 @@ +# The task's image, pinned by digest (the same as [environment].docker_image). +# Setup runs at start from [environment.healthcheck]; environment/setup/ is its readable copy. +FROM docker.io/xiaomimimo/mimo-v2.6-rl-oss@sha256:b948f42514c9f6707d6e29bdf5b819e2cab27ec76a2439b2259d7b00a85ec8d0 diff --git a/tasks/format-code-task-001015/environment/setup/files/blocklist b/tasks/format-code-task-001015/environment/setup/files/blocklist new file mode 100644 index 0000000000000000000000000000000000000000..a8e4bdc4c7d9b739c047a3cb58ea72a1bb05bcbc --- /dev/null +++ b/tasks/format-code-task-001015/environment/setup/files/blocklist @@ -0,0 +1,33 @@ +# mimo answer-leak blocklist (mimoagent) +0.0.0.0 github.com +0.0.0.0 www.github.com +0.0.0.0 api.github.com +0.0.0.0 raw.githubusercontent.com +0.0.0.0 codeload.github.com +0.0.0.0 objects.githubusercontent.com +0.0.0.0 gist.github.com +0.0.0.0 gist.githubusercontent.com +0.0.0.0 gitlab.com +0.0.0.0 bitbucket.org +0.0.0.0 sourceforge.net +0.0.0.0 git.kernel.org +0.0.0.0 chromium.googlesource.com +0.0.0.0 android.googlesource.com +0.0.0.0 sourcegraph.com +0.0.0.0 bugs.chromium.org +0.0.0.0 issues.oss-fuzz.com +0.0.0.0 oss-fuzz.com +0.0.0.0 osv.dev +0.0.0.0 api.osv.dev +0.0.0.0 bugzilla.mozilla.org +0.0.0.0 proxy.golang.org +0.0.0.0 sum.golang.org +0.0.0.0 pkg.go.dev +0.0.0.0 google.com +0.0.0.0 www.google.com +0.0.0.0 bing.com +0.0.0.0 www.bing.com +0.0.0.0 duckduckgo.com +0.0.0.0 html.duckduckgo.com +0.0.0.0 search.brave.com +0.0.0.0 stackoverflow.com diff --git a/tasks/format-code-task-001015/environment/setup/setup.sh b/tasks/format-code-task-001015/environment/setup/setup.sh new file mode 100644 index 0000000000000000000000000000000000000000..d883db90cfcfb48f7a139861bbe9f6b5d95cad6f --- /dev/null +++ b/tasks/format-code-task-001015/environment/setup/setup.sh @@ -0,0 +1,34 @@ +#!/bin/bash +# Runs once, as root, before the agent starts: Harbor's [environment.healthcheck] unpacks this folder into +# /var/lib/mimo and runs it. Generated by mimo_harbor; see its README for how each step maps to Xiaomi's harness. +M=/var/lib/mimo +[ -f "$M/ready" ] && exit 0 +chmod 700 "$M" +fail() { echo "setup: $*" >&2; exit 1; } +# the answer-leak blocklist (mimoagent), applied to /etc/hosts by the agent right after it installs +write_blocklist() { cp "$M/files/blocklist" "$M/blocklist"; } + +# Code: mimoagent environments/datasets/opensource_code.py + base.py, as the explorer runs it (app/runner/domains.py Code). +CWD=/testbed +git config --global --add safe.directory "$CWD" +cd "$CWD" || fail "no working directory $CWD" +if ! git rev-parse --git-dir >/dev/null 2>&1; then # a bare source tree: give it a baseline commit + git init -q && git add -A && git -c user.name=mimo -c user.email=mimo@localhost commit -q -m baseline --allow-empty +fi +BASE=$(git rev-parse HEAD 2>/dev/null) +[ ${#BASE} -eq 40 ] || fail "could not resolve the base commit in $CWD" +echo "$BASE" > "$M/base" +# Images are built with history truncated at the base. If one is not, the fix could be read out of git log, +# so .git is hidden while the agent works and put back for grading. +LATER=$(git rev-list --all --not "$BASE" 2>/dev/null | head -n 5 | grep -c . || true) +rm -f /tmp/fail.log /tmp/pass.log /tmp/patch.diff /tmp/test_patch.diff /tmp/*.log 2>/dev/null; rm -rf /tmp/claude-0 /tmp/claude-* /tmp/testem-* /tmp/puppeteer_dev_chrome_profile-* 2>/dev/null; rm -f /tmp/test_files.json 2>/dev/null; rm -rf /tmp/jest_* /tmp/jest-* /tmp/build /tmp/build_env 2>/dev/null; rm -rf /tmp/pytest-of-root /tmp/pytest-* /tmp/.pytest_cache /tmp/__pycache__ 2>/dev/null; rm -rf /tmp/go-build* /tmp/standards /tmp/wordpress /tmp/zig-* /tmp/testbase /tmp/testbed 2>/dev/null; rm -f /tmp/tmp*.tmp /tmp/*.bak /tmp/expect* /tmp/butwas* 2>/dev/null; rm -rf /root/.cache/go-build 2>/dev/null; rm -rf /tests 2>/dev/null; find /logs -mindepth 1 -delete 2>/dev/null; mkdir -p /logs/agent /logs/verifier /logs/artifacts; chmod 777 /logs/agent /logs/verifier /logs/artifacts; find /var/log -type f -delete 2>/dev/null || true; rm -rf /var/lib/postgresql/*/*/log /var/lib/postgresql/*/*/pg_log 2>/dev/null || true; find /var/lib/mysql /var/lib/mongodb -type f -name '*.log' -delete 2>/dev/null || true; rm -rf /root/.npm/_logs /root/.babel.json /root/.pytest_cache 2>/dev/null || true; find / -maxdepth 4 -xdev -name task_description.md -path '*/.build_env/*' -delete 2>/dev/null || true; true +git clean -fdx --exclude=node_modules --exclude=bower_components --exclude=.husky --exclude=vendor --exclude=third_party --exclude=_deps --exclude=vcpkg_installed --exclude=.venv --exclude=venv --exclude=.gradle --exclude=target --exclude=.build --exclude=lib --exclude=.bundle --exclude=Manifest.toml --exclude=_build --exclude=.stack-work --exclude=dist-newstyle >/dev/null 2>&1 +find /root/.m2 -type f \( -name '*-SNAPSHOT.jar' -o -name '*-SNAPSHOT-sources.jar' -o -name '*-SNAPSHOT-tests.jar' -o -name '*-SNAPSHOT-test-sources.jar' \) -delete 2>/dev/null; rm -rf /root/.julia/compiled 2>/dev/null; rm -rf /root/.gradle/caches/build-cache-* /root/.gradle/daemon 2>/dev/null; rm -rf /root/.gradle/caches/*/scripts /root/.gradle/caches/jars-* 2>/dev/null; rm -rf /root/.cache/bazel 2>/dev/null; true +if [ "$LATER" -gt 0 ]; then + mv "$CWD/.git" "$M/git-hidden" + echo "history not truncated at ${BASE:0:12}: .git hidden while the agent works" +fi +write_blocklist + +touch "$M/ready" +echo "setup done" diff --git a/tasks/format-code-task-001015/tests/test.patch b/tasks/format-code-task-001015/tests/test.patch new file mode 100644 index 0000000000000000000000000000000000000000..d7db0f2ace41818169d4addf3217f35c72355a06 --- /dev/null +++ b/tasks/format-code-task-001015/tests/test.patch @@ -0,0 +1,273 @@ +diff --git a/polaris-react/src/components/DatePicker/tests/DatePicker.keyboard-navigation.verifier.test.tsx b/polaris-react/src/components/DatePicker/tests/DatePicker.keyboard-navigation.verifier.test.tsx +new file mode 100644 +index 000000000..b9fb098dd +--- /dev/null ++++ b/polaris-react/src/components/DatePicker/tests/DatePicker.keyboard-navigation.verifier.test.tsx +@@ -0,0 +1,253 @@ ++import React, {useState} from 'react'; ++import {mountWithApp} from 'tests/utilities'; ++ ++import {DatePicker, DatePickerProps} from '../DatePicker'; ++ ++interface ControlledPickerProps ++ extends Omit { ++ initialMonth: number; ++ initialYear: number; ++ onMonthChange: jest.Mock; ++} ++ ++function ControlledPicker({ ++ initialMonth, ++ initialYear, ++ onMonthChange, ++ ...props ++}: ControlledPickerProps) { ++ const [display, setDisplay] = useState({ ++ month: initialMonth, ++ year: initialYear, ++ }); ++ ++ return ( ++ { ++ onMonthChange(month, year); ++ setDisplay({month, year}); ++ }} ++ /> ++ ); ++} ++ ++function dayButton(datePicker: any, day: number, monthIndex = 0) { ++ const month = datePicker.findAll('table')[monthIndex]; ++ const button = month ++ ?.findAll('button') ++ .find((candidate: any) => candidate.text() === String(day)); ++ ++ if (!button) { ++ throw new Error(`Could not find day ${day} in rendered month ${monthIndex}`); ++ } ++ ++ return button; ++} ++ ++function focusDay(datePicker: any, day: number, monthIndex = 0) { ++ const button = dayButton(datePicker, day, monthIndex); ++ button.domNode!.focus(); ++ button.trigger('onFocus'); ++ return button; ++} ++ ++function pressKey( ++ datePicker: any, ++ key: string, ++ options: {shiftKey?: boolean} = {}, ++) { ++ const target = document.activeElement; ++ if (!(target instanceof HTMLElement)) { ++ throw new Error('Keyboard navigation requires a focused day'); ++ } ++ ++ datePicker.act(() => { ++ target.dispatchEvent( ++ new KeyboardEvent('keyup', { ++ key, ++ shiftKey: Boolean(options.shiftKey), ++ bubbles: true, ++ cancelable: true, ++ }), ++ ); ++ }); ++} ++ ++describe(' keyboard navigation verifier', () => { ++ afterEach(() => { ++ (document.activeElement as HTMLElement | null)?.blur(); ++ }); ++ ++ it('moves by days and weeks while skipping consecutive disabled dates in the direction of travel', () => { ++ const onChange = jest.fn(); ++ const datePicker = mountWithApp( ++ , ++ ); ++ ++ focusDay(datePicker, 10); ++ pressKey(datePicker, 'ArrowRight'); ++ expect(document.activeElement).toBe(dayButton(datePicker, 13).domNode); ++ ++ pressKey(datePicker, 'ArrowLeft'); ++ expect(document.activeElement).toBe(dayButton(datePicker, 10).domNode); ++ ++ focusDay(datePicker, 16); ++ pressKey(datePicker, 'ArrowDown'); ++ expect(document.activeElement).toBe(dayButton(datePicker, 26).domNode); ++ ++ pressKey(datePicker, 'ArrowUp'); ++ expect(document.activeElement).toBe(dayButton(datePicker, 17).domNode); ++ expect(onChange).not.toHaveBeenCalled(); ++ }); ++ ++ it('moves Home and End to the configured calendar week boundaries', () => { ++ const datePicker = mountWithApp( ++ , ++ ); ++ ++ focusDay(datePicker, 18); ++ pressKey(datePicker, 'Home'); ++ expect(document.activeElement).toBe(dayButton(datePicker, 16).domNode); ++ ++ focusDay(datePicker, 18); ++ pressKey(datePicker, 'End'); ++ expect(document.activeElement).toBe(dayButton(datePicker, 22).domNode); ++ }); ++ ++ it.each([ ++ ['PageDown', 0, 2022, 31, 1, 2022, 28], ++ ['PageUp', 2, 2022, 31, 1, 2022, 28], ++ ])( ++ '%s moves one month, clamps the day, requests the new display, and focuses the destination', ++ (key, initialMonth, initialYear, startDay, targetMonth, targetYear, targetDay) => { ++ const onMonthChange = jest.fn(); ++ const datePicker = mountWithApp( ++ , ++ ); ++ ++ focusDay(datePicker, startDay as number); ++ pressKey(datePicker, key as string); ++ ++ expect(onMonthChange).toHaveBeenCalledTimes(1); ++ expect(onMonthChange).toHaveBeenCalledWith(targetMonth, targetYear); ++ expect(document.activeElement).toBe( ++ dayButton(datePicker, targetDay as number).domNode, ++ ); ++ }, ++ ); ++ ++ it.each([ ++ ['PageDown', 2020, 2021], ++ ['PageUp', 2020, 2019], ++ ])( ++ 'Shift+%s moves one year and clamps leap day to the last valid day', ++ (key, initialYear, targetYear) => { ++ const onMonthChange = jest.fn(); ++ const datePicker = mountWithApp( ++ , ++ ); ++ ++ focusDay(datePicker, 29); ++ pressKey(datePicker, key as string, {shiftKey: true}); ++ ++ expect(onMonthChange).toHaveBeenCalledWith(1, targetYear); ++ expect(document.activeElement).toBe(dayButton(datePicker, 28).domNode); ++ }, ++ ); ++ ++ it('does not request a month change when a destination is already visible in multi-month mode', () => { ++ const onMonthChange = jest.fn(); ++ const datePicker = mountWithApp( ++ , ++ ); ++ ++ focusDay(datePicker, 31); ++ pressKey(datePicker, 'PageDown'); ++ ++ expect(document.activeElement).toBe(dayButton(datePicker, 28, 1).domNode); ++ expect(onMonthChange).not.toHaveBeenCalled(); ++ }); ++ ++ it('requests the destination month after arrow navigation crosses a year boundary', () => { ++ const onMonthChange = jest.fn(); ++ const datePicker = mountWithApp( ++ , ++ ); ++ ++ focusDay(datePicker, 31); ++ pressKey(datePicker, 'ArrowRight'); ++ ++ expect(onMonthChange).toHaveBeenCalledWith(0, 2023); ++ expect(document.activeElement).toBe(dayButton(datePicker, 1).domNode); ++ }); ++ ++ it.each([ ++ ['ArrowLeft', 10, {disableDatesBefore: new Date(2022, 4, 10)}], ++ ['ArrowRight', 20, {disableDatesAfter: new Date(2022, 4, 20)}], ++ ])( ++ 'keeps focus in place at the disabled range boundary for %s', ++ (key, boundaryDay, disabledProps) => { ++ const onChange = jest.fn(); ++ const onMonthChange = jest.fn(); ++ const datePicker = mountWithApp( ++ , ++ ); ++ ++ const boundary = focusDay(datePicker, boundaryDay as number); ++ pressKey(datePicker, key as string); ++ ++ expect(document.activeElement).toBe(boundary.domNode); ++ expect(onChange).not.toHaveBeenCalled(); ++ expect(onMonthChange).not.toHaveBeenCalled(); ++ }, ++ ); ++ ++}); +diff --git a/mimo_test_command.sh b/mimo_test_command.sh +new file mode 100755 +--- /dev/null ++++ b/mimo_test_command.sh +@@ -0,0 +1,9 @@ ++#!/bin/bash ++set -euo pipefail ++ ++ ++cd polaris-react ++yarn jest \ ++ src/components/DatePicker/tests/DatePicker.test.tsx \ ++ src/components/DatePicker/tests/DatePicker.keyboard-navigation.verifier.test.tsx \ ++ --runInBand diff --git a/tasks/format-code-task-001015/tests/test.sh b/tasks/format-code-task-001015/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..7ada6a070d1337d5044f73a8d9709cb6abe09a91 --- /dev/null +++ b/tasks/format-code-task-001015/tests/test.sh @@ -0,0 +1,38 @@ +#!/bin/bash +# Code grading, mimoagent opensource_code.py: reset the files the hidden test patch touches, apply it, run the +# task's test command; reward 1 when it exits 0. A testbed failure (reset or apply) writes no reward: not scored. +M=/var/lib/mimo +CWD=/testbed +V=/logs/verifier +mkdir -p "$V" +BASE=$(cat "$M/base" 2>/dev/null) || { echo "setup never ran (no $M/base)" >&2; exit 1; } +cd "$CWD" || exit 1 +if [ -d "$M/git-hidden" ]; then rm -rf "$CWD/.git"; mv "$M/git-hidden" "$CWD/.git"; fi +# the agent's change against the base, so its own commits count too +git add -A >/dev/null 2>&1 && git -c core.fileMode=false diff --cached "$BASE" > "$V/agent.diff" +git reset -q +if ! ( +while IFS= read -r tf; do + [ -z "$tf" ] && continue + if git cat-file -e $BASE:"$tf" 2>/dev/null; then + git checkout $BASE -- "$tf" 2>/dev/null || true + else + git rm -f --cached "$tf" >/dev/null 2>&1 || true + rm -f "$tf" + fi +done <<'EOF_RESET_TEST_FILES' +polaris-react/src/components/DatePicker/tests/DatePicker.keyboard-navigation.verifier.test.tsx +mimo_test_command.sh +EOF_RESET_TEST_FILES + +); then echo "could not reset the test files (testbed problem, not scored)" >&2; exit 1; fi +if ! git apply --verbose /tests/test.patch > "$V/apply.log" 2>&1; then + cat "$V/apply.log" >&2 + echo "the hidden tests could not be applied (testbed problem, not scored)" >&2 + exit 1 +fi +timeout 1800 sh -c "$(cat /tests/test_command.sh)" > "$V/test_output.log" 2>&1 +RC=$? +tail -c 12000 "$V/test_output.log" +if [ $RC -eq 0 ]; then echo 1 > "$V/reward.txt"; else echo 0 > "$V/reward.txt"; fi +echo "test command exited $RC" diff --git a/tasks/format-code-task-001015/tests/test_command.sh b/tasks/format-code-task-001015/tests/test_command.sh new file mode 100644 index 0000000000000000000000000000000000000000..7cb23076694ad17d72e8296d62b2b240083e36db --- /dev/null +++ b/tasks/format-code-task-001015/tests/test_command.sh @@ -0,0 +1 @@ +bash /testbed/mimo_test_command.sh \ No newline at end of file diff --git a/tasks/format-code-task-001024/tests/test.patch b/tasks/format-code-task-001024/tests/test.patch new file mode 100644 index 0000000000000000000000000000000000000000..48b01dd470cb63154cced9d5f5466a1600981c1e --- /dev/null +++ b/tasks/format-code-task-001024/tests/test.patch @@ -0,0 +1,304 @@ +diff --git a/supervisor/tests/test_synth_eventlistener_delivery.py b/supervisor/tests/test_synth_eventlistener_delivery.py +new file mode 100644 +index 0000000..a7f2c61 +--- /dev/null ++++ b/supervisor/tests/test_synth_eventlistener_delivery.py +@@ -0,0 +1,283 @@ ++import errno ++ ++import pytest ++ ++from supervisor import events ++from supervisor.options import ServerOptions ++from supervisor.options import UnhosedConfigParser ++from supervisor.process import EventListenerPool ++from supervisor.states import EventListenerStates ++from supervisor.tests.base import DummyOptions ++from supervisor.tests.base import DummyPConfig ++from supervisor.tests.base import DummyPGroupConfig ++from supervisor.tests.base import DummyLogger ++ ++ ++class SynthDeliveryEvent(events.Event): ++ def __init__(self, label): ++ self.label = label ++ ++ def payload(self): ++ return self.label ++ ++ ++events.register('SYNTH_DELIVERY_EVENT', SynthDeliveryEvent) ++ ++ ++class LevelRecordingLogger(DummyLogger): ++ def __init__(self): ++ DummyLogger.__init__(self) ++ self.errors = [] ++ ++ def error(self, message, **kw): ++ if kw: ++ message = message % kw ++ self.errors.append(message) ++ self.data.append(message) ++ ++ ++@pytest.fixture(autouse=True) ++def isolate_event_subscriptions(): ++ events.clear() ++ yield ++ events.clear() ++ ++ ++def parse_listener_config(extra=''): ++ parser = UnhosedConfigParser() ++ parser.read_string( ++ '[eventlistener:delivery]\n' ++ 'events=SYNTH_DELIVERY_EVENT\n' ++ 'command=/bin/delivery-listener\n' + extra ++ ) ++ configs = ServerOptions().process_groups_from_parser(parser) ++ assert len(configs) == 1 ++ return configs[0] ++ ++ ++def make_pool(buffer_size=10, buffer_overflow='discard_oldest', ++ event_retries=-1, name='delivery'): ++ options = DummyOptions() ++ options.logger = LevelRecordingLogger() ++ pconfig = DummyPConfig(options, 'listener', '/bin/listener') ++ gconfig = DummyPGroupConfig(options, name=name, pconfigs=[pconfig]) ++ gconfig.pool_events = (SynthDeliveryEvent,) ++ gconfig.buffer_size = buffer_size ++ gconfig.buffer_overflow = buffer_overflow ++ gconfig.event_retries = event_retries ++ pool = EventListenerPool(gconfig) ++ return pool, pool.processes['listener'], options ++ ++ ++def publish(label): ++ event = SynthDeliveryEvent(label) ++ events.notify(event) ++ return event ++ ++ ++def dispatch_one(pool, process): ++ process.listener_state = EventListenerStates.READY ++ process.event = None ++ process.stdin_buffer = b'' ++ pool.dispatch() ++ assert process.listener_state == EventListenerStates.BUSY ++ header, payload = process.stdin_buffer.split(b'\n', 1) ++ assert b'eventname:SYNTH_DELIVERY_EVENT' in header ++ return payload.decode('ascii') ++ ++ ++def dispatch_many(pool, process, count): ++ return [dispatch_one(pool, process) for unused in range(count)] ++ ++ ++def assert_no_delivery(pool, process): ++ process.listener_state = EventListenerStates.READY ++ process.event = None ++ process.stdin_buffer = b'' ++ pool.dispatch() ++ assert process.listener_state == EventListenerStates.READY ++ assert process.stdin_buffer == b'' ++ ++ ++def reject(process, event): ++ events.notify(events.EventRejectedEvent(process, event)) ++ ++ ++def test_config_defaults_and_explicit_delivery_controls(): ++ default = parse_listener_config() ++ assert getattr(default, 'buffer_overflow', None) == 'discard_oldest' ++ assert getattr(default, 'event_retries', None) == -1 ++ ++ configured = parse_listener_config( ++ 'buffer_overflow=Discard_Newest\n' ++ 'event_retries=3\n' ++ ) ++ assert configured.buffer_overflow == 'discard_newest' ++ assert configured.event_retries == 3 ++ ++ ++@pytest.mark.parametrize('value', ['anything', 'oldest', 'newest']) ++def test_config_rejects_unknown_overflow_policy(value): ++ with pytest.raises(ValueError) as excinfo: ++ parse_listener_config('buffer_overflow=%s\n' % value) ++ message = str(excinfo.value) ++ assert 'eventlistener:delivery' in message ++ assert 'buffer_overflow' in message ++ assert value in message ++ ++ ++@pytest.mark.parametrize('value', ['-2', 'many']) ++def test_config_rejects_invalid_retry_values(value): ++ with pytest.raises(ValueError) as excinfo: ++ parse_listener_config('event_retries=%s\n' % value) ++ message = str(excinfo.value) ++ assert 'eventlistener:delivery' in message ++ assert 'event_retries' in message ++ assert value in message ++ ++ ++def test_reload_comparison_includes_both_delivery_controls(): ++ baseline = parse_listener_config() ++ overflow_changed = parse_listener_config( ++ 'buffer_overflow=discard_newest\n' ++ ) ++ retries_changed = parse_listener_config('event_retries=2\n') ++ assert baseline != overflow_changed ++ assert baseline != retries_changed ++ ++ ++def test_default_overflow_discards_oldest_and_keeps_fifo_order(): ++ pool, process, options = make_pool(buffer_size=2) ++ first = publish('first') ++ publish('second') ++ publish('third') ++ ++ assert dispatch_many(pool, process, 2) == ['second', 'third'] ++ assert_no_delivery(pool, process) ++ assert any( ++ 'pool delivery event buffer overflowed' in message ++ and str(first.serial) in message ++ for message in options.logger.errors ++ ) ++ ++ ++def test_discard_newest_preserves_already_buffered_fifo_order(): ++ pool, process, options = make_pool( ++ buffer_size=2, buffer_overflow='discard_newest') ++ publish('first') ++ publish('second') ++ newest = publish('third') ++ ++ assert dispatch_many(pool, process, 2) == ['first', 'second'] ++ assert_no_delivery(pool, process) ++ assert any( ++ 'pool delivery event buffer overflowed' in message ++ and str(newest.serial) in message ++ for message in options.logger.errors ++ ) ++ ++ ++def test_discard_newest_prioritizes_a_rejected_inflight_event(): ++ pool, process, options = make_pool( ++ buffer_size=2, buffer_overflow='discard_newest') ++ inflight = publish('inflight') ++ assert dispatch_one(pool, process) == 'inflight' ++ publish('queued-first') ++ displaced = publish('queued-newest') ++ ++ reject(process, inflight) ++ ++ assert dispatch_many(pool, process, 2) == ['inflight', 'queued-first'] ++ assert_no_delivery(pool, process) ++ assert any( ++ 'pool delivery event buffer overflowed' in message ++ and str(displaced.serial) in message ++ for message in options.logger.errors ++ ) ++ ++ ++def test_zero_retries_discards_on_first_rejection_and_moves_on(): ++ pool, process, options = make_pool(event_retries=0) ++ failed = publish('failed') ++ assert dispatch_one(pool, process) == 'failed' ++ publish('next') ++ ++ reject(process, failed) ++ ++ assert dispatch_one(pool, process) == 'next' ++ assert_no_delivery(pool, process) ++ assert any( ++ 'pool delivery' in message ++ and str(failed.serial) in message ++ and ('retry' in message.lower() or 'redeliver' in message.lower()) ++ and 'limit' in message.lower() ++ for message in options.logger.errors ++ ) ++ ++ ++def test_unlimited_retries_allow_repeated_redelivery(): ++ pool, process, unused = make_pool(event_retries=-1) ++ failed = publish('persistent') ++ sequence = [dispatch_one(pool, process)] ++ ++ for unused_attempt in range(3): ++ reject(process, failed) ++ sequence.append(dispatch_one(pool, process)) ++ ++ assert sequence == ['persistent'] * 4 ++ assert_no_delivery(pool, process) ++ ++ ++def test_retry_limit_counts_redeliveries_not_initial_delivery(): ++ pool, process, options = make_pool(event_retries=1) ++ failed = publish('failed') ++ sequence = [dispatch_one(pool, process)] ++ publish('next') ++ ++ reject(process, failed) ++ sequence.append(dispatch_one(pool, process)) ++ reject(process, failed) ++ sequence.append(dispatch_one(pool, process)) ++ assert_no_delivery(pool, process) ++ ++ assert sequence == ['failed', 'failed', 'next'] ++ assert any( ++ 'pool delivery' in message ++ and str(failed.serial) in message ++ and ('retry' in message.lower() or 'redeliver' in message.lower()) ++ and 'limit' in message.lower() ++ for message in options.logger.errors ++ ) ++ ++ ++def test_epipe_rebuffering_does_not_consume_rejection_retries(): ++ pool, process, unused = make_pool(event_retries=0) ++ publish('temporary-write-failure') ++ process.listener_state = EventListenerStates.READY ++ process.write_error = errno.EPIPE ++ ++ pool.dispatch() ++ ++ assert process.listener_state == EventListenerStates.READY ++ process.write_error = None ++ assert dispatch_one(pool, process) == 'temporary-write-failure' ++ assert_no_delivery(pool, process) ++ ++ ++def test_retry_accounting_is_independent_for_each_pool(): ++ pool_a, process_a, unused_a = make_pool(event_retries=1, name='pool-a') ++ pool_b, process_b, unused_b = make_pool(event_retries=1, name='pool-b') ++ shared = publish('shared') ++ assert dispatch_one(pool_a, process_a) == 'shared' ++ assert dispatch_one(pool_b, process_b) == 'shared' ++ ++ reject(process_a, shared) ++ assert dispatch_one(pool_a, process_a) == 'shared' ++ reject(process_a, shared) ++ followup = publish('after-a') ++ assert dispatch_one(pool_a, process_a) == 'after-a' ++ assert_no_delivery(pool_a, process_a) ++ ++ reject(process_b, shared) ++ assert dispatch_one(pool_b, process_b) == 'shared' ++ assert dispatch_one(pool_b, process_b) == 'after-a' ++ assert_no_delivery(pool_b, process_b) +diff --git a/mimo_test_command.sh b/mimo_test_command.sh +new file mode 100755 +--- /dev/null ++++ b/mimo_test_command.sh +@@ -0,0 +1,9 @@ ++#!/bin/bash ++set -euo pipefail ++ ++ ++pytest -q \ ++ supervisor/tests/test_synth_eventlistener_delivery.py \ ++ supervisor/tests/test_process.py::EventListenerPoolTests \ ++ supervisor/tests/test_options.py::ServerOptionsTests \ ++ supervisor/tests/test_options.py::EventListenerPoolConfigTests diff --git a/tasks/format-code-task-001030/environment/Dockerfile b/tasks/format-code-task-001030/environment/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..c3804ebf8b0aa1a9623e68aaf1a44398cda61788 --- /dev/null +++ b/tasks/format-code-task-001030/environment/Dockerfile @@ -0,0 +1,3 @@ +# The task's image, pinned by digest (the same as [environment].docker_image). +# Setup runs at start from [environment.healthcheck]; environment/setup/ is its readable copy. +FROM docker.io/xiaomimimo/mimo-v2.6-rl-oss@sha256:c2f22c25245112bddc259ff24335910ecc389fff8aac7f33b6f344f3bbd84106 diff --git a/tasks/format-code-task-001030/environment/setup/files/blocklist b/tasks/format-code-task-001030/environment/setup/files/blocklist new file mode 100644 index 0000000000000000000000000000000000000000..a8e4bdc4c7d9b739c047a3cb58ea72a1bb05bcbc --- /dev/null +++ b/tasks/format-code-task-001030/environment/setup/files/blocklist @@ -0,0 +1,33 @@ +# mimo answer-leak blocklist (mimoagent) +0.0.0.0 github.com +0.0.0.0 www.github.com +0.0.0.0 api.github.com +0.0.0.0 raw.githubusercontent.com +0.0.0.0 codeload.github.com +0.0.0.0 objects.githubusercontent.com +0.0.0.0 gist.github.com +0.0.0.0 gist.githubusercontent.com +0.0.0.0 gitlab.com +0.0.0.0 bitbucket.org +0.0.0.0 sourceforge.net +0.0.0.0 git.kernel.org +0.0.0.0 chromium.googlesource.com +0.0.0.0 android.googlesource.com +0.0.0.0 sourcegraph.com +0.0.0.0 bugs.chromium.org +0.0.0.0 issues.oss-fuzz.com +0.0.0.0 oss-fuzz.com +0.0.0.0 osv.dev +0.0.0.0 api.osv.dev +0.0.0.0 bugzilla.mozilla.org +0.0.0.0 proxy.golang.org +0.0.0.0 sum.golang.org +0.0.0.0 pkg.go.dev +0.0.0.0 google.com +0.0.0.0 www.google.com +0.0.0.0 bing.com +0.0.0.0 www.bing.com +0.0.0.0 duckduckgo.com +0.0.0.0 html.duckduckgo.com +0.0.0.0 search.brave.com +0.0.0.0 stackoverflow.com diff --git a/tasks/format-code-task-001030/environment/setup/setup.sh b/tasks/format-code-task-001030/environment/setup/setup.sh new file mode 100644 index 0000000000000000000000000000000000000000..d883db90cfcfb48f7a139861bbe9f6b5d95cad6f --- /dev/null +++ b/tasks/format-code-task-001030/environment/setup/setup.sh @@ -0,0 +1,34 @@ +#!/bin/bash +# Runs once, as root, before the agent starts: Harbor's [environment.healthcheck] unpacks this folder into +# /var/lib/mimo and runs it. Generated by mimo_harbor; see its README for how each step maps to Xiaomi's harness. +M=/var/lib/mimo +[ -f "$M/ready" ] && exit 0 +chmod 700 "$M" +fail() { echo "setup: $*" >&2; exit 1; } +# the answer-leak blocklist (mimoagent), applied to /etc/hosts by the agent right after it installs +write_blocklist() { cp "$M/files/blocklist" "$M/blocklist"; } + +# Code: mimoagent environments/datasets/opensource_code.py + base.py, as the explorer runs it (app/runner/domains.py Code). +CWD=/testbed +git config --global --add safe.directory "$CWD" +cd "$CWD" || fail "no working directory $CWD" +if ! git rev-parse --git-dir >/dev/null 2>&1; then # a bare source tree: give it a baseline commit + git init -q && git add -A && git -c user.name=mimo -c user.email=mimo@localhost commit -q -m baseline --allow-empty +fi +BASE=$(git rev-parse HEAD 2>/dev/null) +[ ${#BASE} -eq 40 ] || fail "could not resolve the base commit in $CWD" +echo "$BASE" > "$M/base" +# Images are built with history truncated at the base. If one is not, the fix could be read out of git log, +# so .git is hidden while the agent works and put back for grading. +LATER=$(git rev-list --all --not "$BASE" 2>/dev/null | head -n 5 | grep -c . || true) +rm -f /tmp/fail.log /tmp/pass.log /tmp/patch.diff /tmp/test_patch.diff /tmp/*.log 2>/dev/null; rm -rf /tmp/claude-0 /tmp/claude-* /tmp/testem-* /tmp/puppeteer_dev_chrome_profile-* 2>/dev/null; rm -f /tmp/test_files.json 2>/dev/null; rm -rf /tmp/jest_* /tmp/jest-* /tmp/build /tmp/build_env 2>/dev/null; rm -rf /tmp/pytest-of-root /tmp/pytest-* /tmp/.pytest_cache /tmp/__pycache__ 2>/dev/null; rm -rf /tmp/go-build* /tmp/standards /tmp/wordpress /tmp/zig-* /tmp/testbase /tmp/testbed 2>/dev/null; rm -f /tmp/tmp*.tmp /tmp/*.bak /tmp/expect* /tmp/butwas* 2>/dev/null; rm -rf /root/.cache/go-build 2>/dev/null; rm -rf /tests 2>/dev/null; find /logs -mindepth 1 -delete 2>/dev/null; mkdir -p /logs/agent /logs/verifier /logs/artifacts; chmod 777 /logs/agent /logs/verifier /logs/artifacts; find /var/log -type f -delete 2>/dev/null || true; rm -rf /var/lib/postgresql/*/*/log /var/lib/postgresql/*/*/pg_log 2>/dev/null || true; find /var/lib/mysql /var/lib/mongodb -type f -name '*.log' -delete 2>/dev/null || true; rm -rf /root/.npm/_logs /root/.babel.json /root/.pytest_cache 2>/dev/null || true; find / -maxdepth 4 -xdev -name task_description.md -path '*/.build_env/*' -delete 2>/dev/null || true; true +git clean -fdx --exclude=node_modules --exclude=bower_components --exclude=.husky --exclude=vendor --exclude=third_party --exclude=_deps --exclude=vcpkg_installed --exclude=.venv --exclude=venv --exclude=.gradle --exclude=target --exclude=.build --exclude=lib --exclude=.bundle --exclude=Manifest.toml --exclude=_build --exclude=.stack-work --exclude=dist-newstyle >/dev/null 2>&1 +find /root/.m2 -type f \( -name '*-SNAPSHOT.jar' -o -name '*-SNAPSHOT-sources.jar' -o -name '*-SNAPSHOT-tests.jar' -o -name '*-SNAPSHOT-test-sources.jar' \) -delete 2>/dev/null; rm -rf /root/.julia/compiled 2>/dev/null; rm -rf /root/.gradle/caches/build-cache-* /root/.gradle/daemon 2>/dev/null; rm -rf /root/.gradle/caches/*/scripts /root/.gradle/caches/jars-* 2>/dev/null; rm -rf /root/.cache/bazel 2>/dev/null; true +if [ "$LATER" -gt 0 ]; then + mv "$CWD/.git" "$M/git-hidden" + echo "history not truncated at ${BASE:0:12}: .git hidden while the agent works" +fi +write_blocklist + +touch "$M/ready" +echo "setup done" diff --git a/tasks/format-code-task-001030/tests/test.patch b/tasks/format-code-task-001030/tests/test.patch new file mode 100644 index 0000000000000000000000000000000000000000..2366a2ae7929ebf64f9ba8b85b2327a472494a32 --- /dev/null +++ b/tasks/format-code-task-001030/tests/test.patch @@ -0,0 +1,106 @@ +diff --git a/internal/extproc/translator/safety_settings_contract_test.go b/internal/extproc/translator/safety_settings_contract_test.go +new file mode 100644 +index 00000000..8d639927 +--- /dev/null ++++ b/internal/extproc/translator/safety_settings_contract_test.go +@@ -0,0 +1,90 @@ ++ ++ ++ ++ ++ ++package translator ++ ++import ( ++ "encoding/json" ++ "testing" ++ ++ extprocv3 "github.com/envoyproxy/go-control-plane/envoy/service/ext_proc/v3" ++ "github.com/stretchr/testify/require" ++ "github.com/tidwall/gjson" ++ ++ "github.com/envoyproxy/ai-gateway/internal/apischema/openai" ++) ++ ++func translatedVertexBody(t *testing.T, request string) (map[string]any, string) { ++ t.Helper() ++ var input openai.ChatCompletionRequest ++ require.NoError(t, json.Unmarshal([]byte(request), &input)) ++ header, body, err := NewChatCompletionOpenAIToGCPVertexAITranslator("").RequestBody(nil, &input, false) ++ require.NoError(t, err) ++ require.NotNil(t, header) ++ require.NotNil(t, body) ++ var payload map[string]any ++ require.NoError(t, json.Unmarshal(body.GetMutation().(*extprocv3.BodyMutation_Body).Body, &payload)) ++ path := "" ++ for _, h := range header.SetHeaders { ++ if h.Header.Key == ":path" { ++ path = string(h.Header.RawValue) ++ } ++ } ++ return payload, path ++} ++ ++func TestVertexSafetySettingsForwardingContract(t *testing.T) { ++ payload, path := translatedVertexBody(t, `{ ++ "model": "gemini-2.0-flash", ++ "temperature": 0.4, ++ "max_tokens": 256, ++ "messages": [{"role": "user", "content": "classify this"}], ++ "generationConfig": {"thinkingConfig": {"includeThoughts": true, "thinkingBudget": 128}}, ++ "safetySettings": [ ++ {"category": "HARM_CATEGORY_HATE_SPEECH", "threshold": "BLOCK_LOW_AND_ABOVE"}, ++ {"method": "SEVERITY", "category": "HARM_CATEGORY_DANGEROUS_CONTENT", "threshold": "BLOCK_ONLY_HIGH"} ++ ] ++ }`) ++ require.Equal(t, "publishers/google/models/gemini-2.0-flash:generateContent", path) ++ bodyJSON := string(mustJSON(t, payload)) ++ require.Equal(t, float64(0.4), gjson.Get(bodyJSON, "generation_config.temperature").Float()) ++ require.Equal(t, float64(256), gjson.Get(bodyJSON, "generation_config.maxOutputTokens").Float()) ++ require.True(t, gjson.Get(bodyJSON, "generation_config.thinkingConfig.includeThoughts").Bool()) ++ safety := gjson.Get(bodyJSON, "safetySettings") ++ require.Len(t, safety.Array(), 2) ++ require.Equal(t, "HARM_CATEGORY_HATE_SPEECH", safety.Get("0.category").String()) ++ require.Equal(t, "BLOCK_LOW_AND_ABOVE", safety.Get("0.threshold").String()) ++ require.Equal(t, "SEVERITY", safety.Get("1.method").String()) ++ require.Equal(t, "HARM_CATEGORY_DANGEROUS_CONTENT", safety.Get("1.category").String()) ++ require.Equal(t, "BLOCK_ONLY_HIGH", safety.Get("1.threshold").String()) ++} ++ ++func TestVertexSafetySettingsStreamingContract(t *testing.T) { ++ payload, path := translatedVertexBody(t, `{ ++ "model": "gemini-2.0-flash", ++ "stream": true, ++ "messages": [{"role": "user", "content": "stream this"}], ++ "safetySettings": [{"category": "HARM_CATEGORY_HARASSMENT", "threshold": "BLOCK_MEDIUM_AND_ABOVE"}] ++ }`) ++ require.Equal(t, "publishers/google/models/gemini-2.0-flash:streamGenerateContent?alt=sse", path) ++ bodyJSON := string(mustJSON(t, payload)) ++ require.Equal(t, "HARM_CATEGORY_HARASSMENT", gjson.Get(bodyJSON, "safetySettings.0.category").String()) ++ require.Equal(t, "BLOCK_MEDIUM_AND_ABOVE", gjson.Get(bodyJSON, "safetySettings.0.threshold").String()) ++} ++ ++func TestVertexSafetySettingsOmissionContract(t *testing.T) { ++ withoutVendor, _ := translatedVertexBody(t, `{ ++ "model": "gemini-2.0-flash", ++ "messages": [{"role": "user", "content": "ordinary request"}] ++ }`) ++ require.False(t, gjson.Get(string(mustJSON(t, withoutVendor)), "safetySettings").Exists()) ++} ++ ++func mustJSON(t *testing.T, value map[string]any) []byte { ++ t.Helper() ++ b, err := json.Marshal(value) ++ require.NoError(t, err) ++ return b ++} +diff --git a/mimo_test_command.sh b/mimo_test_command.sh +new file mode 100755 +--- /dev/null ++++ b/mimo_test_command.sh +@@ -0,0 +1,5 @@ ++#!/bin/bash ++set -euo pipefail ++ ++ ++go test ./internal/extproc/translator -run 'TestVertexSafetySettings(Forwarding|Streaming|Omission)Contract' -count=1 diff --git a/tasks/format-code-task-001030/tests/test.sh b/tasks/format-code-task-001030/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..5e717e3683f089892e6b20c5332618c7522fc235 --- /dev/null +++ b/tasks/format-code-task-001030/tests/test.sh @@ -0,0 +1,38 @@ +#!/bin/bash +# Code grading, mimoagent opensource_code.py: reset the files the hidden test patch touches, apply it, run the +# task's test command; reward 1 when it exits 0. A testbed failure (reset or apply) writes no reward: not scored. +M=/var/lib/mimo +CWD=/testbed +V=/logs/verifier +mkdir -p "$V" +BASE=$(cat "$M/base" 2>/dev/null) || { echo "setup never ran (no $M/base)" >&2; exit 1; } +cd "$CWD" || exit 1 +if [ -d "$M/git-hidden" ]; then rm -rf "$CWD/.git"; mv "$M/git-hidden" "$CWD/.git"; fi +# the agent's change against the base, so its own commits count too +git add -A >/dev/null 2>&1 && git -c core.fileMode=false diff --cached "$BASE" > "$V/agent.diff" +git reset -q +if ! ( +while IFS= read -r tf; do + [ -z "$tf" ] && continue + if git cat-file -e $BASE:"$tf" 2>/dev/null; then + git checkout $BASE -- "$tf" 2>/dev/null || true + else + git rm -f --cached "$tf" >/dev/null 2>&1 || true + rm -f "$tf" + fi +done <<'EOF_RESET_TEST_FILES' +internal/extproc/translator/safety_settings_contract_test.go +mimo_test_command.sh +EOF_RESET_TEST_FILES + +); then echo "could not reset the test files (testbed problem, not scored)" >&2; exit 1; fi +if ! git apply --verbose /tests/test.patch > "$V/apply.log" 2>&1; then + cat "$V/apply.log" >&2 + echo "the hidden tests could not be applied (testbed problem, not scored)" >&2 + exit 1 +fi +timeout 1800 sh -c "$(cat /tests/test_command.sh)" > "$V/test_output.log" 2>&1 +RC=$? +tail -c 12000 "$V/test_output.log" +if [ $RC -eq 0 ]; then echo 1 > "$V/reward.txt"; else echo 0 > "$V/reward.txt"; fi +echo "test command exited $RC" diff --git a/tasks/format-code-task-001030/tests/test_command.sh b/tasks/format-code-task-001030/tests/test_command.sh new file mode 100644 index 0000000000000000000000000000000000000000..7cb23076694ad17d72e8296d62b2b240083e36db --- /dev/null +++ b/tasks/format-code-task-001030/tests/test_command.sh @@ -0,0 +1 @@ +bash /testbed/mimo_test_command.sh \ No newline at end of file diff --git a/tasks/format-code-task-001037/environment/Dockerfile b/tasks/format-code-task-001037/environment/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..24fd98821472977f5a1b6a6f68f20fb65e11f525 --- /dev/null +++ b/tasks/format-code-task-001037/environment/Dockerfile @@ -0,0 +1,3 @@ +# The task's image, pinned by digest (the same as [environment].docker_image). +# Setup runs at start from [environment.healthcheck]; environment/setup/ is its readable copy. +FROM docker.io/xiaomimimo/mimo-v2.6-rl-oss@sha256:a9c0e1e837269ee908e788ba2d691423ff7fc8cf0169208b45ea31c756a71f46 diff --git a/tasks/format-code-task-001037/environment/setup/files/blocklist b/tasks/format-code-task-001037/environment/setup/files/blocklist new file mode 100644 index 0000000000000000000000000000000000000000..a8e4bdc4c7d9b739c047a3cb58ea72a1bb05bcbc --- /dev/null +++ b/tasks/format-code-task-001037/environment/setup/files/blocklist @@ -0,0 +1,33 @@ +# mimo answer-leak blocklist (mimoagent) +0.0.0.0 github.com +0.0.0.0 www.github.com +0.0.0.0 api.github.com +0.0.0.0 raw.githubusercontent.com +0.0.0.0 codeload.github.com +0.0.0.0 objects.githubusercontent.com +0.0.0.0 gist.github.com +0.0.0.0 gist.githubusercontent.com +0.0.0.0 gitlab.com +0.0.0.0 bitbucket.org +0.0.0.0 sourceforge.net +0.0.0.0 git.kernel.org +0.0.0.0 chromium.googlesource.com +0.0.0.0 android.googlesource.com +0.0.0.0 sourcegraph.com +0.0.0.0 bugs.chromium.org +0.0.0.0 issues.oss-fuzz.com +0.0.0.0 oss-fuzz.com +0.0.0.0 osv.dev +0.0.0.0 api.osv.dev +0.0.0.0 bugzilla.mozilla.org +0.0.0.0 proxy.golang.org +0.0.0.0 sum.golang.org +0.0.0.0 pkg.go.dev +0.0.0.0 google.com +0.0.0.0 www.google.com +0.0.0.0 bing.com +0.0.0.0 www.bing.com +0.0.0.0 duckduckgo.com +0.0.0.0 html.duckduckgo.com +0.0.0.0 search.brave.com +0.0.0.0 stackoverflow.com diff --git a/tasks/format-code-task-001037/environment/setup/setup.sh b/tasks/format-code-task-001037/environment/setup/setup.sh new file mode 100644 index 0000000000000000000000000000000000000000..d883db90cfcfb48f7a139861bbe9f6b5d95cad6f --- /dev/null +++ b/tasks/format-code-task-001037/environment/setup/setup.sh @@ -0,0 +1,34 @@ +#!/bin/bash +# Runs once, as root, before the agent starts: Harbor's [environment.healthcheck] unpacks this folder into +# /var/lib/mimo and runs it. Generated by mimo_harbor; see its README for how each step maps to Xiaomi's harness. +M=/var/lib/mimo +[ -f "$M/ready" ] && exit 0 +chmod 700 "$M" +fail() { echo "setup: $*" >&2; exit 1; } +# the answer-leak blocklist (mimoagent), applied to /etc/hosts by the agent right after it installs +write_blocklist() { cp "$M/files/blocklist" "$M/blocklist"; } + +# Code: mimoagent environments/datasets/opensource_code.py + base.py, as the explorer runs it (app/runner/domains.py Code). +CWD=/testbed +git config --global --add safe.directory "$CWD" +cd "$CWD" || fail "no working directory $CWD" +if ! git rev-parse --git-dir >/dev/null 2>&1; then # a bare source tree: give it a baseline commit + git init -q && git add -A && git -c user.name=mimo -c user.email=mimo@localhost commit -q -m baseline --allow-empty +fi +BASE=$(git rev-parse HEAD 2>/dev/null) +[ ${#BASE} -eq 40 ] || fail "could not resolve the base commit in $CWD" +echo "$BASE" > "$M/base" +# Images are built with history truncated at the base. If one is not, the fix could be read out of git log, +# so .git is hidden while the agent works and put back for grading. +LATER=$(git rev-list --all --not "$BASE" 2>/dev/null | head -n 5 | grep -c . || true) +rm -f /tmp/fail.log /tmp/pass.log /tmp/patch.diff /tmp/test_patch.diff /tmp/*.log 2>/dev/null; rm -rf /tmp/claude-0 /tmp/claude-* /tmp/testem-* /tmp/puppeteer_dev_chrome_profile-* 2>/dev/null; rm -f /tmp/test_files.json 2>/dev/null; rm -rf /tmp/jest_* /tmp/jest-* /tmp/build /tmp/build_env 2>/dev/null; rm -rf /tmp/pytest-of-root /tmp/pytest-* /tmp/.pytest_cache /tmp/__pycache__ 2>/dev/null; rm -rf /tmp/go-build* /tmp/standards /tmp/wordpress /tmp/zig-* /tmp/testbase /tmp/testbed 2>/dev/null; rm -f /tmp/tmp*.tmp /tmp/*.bak /tmp/expect* /tmp/butwas* 2>/dev/null; rm -rf /root/.cache/go-build 2>/dev/null; rm -rf /tests 2>/dev/null; find /logs -mindepth 1 -delete 2>/dev/null; mkdir -p /logs/agent /logs/verifier /logs/artifacts; chmod 777 /logs/agent /logs/verifier /logs/artifacts; find /var/log -type f -delete 2>/dev/null || true; rm -rf /var/lib/postgresql/*/*/log /var/lib/postgresql/*/*/pg_log 2>/dev/null || true; find /var/lib/mysql /var/lib/mongodb -type f -name '*.log' -delete 2>/dev/null || true; rm -rf /root/.npm/_logs /root/.babel.json /root/.pytest_cache 2>/dev/null || true; find / -maxdepth 4 -xdev -name task_description.md -path '*/.build_env/*' -delete 2>/dev/null || true; true +git clean -fdx --exclude=node_modules --exclude=bower_components --exclude=.husky --exclude=vendor --exclude=third_party --exclude=_deps --exclude=vcpkg_installed --exclude=.venv --exclude=venv --exclude=.gradle --exclude=target --exclude=.build --exclude=lib --exclude=.bundle --exclude=Manifest.toml --exclude=_build --exclude=.stack-work --exclude=dist-newstyle >/dev/null 2>&1 +find /root/.m2 -type f \( -name '*-SNAPSHOT.jar' -o -name '*-SNAPSHOT-sources.jar' -o -name '*-SNAPSHOT-tests.jar' -o -name '*-SNAPSHOT-test-sources.jar' \) -delete 2>/dev/null; rm -rf /root/.julia/compiled 2>/dev/null; rm -rf /root/.gradle/caches/build-cache-* /root/.gradle/daemon 2>/dev/null; rm -rf /root/.gradle/caches/*/scripts /root/.gradle/caches/jars-* 2>/dev/null; rm -rf /root/.cache/bazel 2>/dev/null; true +if [ "$LATER" -gt 0 ]; then + mv "$CWD/.git" "$M/git-hidden" + echo "history not truncated at ${BASE:0:12}: .git hidden while the agent works" +fi +write_blocklist + +touch "$M/ready" +echo "setup done" diff --git a/tasks/format-code-task-001037/tests/test.patch b/tasks/format-code-task-001037/tests/test.patch new file mode 100644 index 0000000000000000000000000000000000000000..ee0cd33a33254bbab03c63401c50cd0bee6a74ed --- /dev/null +++ b/tasks/format-code-task-001037/tests/test.patch @@ -0,0 +1,158 @@ +diff --git a/src/paperless_tika/tests/test_response_compat_synthesis.py b/src/paperless_tika/tests/test_response_compat_synthesis.py +new file mode 100644 +index 000000000..19366a202 +--- /dev/null ++++ b/src/paperless_tika/tests/test_response_compat_synthesis.py +@@ -0,0 +1,140 @@ ++import datetime ++from pathlib import Path ++from types import SimpleNamespace ++from unittest import mock ++ ++from django.test import TestCase ++ ++from documents.parsers import ParseError ++from paperless_mail.parsers import MailDocumentParser ++from paperless_tika.parsers import TikaDocumentParser ++ ++ ++class TikaResponseCompatibilityTests(TestCase): ++ def setUp(self): ++ self.parser = TikaDocumentParser(logging_group=None) ++ self.mail_parser = MailDocumentParser(logging_group=None) ++ self.document = Path(self.parser.tempdir) / "input.docx" ++ self.document.touch() ++ ++ def tearDown(self): ++ self.parser.cleanup() ++ self.mail_parser.cleanup() ++ ++ def _client(self, response=None, error=None): ++ client = mock.MagicMock() ++ client.__enter__.return_value = client ++ if error is not None: ++ client.tika.as_text.from_file.side_effect = error ++ else: ++ client.tika.as_text.from_file.return_value = response ++ return client ++ ++ def test_parse_modern_response_uses_top_level_fields(self): ++ created = datetime.datetime(2024, 2, 3, 4, 5, tzinfo=datetime.timezone.utc) ++ response = SimpleNamespace(content=" modern text ", created=created) ++ ++ with ( ++ mock.patch("paperless_tika.parsers.TikaClient", return_value=self._client(response)), ++ mock.patch.object(self.parser, "convert_to_pdf", return_value="modern.pdf"), ++ ): ++ self.parser.parse(self.document, "application/vnd.openxmlformats-officedocument.wordprocessingml.document", "scan.docx") ++ ++ self.assertEqual(self.parser.get_text(), "modern text") ++ self.assertEqual(self.parser.get_date(), created) ++ self.assertEqual(self.parser.get_archive_path(), "modern.pdf") ++ ++ def test_parse_legacy_response_keeps_metadata_compatibility(self): ++ created = datetime.datetime(2023, 8, 9, tzinfo=datetime.timezone.utc) ++ response = SimpleNamespace( ++ content="legacy text", ++ metadata=SimpleNamespace(created=created), ++ ) ++ ++ with ( ++ mock.patch("paperless_tika.parsers.TikaClient", return_value=self._client(response)), ++ mock.patch.object(self.parser, "convert_to_pdf", return_value="legacy.pdf"), ++ ): ++ self.parser.parse(self.document, "application/msword") ++ ++ self.assertEqual(self.parser.get_text(), "legacy text") ++ self.assertEqual(self.parser.get_date(), created) ++ ++ def test_parse_missing_content_and_date_is_empty_and_undated(self): ++ response = SimpleNamespace(content=None, created=None) ++ ++ with ( ++ mock.patch("paperless_tika.parsers.TikaClient", return_value=self._client(response)), ++ mock.patch.object(self.parser, "convert_to_pdf", return_value="empty.pdf"), ++ ): ++ self.parser.parse(self.document, "application/msword") ++ ++ self.assertEqual(self.parser.get_text(), "") ++ self.assertIsNone(self.parser.get_date()) ++ self.assertEqual(self.parser.get_archive_path(), "empty.pdf") ++ ++ def test_parse_invalid_date_does_not_abort_conversion(self): ++ class InvalidDateResponse: ++ content = "usable text" ++ ++ @property ++ def created(self): ++ raise ValueError("bad date") ++ ++ with ( ++ mock.patch( ++ "paperless_tika.parsers.TikaClient", ++ return_value=self._client(InvalidDateResponse()), ++ ), ++ mock.patch.object(self.parser, "convert_to_pdf", return_value="invalid-date.pdf"), ++ ): ++ self.parser.parse(self.document, "application/msword") ++ ++ self.assertEqual(self.parser.get_text(), "usable text") ++ self.assertIsNone(self.parser.get_date()) ++ self.assertEqual(self.parser.get_archive_path(), "invalid-date.pdf") ++ ++ def test_parse_client_failure_is_parse_error(self): ++ client_error = RuntimeError("connection refused") ++ with mock.patch( ++ "paperless_tika.parsers.TikaClient", ++ return_value=self._client(error=client_error), ++ ): ++ with self.assertRaises(ParseError) as raised: ++ self.parser.parse(self.document, "application/msword") ++ ++ self.assertIn("Could not parse", str(raised.exception)) ++ self.assertIn("connection refused", str(raised.exception)) ++ self.assertIs(raised.exception.__cause__, client_error) ++ ++ def test_extract_metadata_accepts_mapping_response(self): ++ metadata_response = {"title": "Invoice", "pages": 2} ++ client = self._client() ++ client.metadata.from_file.return_value = metadata_response ++ ++ with mock.patch("paperless_tika.parsers.TikaClient", return_value=client): ++ metadata = self.parser.extract_metadata(self.document, "application/msword") ++ ++ self.assertEqual( ++ metadata, ++ [ ++ {"namespace": "", "prefix": "", "key": "title", "value": "Invoice"}, ++ {"namespace": "", "prefix": "", "key": "pages", "value": 2}, ++ ], ++ ) ++ ++ def test_mail_html_parse_uses_modern_content_field(self): ++ client = self._client() ++ client.tika.as_text.from_buffer.return_value = SimpleNamespace( ++ content=" html text ", ++ ) ++ ++ with mock.patch("paperless_mail.parsers.TikaClient", return_value=client): ++ self.assertEqual(self.mail_parser.tika_parse("

ignored

"), "html text") ++ ++ def test_mail_html_parse_missing_content_is_empty(self): ++ client = self._client() ++ client.tika.as_text.from_buffer.return_value = SimpleNamespace(content=None) ++ ++ with mock.patch("paperless_mail.parsers.TikaClient", return_value=client): ++ self.assertEqual(self.mail_parser.tika_parse("

ignored

"), "") +diff --git a/mimo_test_command.sh b/mimo_test_command.sh +new file mode 100755 +--- /dev/null ++++ b/mimo_test_command.sh +@@ -0,0 +1,7 @@ ++#!/bin/bash ++set -euo pipefail ++ ++ ++REPO_ROOT="$(git rev-parse --show-toplevel)" ++cd "${REPO_ROOT}/src" ++"${REPO_ROOT}/.venv/bin/python" -m pytest -o addopts='' paperless_tika/tests/test_response_compat_synthesis.py -q diff --git a/tasks/format-code-task-001037/tests/test.sh b/tasks/format-code-task-001037/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..ca944ac0268f877ab7e6f0d790552a5aa2e2c920 --- /dev/null +++ b/tasks/format-code-task-001037/tests/test.sh @@ -0,0 +1,38 @@ +#!/bin/bash +# Code grading, mimoagent opensource_code.py: reset the files the hidden test patch touches, apply it, run the +# task's test command; reward 1 when it exits 0. A testbed failure (reset or apply) writes no reward: not scored. +M=/var/lib/mimo +CWD=/testbed +V=/logs/verifier +mkdir -p "$V" +BASE=$(cat "$M/base" 2>/dev/null) || { echo "setup never ran (no $M/base)" >&2; exit 1; } +cd "$CWD" || exit 1 +if [ -d "$M/git-hidden" ]; then rm -rf "$CWD/.git"; mv "$M/git-hidden" "$CWD/.git"; fi +# the agent's change against the base, so its own commits count too +git add -A >/dev/null 2>&1 && git -c core.fileMode=false diff --cached "$BASE" > "$V/agent.diff" +git reset -q +if ! ( +while IFS= read -r tf; do + [ -z "$tf" ] && continue + if git cat-file -e $BASE:"$tf" 2>/dev/null; then + git checkout $BASE -- "$tf" 2>/dev/null || true + else + git rm -f --cached "$tf" >/dev/null 2>&1 || true + rm -f "$tf" + fi +done <<'EOF_RESET_TEST_FILES' +src/paperless_tika/tests/test_response_compat_synthesis.py +mimo_test_command.sh +EOF_RESET_TEST_FILES + +); then echo "could not reset the test files (testbed problem, not scored)" >&2; exit 1; fi +if ! git apply --verbose /tests/test.patch > "$V/apply.log" 2>&1; then + cat "$V/apply.log" >&2 + echo "the hidden tests could not be applied (testbed problem, not scored)" >&2 + exit 1 +fi +timeout 1800 sh -c "$(cat /tests/test_command.sh)" > "$V/test_output.log" 2>&1 +RC=$? +tail -c 12000 "$V/test_output.log" +if [ $RC -eq 0 ]; then echo 1 > "$V/reward.txt"; else echo 0 > "$V/reward.txt"; fi +echo "test command exited $RC" diff --git a/tasks/format-code-task-001037/tests/test_command.sh b/tasks/format-code-task-001037/tests/test_command.sh new file mode 100644 index 0000000000000000000000000000000000000000..7cb23076694ad17d72e8296d62b2b240083e36db --- /dev/null +++ b/tasks/format-code-task-001037/tests/test_command.sh @@ -0,0 +1 @@ +bash /testbed/mimo_test_command.sh \ No newline at end of file diff --git a/tasks/format-code-task-001039/environment/Dockerfile b/tasks/format-code-task-001039/environment/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..e031bcabbf7ef1f55febc76c2ba7ec09517f93a3 --- /dev/null +++ b/tasks/format-code-task-001039/environment/Dockerfile @@ -0,0 +1,3 @@ +# The task's image, pinned by digest (the same as [environment].docker_image). +# Setup runs at start from [environment.healthcheck]; environment/setup/ is its readable copy. +FROM docker.io/xiaomimimo/mimo-v2.6-rl-oss@sha256:ecb4c82783349f996e35228db6c6b4f60b24985f85c95903f2876018e92b5204 diff --git a/tasks/format-code-task-001039/environment/setup/files/blocklist b/tasks/format-code-task-001039/environment/setup/files/blocklist new file mode 100644 index 0000000000000000000000000000000000000000..a8e4bdc4c7d9b739c047a3cb58ea72a1bb05bcbc --- /dev/null +++ b/tasks/format-code-task-001039/environment/setup/files/blocklist @@ -0,0 +1,33 @@ +# mimo answer-leak blocklist (mimoagent) +0.0.0.0 github.com +0.0.0.0 www.github.com +0.0.0.0 api.github.com +0.0.0.0 raw.githubusercontent.com +0.0.0.0 codeload.github.com +0.0.0.0 objects.githubusercontent.com +0.0.0.0 gist.github.com +0.0.0.0 gist.githubusercontent.com +0.0.0.0 gitlab.com +0.0.0.0 bitbucket.org +0.0.0.0 sourceforge.net +0.0.0.0 git.kernel.org +0.0.0.0 chromium.googlesource.com +0.0.0.0 android.googlesource.com +0.0.0.0 sourcegraph.com +0.0.0.0 bugs.chromium.org +0.0.0.0 issues.oss-fuzz.com +0.0.0.0 oss-fuzz.com +0.0.0.0 osv.dev +0.0.0.0 api.osv.dev +0.0.0.0 bugzilla.mozilla.org +0.0.0.0 proxy.golang.org +0.0.0.0 sum.golang.org +0.0.0.0 pkg.go.dev +0.0.0.0 google.com +0.0.0.0 www.google.com +0.0.0.0 bing.com +0.0.0.0 www.bing.com +0.0.0.0 duckduckgo.com +0.0.0.0 html.duckduckgo.com +0.0.0.0 search.brave.com +0.0.0.0 stackoverflow.com diff --git a/tasks/format-code-task-001039/environment/setup/setup.sh b/tasks/format-code-task-001039/environment/setup/setup.sh new file mode 100644 index 0000000000000000000000000000000000000000..d883db90cfcfb48f7a139861bbe9f6b5d95cad6f --- /dev/null +++ b/tasks/format-code-task-001039/environment/setup/setup.sh @@ -0,0 +1,34 @@ +#!/bin/bash +# Runs once, as root, before the agent starts: Harbor's [environment.healthcheck] unpacks this folder into +# /var/lib/mimo and runs it. Generated by mimo_harbor; see its README for how each step maps to Xiaomi's harness. +M=/var/lib/mimo +[ -f "$M/ready" ] && exit 0 +chmod 700 "$M" +fail() { echo "setup: $*" >&2; exit 1; } +# the answer-leak blocklist (mimoagent), applied to /etc/hosts by the agent right after it installs +write_blocklist() { cp "$M/files/blocklist" "$M/blocklist"; } + +# Code: mimoagent environments/datasets/opensource_code.py + base.py, as the explorer runs it (app/runner/domains.py Code). +CWD=/testbed +git config --global --add safe.directory "$CWD" +cd "$CWD" || fail "no working directory $CWD" +if ! git rev-parse --git-dir >/dev/null 2>&1; then # a bare source tree: give it a baseline commit + git init -q && git add -A && git -c user.name=mimo -c user.email=mimo@localhost commit -q -m baseline --allow-empty +fi +BASE=$(git rev-parse HEAD 2>/dev/null) +[ ${#BASE} -eq 40 ] || fail "could not resolve the base commit in $CWD" +echo "$BASE" > "$M/base" +# Images are built with history truncated at the base. If one is not, the fix could be read out of git log, +# so .git is hidden while the agent works and put back for grading. +LATER=$(git rev-list --all --not "$BASE" 2>/dev/null | head -n 5 | grep -c . || true) +rm -f /tmp/fail.log /tmp/pass.log /tmp/patch.diff /tmp/test_patch.diff /tmp/*.log 2>/dev/null; rm -rf /tmp/claude-0 /tmp/claude-* /tmp/testem-* /tmp/puppeteer_dev_chrome_profile-* 2>/dev/null; rm -f /tmp/test_files.json 2>/dev/null; rm -rf /tmp/jest_* /tmp/jest-* /tmp/build /tmp/build_env 2>/dev/null; rm -rf /tmp/pytest-of-root /tmp/pytest-* /tmp/.pytest_cache /tmp/__pycache__ 2>/dev/null; rm -rf /tmp/go-build* /tmp/standards /tmp/wordpress /tmp/zig-* /tmp/testbase /tmp/testbed 2>/dev/null; rm -f /tmp/tmp*.tmp /tmp/*.bak /tmp/expect* /tmp/butwas* 2>/dev/null; rm -rf /root/.cache/go-build 2>/dev/null; rm -rf /tests 2>/dev/null; find /logs -mindepth 1 -delete 2>/dev/null; mkdir -p /logs/agent /logs/verifier /logs/artifacts; chmod 777 /logs/agent /logs/verifier /logs/artifacts; find /var/log -type f -delete 2>/dev/null || true; rm -rf /var/lib/postgresql/*/*/log /var/lib/postgresql/*/*/pg_log 2>/dev/null || true; find /var/lib/mysql /var/lib/mongodb -type f -name '*.log' -delete 2>/dev/null || true; rm -rf /root/.npm/_logs /root/.babel.json /root/.pytest_cache 2>/dev/null || true; find / -maxdepth 4 -xdev -name task_description.md -path '*/.build_env/*' -delete 2>/dev/null || true; true +git clean -fdx --exclude=node_modules --exclude=bower_components --exclude=.husky --exclude=vendor --exclude=third_party --exclude=_deps --exclude=vcpkg_installed --exclude=.venv --exclude=venv --exclude=.gradle --exclude=target --exclude=.build --exclude=lib --exclude=.bundle --exclude=Manifest.toml --exclude=_build --exclude=.stack-work --exclude=dist-newstyle >/dev/null 2>&1 +find /root/.m2 -type f \( -name '*-SNAPSHOT.jar' -o -name '*-SNAPSHOT-sources.jar' -o -name '*-SNAPSHOT-tests.jar' -o -name '*-SNAPSHOT-test-sources.jar' \) -delete 2>/dev/null; rm -rf /root/.julia/compiled 2>/dev/null; rm -rf /root/.gradle/caches/build-cache-* /root/.gradle/daemon 2>/dev/null; rm -rf /root/.gradle/caches/*/scripts /root/.gradle/caches/jars-* 2>/dev/null; rm -rf /root/.cache/bazel 2>/dev/null; true +if [ "$LATER" -gt 0 ]; then + mv "$CWD/.git" "$M/git-hidden" + echo "history not truncated at ${BASE:0:12}: .git hidden while the agent works" +fi +write_blocklist + +touch "$M/ready" +echo "setup done" diff --git a/tasks/format-code-task-001039/tests/test.patch b/tasks/format-code-task-001039/tests/test.patch new file mode 100644 index 0000000000000000000000000000000000000000..8b6b2e1667197bfcb4e4003a04a6034a879562bd --- /dev/null +++ b/tasks/format-code-task-001039/tests/test.patch @@ -0,0 +1,139 @@ +diff --git a/pkg/apis/kops/channel_resolution_contract_test.go b/pkg/apis/kops/channel_resolution_contract_test.go +new file mode 100644 +index 0000000000..b33e6d47c4 +--- /dev/null ++++ b/pkg/apis/kops/channel_resolution_contract_test.go +@@ -0,0 +1,123 @@ ++package kops ++ ++import ( ++ "testing" ++ ++ "github.com/blang/semver" ++) ++ ++func TestFindImageUsesSpecificRuleAndDeclarationTieBreak(t *testing.T) { ++ version := semver.MustParse("1.21.0") ++ channel := &Channel{Spec: ChannelSpec{Images: []*ChannelImageSpec{ ++ {ProviderID: string(CloudProviderAWS), Name: "fallback-first"}, ++ {ProviderID: string(CloudProviderAWS), Name: "specific-old", KubernetesVersion: ">=1.20.0"}, ++ {ProviderID: string(CloudProviderAWS), Name: "specific-new", KubernetesVersion: ">=1.18.0"}, ++ {ProviderID: string(CloudProviderAWS), Name: "fallback-last"}, ++ }}} ++ ++ image := channel.FindImage(CloudProviderAWS, version) ++ if image == nil || image.Name != "specific-new" { ++ t.Fatalf("FindImage selected %v, want the later matching ranged rule", image) ++ } ++} ++ ++func TestFindImageUsesLaterFallbackWhenNoRangeMatches(t *testing.T) { ++ channel := &Channel{Spec: ChannelSpec{Images: []*ChannelImageSpec{ ++ {ProviderID: string(CloudProviderAWS), Name: "fallback-old"}, ++ {ProviderID: string(CloudProviderAWS), Name: "future", KubernetesVersion: ">=2.0.0"}, ++ {ProviderID: string(CloudProviderAWS), Name: "fallback-new"}, ++ }}} ++ image := channel.FindImage(CloudProviderAWS, semver.MustParse("1.21.0")) ++ if image == nil || image.Name != "fallback-new" { ++ t.Fatalf("FindImage selected %v, want later fallback rule", image) ++ } ++} ++ ++func TestFindImageRetainsProviderFiltering(t *testing.T) { ++ channel := &Channel{Spec: ChannelSpec{Images: []*ChannelImageSpec{ ++ {ProviderID: string(CloudProviderAWS), Name: "aws"}, ++ {ProviderID: string(CloudProviderGCE), Name: "gce", KubernetesVersion: ">=1.0.0"}, ++ }}} ++ image := channel.FindImage(CloudProviderGCE, semver.MustParse("1.21.0")) ++ if image == nil || image.Name != "gce" { ++ t.Fatalf("FindImage selected %v, want the matching provider rule", image) ++ } ++} ++ ++func TestFindImageSkipsMalformedRules(t *testing.T) { ++ channel := &Channel{Spec: ChannelSpec{Images: []*ChannelImageSpec{ ++ {ProviderID: string(CloudProviderAWS), Name: "bad", KubernetesVersion: "not a range"}, ++ }}} ++ if image := channel.FindImage(CloudProviderAWS, semver.MustParse("1.21.0")); image != nil { ++ t.Fatalf("FindImage returned malformed rule %v", image) ++ } ++} ++ ++func TestFindImageSkipsNilRules(t *testing.T) { ++ channel := &Channel{Spec: ChannelSpec{Images: []*ChannelImageSpec{nil}}} ++ if image := channel.FindImage(CloudProviderAWS, semver.MustParse("1.21.0")); image != nil { ++ t.Fatalf("FindImage returned nil rule as %v", image) ++ } ++} ++ ++func TestFindKopsVersionSpecPrecedence(t *testing.T) { ++ version := semver.MustParse("1.5.2") ++ versions := []KopsVersionSpec{ ++ {RecommendedVersion: "fallback-first"}, ++ {Range: ">=1.0.0", RecommendedVersion: "ranged-old"}, ++ {Range: ">=1.5.0", RecommendedVersion: "ranged-new"}, ++ {RecommendedVersion: "fallback-last"}, ++ {Range: "[invalid", RecommendedVersion: "invalid"}, ++ } ++ ++ got := FindKopsVersionSpec(versions, version) ++ if got == nil || got.RecommendedVersion != "ranged-new" { ++ t.Fatalf("FindKopsVersionSpec selected %#v, want later matching ranged rule", got) ++ } ++} ++ ++func TestFindKopsVersionSpecFallbackAndNoMatch(t *testing.T) { ++ version := semver.MustParse("1.5.2") ++ fallbacks := []KopsVersionSpec{ ++ {RecommendedVersion: "fallback-old"}, ++ {Range: ">=2.0.0", RecommendedVersion: "future"}, ++ {RecommendedVersion: "fallback-new"}, ++ } ++ if got := FindKopsVersionSpec(fallbacks, version); got == nil || got.RecommendedVersion != "fallback-new" { ++ t.Fatalf("FindKopsVersionSpec selected %#v, want later fallback rule", got) ++ } ++ if got := FindKopsVersionSpec([]KopsVersionSpec{{Range: "[invalid"}}, version); got != nil { ++ t.Fatalf("FindKopsVersionSpec returned invalid-only match %#v", got) ++ } ++} ++ ++func TestFindKubernetesVersionSpecPrecedenceAndFallback(t *testing.T) { ++ versions := []KubernetesVersionSpec{ ++ {Range: "[invalid", RecommendedVersion: "invalid"}, ++ {RecommendedVersion: "fallback"}, ++ {Range: ">=1.20.0", RecommendedVersion: "specific"}, ++ } ++ ++ got := FindKubernetesVersionSpec(versions, semver.MustParse("1.21.0")) ++ if got == nil || got.RecommendedVersion != "specific" { ++ t.Fatalf("FindKubernetesVersionSpec selected %#v, want ranged rule", got) ++ } ++ ++ if got := FindKubernetesVersionSpec(versions, semver.MustParse("1.19.0")); got == nil || got.RecommendedVersion != "fallback" { ++ t.Fatalf("FindKubernetesVersionSpec selected %#v, want fallback rule", got) ++ } ++} ++ ++func TestFindKubernetesVersionSpecReturnsNilForInvalidOnlyRules(t *testing.T) { ++ fallbacks := []KubernetesVersionSpec{ ++ {RecommendedVersion: "fallback-old"}, ++ {Range: ">=2.0.0", RecommendedVersion: "future"}, ++ {RecommendedVersion: "fallback-new"}, ++ } ++ if got := FindKubernetesVersionSpec(fallbacks, semver.MustParse("1.21.0")); got == nil || got.RecommendedVersion != "fallback-new" { ++ t.Fatalf("FindKubernetesVersionSpec selected %#v, want later fallback rule", got) ++ } ++ if got := FindKubernetesVersionSpec([]KubernetesVersionSpec{{Range: "[invalid"}}, semver.MustParse("1.21.0")); got != nil { ++ t.Fatalf("FindKubernetesVersionSpec returned invalid-only match %#v", got) ++ } ++} +diff --git a/mimo_test_command.sh b/mimo_test_command.sh +new file mode 100755 +--- /dev/null ++++ b/mimo_test_command.sh +@@ -0,0 +1,5 @@ ++#!/bin/bash ++set -euo pipefail ++ ++ ++go test ./pkg/apis/kops diff --git a/tasks/format-code-task-001039/tests/test.sh b/tasks/format-code-task-001039/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..4d54577f0963c061e56bdde04a2e0d93410f624a --- /dev/null +++ b/tasks/format-code-task-001039/tests/test.sh @@ -0,0 +1,38 @@ +#!/bin/bash +# Code grading, mimoagent opensource_code.py: reset the files the hidden test patch touches, apply it, run the +# task's test command; reward 1 when it exits 0. A testbed failure (reset or apply) writes no reward: not scored. +M=/var/lib/mimo +CWD=/testbed +V=/logs/verifier +mkdir -p "$V" +BASE=$(cat "$M/base" 2>/dev/null) || { echo "setup never ran (no $M/base)" >&2; exit 1; } +cd "$CWD" || exit 1 +if [ -d "$M/git-hidden" ]; then rm -rf "$CWD/.git"; mv "$M/git-hidden" "$CWD/.git"; fi +# the agent's change against the base, so its own commits count too +git add -A >/dev/null 2>&1 && git -c core.fileMode=false diff --cached "$BASE" > "$V/agent.diff" +git reset -q +if ! ( +while IFS= read -r tf; do + [ -z "$tf" ] && continue + if git cat-file -e $BASE:"$tf" 2>/dev/null; then + git checkout $BASE -- "$tf" 2>/dev/null || true + else + git rm -f --cached "$tf" >/dev/null 2>&1 || true + rm -f "$tf" + fi +done <<'EOF_RESET_TEST_FILES' +pkg/apis/kops/channel_resolution_contract_test.go +mimo_test_command.sh +EOF_RESET_TEST_FILES + +); then echo "could not reset the test files (testbed problem, not scored)" >&2; exit 1; fi +if ! git apply --verbose /tests/test.patch > "$V/apply.log" 2>&1; then + cat "$V/apply.log" >&2 + echo "the hidden tests could not be applied (testbed problem, not scored)" >&2 + exit 1 +fi +timeout 1800 sh -c "$(cat /tests/test_command.sh)" > "$V/test_output.log" 2>&1 +RC=$? +tail -c 12000 "$V/test_output.log" +if [ $RC -eq 0 ]; then echo 1 > "$V/reward.txt"; else echo 0 > "$V/reward.txt"; fi +echo "test command exited $RC" diff --git a/tasks/format-code-task-001039/tests/test_command.sh b/tasks/format-code-task-001039/tests/test_command.sh new file mode 100644 index 0000000000000000000000000000000000000000..7cb23076694ad17d72e8296d62b2b240083e36db --- /dev/null +++ b/tasks/format-code-task-001039/tests/test_command.sh @@ -0,0 +1 @@ +bash /testbed/mimo_test_command.sh \ No newline at end of file diff --git a/tasks/format-code-task-001052/environment/Dockerfile b/tasks/format-code-task-001052/environment/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..8774fcb383eab08b50ca80fcef60c92db2fc4780 --- /dev/null +++ b/tasks/format-code-task-001052/environment/Dockerfile @@ -0,0 +1,3 @@ +# The task's image, pinned by digest (the same as [environment].docker_image). +# Setup runs at start from [environment.healthcheck]; environment/setup/ is its readable copy. +FROM docker.io/xiaomimimo/mimo-v2.6-rl-oss@sha256:c474b6ff2b77900faedb38b5f8ba8ba74bf5bd76c830f0fba58009db39a900da diff --git a/tasks/format-code-task-001052/environment/setup/files/blocklist b/tasks/format-code-task-001052/environment/setup/files/blocklist new file mode 100644 index 0000000000000000000000000000000000000000..a8e4bdc4c7d9b739c047a3cb58ea72a1bb05bcbc --- /dev/null +++ b/tasks/format-code-task-001052/environment/setup/files/blocklist @@ -0,0 +1,33 @@ +# mimo answer-leak blocklist (mimoagent) +0.0.0.0 github.com +0.0.0.0 www.github.com +0.0.0.0 api.github.com +0.0.0.0 raw.githubusercontent.com +0.0.0.0 codeload.github.com +0.0.0.0 objects.githubusercontent.com +0.0.0.0 gist.github.com +0.0.0.0 gist.githubusercontent.com +0.0.0.0 gitlab.com +0.0.0.0 bitbucket.org +0.0.0.0 sourceforge.net +0.0.0.0 git.kernel.org +0.0.0.0 chromium.googlesource.com +0.0.0.0 android.googlesource.com +0.0.0.0 sourcegraph.com +0.0.0.0 bugs.chromium.org +0.0.0.0 issues.oss-fuzz.com +0.0.0.0 oss-fuzz.com +0.0.0.0 osv.dev +0.0.0.0 api.osv.dev +0.0.0.0 bugzilla.mozilla.org +0.0.0.0 proxy.golang.org +0.0.0.0 sum.golang.org +0.0.0.0 pkg.go.dev +0.0.0.0 google.com +0.0.0.0 www.google.com +0.0.0.0 bing.com +0.0.0.0 www.bing.com +0.0.0.0 duckduckgo.com +0.0.0.0 html.duckduckgo.com +0.0.0.0 search.brave.com +0.0.0.0 stackoverflow.com diff --git a/tasks/format-code-task-001052/environment/setup/setup.sh b/tasks/format-code-task-001052/environment/setup/setup.sh new file mode 100644 index 0000000000000000000000000000000000000000..d883db90cfcfb48f7a139861bbe9f6b5d95cad6f --- /dev/null +++ b/tasks/format-code-task-001052/environment/setup/setup.sh @@ -0,0 +1,34 @@ +#!/bin/bash +# Runs once, as root, before the agent starts: Harbor's [environment.healthcheck] unpacks this folder into +# /var/lib/mimo and runs it. Generated by mimo_harbor; see its README for how each step maps to Xiaomi's harness. +M=/var/lib/mimo +[ -f "$M/ready" ] && exit 0 +chmod 700 "$M" +fail() { echo "setup: $*" >&2; exit 1; } +# the answer-leak blocklist (mimoagent), applied to /etc/hosts by the agent right after it installs +write_blocklist() { cp "$M/files/blocklist" "$M/blocklist"; } + +# Code: mimoagent environments/datasets/opensource_code.py + base.py, as the explorer runs it (app/runner/domains.py Code). +CWD=/testbed +git config --global --add safe.directory "$CWD" +cd "$CWD" || fail "no working directory $CWD" +if ! git rev-parse --git-dir >/dev/null 2>&1; then # a bare source tree: give it a baseline commit + git init -q && git add -A && git -c user.name=mimo -c user.email=mimo@localhost commit -q -m baseline --allow-empty +fi +BASE=$(git rev-parse HEAD 2>/dev/null) +[ ${#BASE} -eq 40 ] || fail "could not resolve the base commit in $CWD" +echo "$BASE" > "$M/base" +# Images are built with history truncated at the base. If one is not, the fix could be read out of git log, +# so .git is hidden while the agent works and put back for grading. +LATER=$(git rev-list --all --not "$BASE" 2>/dev/null | head -n 5 | grep -c . || true) +rm -f /tmp/fail.log /tmp/pass.log /tmp/patch.diff /tmp/test_patch.diff /tmp/*.log 2>/dev/null; rm -rf /tmp/claude-0 /tmp/claude-* /tmp/testem-* /tmp/puppeteer_dev_chrome_profile-* 2>/dev/null; rm -f /tmp/test_files.json 2>/dev/null; rm -rf /tmp/jest_* /tmp/jest-* /tmp/build /tmp/build_env 2>/dev/null; rm -rf /tmp/pytest-of-root /tmp/pytest-* /tmp/.pytest_cache /tmp/__pycache__ 2>/dev/null; rm -rf /tmp/go-build* /tmp/standards /tmp/wordpress /tmp/zig-* /tmp/testbase /tmp/testbed 2>/dev/null; rm -f /tmp/tmp*.tmp /tmp/*.bak /tmp/expect* /tmp/butwas* 2>/dev/null; rm -rf /root/.cache/go-build 2>/dev/null; rm -rf /tests 2>/dev/null; find /logs -mindepth 1 -delete 2>/dev/null; mkdir -p /logs/agent /logs/verifier /logs/artifacts; chmod 777 /logs/agent /logs/verifier /logs/artifacts; find /var/log -type f -delete 2>/dev/null || true; rm -rf /var/lib/postgresql/*/*/log /var/lib/postgresql/*/*/pg_log 2>/dev/null || true; find /var/lib/mysql /var/lib/mongodb -type f -name '*.log' -delete 2>/dev/null || true; rm -rf /root/.npm/_logs /root/.babel.json /root/.pytest_cache 2>/dev/null || true; find / -maxdepth 4 -xdev -name task_description.md -path '*/.build_env/*' -delete 2>/dev/null || true; true +git clean -fdx --exclude=node_modules --exclude=bower_components --exclude=.husky --exclude=vendor --exclude=third_party --exclude=_deps --exclude=vcpkg_installed --exclude=.venv --exclude=venv --exclude=.gradle --exclude=target --exclude=.build --exclude=lib --exclude=.bundle --exclude=Manifest.toml --exclude=_build --exclude=.stack-work --exclude=dist-newstyle >/dev/null 2>&1 +find /root/.m2 -type f \( -name '*-SNAPSHOT.jar' -o -name '*-SNAPSHOT-sources.jar' -o -name '*-SNAPSHOT-tests.jar' -o -name '*-SNAPSHOT-test-sources.jar' \) -delete 2>/dev/null; rm -rf /root/.julia/compiled 2>/dev/null; rm -rf /root/.gradle/caches/build-cache-* /root/.gradle/daemon 2>/dev/null; rm -rf /root/.gradle/caches/*/scripts /root/.gradle/caches/jars-* 2>/dev/null; rm -rf /root/.cache/bazel 2>/dev/null; true +if [ "$LATER" -gt 0 ]; then + mv "$CWD/.git" "$M/git-hidden" + echo "history not truncated at ${BASE:0:12}: .git hidden while the agent works" +fi +write_blocklist + +touch "$M/ready" +echo "setup done" diff --git a/tasks/format-code-task-001052/tests/test.patch b/tasks/format-code-task-001052/tests/test.patch new file mode 100644 index 0000000000000000000000000000000000000000..bd013be70a8ad07b1bf9a8a2929921c5baae94af --- /dev/null +++ b/tasks/format-code-task-001052/tests/test.patch @@ -0,0 +1,136 @@ +diff --git a/cirq/measurement_key_mapping_test.py b/cirq/measurement_key_mapping_test.py +new file mode 100644 +index 00000000..11111111 +--- /dev/null ++++ b/cirq/measurement_key_mapping_test.py +@@ -0,0 +1,117 @@ ++import pytest ++ ++import cirq ++ ++ ++def test_protocol_dispatches_to_magic_method(): ++ class Carrier: ++ def _with_measurement_key_mapping_(self, key_map): ++ return ('mapped', key_map) ++ ++ assert cirq.with_measurement_key_mapping( ++ Carrier(), {'old': 'new'}) == ('mapped', {'old': 'new'}) ++ ++ ++def test_protocol_no_method_fallback_and_error(): ++ assert cirq.with_measurement_key_mapping( ++ object(), {'old': 'new'}, default=None) is None ++ with pytest.raises(TypeError, match='with_measurement_key_mapping'): ++ cirq.with_measurement_key_mapping(object(), {'old': 'new'}) ++ ++ ++def test_protocol_not_implemented_fallback_and_error(): ++ class ReturnsNotImplemented: ++ def _with_measurement_key_mapping_(self, key_map): ++ return NotImplemented ++ ++ assert cirq.with_measurement_key_mapping( ++ ReturnsNotImplemented(), {'old': 'new'}, default='unchanged') == 'unchanged' ++ with pytest.raises(TypeError, match='with_measurement_key_mapping'): ++ cirq.with_measurement_key_mapping( ++ ReturnsNotImplemented(), {'old': 'new'}) ++ ++ ++def test_measurement_gate_mapping_is_simultaneous_and_keeps_unmapped_keys(): ++ gate = cirq.MeasurementGate(2, key='a', invert_mask=(True, False)) ++ mapped = cirq.with_measurement_key_mapping(gate, {'a': 'b', 'b': 'c'}) ++ ++ assert isinstance(mapped, cirq.MeasurementGate) ++ assert mapped.key == 'b' ++ assert cirq.with_measurement_key_mapping( ++ cirq.MeasurementGate(1, key='untouched'), {'a': 'b'}).key == 'untouched' ++ ++ ++def test_measurement_gate_mapping_preserves_metadata_and_source(): ++ gate = cirq.MeasurementGate(2, key='a', invert_mask=(True, False)) ++ mapped = cirq.with_measurement_key_mapping(gate, {'a': 'renamed'}) ++ ++ assert mapped.num_qubits() == 2 ++ assert mapped.invert_mask == (True, False) ++ assert gate.key == 'a' ++ ++ ++def test_gate_operation_propagates_mapping_and_leaves_other_ops_equal(): ++ q0 = cirq.LineQubit(0) ++ op = cirq.MeasurementGate(1, key='m', invert_mask=(True,)).on(q0) ++ mapped_op = cirq.with_measurement_key_mapping(op, {'m': 'renamed'}) ++ assert mapped_op.qubits == op.qubits ++ assert mapped_op.gate.key == 'renamed' ++ assert mapped_op.gate.invert_mask == (True,) ++ non_measurement = cirq.X(q0) ++ assert cirq.with_measurement_key_mapping( ++ non_measurement, {'m': 'renamed'}) == non_measurement ++ ++ ++def test_controlled_operation_propagates_mapping(): ++ q0, q1 = cirq.LineQubit.range(2) ++ ++ controlled = cirq.ControlledOperation([q0], cirq.measure(q1, key='m')) ++ mapped_controlled = cirq.with_measurement_key_mapping( ++ controlled, {'m': 'renamed'}) ++ assert isinstance(mapped_controlled, cirq.ControlledOperation) ++ assert mapped_controlled.controls == controlled.controls ++ assert mapped_controlled.sub_operation.gate.key == 'renamed' ++ ++ ++def _circuit_with_two_measurements(): ++ q0, q1 = cirq.GridQubit(0, 0), cirq.GridQubit(0, 1) ++ return cirq.Circuit.from_ops( ++ cirq.measure(q0, key='a', invert_mask=(True,)), ++ cirq.X(q1), ++ cirq.measure(q1, key='b'), ++ device=cirq.google.Foxtail) ++ ++ ++def test_moment_mapping_preserves_structure(): ++ circuit = _circuit_with_two_measurements() ++ q1 = cirq.GridQubit(0, 1) ++ ++ mapped_moment = cirq.with_measurement_key_mapping( ++ circuit[0], {'a': 'b', 'b': 'c'}) ++ assert [cirq.measurement_key(op) for op in mapped_moment.operations ++ if cirq.is_measurement(op)] == ['b'] ++ assert mapped_moment.operations[0].gate.invert_mask == (True,) ++ assert mapped_moment.operations[1] == cirq.X(q1) ++ ++ ++def test_circuit_mapping_preserves_structure_device_and_source(): ++ circuit = _circuit_with_two_measurements() ++ device = circuit.device ++ ++ mapped = cirq.with_measurement_key_mapping(circuit, {'a': 'b', 'b': 'c'}) ++ assert mapped is not circuit ++ assert mapped.device is device ++ assert len(mapped) == len(circuit) ++ assert [cirq.measurement_key(op) for op in mapped.all_operations() ++ if cirq.is_measurement(op)] == ['b', 'c'] ++ assert [cirq.measurement_key(op) for op in circuit.all_operations() ++ if cirq.is_measurement(op)] == ['a', 'b'] ++ ++ ++def test_circuit_mapping_is_visible_in_qasm(): ++ mapped = cirq.with_measurement_key_mapping( ++ _circuit_with_two_measurements(), {'a': 'b', 'b': 'c'}) ++ qasm = cirq.qasm(mapped) ++ assert "m_b[0]" in qasm ++ assert "m_c[0]" in qasm ++ assert "m_a[0]" not in qasm +diff --git a/mimo_test_command.sh b/mimo_test_command.sh +new file mode 100755 +--- /dev/null ++++ b/mimo_test_command.sh +@@ -0,0 +1,8 @@ ++#!/bin/bash ++set -euo pipefail ++ ++/opt/cirq_venv/bin/python -m pytest -q -W ignore::DeprecationWarning \ ++ cirq/measurement_key_mapping_test.py \ ++ cirq/protocols/measurement_key_test.py \ ++ cirq/ops/common_gates_test.py \ ++ -k measurement diff --git a/tasks/format-code-task-001052/tests/test.sh b/tasks/format-code-task-001052/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..ab131740d6ac2550dc478f8ec52e238b336297a8 --- /dev/null +++ b/tasks/format-code-task-001052/tests/test.sh @@ -0,0 +1,38 @@ +#!/bin/bash +# Code grading, mimoagent opensource_code.py: reset the files the hidden test patch touches, apply it, run the +# task's test command; reward 1 when it exits 0. A testbed failure (reset or apply) writes no reward: not scored. +M=/var/lib/mimo +CWD=/testbed +V=/logs/verifier +mkdir -p "$V" +BASE=$(cat "$M/base" 2>/dev/null) || { echo "setup never ran (no $M/base)" >&2; exit 1; } +cd "$CWD" || exit 1 +if [ -d "$M/git-hidden" ]; then rm -rf "$CWD/.git"; mv "$M/git-hidden" "$CWD/.git"; fi +# the agent's change against the base, so its own commits count too +git add -A >/dev/null 2>&1 && git -c core.fileMode=false diff --cached "$BASE" > "$V/agent.diff" +git reset -q +if ! ( +while IFS= read -r tf; do + [ -z "$tf" ] && continue + if git cat-file -e $BASE:"$tf" 2>/dev/null; then + git checkout $BASE -- "$tf" 2>/dev/null || true + else + git rm -f --cached "$tf" >/dev/null 2>&1 || true + rm -f "$tf" + fi +done <<'EOF_RESET_TEST_FILES' +cirq/measurement_key_mapping_test.py +mimo_test_command.sh +EOF_RESET_TEST_FILES + +); then echo "could not reset the test files (testbed problem, not scored)" >&2; exit 1; fi +if ! git apply --verbose /tests/test.patch > "$V/apply.log" 2>&1; then + cat "$V/apply.log" >&2 + echo "the hidden tests could not be applied (testbed problem, not scored)" >&2 + exit 1 +fi +timeout 1800 sh -c "$(cat /tests/test_command.sh)" > "$V/test_output.log" 2>&1 +RC=$? +tail -c 12000 "$V/test_output.log" +if [ $RC -eq 0 ]; then echo 1 > "$V/reward.txt"; else echo 0 > "$V/reward.txt"; fi +echo "test command exited $RC" diff --git a/tasks/format-code-task-001052/tests/test_command.sh b/tasks/format-code-task-001052/tests/test_command.sh new file mode 100644 index 0000000000000000000000000000000000000000..7cb23076694ad17d72e8296d62b2b240083e36db --- /dev/null +++ b/tasks/format-code-task-001052/tests/test_command.sh @@ -0,0 +1 @@ +bash /testbed/mimo_test_command.sh \ No newline at end of file diff --git a/tasks/format-code-task-001099/environment/Dockerfile b/tasks/format-code-task-001099/environment/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..575a5417c69cc017f72755102739a699d4c0313d --- /dev/null +++ b/tasks/format-code-task-001099/environment/Dockerfile @@ -0,0 +1,3 @@ +# The task's image, pinned by digest (the same as [environment].docker_image). +# Setup runs at start from [environment.healthcheck]; environment/setup/ is its readable copy. +FROM docker.io/xiaomimimo/mimo-v2.6-rl-oss@sha256:df7052ca5896ec8013dca38f3f59b77a192bbd93c5ca456e2010179e8a5c9d71 diff --git a/tasks/format-code-task-001099/environment/setup/files/blocklist b/tasks/format-code-task-001099/environment/setup/files/blocklist new file mode 100644 index 0000000000000000000000000000000000000000..a8e4bdc4c7d9b739c047a3cb58ea72a1bb05bcbc --- /dev/null +++ b/tasks/format-code-task-001099/environment/setup/files/blocklist @@ -0,0 +1,33 @@ +# mimo answer-leak blocklist (mimoagent) +0.0.0.0 github.com +0.0.0.0 www.github.com +0.0.0.0 api.github.com +0.0.0.0 raw.githubusercontent.com +0.0.0.0 codeload.github.com +0.0.0.0 objects.githubusercontent.com +0.0.0.0 gist.github.com +0.0.0.0 gist.githubusercontent.com +0.0.0.0 gitlab.com +0.0.0.0 bitbucket.org +0.0.0.0 sourceforge.net +0.0.0.0 git.kernel.org +0.0.0.0 chromium.googlesource.com +0.0.0.0 android.googlesource.com +0.0.0.0 sourcegraph.com +0.0.0.0 bugs.chromium.org +0.0.0.0 issues.oss-fuzz.com +0.0.0.0 oss-fuzz.com +0.0.0.0 osv.dev +0.0.0.0 api.osv.dev +0.0.0.0 bugzilla.mozilla.org +0.0.0.0 proxy.golang.org +0.0.0.0 sum.golang.org +0.0.0.0 pkg.go.dev +0.0.0.0 google.com +0.0.0.0 www.google.com +0.0.0.0 bing.com +0.0.0.0 www.bing.com +0.0.0.0 duckduckgo.com +0.0.0.0 html.duckduckgo.com +0.0.0.0 search.brave.com +0.0.0.0 stackoverflow.com diff --git a/tasks/format-code-task-001099/environment/setup/setup.sh b/tasks/format-code-task-001099/environment/setup/setup.sh new file mode 100644 index 0000000000000000000000000000000000000000..d883db90cfcfb48f7a139861bbe9f6b5d95cad6f --- /dev/null +++ b/tasks/format-code-task-001099/environment/setup/setup.sh @@ -0,0 +1,34 @@ +#!/bin/bash +# Runs once, as root, before the agent starts: Harbor's [environment.healthcheck] unpacks this folder into +# /var/lib/mimo and runs it. Generated by mimo_harbor; see its README for how each step maps to Xiaomi's harness. +M=/var/lib/mimo +[ -f "$M/ready" ] && exit 0 +chmod 700 "$M" +fail() { echo "setup: $*" >&2; exit 1; } +# the answer-leak blocklist (mimoagent), applied to /etc/hosts by the agent right after it installs +write_blocklist() { cp "$M/files/blocklist" "$M/blocklist"; } + +# Code: mimoagent environments/datasets/opensource_code.py + base.py, as the explorer runs it (app/runner/domains.py Code). +CWD=/testbed +git config --global --add safe.directory "$CWD" +cd "$CWD" || fail "no working directory $CWD" +if ! git rev-parse --git-dir >/dev/null 2>&1; then # a bare source tree: give it a baseline commit + git init -q && git add -A && git -c user.name=mimo -c user.email=mimo@localhost commit -q -m baseline --allow-empty +fi +BASE=$(git rev-parse HEAD 2>/dev/null) +[ ${#BASE} -eq 40 ] || fail "could not resolve the base commit in $CWD" +echo "$BASE" > "$M/base" +# Images are built with history truncated at the base. If one is not, the fix could be read out of git log, +# so .git is hidden while the agent works and put back for grading. +LATER=$(git rev-list --all --not "$BASE" 2>/dev/null | head -n 5 | grep -c . || true) +rm -f /tmp/fail.log /tmp/pass.log /tmp/patch.diff /tmp/test_patch.diff /tmp/*.log 2>/dev/null; rm -rf /tmp/claude-0 /tmp/claude-* /tmp/testem-* /tmp/puppeteer_dev_chrome_profile-* 2>/dev/null; rm -f /tmp/test_files.json 2>/dev/null; rm -rf /tmp/jest_* /tmp/jest-* /tmp/build /tmp/build_env 2>/dev/null; rm -rf /tmp/pytest-of-root /tmp/pytest-* /tmp/.pytest_cache /tmp/__pycache__ 2>/dev/null; rm -rf /tmp/go-build* /tmp/standards /tmp/wordpress /tmp/zig-* /tmp/testbase /tmp/testbed 2>/dev/null; rm -f /tmp/tmp*.tmp /tmp/*.bak /tmp/expect* /tmp/butwas* 2>/dev/null; rm -rf /root/.cache/go-build 2>/dev/null; rm -rf /tests 2>/dev/null; find /logs -mindepth 1 -delete 2>/dev/null; mkdir -p /logs/agent /logs/verifier /logs/artifacts; chmod 777 /logs/agent /logs/verifier /logs/artifacts; find /var/log -type f -delete 2>/dev/null || true; rm -rf /var/lib/postgresql/*/*/log /var/lib/postgresql/*/*/pg_log 2>/dev/null || true; find /var/lib/mysql /var/lib/mongodb -type f -name '*.log' -delete 2>/dev/null || true; rm -rf /root/.npm/_logs /root/.babel.json /root/.pytest_cache 2>/dev/null || true; find / -maxdepth 4 -xdev -name task_description.md -path '*/.build_env/*' -delete 2>/dev/null || true; true +git clean -fdx --exclude=node_modules --exclude=bower_components --exclude=.husky --exclude=vendor --exclude=third_party --exclude=_deps --exclude=vcpkg_installed --exclude=.venv --exclude=venv --exclude=.gradle --exclude=target --exclude=.build --exclude=lib --exclude=.bundle --exclude=Manifest.toml --exclude=_build --exclude=.stack-work --exclude=dist-newstyle >/dev/null 2>&1 +find /root/.m2 -type f \( -name '*-SNAPSHOT.jar' -o -name '*-SNAPSHOT-sources.jar' -o -name '*-SNAPSHOT-tests.jar' -o -name '*-SNAPSHOT-test-sources.jar' \) -delete 2>/dev/null; rm -rf /root/.julia/compiled 2>/dev/null; rm -rf /root/.gradle/caches/build-cache-* /root/.gradle/daemon 2>/dev/null; rm -rf /root/.gradle/caches/*/scripts /root/.gradle/caches/jars-* 2>/dev/null; rm -rf /root/.cache/bazel 2>/dev/null; true +if [ "$LATER" -gt 0 ]; then + mv "$CWD/.git" "$M/git-hidden" + echo "history not truncated at ${BASE:0:12}: .git hidden while the agent works" +fi +write_blocklist + +touch "$M/ready" +echo "setup done" diff --git a/tasks/format-code-task-001099/tests/test.patch b/tasks/format-code-task-001099/tests/test.patch new file mode 100644 index 0000000000000000000000000000000000000000..3acfce0f2a49f27876a3047a4d20df6962293244 --- /dev/null +++ b/tasks/format-code-task-001099/tests/test.patch @@ -0,0 +1,198 @@ +diff --git a/test/azure/storage/list-pagination-contract-test.js b/test/azure/storage/list-pagination-contract-test.js +new file mode 100644 +index 00000000..af6cd7be +--- /dev/null ++++ b/test/azure/storage/list-pagination-contract-test.js +@@ -0,0 +1,178 @@ ++'use strict'; ++ ++var assert = require('assert'); ++var nock = require('nock'); ++var pkgcloud = require('../../../lib/pkgcloud'); ++ ++var endpoint = 'http://test-storage-account.blob.core.windows.net'; ++var options = { ++ provider: 'azure', ++ storageAccount: 'test-storage-account', ++ storageAccessKey: 'test-storage-access-key' ++}; ++ ++function client() { ++ return pkgcloud.storage.createClient(options); ++} ++ ++function getContainers(c) { ++ return new Promise(function (resolve, reject) { ++ c.getContainers(function (err, value) { ++ if (err) return reject(err); ++ resolve(value); ++ }); ++ }); ++} ++ ++function getFiles(c, container) { ++ return new Promise(function (resolve, reject) { ++ c.getFiles(container, false, function (err, value) { ++ if (err) return reject(err); ++ resolve(value); ++ }); ++ }); ++} ++ ++function getContainersError(c) { ++ return new Promise(function (resolve) { ++ var calls = 0; ++ c.getContainers(function (err, value) { ++ calls++; ++ setImmediate(function () { resolve({ err: err, value: value, calls: calls }); }); ++ }); ++ }); ++} ++ ++function getFilesError(c, container) { ++ return new Promise(function (resolve) { ++ var calls = 0; ++ c.getFiles(container, false, function (err, value) { ++ calls++; ++ setImmediate(function () { resolve({ err: err, value: value, calls: calls }); }); ++ }); ++ }); ++} ++ ++function getFilesWithoutDownload(c, container) { ++ return new Promise(function (resolve, reject) { ++ c.getFiles(container, function (err, value) { ++ if (err) return reject(err); ++ resolve(value); ++ }); ++ }); ++} ++ ++async function run() { ++ var containersPage1 = '' + ++ 'alpha' + ++ 'beta' + ++ 'page 2/+'; ++ var containersPage2 = '' + ++ 'gamma' + ++ ''; ++ ++ var seenContainerMarker; ++ var containerScope = nock(endpoint) ++ .filteringPath(function (path) { ++ if (path.indexOf('marker=') !== -1) { ++ seenContainerMarker = path; ++ return '/?comp=list&marker=TOKEN'; ++ } ++ return '/?comp=list'; ++ }) ++ .get('/?comp=list').reply(200, containersPage1) ++ .get('/?comp=list&marker=TOKEN').reply(200, containersPage2); ++ var containers = await getContainers(client()); ++ assert.deepStrictEqual(containers.map(function (item) { return item.name; }), ++ ['alpha', 'beta', 'gamma']); ++ assert.ok(seenContainerMarker.indexOf('marker=page%202%2F%2B') !== -1); ++ assert.ok(seenContainerMarker.indexOf('comp=list') !== -1); ++ containers.forEach(function (item) { ++ assert.strictEqual(item.constructor.name, 'Container'); ++ }); ++ assert.strictEqual(containerScope.isDone(), true); ++ ++ var emptyContainerScope = nock(endpoint) ++ .get('/?comp=list').reply(200, ++ ''); ++ assert.deepStrictEqual(await getContainers(client()), []); ++ assert.strictEqual(emptyContainerScope.isDone(), true); ++ ++ var filesPage1 = '' + ++ 'one.txt3' + ++ 'two.txt4' + ++ 'resume-token'; ++ var filesPage2 = '' + ++ 'three.txt5' + ++ ''; ++ var seenFileMarker; ++ var filesScope = nock(endpoint) ++ .filteringPath(function (path) { ++ if (path.indexOf('marker=') !== -1) { ++ seenFileMarker = path; ++ return '/docs?restype=container&comp=list&marker=TOKEN'; ++ } ++ return '/docs?restype=container&comp=list'; ++ }) ++ .get('/docs?restype=container&comp=list').reply(200, filesPage1) ++ .get('/docs?restype=container&comp=list&marker=TOKEN').reply(200, filesPage2); ++ var files = await getFiles(client(), 'docs'); ++ assert.deepStrictEqual(files.map(function (item) { return item.name; }), ++ ['one.txt', 'two.txt', 'three.txt']); ++ assert.ok(seenFileMarker.indexOf('marker=resume-token') !== -1); ++ assert.ok(seenFileMarker.indexOf('comp=list') !== -1); ++ assert.ok(seenFileMarker.indexOf('restype=container') !== -1); ++ files.forEach(function (item) { ++ assert.strictEqual(item.constructor.name, 'File'); ++ assert.strictEqual(item.container, 'docs'); ++ }); ++ assert.strictEqual(filesScope.isDone(), true); ++ ++ var emptyFilesScope = nock(endpoint) ++ .filteringPath(function (path) { ++ return path.indexOf('/docs?') === 0 ? '/docs?LIST' : path; ++ }) ++ .get('/docs?LIST').reply(200, ++ ''); ++ assert.deepStrictEqual(await getFilesWithoutDownload(client(), 'docs'), []); ++ assert.strictEqual(emptyFilesScope.isDone(), true); ++ ++ var containerErrorScope = nock(endpoint) ++ .filteringPath(function (path) { ++ return path.indexOf('marker=') === -1 ? '/?comp=list' : '/?comp=list&marker=TOKEN'; ++ }) ++ .get('/?comp=list').reply(200, '' + ++ 'not-returned' + ++ 'next') ++ .get('/?comp=list&marker=TOKEN').reply(503, 'temporarily unavailable'); ++ var containerFailure = await getContainersError(client()); ++ assert.ok(containerFailure.err); ++ assert.strictEqual(containerFailure.err.provider, 'azure'); ++ assert.strictEqual(containerFailure.err.failCode, 'Service Unavailable'); ++ assert.strictEqual(containerFailure.value, undefined); ++ assert.strictEqual(containerFailure.calls, 1); ++ assert.strictEqual(containerErrorScope.isDone(), true); ++ ++ var fileErrorScope = nock(endpoint) ++ .filteringPath(function (path) { ++ return path.indexOf('marker=') === -1 ? '/docs?LIST' : '/docs?LIST&marker=TOKEN'; ++ }) ++ .get('/docs?LIST').reply(200, '' + ++ 'not-returned.txt' + ++ 'next') ++ .get('/docs?LIST&marker=TOKEN').reply(500, 'backend failure'); ++ var fileFailure = await getFilesError(client(), 'docs'); ++ assert.ok(fileFailure.err); ++ assert.strictEqual(fileFailure.err.provider, 'azure'); ++ assert.strictEqual(fileFailure.err.failCode, 'Fault'); ++ assert.strictEqual(fileFailure.value, undefined); ++ assert.strictEqual(fileFailure.calls, 1); ++ assert.strictEqual(fileErrorScope.isDone(), true); ++} ++ ++run().then(function () { ++ process.stdout.write('azure listing contract passed\n'); ++}).catch(function (err) { ++ process.stderr.write((err && err.stack) || String(err)); ++ process.exitCode = 1; ++}); +diff --git a/mimo_test_command.sh b/mimo_test_command.sh +new file mode 100755 +--- /dev/null ++++ b/mimo_test_command.sh +@@ -0,0 +1,9 @@ ++#!/bin/bash ++set -euo pipefail ++ ++ ++ ++export NO_PROXY="*" ++export no_proxy="*" ++ ++node test/azure/storage/list-pagination-contract-test.js diff --git a/tasks/format-code-task-001099/tests/test.sh b/tasks/format-code-task-001099/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..18bada3d4073ecb88567d7b2936966b61a38db26 --- /dev/null +++ b/tasks/format-code-task-001099/tests/test.sh @@ -0,0 +1,38 @@ +#!/bin/bash +# Code grading, mimoagent opensource_code.py: reset the files the hidden test patch touches, apply it, run the +# task's test command; reward 1 when it exits 0. A testbed failure (reset or apply) writes no reward: not scored. +M=/var/lib/mimo +CWD=/testbed +V=/logs/verifier +mkdir -p "$V" +BASE=$(cat "$M/base" 2>/dev/null) || { echo "setup never ran (no $M/base)" >&2; exit 1; } +cd "$CWD" || exit 1 +if [ -d "$M/git-hidden" ]; then rm -rf "$CWD/.git"; mv "$M/git-hidden" "$CWD/.git"; fi +# the agent's change against the base, so its own commits count too +git add -A >/dev/null 2>&1 && git -c core.fileMode=false diff --cached "$BASE" > "$V/agent.diff" +git reset -q +if ! ( +while IFS= read -r tf; do + [ -z "$tf" ] && continue + if git cat-file -e $BASE:"$tf" 2>/dev/null; then + git checkout $BASE -- "$tf" 2>/dev/null || true + else + git rm -f --cached "$tf" >/dev/null 2>&1 || true + rm -f "$tf" + fi +done <<'EOF_RESET_TEST_FILES' +test/azure/storage/list-pagination-contract-test.js +mimo_test_command.sh +EOF_RESET_TEST_FILES + +); then echo "could not reset the test files (testbed problem, not scored)" >&2; exit 1; fi +if ! git apply --verbose /tests/test.patch > "$V/apply.log" 2>&1; then + cat "$V/apply.log" >&2 + echo "the hidden tests could not be applied (testbed problem, not scored)" >&2 + exit 1 +fi +timeout 1800 sh -c "$(cat /tests/test_command.sh)" > "$V/test_output.log" 2>&1 +RC=$? +tail -c 12000 "$V/test_output.log" +if [ $RC -eq 0 ]; then echo 1 > "$V/reward.txt"; else echo 0 > "$V/reward.txt"; fi +echo "test command exited $RC" diff --git a/tasks/format-code-task-001099/tests/test_command.sh b/tasks/format-code-task-001099/tests/test_command.sh new file mode 100644 index 0000000000000000000000000000000000000000..7cb23076694ad17d72e8296d62b2b240083e36db --- /dev/null +++ b/tasks/format-code-task-001099/tests/test_command.sh @@ -0,0 +1 @@ +bash /testbed/mimo_test_command.sh \ No newline at end of file diff --git a/tasks/format-code-task-001205/environment/Dockerfile b/tasks/format-code-task-001205/environment/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..239940ce9008a634c7b235881e8e3b08cc8def25 --- /dev/null +++ b/tasks/format-code-task-001205/environment/Dockerfile @@ -0,0 +1,3 @@ +# The task's image, pinned by digest (the same as [environment].docker_image). +# Setup runs at start from [environment.healthcheck]; environment/setup/ is its readable copy. +FROM docker.io/xiaomimimo/mimo-v2.6-rl-oss@sha256:84d90c476a0642c22b6af1e6deafadd24ee1294b5cb46663a9f1ff9158026cea diff --git a/tasks/format-code-task-001205/environment/setup/files/blocklist b/tasks/format-code-task-001205/environment/setup/files/blocklist new file mode 100644 index 0000000000000000000000000000000000000000..a8e4bdc4c7d9b739c047a3cb58ea72a1bb05bcbc --- /dev/null +++ b/tasks/format-code-task-001205/environment/setup/files/blocklist @@ -0,0 +1,33 @@ +# mimo answer-leak blocklist (mimoagent) +0.0.0.0 github.com +0.0.0.0 www.github.com +0.0.0.0 api.github.com +0.0.0.0 raw.githubusercontent.com +0.0.0.0 codeload.github.com +0.0.0.0 objects.githubusercontent.com +0.0.0.0 gist.github.com +0.0.0.0 gist.githubusercontent.com +0.0.0.0 gitlab.com +0.0.0.0 bitbucket.org +0.0.0.0 sourceforge.net +0.0.0.0 git.kernel.org +0.0.0.0 chromium.googlesource.com +0.0.0.0 android.googlesource.com +0.0.0.0 sourcegraph.com +0.0.0.0 bugs.chromium.org +0.0.0.0 issues.oss-fuzz.com +0.0.0.0 oss-fuzz.com +0.0.0.0 osv.dev +0.0.0.0 api.osv.dev +0.0.0.0 bugzilla.mozilla.org +0.0.0.0 proxy.golang.org +0.0.0.0 sum.golang.org +0.0.0.0 pkg.go.dev +0.0.0.0 google.com +0.0.0.0 www.google.com +0.0.0.0 bing.com +0.0.0.0 www.bing.com +0.0.0.0 duckduckgo.com +0.0.0.0 html.duckduckgo.com +0.0.0.0 search.brave.com +0.0.0.0 stackoverflow.com diff --git a/tasks/format-code-task-001205/environment/setup/setup.sh b/tasks/format-code-task-001205/environment/setup/setup.sh new file mode 100644 index 0000000000000000000000000000000000000000..d883db90cfcfb48f7a139861bbe9f6b5d95cad6f --- /dev/null +++ b/tasks/format-code-task-001205/environment/setup/setup.sh @@ -0,0 +1,34 @@ +#!/bin/bash +# Runs once, as root, before the agent starts: Harbor's [environment.healthcheck] unpacks this folder into +# /var/lib/mimo and runs it. Generated by mimo_harbor; see its README for how each step maps to Xiaomi's harness. +M=/var/lib/mimo +[ -f "$M/ready" ] && exit 0 +chmod 700 "$M" +fail() { echo "setup: $*" >&2; exit 1; } +# the answer-leak blocklist (mimoagent), applied to /etc/hosts by the agent right after it installs +write_blocklist() { cp "$M/files/blocklist" "$M/blocklist"; } + +# Code: mimoagent environments/datasets/opensource_code.py + base.py, as the explorer runs it (app/runner/domains.py Code). +CWD=/testbed +git config --global --add safe.directory "$CWD" +cd "$CWD" || fail "no working directory $CWD" +if ! git rev-parse --git-dir >/dev/null 2>&1; then # a bare source tree: give it a baseline commit + git init -q && git add -A && git -c user.name=mimo -c user.email=mimo@localhost commit -q -m baseline --allow-empty +fi +BASE=$(git rev-parse HEAD 2>/dev/null) +[ ${#BASE} -eq 40 ] || fail "could not resolve the base commit in $CWD" +echo "$BASE" > "$M/base" +# Images are built with history truncated at the base. If one is not, the fix could be read out of git log, +# so .git is hidden while the agent works and put back for grading. +LATER=$(git rev-list --all --not "$BASE" 2>/dev/null | head -n 5 | grep -c . || true) +rm -f /tmp/fail.log /tmp/pass.log /tmp/patch.diff /tmp/test_patch.diff /tmp/*.log 2>/dev/null; rm -rf /tmp/claude-0 /tmp/claude-* /tmp/testem-* /tmp/puppeteer_dev_chrome_profile-* 2>/dev/null; rm -f /tmp/test_files.json 2>/dev/null; rm -rf /tmp/jest_* /tmp/jest-* /tmp/build /tmp/build_env 2>/dev/null; rm -rf /tmp/pytest-of-root /tmp/pytest-* /tmp/.pytest_cache /tmp/__pycache__ 2>/dev/null; rm -rf /tmp/go-build* /tmp/standards /tmp/wordpress /tmp/zig-* /tmp/testbase /tmp/testbed 2>/dev/null; rm -f /tmp/tmp*.tmp /tmp/*.bak /tmp/expect* /tmp/butwas* 2>/dev/null; rm -rf /root/.cache/go-build 2>/dev/null; rm -rf /tests 2>/dev/null; find /logs -mindepth 1 -delete 2>/dev/null; mkdir -p /logs/agent /logs/verifier /logs/artifacts; chmod 777 /logs/agent /logs/verifier /logs/artifacts; find /var/log -type f -delete 2>/dev/null || true; rm -rf /var/lib/postgresql/*/*/log /var/lib/postgresql/*/*/pg_log 2>/dev/null || true; find /var/lib/mysql /var/lib/mongodb -type f -name '*.log' -delete 2>/dev/null || true; rm -rf /root/.npm/_logs /root/.babel.json /root/.pytest_cache 2>/dev/null || true; find / -maxdepth 4 -xdev -name task_description.md -path '*/.build_env/*' -delete 2>/dev/null || true; true +git clean -fdx --exclude=node_modules --exclude=bower_components --exclude=.husky --exclude=vendor --exclude=third_party --exclude=_deps --exclude=vcpkg_installed --exclude=.venv --exclude=venv --exclude=.gradle --exclude=target --exclude=.build --exclude=lib --exclude=.bundle --exclude=Manifest.toml --exclude=_build --exclude=.stack-work --exclude=dist-newstyle >/dev/null 2>&1 +find /root/.m2 -type f \( -name '*-SNAPSHOT.jar' -o -name '*-SNAPSHOT-sources.jar' -o -name '*-SNAPSHOT-tests.jar' -o -name '*-SNAPSHOT-test-sources.jar' \) -delete 2>/dev/null; rm -rf /root/.julia/compiled 2>/dev/null; rm -rf /root/.gradle/caches/build-cache-* /root/.gradle/daemon 2>/dev/null; rm -rf /root/.gradle/caches/*/scripts /root/.gradle/caches/jars-* 2>/dev/null; rm -rf /root/.cache/bazel 2>/dev/null; true +if [ "$LATER" -gt 0 ]; then + mv "$CWD/.git" "$M/git-hidden" + echo "history not truncated at ${BASE:0:12}: .git hidden while the agent works" +fi +write_blocklist + +touch "$M/ready" +echo "setup done" diff --git a/tasks/format-code-task-001205/tests/test.patch b/tasks/format-code-task-001205/tests/test.patch new file mode 100644 index 0000000000000000000000000000000000000000..388dbbdeaf42f93177ed208b3f656a265172ca5e --- /dev/null +++ b/tasks/format-code-task-001205/tests/test.patch @@ -0,0 +1,35 @@ +diff --git a/tests/notifier/notifiers/slack_webhook_test.py b/tests/notifier/notifiers/slack_webhook_test.py +index 8c1424163a..76b38bc61c 100644 +--- a/tests/notifier/notifiers/slack_webhook_test.py ++++ b/tests/notifier/notifiers/slack_webhook_test.py +@@ -56,7 +56,7 @@ def test_no_url_no_run_notifier(self): + """Test that no url for Slack notifier will skip running.""" + with mock.patch.object(slack_webhook.SlackWebhook, '__init__', lambda x: None): + slack_notifier = slack_webhook.SlackWebhook() +- slack_notifier.notifier_config = {} ++ slack_notifier.notification_config = {} + slack_notifier._compose = mock.MagicMock() + slack_notifier.run() + +diff --git a/mimo_build_env.tar.gz.b64 b/mimo_build_env.tar.gz.b64 +new file mode 100644 +--- /dev/null ++++ b/mimo_build_env.tar.gz.b64 +@@ -0,0 +1,6 @@ ++H4sIAAAAAAAAA+3STU+EMBAGYM78ignhoAcKVAFj4sGDyV6MHrwTPqqQhZbQLuq/t2DiGqPuZTcb ++4/sc6DAzSScMrNy0XZ0LOYXOoURWliTLaX09lzhOeMyjNMm47YvjNEodSg420ScbbYqRyBmVMr/1 ++7ar/UWy7fyO0ySvV94WsmW72d8eu/fMs2e4/OrP7P085dyja3wg/++f7r2paFl+K2nXFy6BGQ/fX ++D6srz1/d3d6EbHid/42ylZf+nPdcMRUdef7JUqBWtoaCYChMc/p9zabfX586VdoyZxmLL1ybNI2S ++FPRkIzsBzQ8dSmXax1aMH4EOdVdU6/xZlI1S63xus1NRMLnH/ngAAAAAAAAAAAAAAAAAAAAAAEf2 ++BjXXg6gAKAAA +diff --git a/mimo_test_command.sh b/mimo_test_command.sh +new file mode 100755 +--- /dev/null ++++ b/mimo_test_command.sh +@@ -0,0 +1,6 @@ ++#!/usr/bin/env bash ++ ++set -uo pipefail ++cd /testbed || exit 1 ++base64 -d mimo_build_env.tar.gz.b64 | tar -xzf - -C /testbed || exit 1 ++exec bash -lc 'cd /testbed && bash -eo pipefail /testbed/.build_env/test_command.sh' diff --git a/tasks/format-code-task-001205/tests/test.sh b/tasks/format-code-task-001205/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..4100c3b78c3ac7789a07a6f220099cc9e59c5d1e --- /dev/null +++ b/tasks/format-code-task-001205/tests/test.sh @@ -0,0 +1,39 @@ +#!/bin/bash +# Code grading, mimoagent opensource_code.py: reset the files the hidden test patch touches, apply it, run the +# task's test command; reward 1 when it exits 0. A testbed failure (reset or apply) writes no reward: not scored. +M=/var/lib/mimo +CWD=/testbed +V=/logs/verifier +mkdir -p "$V" +BASE=$(cat "$M/base" 2>/dev/null) || { echo "setup never ran (no $M/base)" >&2; exit 1; } +cd "$CWD" || exit 1 +if [ -d "$M/git-hidden" ]; then rm -rf "$CWD/.git"; mv "$M/git-hidden" "$CWD/.git"; fi +# the agent's change against the base, so its own commits count too +git add -A >/dev/null 2>&1 && git -c core.fileMode=false diff --cached "$BASE" > "$V/agent.diff" +git reset -q +if ! ( +while IFS= read -r tf; do + [ -z "$tf" ] && continue + if git cat-file -e $BASE:"$tf" 2>/dev/null; then + git checkout $BASE -- "$tf" 2>/dev/null || true + else + git rm -f --cached "$tf" >/dev/null 2>&1 || true + rm -f "$tf" + fi +done <<'EOF_RESET_TEST_FILES' +tests/notifier/notifiers/slack_webhook_test.py +mimo_build_env.tar.gz.b64 +mimo_test_command.sh +EOF_RESET_TEST_FILES + +); then echo "could not reset the test files (testbed problem, not scored)" >&2; exit 1; fi +if ! git apply --verbose /tests/test.patch > "$V/apply.log" 2>&1; then + cat "$V/apply.log" >&2 + echo "the hidden tests could not be applied (testbed problem, not scored)" >&2 + exit 1 +fi +timeout 1800 sh -c "$(cat /tests/test_command.sh)" > "$V/test_output.log" 2>&1 +RC=$? +tail -c 12000 "$V/test_output.log" +if [ $RC -eq 0 ]; then echo 1 > "$V/reward.txt"; else echo 0 > "$V/reward.txt"; fi +echo "test command exited $RC" diff --git a/tasks/format-code-task-001205/tests/test_command.sh b/tasks/format-code-task-001205/tests/test_command.sh new file mode 100644 index 0000000000000000000000000000000000000000..7cb23076694ad17d72e8296d62b2b240083e36db --- /dev/null +++ b/tasks/format-code-task-001205/tests/test_command.sh @@ -0,0 +1 @@ +bash /testbed/mimo_test_command.sh \ No newline at end of file diff --git a/tasks/format-code-task-001216/environment/Dockerfile b/tasks/format-code-task-001216/environment/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..be0b88a0858b0b79c1d06f4a924f061fabd9baf7 --- /dev/null +++ b/tasks/format-code-task-001216/environment/Dockerfile @@ -0,0 +1,3 @@ +# The task's image, pinned by digest (the same as [environment].docker_image). +# Setup runs at start from [environment.healthcheck]; environment/setup/ is its readable copy. +FROM docker.io/xiaomimimo/mimo-v2.6-rl-oss@sha256:0318c84ad4b0c99540fc5d1045b5a03244c52e71fa8da9a412020368f42f25ff diff --git a/tasks/format-code-task-001216/environment/setup/files/blocklist b/tasks/format-code-task-001216/environment/setup/files/blocklist new file mode 100644 index 0000000000000000000000000000000000000000..a8e4bdc4c7d9b739c047a3cb58ea72a1bb05bcbc --- /dev/null +++ b/tasks/format-code-task-001216/environment/setup/files/blocklist @@ -0,0 +1,33 @@ +# mimo answer-leak blocklist (mimoagent) +0.0.0.0 github.com +0.0.0.0 www.github.com +0.0.0.0 api.github.com +0.0.0.0 raw.githubusercontent.com +0.0.0.0 codeload.github.com +0.0.0.0 objects.githubusercontent.com +0.0.0.0 gist.github.com +0.0.0.0 gist.githubusercontent.com +0.0.0.0 gitlab.com +0.0.0.0 bitbucket.org +0.0.0.0 sourceforge.net +0.0.0.0 git.kernel.org +0.0.0.0 chromium.googlesource.com +0.0.0.0 android.googlesource.com +0.0.0.0 sourcegraph.com +0.0.0.0 bugs.chromium.org +0.0.0.0 issues.oss-fuzz.com +0.0.0.0 oss-fuzz.com +0.0.0.0 osv.dev +0.0.0.0 api.osv.dev +0.0.0.0 bugzilla.mozilla.org +0.0.0.0 proxy.golang.org +0.0.0.0 sum.golang.org +0.0.0.0 pkg.go.dev +0.0.0.0 google.com +0.0.0.0 www.google.com +0.0.0.0 bing.com +0.0.0.0 www.bing.com +0.0.0.0 duckduckgo.com +0.0.0.0 html.duckduckgo.com +0.0.0.0 search.brave.com +0.0.0.0 stackoverflow.com diff --git a/tasks/format-code-task-001216/environment/setup/setup.sh b/tasks/format-code-task-001216/environment/setup/setup.sh new file mode 100644 index 0000000000000000000000000000000000000000..d883db90cfcfb48f7a139861bbe9f6b5d95cad6f --- /dev/null +++ b/tasks/format-code-task-001216/environment/setup/setup.sh @@ -0,0 +1,34 @@ +#!/bin/bash +# Runs once, as root, before the agent starts: Harbor's [environment.healthcheck] unpacks this folder into +# /var/lib/mimo and runs it. Generated by mimo_harbor; see its README for how each step maps to Xiaomi's harness. +M=/var/lib/mimo +[ -f "$M/ready" ] && exit 0 +chmod 700 "$M" +fail() { echo "setup: $*" >&2; exit 1; } +# the answer-leak blocklist (mimoagent), applied to /etc/hosts by the agent right after it installs +write_blocklist() { cp "$M/files/blocklist" "$M/blocklist"; } + +# Code: mimoagent environments/datasets/opensource_code.py + base.py, as the explorer runs it (app/runner/domains.py Code). +CWD=/testbed +git config --global --add safe.directory "$CWD" +cd "$CWD" || fail "no working directory $CWD" +if ! git rev-parse --git-dir >/dev/null 2>&1; then # a bare source tree: give it a baseline commit + git init -q && git add -A && git -c user.name=mimo -c user.email=mimo@localhost commit -q -m baseline --allow-empty +fi +BASE=$(git rev-parse HEAD 2>/dev/null) +[ ${#BASE} -eq 40 ] || fail "could not resolve the base commit in $CWD" +echo "$BASE" > "$M/base" +# Images are built with history truncated at the base. If one is not, the fix could be read out of git log, +# so .git is hidden while the agent works and put back for grading. +LATER=$(git rev-list --all --not "$BASE" 2>/dev/null | head -n 5 | grep -c . || true) +rm -f /tmp/fail.log /tmp/pass.log /tmp/patch.diff /tmp/test_patch.diff /tmp/*.log 2>/dev/null; rm -rf /tmp/claude-0 /tmp/claude-* /tmp/testem-* /tmp/puppeteer_dev_chrome_profile-* 2>/dev/null; rm -f /tmp/test_files.json 2>/dev/null; rm -rf /tmp/jest_* /tmp/jest-* /tmp/build /tmp/build_env 2>/dev/null; rm -rf /tmp/pytest-of-root /tmp/pytest-* /tmp/.pytest_cache /tmp/__pycache__ 2>/dev/null; rm -rf /tmp/go-build* /tmp/standards /tmp/wordpress /tmp/zig-* /tmp/testbase /tmp/testbed 2>/dev/null; rm -f /tmp/tmp*.tmp /tmp/*.bak /tmp/expect* /tmp/butwas* 2>/dev/null; rm -rf /root/.cache/go-build 2>/dev/null; rm -rf /tests 2>/dev/null; find /logs -mindepth 1 -delete 2>/dev/null; mkdir -p /logs/agent /logs/verifier /logs/artifacts; chmod 777 /logs/agent /logs/verifier /logs/artifacts; find /var/log -type f -delete 2>/dev/null || true; rm -rf /var/lib/postgresql/*/*/log /var/lib/postgresql/*/*/pg_log 2>/dev/null || true; find /var/lib/mysql /var/lib/mongodb -type f -name '*.log' -delete 2>/dev/null || true; rm -rf /root/.npm/_logs /root/.babel.json /root/.pytest_cache 2>/dev/null || true; find / -maxdepth 4 -xdev -name task_description.md -path '*/.build_env/*' -delete 2>/dev/null || true; true +git clean -fdx --exclude=node_modules --exclude=bower_components --exclude=.husky --exclude=vendor --exclude=third_party --exclude=_deps --exclude=vcpkg_installed --exclude=.venv --exclude=venv --exclude=.gradle --exclude=target --exclude=.build --exclude=lib --exclude=.bundle --exclude=Manifest.toml --exclude=_build --exclude=.stack-work --exclude=dist-newstyle >/dev/null 2>&1 +find /root/.m2 -type f \( -name '*-SNAPSHOT.jar' -o -name '*-SNAPSHOT-sources.jar' -o -name '*-SNAPSHOT-tests.jar' -o -name '*-SNAPSHOT-test-sources.jar' \) -delete 2>/dev/null; rm -rf /root/.julia/compiled 2>/dev/null; rm -rf /root/.gradle/caches/build-cache-* /root/.gradle/daemon 2>/dev/null; rm -rf /root/.gradle/caches/*/scripts /root/.gradle/caches/jars-* 2>/dev/null; rm -rf /root/.cache/bazel 2>/dev/null; true +if [ "$LATER" -gt 0 ]; then + mv "$CWD/.git" "$M/git-hidden" + echo "history not truncated at ${BASE:0:12}: .git hidden while the agent works" +fi +write_blocklist + +touch "$M/ready" +echo "setup done" diff --git a/tasks/format-code-task-001216/tests/test.patch b/tasks/format-code-task-001216/tests/test.patch new file mode 100644 index 0000000000000000000000000000000000000000..c663471eaa9cb6f1a369a3d6db7b30c710704a4d --- /dev/null +++ b/tasks/format-code-task-001216/tests/test.patch @@ -0,0 +1,131 @@ +diff --git a/test_commands.json b/test_commands.json +new file mode 100644 +index 0000000..2c6a27d +--- /dev/null ++++ b/test_commands.json +@@ -0,0 +1,3 @@ ++{ ++ "test_commands": ["PYTHONPATH=src python -m pytest tests/test_main.py -k \"test_addheader_gitignore or test_addheader_gitattributes or test_addheader_gitmodules or test_addheader_unrecognised_filename_no_extension\" -v"] ++} +diff --git a/tests/test_main.py b/tests/test_main.py +index d7dc208..4662e81 100644 +--- a/tests/test_main.py ++++ b/tests/test_main.py +@@ -800,3 +800,104 @@ def test_addheader_license_file(fake_repository, stringio, mock_date_today): + ).replace("spdx", "SPDX") + ) + assert not simple_file.read_text() ++ ++ ++def test_addheader_gitignore(fake_repository, stringio, mock_date_today): ++ """Add a header to a .gitignore file (recognised by full filename).""" ++ simple_file = fake_repository / ".gitignore" ++ simple_file.write_text("*.pyc\nbuild/\n") ++ ++ result = main( ++ [ ++ "addheader", ++ "--license", ++ "CC0-1.0", ++ "--copyright", ++ "Mary Sue", ++ ".gitignore", ++ ], ++ out=stringio, ++ ) ++ ++ assert result == 0 ++ assert ( ++ simple_file.read_text() ++ == cleandoc( ++ """ ++ # spdx-FileCopyrightText: 2018 Mary Sue ++ # ++ # spdx-License-Identifier: CC0-1.0 ++ ++ *.pyc ++ build/ ++ """ ++ ).replace("spdx", "SPDX") ++ ) ++ ++ ++def test_addheader_gitattributes(fake_repository, stringio, mock_date_today): ++ """Add a header to a .gitattributes file (recognised by full filename).""" ++ simple_file = fake_repository / ".gitattributes" ++ simple_file.write_text("*.png binary\n") ++ ++ result = main( ++ [ ++ "addheader", ++ "--license", ++ "CC0-1.0", ++ "--copyright", ++ "Mary Sue", ++ ".gitattributes", ++ ], ++ out=stringio, ++ ) ++ ++ assert result == 0 ++ text = simple_file.read_text() ++ assert "# SPDX-FileCopyrightText: 2018 Mary Sue" in text ++ assert "# SPDX-License-Identifier: CC0-1.0" in text ++ assert "*.png binary" in text ++ ++ ++def test_addheader_gitmodules(fake_repository, stringio, mock_date_today): ++ """Add a header to a .gitmodules file (recognised by full filename).""" ++ simple_file = fake_repository / ".gitmodules" ++ simple_file.write_text('[submodule "foo"]\n\tpath = foo\n') ++ ++ result = main( ++ [ ++ "addheader", ++ "--license", ++ "CC0-1.0", ++ "--copyright", ++ "Mary Sue", ++ ".gitmodules", ++ ], ++ out=stringio, ++ ) ++ ++ assert result == 0 ++ text = simple_file.read_text() ++ assert "# SPDX-FileCopyrightText: 2018 Mary Sue" in text ++ assert "# SPDX-License-Identifier: CC0-1.0" in text ++ assert '[submodule "foo"]' in text ++ ++ ++def test_addheader_unrecognised_filename_no_extension(fake_repository): ++ """A text file with no extension and an unknown filename should still ++ error out — addheader must not silently treat every extensionless file ++ as a Python-style comment file.""" ++ simple_file = fake_repository / "Randomfile" ++ simple_file.write_text("some text content\n") ++ ++ with pytest.raises(SystemExit): ++ main( ++ [ ++ "addheader", ++ "--license", ++ "CC0-1.0", ++ "--copyright", ++ "Mary Sue", ++ "Randomfile", ++ ] ++ ) +diff --git a/mimo_test_command.sh b/mimo_test_command.sh +new file mode 100755 +--- /dev/null ++++ b/mimo_test_command.sh +@@ -0,0 +1,8 @@ ++#!/usr/bin/env bash ++ ++set -uo pipefail ++cd /testbed ++rc=0 ++PYTHONPATH=src python -m pytest -v -rA tests/test_main.py::test_addheader_gitignore tests/test_main.py::test_addheader_gitattributes tests/test_main.py::test_addheader_gitmodules tests/test_main.py::test_addheader_unrecognised_filename_no_extension ++rc=$(( rc | $? )) ++exit $rc diff --git a/tasks/format-code-task-001216/tests/test.sh b/tasks/format-code-task-001216/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..6e152e22473309ae424c03d51490cf70e358eb1f --- /dev/null +++ b/tasks/format-code-task-001216/tests/test.sh @@ -0,0 +1,39 @@ +#!/bin/bash +# Code grading, mimoagent opensource_code.py: reset the files the hidden test patch touches, apply it, run the +# task's test command; reward 1 when it exits 0. A testbed failure (reset or apply) writes no reward: not scored. +M=/var/lib/mimo +CWD=/testbed +V=/logs/verifier +mkdir -p "$V" +BASE=$(cat "$M/base" 2>/dev/null) || { echo "setup never ran (no $M/base)" >&2; exit 1; } +cd "$CWD" || exit 1 +if [ -d "$M/git-hidden" ]; then rm -rf "$CWD/.git"; mv "$M/git-hidden" "$CWD/.git"; fi +# the agent's change against the base, so its own commits count too +git add -A >/dev/null 2>&1 && git -c core.fileMode=false diff --cached "$BASE" > "$V/agent.diff" +git reset -q +if ! ( +while IFS= read -r tf; do + [ -z "$tf" ] && continue + if git cat-file -e $BASE:"$tf" 2>/dev/null; then + git checkout $BASE -- "$tf" 2>/dev/null || true + else + git rm -f --cached "$tf" >/dev/null 2>&1 || true + rm -f "$tf" + fi +done <<'EOF_RESET_TEST_FILES' +test_commands.json +tests/test_main.py +mimo_test_command.sh +EOF_RESET_TEST_FILES + +); then echo "could not reset the test files (testbed problem, not scored)" >&2; exit 1; fi +if ! git apply --verbose /tests/test.patch > "$V/apply.log" 2>&1; then + cat "$V/apply.log" >&2 + echo "the hidden tests could not be applied (testbed problem, not scored)" >&2 + exit 1 +fi +timeout 1800 sh -c "$(cat /tests/test_command.sh)" > "$V/test_output.log" 2>&1 +RC=$? +tail -c 12000 "$V/test_output.log" +if [ $RC -eq 0 ]; then echo 1 > "$V/reward.txt"; else echo 0 > "$V/reward.txt"; fi +echo "test command exited $RC" diff --git a/tasks/format-code-task-001216/tests/test_command.sh b/tasks/format-code-task-001216/tests/test_command.sh new file mode 100644 index 0000000000000000000000000000000000000000..7cb23076694ad17d72e8296d62b2b240083e36db --- /dev/null +++ b/tasks/format-code-task-001216/tests/test_command.sh @@ -0,0 +1 @@ +bash /testbed/mimo_test_command.sh \ No newline at end of file diff --git a/tasks/format-code-task-001218/environment/Dockerfile b/tasks/format-code-task-001218/environment/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..87699899d9af499148f924e6848a1b1bcbf38996 --- /dev/null +++ b/tasks/format-code-task-001218/environment/Dockerfile @@ -0,0 +1,3 @@ +# The task's image, pinned by digest (the same as [environment].docker_image). +# Setup runs at start from [environment.healthcheck]; environment/setup/ is its readable copy. +FROM docker.io/xiaomimimo/mimo-v2.6-rl-oss@sha256:7e4e4db8591530b72d1544580c13e7958903af73282827698b872034cc23e8ab diff --git a/tasks/format-code-task-001218/environment/setup/files/blocklist b/tasks/format-code-task-001218/environment/setup/files/blocklist new file mode 100644 index 0000000000000000000000000000000000000000..a8e4bdc4c7d9b739c047a3cb58ea72a1bb05bcbc --- /dev/null +++ b/tasks/format-code-task-001218/environment/setup/files/blocklist @@ -0,0 +1,33 @@ +# mimo answer-leak blocklist (mimoagent) +0.0.0.0 github.com +0.0.0.0 www.github.com +0.0.0.0 api.github.com +0.0.0.0 raw.githubusercontent.com +0.0.0.0 codeload.github.com +0.0.0.0 objects.githubusercontent.com +0.0.0.0 gist.github.com +0.0.0.0 gist.githubusercontent.com +0.0.0.0 gitlab.com +0.0.0.0 bitbucket.org +0.0.0.0 sourceforge.net +0.0.0.0 git.kernel.org +0.0.0.0 chromium.googlesource.com +0.0.0.0 android.googlesource.com +0.0.0.0 sourcegraph.com +0.0.0.0 bugs.chromium.org +0.0.0.0 issues.oss-fuzz.com +0.0.0.0 oss-fuzz.com +0.0.0.0 osv.dev +0.0.0.0 api.osv.dev +0.0.0.0 bugzilla.mozilla.org +0.0.0.0 proxy.golang.org +0.0.0.0 sum.golang.org +0.0.0.0 pkg.go.dev +0.0.0.0 google.com +0.0.0.0 www.google.com +0.0.0.0 bing.com +0.0.0.0 www.bing.com +0.0.0.0 duckduckgo.com +0.0.0.0 html.duckduckgo.com +0.0.0.0 search.brave.com +0.0.0.0 stackoverflow.com diff --git a/tasks/format-code-task-001218/environment/setup/setup.sh b/tasks/format-code-task-001218/environment/setup/setup.sh new file mode 100644 index 0000000000000000000000000000000000000000..d883db90cfcfb48f7a139861bbe9f6b5d95cad6f --- /dev/null +++ b/tasks/format-code-task-001218/environment/setup/setup.sh @@ -0,0 +1,34 @@ +#!/bin/bash +# Runs once, as root, before the agent starts: Harbor's [environment.healthcheck] unpacks this folder into +# /var/lib/mimo and runs it. Generated by mimo_harbor; see its README for how each step maps to Xiaomi's harness. +M=/var/lib/mimo +[ -f "$M/ready" ] && exit 0 +chmod 700 "$M" +fail() { echo "setup: $*" >&2; exit 1; } +# the answer-leak blocklist (mimoagent), applied to /etc/hosts by the agent right after it installs +write_blocklist() { cp "$M/files/blocklist" "$M/blocklist"; } + +# Code: mimoagent environments/datasets/opensource_code.py + base.py, as the explorer runs it (app/runner/domains.py Code). +CWD=/testbed +git config --global --add safe.directory "$CWD" +cd "$CWD" || fail "no working directory $CWD" +if ! git rev-parse --git-dir >/dev/null 2>&1; then # a bare source tree: give it a baseline commit + git init -q && git add -A && git -c user.name=mimo -c user.email=mimo@localhost commit -q -m baseline --allow-empty +fi +BASE=$(git rev-parse HEAD 2>/dev/null) +[ ${#BASE} -eq 40 ] || fail "could not resolve the base commit in $CWD" +echo "$BASE" > "$M/base" +# Images are built with history truncated at the base. If one is not, the fix could be read out of git log, +# so .git is hidden while the agent works and put back for grading. +LATER=$(git rev-list --all --not "$BASE" 2>/dev/null | head -n 5 | grep -c . || true) +rm -f /tmp/fail.log /tmp/pass.log /tmp/patch.diff /tmp/test_patch.diff /tmp/*.log 2>/dev/null; rm -rf /tmp/claude-0 /tmp/claude-* /tmp/testem-* /tmp/puppeteer_dev_chrome_profile-* 2>/dev/null; rm -f /tmp/test_files.json 2>/dev/null; rm -rf /tmp/jest_* /tmp/jest-* /tmp/build /tmp/build_env 2>/dev/null; rm -rf /tmp/pytest-of-root /tmp/pytest-* /tmp/.pytest_cache /tmp/__pycache__ 2>/dev/null; rm -rf /tmp/go-build* /tmp/standards /tmp/wordpress /tmp/zig-* /tmp/testbase /tmp/testbed 2>/dev/null; rm -f /tmp/tmp*.tmp /tmp/*.bak /tmp/expect* /tmp/butwas* 2>/dev/null; rm -rf /root/.cache/go-build 2>/dev/null; rm -rf /tests 2>/dev/null; find /logs -mindepth 1 -delete 2>/dev/null; mkdir -p /logs/agent /logs/verifier /logs/artifacts; chmod 777 /logs/agent /logs/verifier /logs/artifacts; find /var/log -type f -delete 2>/dev/null || true; rm -rf /var/lib/postgresql/*/*/log /var/lib/postgresql/*/*/pg_log 2>/dev/null || true; find /var/lib/mysql /var/lib/mongodb -type f -name '*.log' -delete 2>/dev/null || true; rm -rf /root/.npm/_logs /root/.babel.json /root/.pytest_cache 2>/dev/null || true; find / -maxdepth 4 -xdev -name task_description.md -path '*/.build_env/*' -delete 2>/dev/null || true; true +git clean -fdx --exclude=node_modules --exclude=bower_components --exclude=.husky --exclude=vendor --exclude=third_party --exclude=_deps --exclude=vcpkg_installed --exclude=.venv --exclude=venv --exclude=.gradle --exclude=target --exclude=.build --exclude=lib --exclude=.bundle --exclude=Manifest.toml --exclude=_build --exclude=.stack-work --exclude=dist-newstyle >/dev/null 2>&1 +find /root/.m2 -type f \( -name '*-SNAPSHOT.jar' -o -name '*-SNAPSHOT-sources.jar' -o -name '*-SNAPSHOT-tests.jar' -o -name '*-SNAPSHOT-test-sources.jar' \) -delete 2>/dev/null; rm -rf /root/.julia/compiled 2>/dev/null; rm -rf /root/.gradle/caches/build-cache-* /root/.gradle/daemon 2>/dev/null; rm -rf /root/.gradle/caches/*/scripts /root/.gradle/caches/jars-* 2>/dev/null; rm -rf /root/.cache/bazel 2>/dev/null; true +if [ "$LATER" -gt 0 ]; then + mv "$CWD/.git" "$M/git-hidden" + echo "history not truncated at ${BASE:0:12}: .git hidden while the agent works" +fi +write_blocklist + +touch "$M/ready" +echo "setup done" diff --git a/tasks/format-code-task-001218/tests/test.patch b/tasks/format-code-task-001218/tests/test.patch new file mode 100644 index 0000000000000000000000000000000000000000..c4ba66fe447e72c21c0b5fc7a2e0c1ce1b3abd93 --- /dev/null +++ b/tasks/format-code-task-001218/tests/test.patch @@ -0,0 +1,96 @@ +diff --git a/fsspec/implementations/tests/test_memory.py b/fsspec/implementations/tests/test_memory.py +index 3738935..e271612 100644 +--- a/fsspec/implementations/tests/test_memory.py ++++ b/fsspec/implementations/tests/test_memory.py +@@ -83,3 +83,69 @@ def test_moves(m): + m.touch("source2.txt") + m.mv("source2.txt", "target2.txt", recursive=True) + assert m.find("") == ["target.txt", "target2.txt"] ++ ++ ++def _reset(m): ++ m.store.clear() ++ m.pseudo_dirs.clear() ++ ++ ++def test_ls_no_duplicate_after_mkdir_then_touch(m): ++ ++ _reset(m) ++ m.mkdir("a/b") ++ m.touch("a/b/c.d") ++ listed = m.ls("a") ++ assert listed == ["a/b/"] ++ ++ ++def test_ls_root_no_duplicate_after_mkdir_then_touch(m): ++ _reset(m) ++ m.mkdir("a/b") ++ m.touch("a/b/c.d") ++ listed = m.ls("") ++ assert listed == ["a/"] ++ ++ ++def test_ls_only_touch_no_dup(m): ++ ++ _reset(m) ++ m.touch("a/b/c.d") ++ assert m.ls("a") == ["a/b/"] ++ ++ ++def test_ls_detail_no_duplicate_after_mkdir_then_touch(m): ++ _reset(m) ++ m.mkdir("a/b") ++ m.touch("a/b/c.d") ++ detail = m.ls("a", detail=True) ++ assert len(detail) == 1 ++ assert detail[0]["name"] == "a/b/" ++ assert detail[0]["type"] == "directory" ++ ++ ++def test_ls_mkdir_only_still_shows_directory(m): ++ ++ _reset(m) ++ m.mkdir("a/b") ++ assert m.ls("a") == ["a/b/"] ++ ++ ++def test_ls_multiple_files_in_mkdir_dir_no_dup(m): ++ _reset(m) ++ m.mkdir("a/b") ++ m.touch("a/b/c.d") ++ m.touch("a/b/e.f") ++ listed = m.ls("a") ++ ++ ++ assert listed == ["a/b/"] ++ ++ ++def test_ls_no_duplicate_with_leading_slash(m): ++ ++ _reset(m) ++ m.mkdir("/a/b") ++ m.touch("/a/b/c.d") ++ listed = m.ls("/a") ++ assert listed == ["/a/b/"] +diff --git a/test_commands.json b/test_commands.json +new file mode 100644 +index 0000000..8a1b6a3 +--- /dev/null ++++ b/test_commands.json +@@ -0,0 +1,3 @@ ++{ ++ "test_commands": ["python -m pytest fsspec/implementations/tests/test_memory.py -v"] ++} +diff --git a/mimo_test_command.sh b/mimo_test_command.sh +new file mode 100755 +--- /dev/null ++++ b/mimo_test_command.sh +@@ -0,0 +1,8 @@ ++#!/usr/bin/env bash ++ ++set -uo pipefail ++cd /testbed ++rc=0 ++python -m pytest -v -rA fsspec/implementations/tests/test_memory.py::test_ls_no_duplicate_after_mkdir_then_touch fsspec/implementations/tests/test_memory.py::test_ls_root_no_duplicate_after_mkdir_then_touch fsspec/implementations/tests/test_memory.py::test_ls_only_touch_no_dup fsspec/implementations/tests/test_memory.py::test_ls_detail_no_duplicate_after_mkdir_then_touch fsspec/implementations/tests/test_memory.py::test_ls_mkdir_only_still_shows_directory fsspec/implementations/tests/test_memory.py::test_ls_multiple_files_in_mkdir_dir_no_dup fsspec/implementations/tests/test_memory.py::test_ls_no_duplicate_with_leading_slash ++rc=$(( rc | $? )) ++exit $rc diff --git a/tasks/format-code-task-001218/tests/test.sh b/tasks/format-code-task-001218/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..a568a69da7c0e80bbeac08b6a8c995191667e7f5 --- /dev/null +++ b/tasks/format-code-task-001218/tests/test.sh @@ -0,0 +1,39 @@ +#!/bin/bash +# Code grading, mimoagent opensource_code.py: reset the files the hidden test patch touches, apply it, run the +# task's test command; reward 1 when it exits 0. A testbed failure (reset or apply) writes no reward: not scored. +M=/var/lib/mimo +CWD=/testbed +V=/logs/verifier +mkdir -p "$V" +BASE=$(cat "$M/base" 2>/dev/null) || { echo "setup never ran (no $M/base)" >&2; exit 1; } +cd "$CWD" || exit 1 +if [ -d "$M/git-hidden" ]; then rm -rf "$CWD/.git"; mv "$M/git-hidden" "$CWD/.git"; fi +# the agent's change against the base, so its own commits count too +git add -A >/dev/null 2>&1 && git -c core.fileMode=false diff --cached "$BASE" > "$V/agent.diff" +git reset -q +if ! ( +while IFS= read -r tf; do + [ -z "$tf" ] && continue + if git cat-file -e $BASE:"$tf" 2>/dev/null; then + git checkout $BASE -- "$tf" 2>/dev/null || true + else + git rm -f --cached "$tf" >/dev/null 2>&1 || true + rm -f "$tf" + fi +done <<'EOF_RESET_TEST_FILES' +fsspec/implementations/tests/test_memory.py +test_commands.json +mimo_test_command.sh +EOF_RESET_TEST_FILES + +); then echo "could not reset the test files (testbed problem, not scored)" >&2; exit 1; fi +if ! git apply --verbose /tests/test.patch > "$V/apply.log" 2>&1; then + cat "$V/apply.log" >&2 + echo "the hidden tests could not be applied (testbed problem, not scored)" >&2 + exit 1 +fi +timeout 1800 sh -c "$(cat /tests/test_command.sh)" > "$V/test_output.log" 2>&1 +RC=$? +tail -c 12000 "$V/test_output.log" +if [ $RC -eq 0 ]; then echo 1 > "$V/reward.txt"; else echo 0 > "$V/reward.txt"; fi +echo "test command exited $RC" diff --git a/tasks/format-code-task-001218/tests/test_command.sh b/tasks/format-code-task-001218/tests/test_command.sh new file mode 100644 index 0000000000000000000000000000000000000000..7cb23076694ad17d72e8296d62b2b240083e36db --- /dev/null +++ b/tasks/format-code-task-001218/tests/test_command.sh @@ -0,0 +1 @@ +bash /testbed/mimo_test_command.sh \ No newline at end of file diff --git a/tasks/format-code-task-001220/environment/Dockerfile b/tasks/format-code-task-001220/environment/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..f1f5e1995986e00518b138de1d241a898595a53a --- /dev/null +++ b/tasks/format-code-task-001220/environment/Dockerfile @@ -0,0 +1,3 @@ +# The task's image, pinned by digest (the same as [environment].docker_image). +# Setup runs at start from [environment.healthcheck]; environment/setup/ is its readable copy. +FROM docker.io/xiaomimimo/mimo-v2.6-rl-oss@sha256:1a1a26358a96fe3103d977155bdd305369d9d33309a495dd2d4a0ac4254098d9 diff --git a/tasks/format-code-task-001220/environment/setup/files/blocklist b/tasks/format-code-task-001220/environment/setup/files/blocklist new file mode 100644 index 0000000000000000000000000000000000000000..a8e4bdc4c7d9b739c047a3cb58ea72a1bb05bcbc --- /dev/null +++ b/tasks/format-code-task-001220/environment/setup/files/blocklist @@ -0,0 +1,33 @@ +# mimo answer-leak blocklist (mimoagent) +0.0.0.0 github.com +0.0.0.0 www.github.com +0.0.0.0 api.github.com +0.0.0.0 raw.githubusercontent.com +0.0.0.0 codeload.github.com +0.0.0.0 objects.githubusercontent.com +0.0.0.0 gist.github.com +0.0.0.0 gist.githubusercontent.com +0.0.0.0 gitlab.com +0.0.0.0 bitbucket.org +0.0.0.0 sourceforge.net +0.0.0.0 git.kernel.org +0.0.0.0 chromium.googlesource.com +0.0.0.0 android.googlesource.com +0.0.0.0 sourcegraph.com +0.0.0.0 bugs.chromium.org +0.0.0.0 issues.oss-fuzz.com +0.0.0.0 oss-fuzz.com +0.0.0.0 osv.dev +0.0.0.0 api.osv.dev +0.0.0.0 bugzilla.mozilla.org +0.0.0.0 proxy.golang.org +0.0.0.0 sum.golang.org +0.0.0.0 pkg.go.dev +0.0.0.0 google.com +0.0.0.0 www.google.com +0.0.0.0 bing.com +0.0.0.0 www.bing.com +0.0.0.0 duckduckgo.com +0.0.0.0 html.duckduckgo.com +0.0.0.0 search.brave.com +0.0.0.0 stackoverflow.com diff --git a/tasks/format-code-task-001220/environment/setup/setup.sh b/tasks/format-code-task-001220/environment/setup/setup.sh new file mode 100644 index 0000000000000000000000000000000000000000..e9eb7daf39f9542bd095367feee457f3da77e492 --- /dev/null +++ b/tasks/format-code-task-001220/environment/setup/setup.sh @@ -0,0 +1,34 @@ +#!/bin/bash +# Runs once, as root, before the agent starts: Harbor's [environment.healthcheck] unpacks this folder into +# /var/lib/mimo and runs it. Generated by mimo_harbor; see its README for how each step maps to Xiaomi's harness. +M=/var/lib/mimo +[ -f "$M/ready" ] && exit 0 +chmod 700 "$M" +fail() { echo "setup: $*" >&2; exit 1; } +# the answer-leak blocklist (mimoagent), applied to /etc/hosts by the agent right after it installs +write_blocklist() { cp "$M/files/blocklist" "$M/blocklist"; } + +# Code: mimoagent environments/datasets/opensource_code.py + base.py, as the explorer runs it (app/runner/domains.py Code). +CWD=/workspace/repo +git config --global --add safe.directory "$CWD" +cd "$CWD" || fail "no working directory $CWD" +if ! git rev-parse --git-dir >/dev/null 2>&1; then # a bare source tree: give it a baseline commit + git init -q && git add -A && git -c user.name=mimo -c user.email=mimo@localhost commit -q -m baseline --allow-empty +fi +BASE=$(git rev-parse HEAD 2>/dev/null) +[ ${#BASE} -eq 40 ] || fail "could not resolve the base commit in $CWD" +echo "$BASE" > "$M/base" +# Images are built with history truncated at the base. If one is not, the fix could be read out of git log, +# so .git is hidden while the agent works and put back for grading. +LATER=$(git rev-list --all --not "$BASE" 2>/dev/null | head -n 5 | grep -c . || true) +rm -f /tmp/fail.log /tmp/pass.log /tmp/patch.diff /tmp/test_patch.diff /tmp/*.log 2>/dev/null; rm -rf /tmp/claude-0 /tmp/claude-* /tmp/testem-* /tmp/puppeteer_dev_chrome_profile-* 2>/dev/null; rm -f /tmp/test_files.json 2>/dev/null; rm -rf /tmp/jest_* /tmp/jest-* /tmp/build /tmp/build_env 2>/dev/null; rm -rf /tmp/pytest-of-root /tmp/pytest-* /tmp/.pytest_cache /tmp/__pycache__ 2>/dev/null; rm -rf /tmp/go-build* /tmp/standards /tmp/wordpress /tmp/zig-* /tmp/testbase /tmp/testbed 2>/dev/null; rm -f /tmp/tmp*.tmp /tmp/*.bak /tmp/expect* /tmp/butwas* 2>/dev/null; rm -rf /root/.cache/go-build 2>/dev/null; rm -rf /tests 2>/dev/null; find /logs -mindepth 1 -delete 2>/dev/null; mkdir -p /logs/agent /logs/verifier /logs/artifacts; chmod 777 /logs/agent /logs/verifier /logs/artifacts; find /var/log -type f -delete 2>/dev/null || true; rm -rf /var/lib/postgresql/*/*/log /var/lib/postgresql/*/*/pg_log 2>/dev/null || true; find /var/lib/mysql /var/lib/mongodb -type f -name '*.log' -delete 2>/dev/null || true; rm -rf /root/.npm/_logs /root/.babel.json /root/.pytest_cache 2>/dev/null || true; find / -maxdepth 4 -xdev -name task_description.md -path '*/.build_env/*' -delete 2>/dev/null || true; true +git clean -fdx --exclude=node_modules --exclude=bower_components --exclude=.husky --exclude=vendor --exclude=third_party --exclude=_deps --exclude=vcpkg_installed --exclude=.venv --exclude=venv --exclude=.gradle --exclude=target --exclude=.build --exclude=lib --exclude=.bundle --exclude=Manifest.toml --exclude=_build --exclude=.stack-work --exclude=dist-newstyle >/dev/null 2>&1 +find /root/.m2 -type f \( -name '*-SNAPSHOT.jar' -o -name '*-SNAPSHOT-sources.jar' -o -name '*-SNAPSHOT-tests.jar' -o -name '*-SNAPSHOT-test-sources.jar' \) -delete 2>/dev/null; rm -rf /root/.julia/compiled 2>/dev/null; rm -rf /root/.gradle/caches/build-cache-* /root/.gradle/daemon 2>/dev/null; rm -rf /root/.gradle/caches/*/scripts /root/.gradle/caches/jars-* 2>/dev/null; rm -rf /root/.cache/bazel 2>/dev/null; true +if [ "$LATER" -gt 0 ]; then + mv "$CWD/.git" "$M/git-hidden" + echo "history not truncated at ${BASE:0:12}: .git hidden while the agent works" +fi +write_blocklist + +touch "$M/ready" +echo "setup done" diff --git a/tasks/format-code-task-001220/tests/test.patch b/tasks/format-code-task-001220/tests/test.patch new file mode 100644 index 0000000000000000000000000000000000000000..619da74d54e5ed6de2c642138c9335c8982e6a7a --- /dev/null +++ b/tasks/format-code-task-001220/tests/test.patch @@ -0,0 +1,410 @@ +diff --git a/usercase-test-coderl/test_pdm_score_api.py b/usercase-test-coderl/test_pdm_score_api.py +new file mode 100644 +--- /dev/null ++++ b/usercase-test-coderl/test_pdm_score_api.py +@@ -0,0 +1,385 @@ ++ ++ ++ ++ ++ ++ ++from __future__ import annotations ++ ++import builtins ++import json ++import os ++import socket ++import subprocess ++import sys ++from dataclasses import asdict ++from pathlib import Path ++ ++import numpy as np ++import pytest ++ ++from navsim.common.dataclasses import PDMResults, Trajectory ++from navsim.evaluate.pdm_score import pdm_score, pdm_score_multi ++from navsim.planning.metric_caching.metric_cache import MetricCache ++from navsim.planning.simulation.planner.pdm_planner.utils.pdm_enums import MultiMetricIndex, WeightedMetricIndex ++from nuplan.common.actor_state.ego_state import EgoState ++from nuplan.common.actor_state.state_representation import StateSE2, StateVector2D, TimePoint ++from nuplan.common.actor_state.vehicle_parameters import get_pacifica_parameters ++from nuplan.planning.simulation.trajectory.interpolated_trajectory import InterpolatedTrajectory ++from nuplan.planning.simulation.trajectory.trajectory_sampling import TrajectorySampling ++ ++ ++VEHICLE_PARAMETERS = get_pacifica_parameters() ++SAMPLING = TrajectorySampling(time_horizon=1.0, interval_length=0.5) ++ ++ ++def _ego_state(x: float, y: float, heading: float, time_us: int) -> EgoState: ++ return EgoState.build_from_rear_axle( ++ rear_axle_pose=StateSE2(x, y, heading), ++ rear_axle_velocity_2d=StateVector2D(0.0, 0.0), ++ rear_axle_acceleration_2d=StateVector2D(0.0, 0.0), ++ tire_steering_angle=0.0, ++ time_point=TimePoint(time_us), ++ vehicle_parameters=VEHICLE_PARAMETERS, ++ ) ++ ++ ++def _metric_cache(reference_offsets: list[tuple[float, float, float]]) -> MetricCache: ++ initial_ego_state = _ego_state(10.0, -2.0, 0.25, 1_000_000) ++ reference_states = [initial_ego_state] ++ for index, (dx, dy, dheading) in enumerate(reference_offsets, start=1): ++ reference_states.append( ++ _ego_state(10.0 + dx, -2.0 + dy, 0.25 + dheading, 1_000_000 + index * 500_000) ++ ) ++ ++ return MetricCache( ++ file_path=Path("/unused/metric-cache.pkl.xz"), ++ trajectory=InterpolatedTrajectory(reference_states), ++ ego_state=initial_ego_state, ++ observation={"obs": "sentinel"}, ++ centerline=("centerline", 3), ++ route_lane_ids=["r1", "r2"], ++ drivable_area_map={"map": True}, ++ ) ++ ++ ++class RecordingSimulator: ++ def __init__(self, offset: float = 100.0) -> None: ++ self.offset = offset ++ self.calls: list[np.ndarray] = [] ++ ++ def simulate_proposals(self, trajectory_states: np.ndarray, initial_ego_state: EgoState) -> np.ndarray: ++ assert initial_ego_state.rear_axle.serialize() == [10.0, -2.0, 0.25] ++ self.calls.append(np.array(trajectory_states, copy=True)) ++ return trajectory_states + self.offset ++ ++ ++class LiteralScorer: ++ def __init__( ++ self, ++ *, ++ scores: list[float], ++ multi_metrics: list[list[float]], ++ weighted_metrics: list[list[float]], ++ expected_simulated_pose_columns: list | None = None, ++ ) -> None: ++ self._scores = np.array(scores, dtype=float) ++ self._multi_metrics = np.array(multi_metrics, dtype=float) ++ self._weighted_metrics = np.array(weighted_metrics, dtype=float) ++ self._expected_simulated_pose_columns = ( ++ None if expected_simulated_pose_columns is None else np.array(expected_simulated_pose_columns, dtype=float) ++ ) ++ self.calls: list[np.ndarray] = [] ++ ++ def score_proposals( ++ self, ++ simulated_states: np.ndarray, ++ observation: object, ++ centerline: object, ++ route_lane_ids: object, ++ drivable_area_map: object, ++ ) -> np.ndarray: ++ assert observation == {"obs": "sentinel"} ++ assert centerline == ("centerline", 3) ++ assert route_lane_ids == ["r1", "r2"] ++ assert drivable_area_map == {"map": True} ++ if self._expected_simulated_pose_columns is not None: ++ ++ np.testing.assert_allclose( ++ simulated_states[:, :, :3], ++ self._expected_simulated_pose_columns, ++ rtol=0.0, ++ atol=1e-8, ++ ) ++ self.calls.append(np.array(simulated_states, copy=True)) ++ return self._scores ++ ++ ++def _trajectory(poses: list[list[float]]) -> Trajectory: ++ return Trajectory(np.array(poses, dtype=np.float32), SAMPLING) ++ ++ ++def _example_single_a() -> PDMResults: ++ metric_cache = _metric_cache([(1.0, 0.0, 0.0), (2.0, 0.2, 0.1)]) ++ simulator = RecordingSimulator() ++ scorer = LiteralScorer( ++ scores=[0.75, 0.42], ++ multi_metrics=[[0.9, 1.0], [0.25, 0.5]], ++ weighted_metrics=[[0.2, 0.8], [0.3, 1.0], [0.4, 0.0], [0.5, 1.0]], ++ ) ++ return pdm_score(metric_cache, _trajectory([[0.5, 0.0, 0.0], [1.25, 0.3, 0.1]]), SAMPLING, simulator, scorer) ++ ++ ++def test_single_trajectory_returns_prediction_row_from_scorer_index_one() -> None: ++ ++ ++ ++ ++ expected = PDMResults( ++ no_at_fault_collisions=1.0, ++ drivable_area_compliance=0.5, ++ time_to_collision_within_bound=1.0, ++ comfort=0.0, ++ ego_progress=0.8, ++ driving_direction_compliance=1.0, ++ score=0.42, ++ ) ++ ++ assert _example_single_a() == expected ++ ++ ++def test_single_trajectory_transforms_reference_and_ego_relative_prediction_before_scoring() -> None: ++ ++ ++ ++ ++ metric_cache = _metric_cache([(1.0, 0.0, 0.0), (2.0, 0.2, 0.1)]) ++ ++ expected_simulated_pose_columns = [ ++ [ ++ [110.0, 98.0, 100.25], ++ [111.0, 98.0, 100.25], ++ [112.0, 98.2, 100.35], ++ ], ++ [ ++ [110.0, 98.0, 100.25], ++ [110.48445621, 98.12370198, 100.25], ++ [111.13691934, 98.59992869, 100.35], ++ ], ++ ] ++ simulator = RecordingSimulator() ++ scorer = LiteralScorer( ++ scores=[0.75, 0.42], ++ multi_metrics=[[0.9, 1.0], [0.25, 0.5]], ++ weighted_metrics=[[0.2, 0.8], [0.3, 1.0], [0.4, 0.0], [0.5, 1.0]], ++ expected_simulated_pose_columns=expected_simulated_pose_columns, ++ ) ++ ++ actual = pdm_score( ++ metric_cache, ++ _trajectory([[0.5, 0.0, 0.0], [1.25, 0.3, 0.1]]), ++ SAMPLING, ++ simulator, ++ scorer, ++ ) ++ ++ assert actual == PDMResults(1.0, 0.5, 1.0, 0.0, 0.8, 1.0, 0.42) ++ ++ assert len(simulator.calls) >= 1 ++ assert len(scorer.calls) >= 1 ++ ++ ++def test_single_trajectory_uses_another_literal_score_and_progress_row() -> None: ++ ++ ++ ++ ++ metric_cache = _metric_cache([(0.0, 1.0, 0.0), (0.0, 2.0, -0.2)]) ++ simulator = RecordingSimulator() ++ scorer = LiteralScorer( ++ scores=[0.6, 0.9], ++ multi_metrics=[[0.4, 1.0], [0.3, 1.0]], ++ weighted_metrics=[[0.1, 0.7], [0.2, 1.0], [0.3, 1.0], [0.4, 1.0]], ++ ) ++ ++ actual = pdm_score( ++ metric_cache, ++ _trajectory([[0.0, 0.75, 0.0], [-0.25, 1.5, -0.15]]), ++ SAMPLING, ++ simulator, ++ scorer, ++ ) ++ ++ assert actual == PDMResults(1.0, 1.0, 1.0, 1.0, 0.7, 1.0, 0.9) ++ ++ ++def test_multi_trajectory_returns_only_prediction_scores_after_reference() -> None: ++ ++ ++ ++ ++ metric_cache = _metric_cache([(1.0, 1.0, 0.05), (2.0, 1.5, 0.1)]) ++ ++ expected_simulated_pose_columns = [ ++ [ ++ [110.0, 98.0, 100.25], ++ [111.0, 99.0, 100.3], ++ [112.0, 99.5, 100.35], ++ ], ++ [ ++ [110.0, 98.0, 100.25], ++ [110.96891242, 98.24740396, 100.25], ++ [111.93782484, 98.49480792, 100.25], ++ ], ++ [ ++ [110.0, 98.0, 100.25], ++ [109.75259604, 98.96891242, 100.3], ++ [109.50519208, 99.93782484, 100.35], ++ ], ++ ] ++ simulator = RecordingSimulator() ++ scorer = LiteralScorer( ++ scores=[0.2, 0.4, 0.8], ++ multi_metrics=[[1.0, 1.0, 1.0], [1.0, 1.0, 1.0]], ++ weighted_metrics=[[1.0, 1.0, 1.0], [1.0, 1.0, 1.0], [1.0, 1.0, 1.0], [1.0, 1.0, 1.0]], ++ expected_simulated_pose_columns=expected_simulated_pose_columns, ++ ) ++ ++ actual = pdm_score_multi( ++ metric_cache, ++ [ ++ _trajectory([[1.0, 0.0, 0.0], [2.0, 0.0, 0.0]]), ++ _trajectory([[0.0, 1.0, 0.05], [0.0, 2.0, 0.1]]), ++ ], ++ SAMPLING, ++ simulator, ++ scorer, ++ ) ++ ++ np.testing.assert_array_equal(actual, np.array([0.4, 0.8])) ++ ++ ++def test_multi_trajectory_one_prediction_boundary_returns_one_score() -> None: ++ ++ ++ ++ ++ metric_cache = _metric_cache([(-1.0, 0.2, 0.0), (-2.0, 0.4, 0.0)]) ++ simulator = RecordingSimulator() ++ scorer = LiteralScorer( ++ scores=[0.33, 0.66], ++ multi_metrics=[[1.0, 1.0], [1.0, 1.0]], ++ weighted_metrics=[[1.0, 1.0], [1.0, 1.0], [1.0, 1.0], [1.0, 1.0]], ++ ) ++ ++ actual = pdm_score_multi( ++ metric_cache, ++ [_trajectory([[0.2, -0.5, 0.0], [0.4, -1.0, -0.05]])], ++ SAMPLING, ++ simulator, ++ scorer, ++ ) ++ ++ np.testing.assert_array_equal(actual, np.array([0.66])) ++ ++ ++def test_multi_trajectory_empty_list_has_no_predicted_scores_or_raises_value_error() -> None: ++ ++ ++ ++ ++ metric_cache = _metric_cache([(1.0, 1.0, 0.05), (2.0, 1.5, 0.1)]) ++ ++ try: ++ actual = pdm_score_multi( ++ metric_cache, ++ [], ++ SAMPLING, ++ RecordingSimulator(), ++ LiteralScorer( ++ scores=[0.2], ++ multi_metrics=[[1.0], [1.0]], ++ weighted_metrics=[[1.0], [1.0], [1.0], [1.0]], ++ ), ++ ) ++ except ValueError: ++ ++ return ++ ++ ++ assert isinstance(actual, np.ndarray) ++ assert actual.shape == (0,) ++ ++ ++def test_referential_transparency_same_inputs_same_values() -> None: ++ first = _example_single_a() ++ second = _example_single_a() ++ ++ assert first == second ++ assert first == PDMResults(1.0, 0.5, 1.0, 0.0, 0.8, 1.0, 0.42) ++ ++ ++def test_model_trajectory_poses_are_not_mutated() -> None: ++ metric_cache = _metric_cache([(0.0, 1.0, 0.0), (0.0, 2.0, -0.2)]) ++ trajectory = _trajectory([[0.0, 0.75, 0.0], [-0.25, 1.5, -0.15]]) ++ before = trajectory.poses.copy() ++ simulator = RecordingSimulator() ++ scorer = LiteralScorer( ++ scores=[0.6, 0.9], ++ multi_metrics=[[0.4, 1.0], [0.3, 1.0]], ++ weighted_metrics=[[0.1, 0.7], [0.2, 1.0], [0.3, 1.0], [0.4, 1.0]], ++ ) ++ ++ pdm_score(metric_cache, trajectory, SAMPLING, simulator, scorer) ++ ++ np.testing.assert_array_equal(trajectory.poses, before) ++ np.testing.assert_array_equal(trajectory.poses, np.array([[0.0, 0.75, 0.0], [-0.25, 1.5, -0.15]], dtype=np.float32)) ++ ++ ++def test_no_global_state_matches_fresh_python_process() -> None: ++ in_process = asdict(_example_single_a()) ++ script = ( ++ "import json, sys; " ++ "sys.path.insert(0, '/workspace/repo/usercase-test-coderl'); " ++ "sys.path.insert(0, '/workspace/repo'); " ++ "from dataclasses import asdict; " ++ "from test_pdm_score_api import _example_single_a; " ++ "print(json.dumps(asdict(_example_single_a()), sort_keys=True))" ++ ) ++ completed = subprocess.run([sys.executable, "-c", script], check=True, text=True, capture_output=True) ++ fresh_process = json.loads(completed.stdout) ++ ++ assert in_process == { ++ "no_at_fault_collisions": 1.0, ++ "drivable_area_compliance": 0.5, ++ "time_to_collision_within_bound": 1.0, ++ "comfort": 0.0, ++ "ego_progress": 0.8, ++ "driving_direction_compliance": 1.0, ++ "score": 0.42, ++ } ++ assert fresh_process == in_process ++ ++ ++def test_no_undeclared_file_writes_or_network_connections(tmp_path: Path, monkeypatch: pytest.MonkeyPatch) -> None: ++ original_open = builtins.open ++ ++ def guarded_open(file, mode="r", *args, **kwargs): ++ if any(flag in mode for flag in ("w", "a", "x", "+")): ++ raise AssertionError(f"unexpected file write through open({file!r}, {mode!r})") ++ return original_open(file, mode, *args, **kwargs) ++ ++ def blocked_socket(*args, **kwargs): ++ raise AssertionError("unexpected network socket creation") ++ ++ monkeypatch.setattr(builtins, "open", guarded_open) ++ monkeypatch.setattr(socket, "socket", blocked_socket) ++ monkeypatch.chdir(tmp_path) ++ before = sorted(path.relative_to(tmp_path).as_posix() for path in tmp_path.rglob("*")) ++ ++ actual = _example_single_a() ++ ++ after = sorted(path.relative_to(tmp_path).as_posix() for path in tmp_path.rglob("*")) ++ assert actual == PDMResults(1.0, 0.5, 1.0, 0.0, 0.8, 1.0, 0.42) ++ assert before == [] ++ assert after == [] +diff --git a/mimo_test_command.sh b/mimo_test_command.sh +new file mode 100755 +--- /dev/null ++++ b/mimo_test_command.sh +@@ -0,0 +1,15 @@ ++#!/usr/bin/env bash ++ ++ ++ ++ ++export NODE_OPTIONS="${NODE_OPTIONS:-} --max-old-space-size=4096" ++export MAVEN_OPTS="${MAVEN_OPTS:-} -Xmx3g -XX:+UseG1GC" ++export GRADLE_OPTS="${GRADLE_OPTS:-} -Xmx3g -XX:+UseG1GC" ++export TEST_JVM_OPTS="${TEST_JVM_OPTS:-} -Xmx3g" ++set -e ++cd /workspace/repo ++set -euo pipefail ++cd /workspace/repo ++export PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 ++exec python -m pytest -p no:cacheprovider /workspace/repo/usercase-test-coderl/test_pdm_score_api.py -v diff --git a/tasks/format-code-task-001220/tests/test.sh b/tasks/format-code-task-001220/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..de1e2d2526985e52e0ce8f36fa9535a5cdb5eb53 --- /dev/null +++ b/tasks/format-code-task-001220/tests/test.sh @@ -0,0 +1,38 @@ +#!/bin/bash +# Code grading, mimoagent opensource_code.py: reset the files the hidden test patch touches, apply it, run the +# task's test command; reward 1 when it exits 0. A testbed failure (reset or apply) writes no reward: not scored. +M=/var/lib/mimo +CWD=/workspace/repo +V=/logs/verifier +mkdir -p "$V" +BASE=$(cat "$M/base" 2>/dev/null) || { echo "setup never ran (no $M/base)" >&2; exit 1; } +cd "$CWD" || exit 1 +if [ -d "$M/git-hidden" ]; then rm -rf "$CWD/.git"; mv "$M/git-hidden" "$CWD/.git"; fi +# the agent's change against the base, so its own commits count too +git add -A >/dev/null 2>&1 && git -c core.fileMode=false diff --cached "$BASE" > "$V/agent.diff" +git reset -q +if ! ( +while IFS= read -r tf; do + [ -z "$tf" ] && continue + if git cat-file -e $BASE:"$tf" 2>/dev/null; then + git checkout $BASE -- "$tf" 2>/dev/null || true + else + git rm -f --cached "$tf" >/dev/null 2>&1 || true + rm -f "$tf" + fi +done <<'EOF_RESET_TEST_FILES' +usercase-test-coderl/test_pdm_score_api.py +mimo_test_command.sh +EOF_RESET_TEST_FILES + +); then echo "could not reset the test files (testbed problem, not scored)" >&2; exit 1; fi +if ! git apply --verbose /tests/test.patch > "$V/apply.log" 2>&1; then + cat "$V/apply.log" >&2 + echo "the hidden tests could not be applied (testbed problem, not scored)" >&2 + exit 1 +fi +timeout 1800 sh -c "$(cat /tests/test_command.sh)" > "$V/test_output.log" 2>&1 +RC=$? +tail -c 12000 "$V/test_output.log" +if [ $RC -eq 0 ]; then echo 1 > "$V/reward.txt"; else echo 0 > "$V/reward.txt"; fi +echo "test command exited $RC" diff --git a/tasks/format-code-task-001220/tests/test_command.sh b/tasks/format-code-task-001220/tests/test_command.sh new file mode 100644 index 0000000000000000000000000000000000000000..88cb7810b836396c4869db31aeac7d4d4b189685 --- /dev/null +++ b/tasks/format-code-task-001220/tests/test_command.sh @@ -0,0 +1 @@ +bash /workspace/repo/mimo_test_command.sh \ No newline at end of file diff --git a/tasks/format-code-task-001227/environment/Dockerfile b/tasks/format-code-task-001227/environment/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..ec11812e3f849eee22b9eacf100f1dcabc8718f5 --- /dev/null +++ b/tasks/format-code-task-001227/environment/Dockerfile @@ -0,0 +1,3 @@ +# The task's image, pinned by digest (the same as [environment].docker_image). +# Setup runs at start from [environment.healthcheck]; environment/setup/ is its readable copy. +FROM docker.io/xiaomimimo/mimo-v2.6-rl-oss@sha256:4ed35ad9c41db2112b782b277438535d59dced22d5491f41ca222d1da1e43e37 diff --git a/tasks/format-code-task-001227/environment/setup/files/blocklist b/tasks/format-code-task-001227/environment/setup/files/blocklist new file mode 100644 index 0000000000000000000000000000000000000000..a8e4bdc4c7d9b739c047a3cb58ea72a1bb05bcbc --- /dev/null +++ b/tasks/format-code-task-001227/environment/setup/files/blocklist @@ -0,0 +1,33 @@ +# mimo answer-leak blocklist (mimoagent) +0.0.0.0 github.com +0.0.0.0 www.github.com +0.0.0.0 api.github.com +0.0.0.0 raw.githubusercontent.com +0.0.0.0 codeload.github.com +0.0.0.0 objects.githubusercontent.com +0.0.0.0 gist.github.com +0.0.0.0 gist.githubusercontent.com +0.0.0.0 gitlab.com +0.0.0.0 bitbucket.org +0.0.0.0 sourceforge.net +0.0.0.0 git.kernel.org +0.0.0.0 chromium.googlesource.com +0.0.0.0 android.googlesource.com +0.0.0.0 sourcegraph.com +0.0.0.0 bugs.chromium.org +0.0.0.0 issues.oss-fuzz.com +0.0.0.0 oss-fuzz.com +0.0.0.0 osv.dev +0.0.0.0 api.osv.dev +0.0.0.0 bugzilla.mozilla.org +0.0.0.0 proxy.golang.org +0.0.0.0 sum.golang.org +0.0.0.0 pkg.go.dev +0.0.0.0 google.com +0.0.0.0 www.google.com +0.0.0.0 bing.com +0.0.0.0 www.bing.com +0.0.0.0 duckduckgo.com +0.0.0.0 html.duckduckgo.com +0.0.0.0 search.brave.com +0.0.0.0 stackoverflow.com diff --git a/tasks/format-code-task-001227/environment/setup/setup.sh b/tasks/format-code-task-001227/environment/setup/setup.sh new file mode 100644 index 0000000000000000000000000000000000000000..e9eb7daf39f9542bd095367feee457f3da77e492 --- /dev/null +++ b/tasks/format-code-task-001227/environment/setup/setup.sh @@ -0,0 +1,34 @@ +#!/bin/bash +# Runs once, as root, before the agent starts: Harbor's [environment.healthcheck] unpacks this folder into +# /var/lib/mimo and runs it. Generated by mimo_harbor; see its README for how each step maps to Xiaomi's harness. +M=/var/lib/mimo +[ -f "$M/ready" ] && exit 0 +chmod 700 "$M" +fail() { echo "setup: $*" >&2; exit 1; } +# the answer-leak blocklist (mimoagent), applied to /etc/hosts by the agent right after it installs +write_blocklist() { cp "$M/files/blocklist" "$M/blocklist"; } + +# Code: mimoagent environments/datasets/opensource_code.py + base.py, as the explorer runs it (app/runner/domains.py Code). +CWD=/workspace/repo +git config --global --add safe.directory "$CWD" +cd "$CWD" || fail "no working directory $CWD" +if ! git rev-parse --git-dir >/dev/null 2>&1; then # a bare source tree: give it a baseline commit + git init -q && git add -A && git -c user.name=mimo -c user.email=mimo@localhost commit -q -m baseline --allow-empty +fi +BASE=$(git rev-parse HEAD 2>/dev/null) +[ ${#BASE} -eq 40 ] || fail "could not resolve the base commit in $CWD" +echo "$BASE" > "$M/base" +# Images are built with history truncated at the base. If one is not, the fix could be read out of git log, +# so .git is hidden while the agent works and put back for grading. +LATER=$(git rev-list --all --not "$BASE" 2>/dev/null | head -n 5 | grep -c . || true) +rm -f /tmp/fail.log /tmp/pass.log /tmp/patch.diff /tmp/test_patch.diff /tmp/*.log 2>/dev/null; rm -rf /tmp/claude-0 /tmp/claude-* /tmp/testem-* /tmp/puppeteer_dev_chrome_profile-* 2>/dev/null; rm -f /tmp/test_files.json 2>/dev/null; rm -rf /tmp/jest_* /tmp/jest-* /tmp/build /tmp/build_env 2>/dev/null; rm -rf /tmp/pytest-of-root /tmp/pytest-* /tmp/.pytest_cache /tmp/__pycache__ 2>/dev/null; rm -rf /tmp/go-build* /tmp/standards /tmp/wordpress /tmp/zig-* /tmp/testbase /tmp/testbed 2>/dev/null; rm -f /tmp/tmp*.tmp /tmp/*.bak /tmp/expect* /tmp/butwas* 2>/dev/null; rm -rf /root/.cache/go-build 2>/dev/null; rm -rf /tests 2>/dev/null; find /logs -mindepth 1 -delete 2>/dev/null; mkdir -p /logs/agent /logs/verifier /logs/artifacts; chmod 777 /logs/agent /logs/verifier /logs/artifacts; find /var/log -type f -delete 2>/dev/null || true; rm -rf /var/lib/postgresql/*/*/log /var/lib/postgresql/*/*/pg_log 2>/dev/null || true; find /var/lib/mysql /var/lib/mongodb -type f -name '*.log' -delete 2>/dev/null || true; rm -rf /root/.npm/_logs /root/.babel.json /root/.pytest_cache 2>/dev/null || true; find / -maxdepth 4 -xdev -name task_description.md -path '*/.build_env/*' -delete 2>/dev/null || true; true +git clean -fdx --exclude=node_modules --exclude=bower_components --exclude=.husky --exclude=vendor --exclude=third_party --exclude=_deps --exclude=vcpkg_installed --exclude=.venv --exclude=venv --exclude=.gradle --exclude=target --exclude=.build --exclude=lib --exclude=.bundle --exclude=Manifest.toml --exclude=_build --exclude=.stack-work --exclude=dist-newstyle >/dev/null 2>&1 +find /root/.m2 -type f \( -name '*-SNAPSHOT.jar' -o -name '*-SNAPSHOT-sources.jar' -o -name '*-SNAPSHOT-tests.jar' -o -name '*-SNAPSHOT-test-sources.jar' \) -delete 2>/dev/null; rm -rf /root/.julia/compiled 2>/dev/null; rm -rf /root/.gradle/caches/build-cache-* /root/.gradle/daemon 2>/dev/null; rm -rf /root/.gradle/caches/*/scripts /root/.gradle/caches/jars-* 2>/dev/null; rm -rf /root/.cache/bazel 2>/dev/null; true +if [ "$LATER" -gt 0 ]; then + mv "$CWD/.git" "$M/git-hidden" + echo "history not truncated at ${BASE:0:12}: .git hidden while the agent works" +fi +write_blocklist + +touch "$M/ready" +echo "setup done" diff --git a/tasks/format-code-task-001227/tests/test.patch b/tasks/format-code-task-001227/tests/test.patch new file mode 100644 index 0000000000000000000000000000000000000000..d000402fa10da7d23447cb3e900ff1b2a43dc923 --- /dev/null +++ b/tasks/format-code-task-001227/tests/test.patch @@ -0,0 +1,485 @@ +diff --git a/usercase-test-coderl/sanitize_activation_spec.rb b/usercase-test-coderl/sanitize_activation_spec.rb +new file mode 100644 +--- /dev/null ++++ b/usercase-test-coderl/sanitize_activation_spec.rb +@@ -0,0 +1,439 @@ ++# frozen_string_literal: true ++ ++ ++ ++ ++ ++ ++ ++ ++require "mail" ++require "sanitize_email" ++ ++RSpec.describe "SanitizeEmail stateful activation controls" do ++ def reset_sanitize_email_session ++ SanitizeEmail::Config.config = SanitizeEmail::Config::DEFAULTS.dup ++ SanitizeEmail.force_sanitize = nil ++ SanitizeEmail::Deprecation.deprecate_in_silence = true ++ Mail.defaults { delivery_method :test } ++ Mail::TestMailer.deliveries.clear ++ while Mail.delivery_interceptors.include?(SanitizeEmail::Bleach) ++ Mail.unregister_interceptor(SanitizeEmail::Bleach) ++ end ++ Mail.register_interceptor(SanitizeEmail::Bleach) ++ end ++ ++ def configure_sanitize_email(options) ++ SanitizeEmail::Config.configure do |config| ++ options.each { |key, value| config[key] = value } ++ end ++ end ++ ++ def deliver_message(to: "real@example.test", subject: "hello", perform_deliveries: true) ++ message = Mail.new do ++ from "sender@example.test" ++ to to ++ subject subject ++ body "body" ++ end ++ message.perform_deliveries = perform_deliveries ++ message.deliver ++ message ++ end ++ ++ def original_recipient_header_values(message) ++ message.header.fields.filter_map do |field| ++ name = field.name.to_s.downcase ++ next unless name.include?("sanitize") || name.include?("original") ++ ++ field.decoded.to_s ++ end ++ end ++ ++ def expect_original_recipient_record(message, expected) ++ ++ expect(original_recipient_header_values(message).any? { |value| value.include?(expected) }).to eq(true) ++ end ++ ++ def expect_no_original_recipient_record(message) ++ ++ expect(original_recipient_header_values(message)).to be_empty ++ end ++ ++ def with_rails_env(env) ++ rails_was_defined = Object.const_defined?(:Rails) ++ previous_rails = Object.const_get(:Rails) if rails_was_defined ++ Object.send(:remove_const, :Rails) if rails_was_defined ++ ++ rails_module = Module.new ++ rails_module.define_singleton_method(:env) { env } ++ Object.const_set(:Rails, rails_module) ++ ++ yield ++ ensure ++ Object.send(:remove_const, :Rails) if Object.const_defined?(:Rails) ++ Object.const_set(:Rails, previous_rails) if rails_was_defined ++ end ++ ++ before do ++ reset_sanitize_email_session ++ end ++ ++ after do ++ reset_sanitize_email_session ++ end ++ ++ it "leaves mail unchanged by default until configured" do ++ ++ ++ message = deliver_message ++ ++ expect(SanitizeEmail.force_sanitize).to eq(nil) ++ expect(SanitizeEmail::Config.config[:engage]).to eq(nil) ++ expect(message.to).to eq(["real@example.test"]) ++ expect_no_original_recipient_record(message) ++ expect(Mail::TestMailer.deliveries.length).to eq(1) ++ end ++ ++ it "sanitizes a later delivery when engage is true" do ++ ++ ++ configure_sanitize_email(sanitized_to: "safe@example.test", engage: true) ++ ++ message = deliver_message ++ ++ expect(SanitizeEmail.force_sanitize).to eq(nil) ++ expect(SanitizeEmail::Config.config[:engage]).to eq(true) ++ expect(message.to).to eq(["safe@example.test"]) ++ expect_original_recipient_record(message, "real@example.test") ++ expect(Mail::TestMailer.deliveries.length).to eq(1) ++ end ++ ++ it "keeps a later delivery unchanged when engage is false" do ++ ++ ++ configure_sanitize_email(sanitized_to: "safe@example.test", engage: false) ++ ++ message = deliver_message ++ ++ expect(SanitizeEmail.force_sanitize).to eq(nil) ++ expect(SanitizeEmail::Config.config[:engage]).to eq(false) ++ expect(message.to).to eq(["real@example.test"]) ++ expect_no_original_recipient_record(message) ++ expect(Mail::TestMailer.deliveries.length).to eq(1) ++ end ++ ++ it "lets non-nil force_sanitize override configured activation across later deliveries" do ++ ++ ++ configure_sanitize_email( ++ sanitized_to: "safe@example.test", ++ engage: false, ++ activation_proc: proc { true } ++ ) ++ ++ SanitizeEmail.force_sanitize = false ++ denied = deliver_message(subject: "force false") ++ ++ SanitizeEmail.force_sanitize = true ++ forced = deliver_message(subject: "force true") ++ ++ expect(denied.to).to eq(["real@example.test"]) ++ expect_no_original_recipient_record(denied) ++ expect(forced.to).to eq(["safe@example.test"]) ++ expect_original_recipient_record(forced, "real@example.test") ++ expect(SanitizeEmail.force_sanitize).to eq(true) ++ expect(Mail::TestMailer.deliveries.length).to eq(2) ++ end ++ ++ it "falls through nil engage to an activation_proc that receives each Mail message" do ++ ++ ++ seen_subjects = [] ++ configure_sanitize_email( ++ sanitized_to: "safe@example.test", ++ engage: nil, ++ activation_proc: proc { |message| ++ seen_subjects << message.subject ++ message.subject == "allow" ++ } ++ ) ++ ++ denied = deliver_message(subject: "deny") ++ allowed = deliver_message(subject: "allow") ++ ++ expect(seen_subjects).to eq(["deny", "allow"]) ++ expect(denied.to).to eq(["real@example.test"]) ++ expect_no_original_recipient_record(denied) ++ expect(allowed.to).to eq(["safe@example.test"]) ++ expect_original_recipient_record(allowed, "real@example.test") ++ expect(Mail::TestMailer.deliveries.length).to eq(2) ++ end ++ ++ it "does not sanitize messages whose perform_deliveries flag is false" do ++ ++ ++ configure_sanitize_email(sanitized_to: "safe@example.test", engage: true) ++ ++ message = deliver_message(perform_deliveries: false) ++ ++ expect(message.perform_deliveries).to eq(false) ++ expect(message.to).to eq(["real@example.test"]) ++ expect_no_original_recipient_record(message) ++ expect(Mail::TestMailer.deliveries.length).to eq(0) ++ end ++ ++ it "sanitary merges options, forces sanitization by default, and restores state afterward" do ++ ++ ++ configure_sanitize_email(sanitized_to: "global@example.test", engage: false) ++ ++ expect(SanitizeEmail.force_sanitize).to eq(nil) ++ expect(SanitizeEmail::Config.config[:sanitized_to]).to eq("global@example.test") ++ expect(SanitizeEmail::Config.config[:engage]).to eq(false) ++ ++ SanitizeEmail.sanitary(sanitized_to: "block@example.test") do ++ expect(SanitizeEmail.force_sanitize).to eq(true) ++ expect(SanitizeEmail::Config.config[:sanitized_to]).to eq("block@example.test") ++ expect(SanitizeEmail::Config.config[:engage]).to eq(false) ++ ++ message = deliver_message ++ ++ expect(message.to).to eq(["block@example.test"]) ++ expect_original_recipient_record(message, "real@example.test") ++ expect(Mail::TestMailer.deliveries.length).to eq(1) ++ end ++ ++ expect(SanitizeEmail.force_sanitize).to eq(nil) ++ expect(SanitizeEmail::Config.config[:sanitized_to]).to eq("global@example.test") ++ expect(SanitizeEmail::Config.config[:engage]).to eq(false) ++ end ++ ++ it "lets sanitary engage option decide activation instead of default force-on behavior" do ++ ++ ++ configure_sanitize_email(sanitized_to: "global@example.test", engage: true) ++ ++ SanitizeEmail.sanitary(engage: false, sanitized_to: "block@example.test") do ++ expect(SanitizeEmail.force_sanitize).to eq(nil) ++ expect(SanitizeEmail::Config.config[:sanitized_to]).to eq("block@example.test") ++ expect(SanitizeEmail::Config.config[:engage]).to eq(false) ++ ++ message = deliver_message ++ ++ expect(message.to).to eq(["real@example.test"]) ++ expect_no_original_recipient_record(message) ++ expect(Mail::TestMailer.deliveries.length).to eq(1) ++ end ++ ++ expect(SanitizeEmail.force_sanitize).to eq(nil) ++ expect(SanitizeEmail::Config.config[:sanitized_to]).to eq("global@example.test") ++ expect(SanitizeEmail::Config.config[:engage]).to eq(true) ++ end ++ ++ it "lets sanitary activation_proc option decide activation when engage falls through" do ++ ++ ++ configure_sanitize_email( ++ sanitized_to: "global@example.test", ++ engage: nil, ++ activation_proc: proc { false } ++ ) ++ ++ SanitizeEmail.sanitary( ++ activation_proc: proc { |message| message.subject == "allow" }, ++ sanitized_to: "block@example.test" ++ ) do ++ expect(SanitizeEmail.force_sanitize).to eq(nil) ++ expect(SanitizeEmail::Config.config[:sanitized_to]).to eq("block@example.test") ++ expect(SanitizeEmail::Config.config[:engage]).to eq(nil) ++ ++ denied = deliver_message(subject: "deny") ++ allowed = deliver_message(subject: "allow") ++ ++ expect(denied.to).to eq(["real@example.test"]) ++ expect_no_original_recipient_record(denied) ++ expect(allowed.to).to eq(["block@example.test"]) ++ expect_original_recipient_record(allowed, "real@example.test") ++ expect(Mail::TestMailer.deliveries.length).to eq(2) ++ end ++ ++ expect(SanitizeEmail.force_sanitize).to eq(nil) ++ expect(SanitizeEmail::Config.config[:sanitized_to]).to eq("global@example.test") ++ expect(SanitizeEmail::Config.config[:engage]).to eq(nil) ++ end ++ ++ it "restores sanitary config and force state when the block raises" do ++ ++ ++ configure_sanitize_email(sanitized_to: "global@example.test", engage: false) ++ ++ expect { ++ SanitizeEmail.sanitary(sanitized_to: "raise@example.test") do ++ expect(SanitizeEmail.force_sanitize).to eq(true) ++ expect(SanitizeEmail::Config.config[:sanitized_to]).to eq("raise@example.test") ++ expect(SanitizeEmail::Config.config[:engage]).to eq(false) ++ raise "boom" ++ end ++ ++ }.to raise_error(RuntimeError) ++ ++ expect(SanitizeEmail.force_sanitize).to eq(nil) ++ expect(SanitizeEmail::Config.config[:sanitized_to]).to eq("global@example.test") ++ expect(SanitizeEmail::Config.config[:engage]).to eq(false) ++ end ++ ++ it "unsanitary forces delivery to remain unsanitized and restores force afterward" do ++ ++ ++ configure_sanitize_email(sanitized_to: "global@example.test", engage: true) ++ ++ SanitizeEmail.unsanitary do ++ expect(SanitizeEmail.force_sanitize).to eq(false) ++ expect(SanitizeEmail::Config.config[:sanitized_to]).to eq("global@example.test") ++ expect(SanitizeEmail::Config.config[:engage]).to eq(true) ++ ++ message = deliver_message ++ ++ expect(message.to).to eq(["real@example.test"]) ++ expect_no_original_recipient_record(message) ++ expect(Mail::TestMailer.deliveries.length).to eq(1) ++ end ++ ++ expect(SanitizeEmail.force_sanitize).to eq(nil) ++ expect(SanitizeEmail::Config.config[:sanitized_to]).to eq("global@example.test") ++ expect(SanitizeEmail::Config.config[:engage]).to eq(true) ++ end ++ ++ it "raises a specific missing block error naming the scoped method" do ++ ++ ++ expect { ++ SanitizeEmail.sanitary ++ ++ }.to raise_error(SanitizeEmail::MissingBlockParameter) { |error| ++ expect(error.message).to include("sanitary") ++ } ++ ++ expect { ++ SanitizeEmail.unsanitary ++ ++ }.to raise_error(SanitizeEmail::MissingBlockParameter) { |error| ++ expect(error.message).to include("unsanitary") ++ } ++ end ++ ++ it "allows repeated scoped cleanup calls without corrupting force state" do ++ ++ ++ SanitizeEmail.unsanitary do ++ expect(SanitizeEmail.force_sanitize).to eq(false) ++ end ++ expect(SanitizeEmail.force_sanitize).to eq(nil) ++ ++ SanitizeEmail.unsanitary do ++ expect(SanitizeEmail.force_sanitize).to eq(false) ++ end ++ expect(SanitizeEmail.force_sanitize).to eq(nil) ++ end ++ ++ it "keeps independent Mail message state when activation_proc is message-dependent" do ++ ++ ++ configure_sanitize_email( ++ sanitized_to: "safe@example.test", ++ engage: nil, ++ activation_proc: proc { |message| message.subject == "first" } ++ ) ++ ++ first = deliver_message(to: "first-real@example.test", subject: "first") ++ second = Mail.new do ++ from "sender@example.test" ++ to "second-real@example.test" ++ subject "second" ++ body "body" ++ end ++ ++ expect(first.to).to eq(["safe@example.test"]) ++ expect_original_recipient_record(first, "first-real@example.test") ++ expect(second.to).to eq(["second-real@example.test"]) ++ expect_no_original_recipient_record(second) ++ ++ second.deliver ++ ++ expect(second.to).to eq(["second-real@example.test"]) ++ expect_no_original_recipient_record(second) ++ expect(Mail::TestMailer.deliveries.length).to eq(2) ++ end ++ ++ it "keeps scoped state bounded across repeated construct-use-cleanup cycles" do ++ ++ ++ configure_sanitize_email(sanitized_to: "global@example.test", engage: false) ++ config_keys_before_cycles = SanitizeEmail::Config.config.keys ++ ++ 125.times do ++ SanitizeEmail.sanitary(sanitized_to: "cycle@example.test") do ++ message = deliver_message ++ expect(SanitizeEmail.force_sanitize).to eq(true) ++ expect(message.to).to eq(["cycle@example.test"]) ++ expect_original_recipient_record(message, "real@example.test") ++ end ++ ++ expect(SanitizeEmail.force_sanitize).to eq(nil) ++ expect(SanitizeEmail::Config.config[:sanitized_to]).to eq("global@example.test") ++ ++ expect(SanitizeEmail::Config.config.keys).to match_array(config_keys_before_cycles) ++ end ++ ++ expect(Mail::TestMailer.deliveries.length).to eq(125) ++ ++ expect(SanitizeEmail::Config.config.keys.length).to eq(config_keys_before_cycles.length) ++ end ++ ++ it "maps Rails local_environments to an activation proc using Rails.env" do ++ ++ ++ with_rails_env("test") do ++ configure_sanitize_email(sanitized_to: "safe@example.test", local_environments: ["test"]) ++ matching = deliver_message ++ ++ ++ expect(SanitizeEmail::Config.config[:activation_proc].call(matching)).to eq(true) ++ expect(matching.to).to eq(["safe@example.test"]) ++ expect_original_recipient_record(matching, "real@example.test") ++ end ++ ++ reset_sanitize_email_session ++ ++ with_rails_env("production") do ++ configure_sanitize_email(sanitized_to: "safe@example.test", local_environments: ["test"]) ++ nonmatching = deliver_message ++ ++ ++ expect(SanitizeEmail::Config.config[:activation_proc].call(nonmatching)).to eq(false) ++ expect(nonmatching.to).to eq(["real@example.test"]) ++ expect_no_original_recipient_record(nonmatching) ++ end ++ end ++ ++ it "warns for deprecated config force_sanitize and copies it to the public force state" do ++ ++ ++ SanitizeEmail::Deprecation.deprecate_in_silence = false ++ expect { ++ configure_sanitize_email( ++ sanitized_to: "safe@example.test", ++ activation_proc: proc { true }, ++ force_sanitize: false ++ ) ++ ++ }.to output(a_string_including("force_sanitize")).to_stderr ++ ++ expect(SanitizeEmail.force_sanitize).to eq(false) ++ message = deliver_message ++ ++ expect(message.to).to eq(["real@example.test"]) ++ expect_no_original_recipient_record(message) ++ end ++end +diff --git a/mimo_test_command.sh b/mimo_test_command.sh +new file mode 100755 +--- /dev/null ++++ b/mimo_test_command.sh +@@ -0,0 +1,36 @@ ++#!/usr/bin/env bash ++ ++ ++ ++ ++export NODE_OPTIONS="${NODE_OPTIONS:-} --max-old-space-size=4096" ++export MAVEN_OPTS="${MAVEN_OPTS:-} -Xmx3g -XX:+UseG1GC" ++export GRADLE_OPTS="${GRADLE_OPTS:-} -Xmx3g -XX:+UseG1GC" ++export TEST_JVM_OPTS="${TEST_JVM_OPTS:-} -Xmx3g" ++set -e ++cd /workspace/repo ++set -euo pipefail ++ ++cd /workspace/repo ++ ++export BUNDLE_FROZEN=true ++export BUNDLE_DISABLE_VERSION_CHECK=true ++export GEM_SPEC_CACHE=/usr/local/bundle/specifications ++export RUBYGEMS_GEMDEPS="" ++ ++if ! ruby -I /workspace/repo/lib -e 'require "rspec"; require "mail"; require "sanitize_email"' >/dev/null 2>&1; then ++ echo "Required offline Ruby gems are not installed" >&2 ++ exit 127 ++fi ++ ++RSPEC_EXE="${RSPEC_EXE:-/usr/local/bundle/gems/rspec-core-3.13.6/exe/rspec}" ++if [[ ! -f "${RSPEC_EXE}" ]]; then ++ echo "RSpec executable is missing at ${RSPEC_EXE}" >&2 ++ exit 127 ++fi ++ ++exec ruby "${RSPEC_EXE}" \ ++ -O /dev/null \ ++ -I /workspace/repo/lib \ ++ /workspace/repo/usercase-test-coderl/sanitize_activation_spec.rb \ ++ --format documentation diff --git a/tasks/format-code-task-001227/tests/test.sh b/tasks/format-code-task-001227/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..5e5b8e3b8fff5238e25548e03a9f1721f800bf8e --- /dev/null +++ b/tasks/format-code-task-001227/tests/test.sh @@ -0,0 +1,38 @@ +#!/bin/bash +# Code grading, mimoagent opensource_code.py: reset the files the hidden test patch touches, apply it, run the +# task's test command; reward 1 when it exits 0. A testbed failure (reset or apply) writes no reward: not scored. +M=/var/lib/mimo +CWD=/workspace/repo +V=/logs/verifier +mkdir -p "$V" +BASE=$(cat "$M/base" 2>/dev/null) || { echo "setup never ran (no $M/base)" >&2; exit 1; } +cd "$CWD" || exit 1 +if [ -d "$M/git-hidden" ]; then rm -rf "$CWD/.git"; mv "$M/git-hidden" "$CWD/.git"; fi +# the agent's change against the base, so its own commits count too +git add -A >/dev/null 2>&1 && git -c core.fileMode=false diff --cached "$BASE" > "$V/agent.diff" +git reset -q +if ! ( +while IFS= read -r tf; do + [ -z "$tf" ] && continue + if git cat-file -e $BASE:"$tf" 2>/dev/null; then + git checkout $BASE -- "$tf" 2>/dev/null || true + else + git rm -f --cached "$tf" >/dev/null 2>&1 || true + rm -f "$tf" + fi +done <<'EOF_RESET_TEST_FILES' +usercase-test-coderl/sanitize_activation_spec.rb +mimo_test_command.sh +EOF_RESET_TEST_FILES + +); then echo "could not reset the test files (testbed problem, not scored)" >&2; exit 1; fi +if ! git apply --verbose /tests/test.patch > "$V/apply.log" 2>&1; then + cat "$V/apply.log" >&2 + echo "the hidden tests could not be applied (testbed problem, not scored)" >&2 + exit 1 +fi +timeout 1800 sh -c "$(cat /tests/test_command.sh)" > "$V/test_output.log" 2>&1 +RC=$? +tail -c 12000 "$V/test_output.log" +if [ $RC -eq 0 ]; then echo 1 > "$V/reward.txt"; else echo 0 > "$V/reward.txt"; fi +echo "test command exited $RC" diff --git a/tasks/format-code-task-001227/tests/test_command.sh b/tasks/format-code-task-001227/tests/test_command.sh new file mode 100644 index 0000000000000000000000000000000000000000..88cb7810b836396c4869db31aeac7d4d4b189685 --- /dev/null +++ b/tasks/format-code-task-001227/tests/test_command.sh @@ -0,0 +1 @@ +bash /workspace/repo/mimo_test_command.sh \ No newline at end of file diff --git a/tasks/format-code-task-001233/environment/Dockerfile b/tasks/format-code-task-001233/environment/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..33cf56d9862a5038c9fecaaf01d461454e04bade --- /dev/null +++ b/tasks/format-code-task-001233/environment/Dockerfile @@ -0,0 +1,3 @@ +# The task's image, pinned by digest (the same as [environment].docker_image). +# Setup runs at start from [environment.healthcheck]; environment/setup/ is its readable copy. +FROM docker.io/xiaomimimo/mimo-v2.6-rl-oss@sha256:07ae79f9da14c4101e23aab89b3dd891887eed9109f1a9623f6a1556fb819d99 diff --git a/tasks/format-code-task-001233/environment/setup/files/blocklist b/tasks/format-code-task-001233/environment/setup/files/blocklist new file mode 100644 index 0000000000000000000000000000000000000000..a8e4bdc4c7d9b739c047a3cb58ea72a1bb05bcbc --- /dev/null +++ b/tasks/format-code-task-001233/environment/setup/files/blocklist @@ -0,0 +1,33 @@ +# mimo answer-leak blocklist (mimoagent) +0.0.0.0 github.com +0.0.0.0 www.github.com +0.0.0.0 api.github.com +0.0.0.0 raw.githubusercontent.com +0.0.0.0 codeload.github.com +0.0.0.0 objects.githubusercontent.com +0.0.0.0 gist.github.com +0.0.0.0 gist.githubusercontent.com +0.0.0.0 gitlab.com +0.0.0.0 bitbucket.org +0.0.0.0 sourceforge.net +0.0.0.0 git.kernel.org +0.0.0.0 chromium.googlesource.com +0.0.0.0 android.googlesource.com +0.0.0.0 sourcegraph.com +0.0.0.0 bugs.chromium.org +0.0.0.0 issues.oss-fuzz.com +0.0.0.0 oss-fuzz.com +0.0.0.0 osv.dev +0.0.0.0 api.osv.dev +0.0.0.0 bugzilla.mozilla.org +0.0.0.0 proxy.golang.org +0.0.0.0 sum.golang.org +0.0.0.0 pkg.go.dev +0.0.0.0 google.com +0.0.0.0 www.google.com +0.0.0.0 bing.com +0.0.0.0 www.bing.com +0.0.0.0 duckduckgo.com +0.0.0.0 html.duckduckgo.com +0.0.0.0 search.brave.com +0.0.0.0 stackoverflow.com diff --git a/tasks/format-code-task-001233/environment/setup/setup.sh b/tasks/format-code-task-001233/environment/setup/setup.sh new file mode 100644 index 0000000000000000000000000000000000000000..d883db90cfcfb48f7a139861bbe9f6b5d95cad6f --- /dev/null +++ b/tasks/format-code-task-001233/environment/setup/setup.sh @@ -0,0 +1,34 @@ +#!/bin/bash +# Runs once, as root, before the agent starts: Harbor's [environment.healthcheck] unpacks this folder into +# /var/lib/mimo and runs it. Generated by mimo_harbor; see its README for how each step maps to Xiaomi's harness. +M=/var/lib/mimo +[ -f "$M/ready" ] && exit 0 +chmod 700 "$M" +fail() { echo "setup: $*" >&2; exit 1; } +# the answer-leak blocklist (mimoagent), applied to /etc/hosts by the agent right after it installs +write_blocklist() { cp "$M/files/blocklist" "$M/blocklist"; } + +# Code: mimoagent environments/datasets/opensource_code.py + base.py, as the explorer runs it (app/runner/domains.py Code). +CWD=/testbed +git config --global --add safe.directory "$CWD" +cd "$CWD" || fail "no working directory $CWD" +if ! git rev-parse --git-dir >/dev/null 2>&1; then # a bare source tree: give it a baseline commit + git init -q && git add -A && git -c user.name=mimo -c user.email=mimo@localhost commit -q -m baseline --allow-empty +fi +BASE=$(git rev-parse HEAD 2>/dev/null) +[ ${#BASE} -eq 40 ] || fail "could not resolve the base commit in $CWD" +echo "$BASE" > "$M/base" +# Images are built with history truncated at the base. If one is not, the fix could be read out of git log, +# so .git is hidden while the agent works and put back for grading. +LATER=$(git rev-list --all --not "$BASE" 2>/dev/null | head -n 5 | grep -c . || true) +rm -f /tmp/fail.log /tmp/pass.log /tmp/patch.diff /tmp/test_patch.diff /tmp/*.log 2>/dev/null; rm -rf /tmp/claude-0 /tmp/claude-* /tmp/testem-* /tmp/puppeteer_dev_chrome_profile-* 2>/dev/null; rm -f /tmp/test_files.json 2>/dev/null; rm -rf /tmp/jest_* /tmp/jest-* /tmp/build /tmp/build_env 2>/dev/null; rm -rf /tmp/pytest-of-root /tmp/pytest-* /tmp/.pytest_cache /tmp/__pycache__ 2>/dev/null; rm -rf /tmp/go-build* /tmp/standards /tmp/wordpress /tmp/zig-* /tmp/testbase /tmp/testbed 2>/dev/null; rm -f /tmp/tmp*.tmp /tmp/*.bak /tmp/expect* /tmp/butwas* 2>/dev/null; rm -rf /root/.cache/go-build 2>/dev/null; rm -rf /tests 2>/dev/null; find /logs -mindepth 1 -delete 2>/dev/null; mkdir -p /logs/agent /logs/verifier /logs/artifacts; chmod 777 /logs/agent /logs/verifier /logs/artifacts; find /var/log -type f -delete 2>/dev/null || true; rm -rf /var/lib/postgresql/*/*/log /var/lib/postgresql/*/*/pg_log 2>/dev/null || true; find /var/lib/mysql /var/lib/mongodb -type f -name '*.log' -delete 2>/dev/null || true; rm -rf /root/.npm/_logs /root/.babel.json /root/.pytest_cache 2>/dev/null || true; find / -maxdepth 4 -xdev -name task_description.md -path '*/.build_env/*' -delete 2>/dev/null || true; true +git clean -fdx --exclude=node_modules --exclude=bower_components --exclude=.husky --exclude=vendor --exclude=third_party --exclude=_deps --exclude=vcpkg_installed --exclude=.venv --exclude=venv --exclude=.gradle --exclude=target --exclude=.build --exclude=lib --exclude=.bundle --exclude=Manifest.toml --exclude=_build --exclude=.stack-work --exclude=dist-newstyle >/dev/null 2>&1 +find /root/.m2 -type f \( -name '*-SNAPSHOT.jar' -o -name '*-SNAPSHOT-sources.jar' -o -name '*-SNAPSHOT-tests.jar' -o -name '*-SNAPSHOT-test-sources.jar' \) -delete 2>/dev/null; rm -rf /root/.julia/compiled 2>/dev/null; rm -rf /root/.gradle/caches/build-cache-* /root/.gradle/daemon 2>/dev/null; rm -rf /root/.gradle/caches/*/scripts /root/.gradle/caches/jars-* 2>/dev/null; rm -rf /root/.cache/bazel 2>/dev/null; true +if [ "$LATER" -gt 0 ]; then + mv "$CWD/.git" "$M/git-hidden" + echo "history not truncated at ${BASE:0:12}: .git hidden while the agent works" +fi +write_blocklist + +touch "$M/ready" +echo "setup done" diff --git a/tasks/format-code-task-001233/tests/test.patch b/tasks/format-code-task-001233/tests/test.patch new file mode 100644 index 0000000000000000000000000000000000000000..f3c892c5c61781dc75952df37be930020b437f49 --- /dev/null +++ b/tasks/format-code-task-001233/tests/test.patch @@ -0,0 +1,265 @@ +diff --git a/pkg/apis/extensions/validation/bastion_test.go b/pkg/apis/extensions/validation/bastion_test.go +new file mode 100644 +index 0000000000..fa8c0b50ed +--- /dev/null ++++ b/pkg/apis/extensions/validation/bastion_test.go +@@ -0,0 +1,235 @@ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++package validation_test ++ ++import ( ++ extensionsv1alpha1 "github.com/gardener/gardener/pkg/apis/extensions/v1alpha1" ++ . "github.com/gardener/gardener/pkg/apis/extensions/validation" ++ ++ . "github.com/onsi/ginkgo" ++ . "github.com/onsi/gomega" ++ . "github.com/onsi/gomega/gstruct" ++ corev1 "k8s.io/api/core/v1" ++ networkingv1 "k8s.io/api/networking/v1" ++ metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ++ "k8s.io/apimachinery/pkg/runtime" ++ "k8s.io/apimachinery/pkg/util/validation/field" ++) ++ ++var _ = Describe("Bastion validation tests", func() { ++ var bastion *extensionsv1alpha1.Bastion ++ ++ BeforeEach(func() { ++ bastion = &extensionsv1alpha1.Bastion{ ++ ObjectMeta: metav1.ObjectMeta{ ++ Name: "test-bastion", ++ Namespace: "test-namespace", ++ }, ++ Spec: extensionsv1alpha1.BastionSpec{ ++ DefaultSpec: extensionsv1alpha1.DefaultSpec{ ++ Type: "aws", ++ }, ++ UserData: []byte("foobar"), ++ Ingress: []extensionsv1alpha1.BastionIngressPolicy{ ++ { ++ IPBlock: networkingv1.IPBlock{ ++ CIDR: "1.2.3.4/8", ++ }, ++ }, ++ }, ++ }, ++ Status: extensionsv1alpha1.BastionStatus{ ++ Ingress: corev1.LoadBalancerIngress{ ++ IP: "5.6.7.8", ++ }, ++ }, ++ } ++ }) ++ ++ Describe("#ValidateBastion", func() { ++ It("should allow valid bastion resources", func() { ++ Expect(ValidateBastion(bastion)).To(BeEmpty()) ++ }) ++ ++ It("should forbid empty Bastion resources", func() { ++ errorList := ValidateBastion(&extensionsv1alpha1.Bastion{}) ++ ++ Expect(errorList).To(ConsistOf( ++ PointTo(MatchFields(IgnoreExtras, Fields{ ++ "Type": Equal(field.ErrorTypeRequired), ++ "Field": Equal("metadata.name"), ++ })), ++ PointTo(MatchFields(IgnoreExtras, Fields{ ++ "Type": Equal(field.ErrorTypeRequired), ++ "Field": Equal("metadata.namespace"), ++ })), ++ PointTo(MatchFields(IgnoreExtras, Fields{ ++ "Type": Equal(field.ErrorTypeRequired), ++ "Field": Equal("spec.type"), ++ })), ++ PointTo(MatchFields(IgnoreExtras, Fields{ ++ "Type": Equal(field.ErrorTypeRequired), ++ "Field": Equal("spec.userData"), ++ })), ++ PointTo(MatchFields(IgnoreExtras, Fields{ ++ "Type": Equal(field.ErrorTypeRequired), ++ "Field": Equal("spec.ingress"), ++ })), ++ )) ++ }) ++ ++ It("should require a non-empty user data", func() { ++ bastion.Spec.UserData = []byte{} ++ ++ Expect(ValidateBastion(bastion)).To(ConsistOf(PointTo(MatchFields(IgnoreExtras, Fields{ ++ "Type": Equal(field.ErrorTypeRequired), ++ "Field": Equal("spec.userData"), ++ })))) ++ }) ++ ++ It("should require at least one ingress policy", func() { ++ bastion.Spec.Ingress = nil ++ ++ Expect(ValidateBastion(bastion)).To(ConsistOf(PointTo(MatchFields(IgnoreExtras, Fields{ ++ "Type": Equal(field.ErrorTypeRequired), ++ "Field": Equal("spec.ingress"), ++ })))) ++ }) ++ ++ It("should require a CIDR for each ingress policy", func() { ++ bastion.Spec.Ingress[0].IPBlock.CIDR = "" ++ ++ Expect(ValidateBastion(bastion)).To(ConsistOf(PointTo(MatchFields(IgnoreExtras, Fields{ ++ "Type": Equal(field.ErrorTypeRequired), ++ "Field": Equal("spec.ingress[0].ipBlock.cidr"), ++ })))) ++ }) ++ ++ It("should reject an invalid CIDR", func() { ++ bastion.Spec.Ingress[0].IPBlock.CIDR = "not-a-cidr" ++ ++ Expect(ValidateBastion(bastion)).To(ConsistOf(PointTo(MatchFields(IgnoreExtras, Fields{ ++ "Type": Equal(field.ErrorTypeInvalid), ++ "Field": Equal("spec.ingress[0].ipBlock.cidr"), ++ })))) ++ }) ++ ++ It("should report the correct index of a faulty ingress policy", func() { ++ bastion.Spec.Ingress = append(bastion.Spec.Ingress, extensionsv1alpha1.BastionIngressPolicy{ ++ IPBlock: networkingv1.IPBlock{ ++ CIDR: "garbage", ++ }, ++ }) ++ ++ Expect(ValidateBastion(bastion)).To(ConsistOf(PointTo(MatchFields(IgnoreExtras, Fields{ ++ "Type": Equal(field.ErrorTypeInvalid), ++ "Field": Equal("spec.ingress[1].ipBlock.cidr"), ++ })))) ++ }) ++ ++ It("should reject an unparseable except entry", func() { ++ bastion.Spec.Ingress[0].IPBlock.CIDR = "10.250.0.0/16" ++ bastion.Spec.Ingress[0].IPBlock.Except = []string{"nonsense"} ++ ++ Expect(ValidateBastion(bastion)).To(ConsistOf(PointTo(MatchFields(IgnoreExtras, Fields{ ++ "Type": Equal(field.ErrorTypeInvalid), ++ "Field": Equal("spec.ingress[0].ipBlock.except[0]"), ++ })))) ++ }) ++ ++ It("should reject an except entry outside the CIDR range", func() { ++ bastion.Spec.Ingress[0].IPBlock.CIDR = "10.250.0.0/16" ++ bastion.Spec.Ingress[0].IPBlock.Except = []string{"10.241.0.0/24"} ++ ++ Expect(ValidateBastion(bastion)).To(ConsistOf(PointTo(MatchFields(IgnoreExtras, Fields{ ++ "Type": Equal(field.ErrorTypeInvalid), ++ "Field": Equal("spec.ingress[0].ipBlock.except[0]"), ++ })))) ++ }) ++ ++ It("should allow an except entry within the CIDR range", func() { ++ bastion.Spec.Ingress[0].IPBlock.CIDR = "10.250.0.0/16" ++ bastion.Spec.Ingress[0].IPBlock.Except = []string{"10.250.1.0/24"} ++ ++ Expect(ValidateBastion(bastion)).To(BeEmpty()) ++ }) ++ }) ++ ++ Describe("#ValidateBastionUpdate", func() { ++ It("should allow updating the ingress", func() { ++ newBastion := prepareBastionForUpdate(bastion) ++ newBastion.Spec.Ingress[0].IPBlock.CIDR = "9.10.11.12/8" ++ ++ Expect(ValidateBastionUpdate(newBastion, bastion)).To(BeEmpty()) ++ }) ++ ++ It("should forbid changing the type", func() { ++ newBastion := prepareBastionForUpdate(bastion) ++ newBastion.Spec.Type = "gcp" ++ ++ Expect(ValidateBastionUpdate(newBastion, bastion)).To(ConsistOf(PointTo(MatchFields(IgnoreExtras, Fields{ ++ "Type": Equal(field.ErrorTypeInvalid), ++ "Field": Equal("spec.type"), ++ })))) ++ }) ++ ++ It("should forbid changing the user data", func() { ++ newBastion := prepareBastionForUpdate(bastion) ++ newBastion.Spec.UserData = []byte("changed") ++ ++ Expect(ValidateBastionUpdate(newBastion, bastion)).To(ConsistOf(PointTo(MatchFields(IgnoreExtras, Fields{ ++ "Type": Equal(field.ErrorTypeInvalid), ++ "Field": Equal("spec.userData"), ++ })))) ++ }) ++ ++ It("should prevent updating anything if the deletion timestamp is set", func() { ++ now := metav1.Now() ++ bastion.DeletionTimestamp = &now ++ ++ newBastion := prepareBastionForUpdate(bastion) ++ newBastion.DeletionTimestamp = &now ++ newBastion.Spec.Ingress[0].IPBlock.CIDR = "9.10.11.12/8" ++ ++ Expect(ValidateBastionUpdate(newBastion, bastion)).To(ConsistOf(PointTo(MatchFields(IgnoreExtras, Fields{ ++ "Type": Equal(field.ErrorTypeInvalid), ++ "Field": Equal("spec"), ++ })))) ++ }) ++ }) ++ ++ Describe("Bastion API type", func() { ++ It("should be registered in the v1alpha1 scheme", func() { ++ scheme := runtime.NewScheme() ++ Expect(extensionsv1alpha1.AddToScheme(scheme)).To(Succeed()) ++ ++ gvks, _, err := scheme.ObjectKinds(&extensionsv1alpha1.Bastion{}) ++ Expect(err).NotTo(HaveOccurred()) ++ Expect(gvks).To(ContainElement(extensionsv1alpha1.SchemeGroupVersion.WithKind("Bastion"))) ++ }) ++ ++ It("should expose its spec and status as an extension object", func() { ++ var obj extensionsv1alpha1.Object = bastion ++ Expect(obj.GetExtensionSpec().GetExtensionType()).To(Equal("aws")) ++ Expect(obj.GetExtensionStatus()).NotTo(BeNil()) ++ }) ++ }) ++}) ++ ++func prepareBastionForUpdate(obj *extensionsv1alpha1.Bastion) *extensionsv1alpha1.Bastion { ++ newObj := obj.DeepCopy() ++ newObj.ResourceVersion = "1" ++ return newObj ++} +diff --git a/mimo_test_command.sh b/mimo_test_command.sh +new file mode 100755 +--- /dev/null ++++ b/mimo_test_command.sh +@@ -0,0 +1,19 @@ ++#!/usr/bin/env bash ++ ++ ++ ++set -euo pipefail ++HERE="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" ++cd /testbed ++ ++ ++ ++ ++export PATH=/opt/go-1.16/bin:$PATH ++unset GOROOT || true ++export GOFLAGS=-mod=vendor ++ ++ ++ ++ ++go test -count=1 ./pkg/apis/extensions/validation/ diff --git a/tasks/format-code-task-001233/tests/test.sh b/tasks/format-code-task-001233/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..24fccef02306dbd68c7b7eaceb446f8fd62b0d87 --- /dev/null +++ b/tasks/format-code-task-001233/tests/test.sh @@ -0,0 +1,38 @@ +#!/bin/bash +# Code grading, mimoagent opensource_code.py: reset the files the hidden test patch touches, apply it, run the +# task's test command; reward 1 when it exits 0. A testbed failure (reset or apply) writes no reward: not scored. +M=/var/lib/mimo +CWD=/testbed +V=/logs/verifier +mkdir -p "$V" +BASE=$(cat "$M/base" 2>/dev/null) || { echo "setup never ran (no $M/base)" >&2; exit 1; } +cd "$CWD" || exit 1 +if [ -d "$M/git-hidden" ]; then rm -rf "$CWD/.git"; mv "$M/git-hidden" "$CWD/.git"; fi +# the agent's change against the base, so its own commits count too +git add -A >/dev/null 2>&1 && git -c core.fileMode=false diff --cached "$BASE" > "$V/agent.diff" +git reset -q +if ! ( +while IFS= read -r tf; do + [ -z "$tf" ] && continue + if git cat-file -e $BASE:"$tf" 2>/dev/null; then + git checkout $BASE -- "$tf" 2>/dev/null || true + else + git rm -f --cached "$tf" >/dev/null 2>&1 || true + rm -f "$tf" + fi +done <<'EOF_RESET_TEST_FILES' +pkg/apis/extensions/validation/bastion_test.go +mimo_test_command.sh +EOF_RESET_TEST_FILES + +); then echo "could not reset the test files (testbed problem, not scored)" >&2; exit 1; fi +if ! git apply --verbose /tests/test.patch > "$V/apply.log" 2>&1; then + cat "$V/apply.log" >&2 + echo "the hidden tests could not be applied (testbed problem, not scored)" >&2 + exit 1 +fi +timeout 1800 sh -c "$(cat /tests/test_command.sh)" > "$V/test_output.log" 2>&1 +RC=$? +tail -c 12000 "$V/test_output.log" +if [ $RC -eq 0 ]; then echo 1 > "$V/reward.txt"; else echo 0 > "$V/reward.txt"; fi +echo "test command exited $RC" diff --git a/tasks/format-code-task-001233/tests/test_command.sh b/tasks/format-code-task-001233/tests/test_command.sh new file mode 100644 index 0000000000000000000000000000000000000000..7cb23076694ad17d72e8296d62b2b240083e36db --- /dev/null +++ b/tasks/format-code-task-001233/tests/test_command.sh @@ -0,0 +1 @@ +bash /testbed/mimo_test_command.sh \ No newline at end of file diff --git a/tasks/format-code-task-001234/environment/Dockerfile b/tasks/format-code-task-001234/environment/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..18cda18c9a0f02418b680ddd95b199af966fc39b --- /dev/null +++ b/tasks/format-code-task-001234/environment/Dockerfile @@ -0,0 +1,3 @@ +# The task's image, pinned by digest (the same as [environment].docker_image). +# Setup runs at start from [environment.healthcheck]; environment/setup/ is its readable copy. +FROM docker.io/xiaomimimo/mimo-v2.6-rl-oss@sha256:8a86740cb592bb34559554707de8ce364fba14b497ee6013f5c52977a9a8b990 diff --git a/tasks/format-code-task-001234/environment/setup/files/blocklist b/tasks/format-code-task-001234/environment/setup/files/blocklist new file mode 100644 index 0000000000000000000000000000000000000000..a8e4bdc4c7d9b739c047a3cb58ea72a1bb05bcbc --- /dev/null +++ b/tasks/format-code-task-001234/environment/setup/files/blocklist @@ -0,0 +1,33 @@ +# mimo answer-leak blocklist (mimoagent) +0.0.0.0 github.com +0.0.0.0 www.github.com +0.0.0.0 api.github.com +0.0.0.0 raw.githubusercontent.com +0.0.0.0 codeload.github.com +0.0.0.0 objects.githubusercontent.com +0.0.0.0 gist.github.com +0.0.0.0 gist.githubusercontent.com +0.0.0.0 gitlab.com +0.0.0.0 bitbucket.org +0.0.0.0 sourceforge.net +0.0.0.0 git.kernel.org +0.0.0.0 chromium.googlesource.com +0.0.0.0 android.googlesource.com +0.0.0.0 sourcegraph.com +0.0.0.0 bugs.chromium.org +0.0.0.0 issues.oss-fuzz.com +0.0.0.0 oss-fuzz.com +0.0.0.0 osv.dev +0.0.0.0 api.osv.dev +0.0.0.0 bugzilla.mozilla.org +0.0.0.0 proxy.golang.org +0.0.0.0 sum.golang.org +0.0.0.0 pkg.go.dev +0.0.0.0 google.com +0.0.0.0 www.google.com +0.0.0.0 bing.com +0.0.0.0 www.bing.com +0.0.0.0 duckduckgo.com +0.0.0.0 html.duckduckgo.com +0.0.0.0 search.brave.com +0.0.0.0 stackoverflow.com diff --git a/tasks/format-code-task-001234/environment/setup/setup.sh b/tasks/format-code-task-001234/environment/setup/setup.sh new file mode 100644 index 0000000000000000000000000000000000000000..d883db90cfcfb48f7a139861bbe9f6b5d95cad6f --- /dev/null +++ b/tasks/format-code-task-001234/environment/setup/setup.sh @@ -0,0 +1,34 @@ +#!/bin/bash +# Runs once, as root, before the agent starts: Harbor's [environment.healthcheck] unpacks this folder into +# /var/lib/mimo and runs it. Generated by mimo_harbor; see its README for how each step maps to Xiaomi's harness. +M=/var/lib/mimo +[ -f "$M/ready" ] && exit 0 +chmod 700 "$M" +fail() { echo "setup: $*" >&2; exit 1; } +# the answer-leak blocklist (mimoagent), applied to /etc/hosts by the agent right after it installs +write_blocklist() { cp "$M/files/blocklist" "$M/blocklist"; } + +# Code: mimoagent environments/datasets/opensource_code.py + base.py, as the explorer runs it (app/runner/domains.py Code). +CWD=/testbed +git config --global --add safe.directory "$CWD" +cd "$CWD" || fail "no working directory $CWD" +if ! git rev-parse --git-dir >/dev/null 2>&1; then # a bare source tree: give it a baseline commit + git init -q && git add -A && git -c user.name=mimo -c user.email=mimo@localhost commit -q -m baseline --allow-empty +fi +BASE=$(git rev-parse HEAD 2>/dev/null) +[ ${#BASE} -eq 40 ] || fail "could not resolve the base commit in $CWD" +echo "$BASE" > "$M/base" +# Images are built with history truncated at the base. If one is not, the fix could be read out of git log, +# so .git is hidden while the agent works and put back for grading. +LATER=$(git rev-list --all --not "$BASE" 2>/dev/null | head -n 5 | grep -c . || true) +rm -f /tmp/fail.log /tmp/pass.log /tmp/patch.diff /tmp/test_patch.diff /tmp/*.log 2>/dev/null; rm -rf /tmp/claude-0 /tmp/claude-* /tmp/testem-* /tmp/puppeteer_dev_chrome_profile-* 2>/dev/null; rm -f /tmp/test_files.json 2>/dev/null; rm -rf /tmp/jest_* /tmp/jest-* /tmp/build /tmp/build_env 2>/dev/null; rm -rf /tmp/pytest-of-root /tmp/pytest-* /tmp/.pytest_cache /tmp/__pycache__ 2>/dev/null; rm -rf /tmp/go-build* /tmp/standards /tmp/wordpress /tmp/zig-* /tmp/testbase /tmp/testbed 2>/dev/null; rm -f /tmp/tmp*.tmp /tmp/*.bak /tmp/expect* /tmp/butwas* 2>/dev/null; rm -rf /root/.cache/go-build 2>/dev/null; rm -rf /tests 2>/dev/null; find /logs -mindepth 1 -delete 2>/dev/null; mkdir -p /logs/agent /logs/verifier /logs/artifacts; chmod 777 /logs/agent /logs/verifier /logs/artifacts; find /var/log -type f -delete 2>/dev/null || true; rm -rf /var/lib/postgresql/*/*/log /var/lib/postgresql/*/*/pg_log 2>/dev/null || true; find /var/lib/mysql /var/lib/mongodb -type f -name '*.log' -delete 2>/dev/null || true; rm -rf /root/.npm/_logs /root/.babel.json /root/.pytest_cache 2>/dev/null || true; find / -maxdepth 4 -xdev -name task_description.md -path '*/.build_env/*' -delete 2>/dev/null || true; true +git clean -fdx --exclude=node_modules --exclude=bower_components --exclude=.husky --exclude=vendor --exclude=third_party --exclude=_deps --exclude=vcpkg_installed --exclude=.venv --exclude=venv --exclude=.gradle --exclude=target --exclude=.build --exclude=lib --exclude=.bundle --exclude=Manifest.toml --exclude=_build --exclude=.stack-work --exclude=dist-newstyle >/dev/null 2>&1 +find /root/.m2 -type f \( -name '*-SNAPSHOT.jar' -o -name '*-SNAPSHOT-sources.jar' -o -name '*-SNAPSHOT-tests.jar' -o -name '*-SNAPSHOT-test-sources.jar' \) -delete 2>/dev/null; rm -rf /root/.julia/compiled 2>/dev/null; rm -rf /root/.gradle/caches/build-cache-* /root/.gradle/daemon 2>/dev/null; rm -rf /root/.gradle/caches/*/scripts /root/.gradle/caches/jars-* 2>/dev/null; rm -rf /root/.cache/bazel 2>/dev/null; true +if [ "$LATER" -gt 0 ]; then + mv "$CWD/.git" "$M/git-hidden" + echo "history not truncated at ${BASE:0:12}: .git hidden while the agent works" +fi +write_blocklist + +touch "$M/ready" +echo "setup done" diff --git a/tasks/format-code-task-001234/tests/test.patch b/tasks/format-code-task-001234/tests/test.patch new file mode 100644 index 0000000000000000000000000000000000000000..1bb3251dcde56d64ba7dc9764e709e646971ef3a --- /dev/null +++ b/tasks/format-code-task-001234/tests/test.patch @@ -0,0 +1,70 @@ +diff --git a/plugin/pkg/shoot/validator/admission_test.go b/plugin/pkg/shoot/validator/admission_test.go +index 59f1891fd0..dd063afc84 100644 +--- a/plugin/pkg/shoot/validator/admission_test.go ++++ b/plugin/pkg/shoot/validator/admission_test.go +@@ -839,6 +839,43 @@ var _ = Describe("validator", func() { + Expect(err).To(Not(HaveOccurred())) + Expect(controllerutils.HasTask(shoot.ObjectMeta.Annotations, v1beta1constants.ShootTaskDeployInfrastructure)).ToNot(BeTrue()) + }) ++ ++ It("should add deploy infrastructure task because rotate-ssh-keypair annotation is set", func() { ++ shoot.ObjectMeta.Annotations = map[string]string{ ++ v1beta1constants.GardenerOperation: v1beta1constants.ShootOperationRotateSSHKeypair, ++ } ++ ++ attrs := admission.NewAttributesRecord(&shoot, oldShoot, core.Kind("Shoot").WithVersion("version"), shoot.Namespace, shoot.Name, core.Resource("shoots").WithVersion("version"), "", admission.Update, &metav1.UpdateOptions{}, false, nil) ++ err := admissionHandler.Admit(context.TODO(), attrs, nil) ++ ++ Expect(err).To(Not(HaveOccurred())) ++ Expect(controllerutils.HasTask(shoot.ObjectMeta.Annotations, v1beta1constants.ShootTaskDeployInfrastructure)).To(BeTrue()) ++ }) ++ ++ It("should add deploy infrastructure task because rotate-ssh-keypair annotation is set even when spec has not changed and oldShoot had no annotations", func() { ++ oldShoot.ObjectMeta.Annotations = nil ++ shoot.ObjectMeta.Annotations = map[string]string{ ++ v1beta1constants.GardenerOperation: v1beta1constants.ShootOperationRotateSSHKeypair, ++ } ++ ++ attrs := admission.NewAttributesRecord(&shoot, oldShoot, core.Kind("Shoot").WithVersion("version"), shoot.Namespace, shoot.Name, core.Resource("shoots").WithVersion("version"), "", admission.Update, &metav1.UpdateOptions{}, false, nil) ++ err := admissionHandler.Admit(context.TODO(), attrs, nil) ++ ++ Expect(err).To(Not(HaveOccurred())) ++ Expect(controllerutils.HasTask(shoot.ObjectMeta.Annotations, v1beta1constants.ShootTaskDeployInfrastructure)).To(BeTrue()) ++ }) ++ ++ It("should not add deploy infrastructure task because gardener operation annotation has a different value (not rotate-ssh-keypair)", func() { ++ shoot.ObjectMeta.Annotations = map[string]string{ ++ v1beta1constants.GardenerOperation: "some-other-operation", ++ } ++ ++ attrs := admission.NewAttributesRecord(&shoot, oldShoot, core.Kind("Shoot").WithVersion("version"), shoot.Namespace, shoot.Name, core.Resource("shoots").WithVersion("version"), "", admission.Update, &metav1.UpdateOptions{}, false, nil) ++ err := admissionHandler.Admit(context.TODO(), attrs, nil) ++ ++ Expect(err).To(Not(HaveOccurred())) ++ Expect(controllerutils.HasTask(shoot.ObjectMeta.Annotations, v1beta1constants.ShootTaskDeployInfrastructure)).ToNot(BeTrue()) ++ }) + }) + + Context("tests for region/zone updates", func() { +diff --git a/test_commands.json b/test_commands.json +new file mode 100644 +index 0000000000..6c104bccb4 +--- /dev/null ++++ b/test_commands.json +@@ -0,0 +1,3 @@ ++{ ++ "test_commands": ["go test ./plugin/pkg/shoot/validator/... -run TestValidator -count=1"] ++} +diff --git a/mimo_test_command.sh b/mimo_test_command.sh +new file mode 100755 +--- /dev/null ++++ b/mimo_test_command.sh +@@ -0,0 +1,8 @@ ++#!/usr/bin/env bash ++ ++set -uo pipefail ++cd /testbed ++rc=0 ++go test ./plugin/pkg/shoot/validator/... -run TestValidator -count=1 ++rc=$(( rc | $? )) ++exit $rc diff --git a/tasks/format-code-task-001234/tests/test.sh b/tasks/format-code-task-001234/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..a3a94e39bad5a2a555ac421b67df67b13e70ca39 --- /dev/null +++ b/tasks/format-code-task-001234/tests/test.sh @@ -0,0 +1,39 @@ +#!/bin/bash +# Code grading, mimoagent opensource_code.py: reset the files the hidden test patch touches, apply it, run the +# task's test command; reward 1 when it exits 0. A testbed failure (reset or apply) writes no reward: not scored. +M=/var/lib/mimo +CWD=/testbed +V=/logs/verifier +mkdir -p "$V" +BASE=$(cat "$M/base" 2>/dev/null) || { echo "setup never ran (no $M/base)" >&2; exit 1; } +cd "$CWD" || exit 1 +if [ -d "$M/git-hidden" ]; then rm -rf "$CWD/.git"; mv "$M/git-hidden" "$CWD/.git"; fi +# the agent's change against the base, so its own commits count too +git add -A >/dev/null 2>&1 && git -c core.fileMode=false diff --cached "$BASE" > "$V/agent.diff" +git reset -q +if ! ( +while IFS= read -r tf; do + [ -z "$tf" ] && continue + if git cat-file -e $BASE:"$tf" 2>/dev/null; then + git checkout $BASE -- "$tf" 2>/dev/null || true + else + git rm -f --cached "$tf" >/dev/null 2>&1 || true + rm -f "$tf" + fi +done <<'EOF_RESET_TEST_FILES' +plugin/pkg/shoot/validator/admission_test.go +test_commands.json +mimo_test_command.sh +EOF_RESET_TEST_FILES + +); then echo "could not reset the test files (testbed problem, not scored)" >&2; exit 1; fi +if ! git apply --verbose /tests/test.patch > "$V/apply.log" 2>&1; then + cat "$V/apply.log" >&2 + echo "the hidden tests could not be applied (testbed problem, not scored)" >&2 + exit 1 +fi +timeout 1800 sh -c "$(cat /tests/test_command.sh)" > "$V/test_output.log" 2>&1 +RC=$? +tail -c 12000 "$V/test_output.log" +if [ $RC -eq 0 ]; then echo 1 > "$V/reward.txt"; else echo 0 > "$V/reward.txt"; fi +echo "test command exited $RC" diff --git a/tasks/format-code-task-001234/tests/test_command.sh b/tasks/format-code-task-001234/tests/test_command.sh new file mode 100644 index 0000000000000000000000000000000000000000..7cb23076694ad17d72e8296d62b2b240083e36db --- /dev/null +++ b/tasks/format-code-task-001234/tests/test_command.sh @@ -0,0 +1 @@ +bash /testbed/mimo_test_command.sh \ No newline at end of file diff --git a/tasks/format-code-task-001258/environment/Dockerfile b/tasks/format-code-task-001258/environment/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..58fe86146318a838f9b2bddbf8a6a1acf9ab5598 --- /dev/null +++ b/tasks/format-code-task-001258/environment/Dockerfile @@ -0,0 +1,3 @@ +# The task's image, pinned by digest (the same as [environment].docker_image). +# Setup runs at start from [environment.healthcheck]; environment/setup/ is its readable copy. +FROM docker.io/xiaomimimo/mimo-v2.6-rl-oss@sha256:e230d2465b457aebbfa5041ac4540b27f7a46d85e02796c3449f547d2cb8d9fa diff --git a/tasks/format-code-task-001258/environment/setup/files/blocklist b/tasks/format-code-task-001258/environment/setup/files/blocklist new file mode 100644 index 0000000000000000000000000000000000000000..a8e4bdc4c7d9b739c047a3cb58ea72a1bb05bcbc --- /dev/null +++ b/tasks/format-code-task-001258/environment/setup/files/blocklist @@ -0,0 +1,33 @@ +# mimo answer-leak blocklist (mimoagent) +0.0.0.0 github.com +0.0.0.0 www.github.com +0.0.0.0 api.github.com +0.0.0.0 raw.githubusercontent.com +0.0.0.0 codeload.github.com +0.0.0.0 objects.githubusercontent.com +0.0.0.0 gist.github.com +0.0.0.0 gist.githubusercontent.com +0.0.0.0 gitlab.com +0.0.0.0 bitbucket.org +0.0.0.0 sourceforge.net +0.0.0.0 git.kernel.org +0.0.0.0 chromium.googlesource.com +0.0.0.0 android.googlesource.com +0.0.0.0 sourcegraph.com +0.0.0.0 bugs.chromium.org +0.0.0.0 issues.oss-fuzz.com +0.0.0.0 oss-fuzz.com +0.0.0.0 osv.dev +0.0.0.0 api.osv.dev +0.0.0.0 bugzilla.mozilla.org +0.0.0.0 proxy.golang.org +0.0.0.0 sum.golang.org +0.0.0.0 pkg.go.dev +0.0.0.0 google.com +0.0.0.0 www.google.com +0.0.0.0 bing.com +0.0.0.0 www.bing.com +0.0.0.0 duckduckgo.com +0.0.0.0 html.duckduckgo.com +0.0.0.0 search.brave.com +0.0.0.0 stackoverflow.com diff --git a/tasks/format-code-task-001258/environment/setup/setup.sh b/tasks/format-code-task-001258/environment/setup/setup.sh new file mode 100644 index 0000000000000000000000000000000000000000..d883db90cfcfb48f7a139861bbe9f6b5d95cad6f --- /dev/null +++ b/tasks/format-code-task-001258/environment/setup/setup.sh @@ -0,0 +1,34 @@ +#!/bin/bash +# Runs once, as root, before the agent starts: Harbor's [environment.healthcheck] unpacks this folder into +# /var/lib/mimo and runs it. Generated by mimo_harbor; see its README for how each step maps to Xiaomi's harness. +M=/var/lib/mimo +[ -f "$M/ready" ] && exit 0 +chmod 700 "$M" +fail() { echo "setup: $*" >&2; exit 1; } +# the answer-leak blocklist (mimoagent), applied to /etc/hosts by the agent right after it installs +write_blocklist() { cp "$M/files/blocklist" "$M/blocklist"; } + +# Code: mimoagent environments/datasets/opensource_code.py + base.py, as the explorer runs it (app/runner/domains.py Code). +CWD=/testbed +git config --global --add safe.directory "$CWD" +cd "$CWD" || fail "no working directory $CWD" +if ! git rev-parse --git-dir >/dev/null 2>&1; then # a bare source tree: give it a baseline commit + git init -q && git add -A && git -c user.name=mimo -c user.email=mimo@localhost commit -q -m baseline --allow-empty +fi +BASE=$(git rev-parse HEAD 2>/dev/null) +[ ${#BASE} -eq 40 ] || fail "could not resolve the base commit in $CWD" +echo "$BASE" > "$M/base" +# Images are built with history truncated at the base. If one is not, the fix could be read out of git log, +# so .git is hidden while the agent works and put back for grading. +LATER=$(git rev-list --all --not "$BASE" 2>/dev/null | head -n 5 | grep -c . || true) +rm -f /tmp/fail.log /tmp/pass.log /tmp/patch.diff /tmp/test_patch.diff /tmp/*.log 2>/dev/null; rm -rf /tmp/claude-0 /tmp/claude-* /tmp/testem-* /tmp/puppeteer_dev_chrome_profile-* 2>/dev/null; rm -f /tmp/test_files.json 2>/dev/null; rm -rf /tmp/jest_* /tmp/jest-* /tmp/build /tmp/build_env 2>/dev/null; rm -rf /tmp/pytest-of-root /tmp/pytest-* /tmp/.pytest_cache /tmp/__pycache__ 2>/dev/null; rm -rf /tmp/go-build* /tmp/standards /tmp/wordpress /tmp/zig-* /tmp/testbase /tmp/testbed 2>/dev/null; rm -f /tmp/tmp*.tmp /tmp/*.bak /tmp/expect* /tmp/butwas* 2>/dev/null; rm -rf /root/.cache/go-build 2>/dev/null; rm -rf /tests 2>/dev/null; find /logs -mindepth 1 -delete 2>/dev/null; mkdir -p /logs/agent /logs/verifier /logs/artifacts; chmod 777 /logs/agent /logs/verifier /logs/artifacts; find /var/log -type f -delete 2>/dev/null || true; rm -rf /var/lib/postgresql/*/*/log /var/lib/postgresql/*/*/pg_log 2>/dev/null || true; find /var/lib/mysql /var/lib/mongodb -type f -name '*.log' -delete 2>/dev/null || true; rm -rf /root/.npm/_logs /root/.babel.json /root/.pytest_cache 2>/dev/null || true; find / -maxdepth 4 -xdev -name task_description.md -path '*/.build_env/*' -delete 2>/dev/null || true; true +git clean -fdx --exclude=node_modules --exclude=bower_components --exclude=.husky --exclude=vendor --exclude=third_party --exclude=_deps --exclude=vcpkg_installed --exclude=.venv --exclude=venv --exclude=.gradle --exclude=target --exclude=.build --exclude=lib --exclude=.bundle --exclude=Manifest.toml --exclude=_build --exclude=.stack-work --exclude=dist-newstyle >/dev/null 2>&1 +find /root/.m2 -type f \( -name '*-SNAPSHOT.jar' -o -name '*-SNAPSHOT-sources.jar' -o -name '*-SNAPSHOT-tests.jar' -o -name '*-SNAPSHOT-test-sources.jar' \) -delete 2>/dev/null; rm -rf /root/.julia/compiled 2>/dev/null; rm -rf /root/.gradle/caches/build-cache-* /root/.gradle/daemon 2>/dev/null; rm -rf /root/.gradle/caches/*/scripts /root/.gradle/caches/jars-* 2>/dev/null; rm -rf /root/.cache/bazel 2>/dev/null; true +if [ "$LATER" -gt 0 ]; then + mv "$CWD/.git" "$M/git-hidden" + echo "history not truncated at ${BASE:0:12}: .git hidden while the agent works" +fi +write_blocklist + +touch "$M/ready" +echo "setup done" diff --git a/tasks/format-code-task-001258/tests/test.patch b/tasks/format-code-task-001258/tests/test.patch new file mode 100644 index 0000000000000000000000000000000000000000..3fb8640c1016b03bf22684c06c0cd92e4f44b29c --- /dev/null +++ b/tasks/format-code-task-001258/tests/test.patch @@ -0,0 +1,51 @@ +diff --git a/tests/test_dynamodb2/test_dynamodb_exceptions.py b/tests/test_dynamodb2/test_dynamodb_exceptions.py +index c2f8a842dad6..377ef2e0e22d 100644 +--- a/tests/test_dynamodb2/test_dynamodb_exceptions.py ++++ b/tests/test_dynamodb2/test_dynamodb_exceptions.py +@@ -147,3 +147,25 @@ def test_empty_expressionattributenames_with_projection(): + err = exc.value.response["Error"] + err["Code"].should.equal("ValidationException") + err["Message"].should.equal("ExpressionAttributeNames must not be empty") ++ ++ ++@mock_dynamodb2 ++def test_update_item_range_key_set(): ++ ddb = boto3.resource("dynamodb", region_name="us-east-1") ++ ++ ++ table = ddb.create_table( ++ TableName="test-table", BillingMode="PAY_PER_REQUEST", **table_schema ++ ) ++ ++ with pytest.raises(ClientError) as exc: ++ table.update_item( ++ Key={"partitionKey": "the-key"}, ++ UpdateExpression="ADD x :one SET a = :a ADD y :one", ++ ExpressionAttributeValues={":one": 1, ":a": "lore ipsum"}, ++ ) ++ err = exc.value.response["Error"] ++ err["Code"].should.equal("ValidationException") ++ err["Message"].should.equal( ++ 'Invalid UpdateExpression: The "ADD" section can only be used once in an update expression;' ++ ) +diff --git a/mimo_build_env.tar.gz.b64 b/mimo_build_env.tar.gz.b64 +new file mode 100644 +--- /dev/null ++++ b/mimo_build_env.tar.gz.b64 +@@ -0,0 +1,5 @@ ++H4sIAAAAAAAAA+3SQY6DIBQGYNee4l1AFBztrlcxKiSaKBhBW5MefqiTmXYmmbpp0zT9v4U84QUw ++v6ya2k4WSs9x8CiJt8uydfT+jmvNM8F5LnIhRJD4yk9R9rAbXZmsK0eiYDTG3erbWn9R7JK/U9YV ++ten7Uktmm/udsZU/3+U/+a/z/CPnIqDkflf435vnX0tag6+UDKWaI3toXd3QsLjG6JRSxjmJfeyX ++Yj11HZ1O5MZJhd8NUX/u9RvQ+WG/fiK56LI3shK/Xwt1rNXgWqMtGxaK5vDZXw8AAAAAAAAAAAAA ++AAAAAAAA8No+AQkwlJ8AKAAA +diff --git a/mimo_test_command.sh b/mimo_test_command.sh +new file mode 100755 +--- /dev/null ++++ b/mimo_test_command.sh +@@ -0,0 +1,6 @@ ++#!/usr/bin/env bash ++ ++set -uo pipefail ++cd /testbed || exit 1 ++base64 -d mimo_build_env.tar.gz.b64 | tar -xzf - -C /testbed || exit 1 ++exec bash -lc 'cd /testbed && bash -eo pipefail /testbed/.build_env/test_command.sh' diff --git a/tasks/format-code-task-001258/tests/test.sh b/tasks/format-code-task-001258/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..5b3df2b9f819f80b025ba58201923c27ec4ec478 --- /dev/null +++ b/tasks/format-code-task-001258/tests/test.sh @@ -0,0 +1,39 @@ +#!/bin/bash +# Code grading, mimoagent opensource_code.py: reset the files the hidden test patch touches, apply it, run the +# task's test command; reward 1 when it exits 0. A testbed failure (reset or apply) writes no reward: not scored. +M=/var/lib/mimo +CWD=/testbed +V=/logs/verifier +mkdir -p "$V" +BASE=$(cat "$M/base" 2>/dev/null) || { echo "setup never ran (no $M/base)" >&2; exit 1; } +cd "$CWD" || exit 1 +if [ -d "$M/git-hidden" ]; then rm -rf "$CWD/.git"; mv "$M/git-hidden" "$CWD/.git"; fi +# the agent's change against the base, so its own commits count too +git add -A >/dev/null 2>&1 && git -c core.fileMode=false diff --cached "$BASE" > "$V/agent.diff" +git reset -q +if ! ( +while IFS= read -r tf; do + [ -z "$tf" ] && continue + if git cat-file -e $BASE:"$tf" 2>/dev/null; then + git checkout $BASE -- "$tf" 2>/dev/null || true + else + git rm -f --cached "$tf" >/dev/null 2>&1 || true + rm -f "$tf" + fi +done <<'EOF_RESET_TEST_FILES' +tests/test_dynamodb2/test_dynamodb_exceptions.py +mimo_build_env.tar.gz.b64 +mimo_test_command.sh +EOF_RESET_TEST_FILES + +); then echo "could not reset the test files (testbed problem, not scored)" >&2; exit 1; fi +if ! git apply --verbose /tests/test.patch > "$V/apply.log" 2>&1; then + cat "$V/apply.log" >&2 + echo "the hidden tests could not be applied (testbed problem, not scored)" >&2 + exit 1 +fi +timeout 1800 sh -c "$(cat /tests/test_command.sh)" > "$V/test_output.log" 2>&1 +RC=$? +tail -c 12000 "$V/test_output.log" +if [ $RC -eq 0 ]; then echo 1 > "$V/reward.txt"; else echo 0 > "$V/reward.txt"; fi +echo "test command exited $RC" diff --git a/tasks/format-code-task-001258/tests/test_command.sh b/tasks/format-code-task-001258/tests/test_command.sh new file mode 100644 index 0000000000000000000000000000000000000000..7cb23076694ad17d72e8296d62b2b240083e36db --- /dev/null +++ b/tasks/format-code-task-001258/tests/test_command.sh @@ -0,0 +1 @@ +bash /testbed/mimo_test_command.sh \ No newline at end of file diff --git a/tasks/format-code-task-001260/environment/Dockerfile b/tasks/format-code-task-001260/environment/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..19bad17def72e471130a171d1779a1f121d714b4 --- /dev/null +++ b/tasks/format-code-task-001260/environment/Dockerfile @@ -0,0 +1,3 @@ +# The task's image, pinned by digest (the same as [environment].docker_image). +# Setup runs at start from [environment.healthcheck]; environment/setup/ is its readable copy. +FROM docker.io/xiaomimimo/mimo-v2.6-rl-oss@sha256:b40d9759eb0f57110ce4b7f2b9457295c3be0ac4209236d5730a3ff6b9083ca0 diff --git a/tasks/format-code-task-001260/environment/setup/files/blocklist b/tasks/format-code-task-001260/environment/setup/files/blocklist new file mode 100644 index 0000000000000000000000000000000000000000..a8e4bdc4c7d9b739c047a3cb58ea72a1bb05bcbc --- /dev/null +++ b/tasks/format-code-task-001260/environment/setup/files/blocklist @@ -0,0 +1,33 @@ +# mimo answer-leak blocklist (mimoagent) +0.0.0.0 github.com +0.0.0.0 www.github.com +0.0.0.0 api.github.com +0.0.0.0 raw.githubusercontent.com +0.0.0.0 codeload.github.com +0.0.0.0 objects.githubusercontent.com +0.0.0.0 gist.github.com +0.0.0.0 gist.githubusercontent.com +0.0.0.0 gitlab.com +0.0.0.0 bitbucket.org +0.0.0.0 sourceforge.net +0.0.0.0 git.kernel.org +0.0.0.0 chromium.googlesource.com +0.0.0.0 android.googlesource.com +0.0.0.0 sourcegraph.com +0.0.0.0 bugs.chromium.org +0.0.0.0 issues.oss-fuzz.com +0.0.0.0 oss-fuzz.com +0.0.0.0 osv.dev +0.0.0.0 api.osv.dev +0.0.0.0 bugzilla.mozilla.org +0.0.0.0 proxy.golang.org +0.0.0.0 sum.golang.org +0.0.0.0 pkg.go.dev +0.0.0.0 google.com +0.0.0.0 www.google.com +0.0.0.0 bing.com +0.0.0.0 www.bing.com +0.0.0.0 duckduckgo.com +0.0.0.0 html.duckduckgo.com +0.0.0.0 search.brave.com +0.0.0.0 stackoverflow.com diff --git a/tasks/format-code-task-001260/environment/setup/setup.sh b/tasks/format-code-task-001260/environment/setup/setup.sh new file mode 100644 index 0000000000000000000000000000000000000000..d883db90cfcfb48f7a139861bbe9f6b5d95cad6f --- /dev/null +++ b/tasks/format-code-task-001260/environment/setup/setup.sh @@ -0,0 +1,34 @@ +#!/bin/bash +# Runs once, as root, before the agent starts: Harbor's [environment.healthcheck] unpacks this folder into +# /var/lib/mimo and runs it. Generated by mimo_harbor; see its README for how each step maps to Xiaomi's harness. +M=/var/lib/mimo +[ -f "$M/ready" ] && exit 0 +chmod 700 "$M" +fail() { echo "setup: $*" >&2; exit 1; } +# the answer-leak blocklist (mimoagent), applied to /etc/hosts by the agent right after it installs +write_blocklist() { cp "$M/files/blocklist" "$M/blocklist"; } + +# Code: mimoagent environments/datasets/opensource_code.py + base.py, as the explorer runs it (app/runner/domains.py Code). +CWD=/testbed +git config --global --add safe.directory "$CWD" +cd "$CWD" || fail "no working directory $CWD" +if ! git rev-parse --git-dir >/dev/null 2>&1; then # a bare source tree: give it a baseline commit + git init -q && git add -A && git -c user.name=mimo -c user.email=mimo@localhost commit -q -m baseline --allow-empty +fi +BASE=$(git rev-parse HEAD 2>/dev/null) +[ ${#BASE} -eq 40 ] || fail "could not resolve the base commit in $CWD" +echo "$BASE" > "$M/base" +# Images are built with history truncated at the base. If one is not, the fix could be read out of git log, +# so .git is hidden while the agent works and put back for grading. +LATER=$(git rev-list --all --not "$BASE" 2>/dev/null | head -n 5 | grep -c . || true) +rm -f /tmp/fail.log /tmp/pass.log /tmp/patch.diff /tmp/test_patch.diff /tmp/*.log 2>/dev/null; rm -rf /tmp/claude-0 /tmp/claude-* /tmp/testem-* /tmp/puppeteer_dev_chrome_profile-* 2>/dev/null; rm -f /tmp/test_files.json 2>/dev/null; rm -rf /tmp/jest_* /tmp/jest-* /tmp/build /tmp/build_env 2>/dev/null; rm -rf /tmp/pytest-of-root /tmp/pytest-* /tmp/.pytest_cache /tmp/__pycache__ 2>/dev/null; rm -rf /tmp/go-build* /tmp/standards /tmp/wordpress /tmp/zig-* /tmp/testbase /tmp/testbed 2>/dev/null; rm -f /tmp/tmp*.tmp /tmp/*.bak /tmp/expect* /tmp/butwas* 2>/dev/null; rm -rf /root/.cache/go-build 2>/dev/null; rm -rf /tests 2>/dev/null; find /logs -mindepth 1 -delete 2>/dev/null; mkdir -p /logs/agent /logs/verifier /logs/artifacts; chmod 777 /logs/agent /logs/verifier /logs/artifacts; find /var/log -type f -delete 2>/dev/null || true; rm -rf /var/lib/postgresql/*/*/log /var/lib/postgresql/*/*/pg_log 2>/dev/null || true; find /var/lib/mysql /var/lib/mongodb -type f -name '*.log' -delete 2>/dev/null || true; rm -rf /root/.npm/_logs /root/.babel.json /root/.pytest_cache 2>/dev/null || true; find / -maxdepth 4 -xdev -name task_description.md -path '*/.build_env/*' -delete 2>/dev/null || true; true +git clean -fdx --exclude=node_modules --exclude=bower_components --exclude=.husky --exclude=vendor --exclude=third_party --exclude=_deps --exclude=vcpkg_installed --exclude=.venv --exclude=venv --exclude=.gradle --exclude=target --exclude=.build --exclude=lib --exclude=.bundle --exclude=Manifest.toml --exclude=_build --exclude=.stack-work --exclude=dist-newstyle >/dev/null 2>&1 +find /root/.m2 -type f \( -name '*-SNAPSHOT.jar' -o -name '*-SNAPSHOT-sources.jar' -o -name '*-SNAPSHOT-tests.jar' -o -name '*-SNAPSHOT-test-sources.jar' \) -delete 2>/dev/null; rm -rf /root/.julia/compiled 2>/dev/null; rm -rf /root/.gradle/caches/build-cache-* /root/.gradle/daemon 2>/dev/null; rm -rf /root/.gradle/caches/*/scripts /root/.gradle/caches/jars-* 2>/dev/null; rm -rf /root/.cache/bazel 2>/dev/null; true +if [ "$LATER" -gt 0 ]; then + mv "$CWD/.git" "$M/git-hidden" + echo "history not truncated at ${BASE:0:12}: .git hidden while the agent works" +fi +write_blocklist + +touch "$M/ready" +echo "setup done" diff --git a/tasks/format-code-task-001260/tests/test.patch b/tasks/format-code-task-001260/tests/test.patch new file mode 100644 index 0000000000000000000000000000000000000000..052a9fb8963347ecd4fd1086082d8df65ac74dbd --- /dev/null +++ b/tasks/format-code-task-001260/tests/test.patch @@ -0,0 +1,155 @@ +diff --git a/test_commands.json b/test_commands.json +new file mode 100644 +index 000000000..50450e63c +--- /dev/null ++++ b/test_commands.json +@@ -0,0 +1,3 @@ ++{ ++ "test_commands": ["python -m pytest tests/test_awslambda/test_lambda_layers.py -v"] ++} +diff --git a/tests/test_awslambda/test_lambda_layers.py b/tests/test_awslambda/test_lambda_layers.py +index 8e0be4001..4685f4907 100644 +--- a/tests/test_awslambda/test_lambda_layers.py ++++ b/tests/test_awslambda/test_lambda_layers.py +@@ -230,3 +230,128 @@ def test_delete_layer_version(): + + result = conn.list_layer_versions(LayerName=layer_name)["LayerVersions"] + result.should.equal([]) ++ ++ ++@mock_lambda ++@mock_s3 ++def test_list_layers_after_only_version_deleted(): ++ """Issue reproduction: publish a single layer version, delete it, then ++ list_layers must not raise and must not include the now-empty layer.""" ++ conn = boto3.client("lambda", _lambda_region) ++ layer_name = str(uuid4())[0:6] ++ ++ resp = conn.publish_layer_version( ++ LayerName=layer_name, ++ Content={"ZipFile": get_test_zip_file1()}, ++ CompatibleRuntimes=["python3.6"], ++ LicenseInfo="MIT", ++ ) ++ layer_version = resp["Version"] ++ ++ ++ pre = conn.list_layers() ++ pre_names = [l["LayerName"] for l in pre["Layers"]] ++ assert layer_name in pre_names ++ ++ conn.delete_layer_version(LayerName=layer_name, VersionNumber=layer_version) ++ ++ ++ result = conn.list_layers() ++ names = [l["LayerName"] for l in result["Layers"]] ++ assert layer_name not in names ++ ++ ++@mock_lambda ++@mock_s3 ++def test_list_layers_after_latest_version_deleted_with_remaining(): ++ """publish v1 and v2, delete v2; list_layers must succeed and report v1 ++ as the LatestMatchingVersion of the remaining layer.""" ++ conn = boto3.client("lambda", _lambda_region) ++ layer_name = str(uuid4())[0:6] ++ ++ resp1 = conn.publish_layer_version( ++ LayerName=layer_name, ++ Content={"ZipFile": get_test_zip_file1()}, ++ CompatibleRuntimes=["python3.6"], ++ LicenseInfo="MIT", ++ ) ++ v1 = resp1["Version"] ++ resp2 = conn.publish_layer_version( ++ LayerName=layer_name, ++ Content={"ZipFile": get_test_zip_file1()}, ++ CompatibleRuntimes=["python3.7"], ++ LicenseInfo="MIT", ++ ) ++ v2 = resp2["Version"] ++ assert v1 == 1 ++ assert v2 == 2 ++ ++ ++ conn.delete_layer_version(LayerName=layer_name, VersionNumber=v2) ++ ++ result = conn.list_layers() ++ matching = [l for l in result["Layers"] if l["LayerName"] == layer_name] ++ assert len(matching) == 1 ++ layer = matching[0] ++ assert layer["LatestMatchingVersion"]["Version"] == v1 ++ ++ assert layer["LatestMatchingVersion"]["LayerVersionArn"].endswith(":1") ++ ++ ++@mock_lambda ++@mock_s3 ++def test_list_layers_excludes_only_deleted_layer_keeps_others(): ++ """When several layers exist and only one is fully deleted, list_layers ++ must keep the others.""" ++ conn = boto3.client("lambda", _lambda_region) ++ layer_a = "a-" + str(uuid4())[0:6] ++ layer_b = "b-" + str(uuid4())[0:6] ++ ++ resp_a = conn.publish_layer_version( ++ LayerName=layer_a, ++ Content={"ZipFile": get_test_zip_file1()}, ++ CompatibleRuntimes=["python3.6"], ++ LicenseInfo="MIT", ++ ) ++ conn.publish_layer_version( ++ LayerName=layer_b, ++ Content={"ZipFile": get_test_zip_file1()}, ++ CompatibleRuntimes=["python3.6"], ++ LicenseInfo="MIT", ++ ) ++ ++ conn.delete_layer_version(LayerName=layer_a, VersionNumber=resp_a["Version"]) ++ ++ result = conn.list_layers() ++ names = [l["LayerName"] for l in result["Layers"]] ++ assert layer_a not in names ++ assert layer_b in names ++ ++ ++@mock_lambda ++@mock_s3 ++def test_publish_after_deleting_only_version_does_not_reuse_version_number(): ++ """After deleting the only version of a layer, the next publish_layer_version ++ must continue the sequence (v2), not restart from v1 — AWS layer versions are ++ not reused after deletion.""" ++ conn = boto3.client("lambda", _lambda_region) ++ layer_name = str(uuid4())[0:6] ++ ++ resp1 = conn.publish_layer_version( ++ LayerName=layer_name, ++ Content={"ZipFile": get_test_zip_file1()}, ++ CompatibleRuntimes=["python3.6"], ++ LicenseInfo="MIT", ++ ) ++ assert resp1["Version"] == 1 ++ ++ conn.delete_layer_version(LayerName=layer_name, VersionNumber=resp1["Version"]) ++ ++ resp2 = conn.publish_layer_version( ++ LayerName=layer_name, ++ Content={"ZipFile": get_test_zip_file1()}, ++ CompatibleRuntimes=["python3.7"], ++ LicenseInfo="MIT", ++ ) ++ assert resp2["Version"] == 2 ++ assert resp2["LayerVersionArn"].endswith(":2") +diff --git a/mimo_test_command.sh b/mimo_test_command.sh +new file mode 100755 +--- /dev/null ++++ b/mimo_test_command.sh +@@ -0,0 +1,8 @@ ++#!/usr/bin/env bash ++ ++set -uo pipefail ++cd /testbed ++rc=0 ++python -m pytest -v -rA tests/test_awslambda/test_lambda_layers.py::test_list_layers_after_only_version_deleted tests/test_awslambda/test_lambda_layers.py::test_list_layers_after_latest_version_deleted_with_remaining tests/test_awslambda/test_lambda_layers.py::test_list_layers_excludes_only_deleted_layer_keeps_others tests/test_awslambda/test_lambda_layers.py::test_publish_after_deleting_only_version_does_not_reuse_version_number ++rc=$(( rc | $? )) ++exit $rc diff --git a/tasks/format-code-task-001260/tests/test.sh b/tasks/format-code-task-001260/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..934570b19a96e294663dafca853ab539a78edac5 --- /dev/null +++ b/tasks/format-code-task-001260/tests/test.sh @@ -0,0 +1,39 @@ +#!/bin/bash +# Code grading, mimoagent opensource_code.py: reset the files the hidden test patch touches, apply it, run the +# task's test command; reward 1 when it exits 0. A testbed failure (reset or apply) writes no reward: not scored. +M=/var/lib/mimo +CWD=/testbed +V=/logs/verifier +mkdir -p "$V" +BASE=$(cat "$M/base" 2>/dev/null) || { echo "setup never ran (no $M/base)" >&2; exit 1; } +cd "$CWD" || exit 1 +if [ -d "$M/git-hidden" ]; then rm -rf "$CWD/.git"; mv "$M/git-hidden" "$CWD/.git"; fi +# the agent's change against the base, so its own commits count too +git add -A >/dev/null 2>&1 && git -c core.fileMode=false diff --cached "$BASE" > "$V/agent.diff" +git reset -q +if ! ( +while IFS= read -r tf; do + [ -z "$tf" ] && continue + if git cat-file -e $BASE:"$tf" 2>/dev/null; then + git checkout $BASE -- "$tf" 2>/dev/null || true + else + git rm -f --cached "$tf" >/dev/null 2>&1 || true + rm -f "$tf" + fi +done <<'EOF_RESET_TEST_FILES' +test_commands.json +tests/test_awslambda/test_lambda_layers.py +mimo_test_command.sh +EOF_RESET_TEST_FILES + +); then echo "could not reset the test files (testbed problem, not scored)" >&2; exit 1; fi +if ! git apply --verbose /tests/test.patch > "$V/apply.log" 2>&1; then + cat "$V/apply.log" >&2 + echo "the hidden tests could not be applied (testbed problem, not scored)" >&2 + exit 1 +fi +timeout 1800 sh -c "$(cat /tests/test_command.sh)" > "$V/test_output.log" 2>&1 +RC=$? +tail -c 12000 "$V/test_output.log" +if [ $RC -eq 0 ]; then echo 1 > "$V/reward.txt"; else echo 0 > "$V/reward.txt"; fi +echo "test command exited $RC" diff --git a/tasks/format-code-task-001260/tests/test_command.sh b/tasks/format-code-task-001260/tests/test_command.sh new file mode 100644 index 0000000000000000000000000000000000000000..7cb23076694ad17d72e8296d62b2b240083e36db --- /dev/null +++ b/tasks/format-code-task-001260/tests/test_command.sh @@ -0,0 +1 @@ +bash /testbed/mimo_test_command.sh \ No newline at end of file diff --git a/tasks/format-code-task-001294/environment/Dockerfile b/tasks/format-code-task-001294/environment/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..1828dd1d62a252f242b219ce09fa55a2331a1e61 --- /dev/null +++ b/tasks/format-code-task-001294/environment/Dockerfile @@ -0,0 +1,3 @@ +# The task's image, pinned by digest (the same as [environment].docker_image). +# Setup runs at start from [environment.healthcheck]; environment/setup/ is its readable copy. +FROM docker.io/xiaomimimo/mimo-v2.6-rl-oss@sha256:feaa631fc8ed5253042c810aacb1de9fbee49cb3f8449be72fa90442eaf47865 diff --git a/tasks/format-code-task-001294/environment/setup/files/blocklist b/tasks/format-code-task-001294/environment/setup/files/blocklist new file mode 100644 index 0000000000000000000000000000000000000000..a8e4bdc4c7d9b739c047a3cb58ea72a1bb05bcbc --- /dev/null +++ b/tasks/format-code-task-001294/environment/setup/files/blocklist @@ -0,0 +1,33 @@ +# mimo answer-leak blocklist (mimoagent) +0.0.0.0 github.com +0.0.0.0 www.github.com +0.0.0.0 api.github.com +0.0.0.0 raw.githubusercontent.com +0.0.0.0 codeload.github.com +0.0.0.0 objects.githubusercontent.com +0.0.0.0 gist.github.com +0.0.0.0 gist.githubusercontent.com +0.0.0.0 gitlab.com +0.0.0.0 bitbucket.org +0.0.0.0 sourceforge.net +0.0.0.0 git.kernel.org +0.0.0.0 chromium.googlesource.com +0.0.0.0 android.googlesource.com +0.0.0.0 sourcegraph.com +0.0.0.0 bugs.chromium.org +0.0.0.0 issues.oss-fuzz.com +0.0.0.0 oss-fuzz.com +0.0.0.0 osv.dev +0.0.0.0 api.osv.dev +0.0.0.0 bugzilla.mozilla.org +0.0.0.0 proxy.golang.org +0.0.0.0 sum.golang.org +0.0.0.0 pkg.go.dev +0.0.0.0 google.com +0.0.0.0 www.google.com +0.0.0.0 bing.com +0.0.0.0 www.bing.com +0.0.0.0 duckduckgo.com +0.0.0.0 html.duckduckgo.com +0.0.0.0 search.brave.com +0.0.0.0 stackoverflow.com diff --git a/tasks/format-code-task-001294/environment/setup/setup.sh b/tasks/format-code-task-001294/environment/setup/setup.sh new file mode 100644 index 0000000000000000000000000000000000000000..d883db90cfcfb48f7a139861bbe9f6b5d95cad6f --- /dev/null +++ b/tasks/format-code-task-001294/environment/setup/setup.sh @@ -0,0 +1,34 @@ +#!/bin/bash +# Runs once, as root, before the agent starts: Harbor's [environment.healthcheck] unpacks this folder into +# /var/lib/mimo and runs it. Generated by mimo_harbor; see its README for how each step maps to Xiaomi's harness. +M=/var/lib/mimo +[ -f "$M/ready" ] && exit 0 +chmod 700 "$M" +fail() { echo "setup: $*" >&2; exit 1; } +# the answer-leak blocklist (mimoagent), applied to /etc/hosts by the agent right after it installs +write_blocklist() { cp "$M/files/blocklist" "$M/blocklist"; } + +# Code: mimoagent environments/datasets/opensource_code.py + base.py, as the explorer runs it (app/runner/domains.py Code). +CWD=/testbed +git config --global --add safe.directory "$CWD" +cd "$CWD" || fail "no working directory $CWD" +if ! git rev-parse --git-dir >/dev/null 2>&1; then # a bare source tree: give it a baseline commit + git init -q && git add -A && git -c user.name=mimo -c user.email=mimo@localhost commit -q -m baseline --allow-empty +fi +BASE=$(git rev-parse HEAD 2>/dev/null) +[ ${#BASE} -eq 40 ] || fail "could not resolve the base commit in $CWD" +echo "$BASE" > "$M/base" +# Images are built with history truncated at the base. If one is not, the fix could be read out of git log, +# so .git is hidden while the agent works and put back for grading. +LATER=$(git rev-list --all --not "$BASE" 2>/dev/null | head -n 5 | grep -c . || true) +rm -f /tmp/fail.log /tmp/pass.log /tmp/patch.diff /tmp/test_patch.diff /tmp/*.log 2>/dev/null; rm -rf /tmp/claude-0 /tmp/claude-* /tmp/testem-* /tmp/puppeteer_dev_chrome_profile-* 2>/dev/null; rm -f /tmp/test_files.json 2>/dev/null; rm -rf /tmp/jest_* /tmp/jest-* /tmp/build /tmp/build_env 2>/dev/null; rm -rf /tmp/pytest-of-root /tmp/pytest-* /tmp/.pytest_cache /tmp/__pycache__ 2>/dev/null; rm -rf /tmp/go-build* /tmp/standards /tmp/wordpress /tmp/zig-* /tmp/testbase /tmp/testbed 2>/dev/null; rm -f /tmp/tmp*.tmp /tmp/*.bak /tmp/expect* /tmp/butwas* 2>/dev/null; rm -rf /root/.cache/go-build 2>/dev/null; rm -rf /tests 2>/dev/null; find /logs -mindepth 1 -delete 2>/dev/null; mkdir -p /logs/agent /logs/verifier /logs/artifacts; chmod 777 /logs/agent /logs/verifier /logs/artifacts; find /var/log -type f -delete 2>/dev/null || true; rm -rf /var/lib/postgresql/*/*/log /var/lib/postgresql/*/*/pg_log 2>/dev/null || true; find /var/lib/mysql /var/lib/mongodb -type f -name '*.log' -delete 2>/dev/null || true; rm -rf /root/.npm/_logs /root/.babel.json /root/.pytest_cache 2>/dev/null || true; find / -maxdepth 4 -xdev -name task_description.md -path '*/.build_env/*' -delete 2>/dev/null || true; true +git clean -fdx --exclude=node_modules --exclude=bower_components --exclude=.husky --exclude=vendor --exclude=third_party --exclude=_deps --exclude=vcpkg_installed --exclude=.venv --exclude=venv --exclude=.gradle --exclude=target --exclude=.build --exclude=lib --exclude=.bundle --exclude=Manifest.toml --exclude=_build --exclude=.stack-work --exclude=dist-newstyle >/dev/null 2>&1 +find /root/.m2 -type f \( -name '*-SNAPSHOT.jar' -o -name '*-SNAPSHOT-sources.jar' -o -name '*-SNAPSHOT-tests.jar' -o -name '*-SNAPSHOT-test-sources.jar' \) -delete 2>/dev/null; rm -rf /root/.julia/compiled 2>/dev/null; rm -rf /root/.gradle/caches/build-cache-* /root/.gradle/daemon 2>/dev/null; rm -rf /root/.gradle/caches/*/scripts /root/.gradle/caches/jars-* 2>/dev/null; rm -rf /root/.cache/bazel 2>/dev/null; true +if [ "$LATER" -gt 0 ]; then + mv "$CWD/.git" "$M/git-hidden" + echo "history not truncated at ${BASE:0:12}: .git hidden while the agent works" +fi +write_blocklist + +touch "$M/ready" +echo "setup done" diff --git a/tasks/format-code-task-001294/tests/test.patch b/tasks/format-code-task-001294/tests/test.patch new file mode 100644 index 0000000000000000000000000000000000000000..08cf5708625cf8394912bef6d2626af44b839acc --- /dev/null +++ b/tasks/format-code-task-001294/tests/test.patch @@ -0,0 +1,143 @@ +diff --git a/gno.land/pkg/gnoland/app_test.go b/gno.land/pkg/gnoland/app_test.go +index ffe0479778d..075e98e4d8a 100644 +--- a/gno.land/pkg/gnoland/app_test.go ++++ b/gno.land/pkg/gnoland/app_test.go +@@ -895,7 +895,7 @@ func newGasPriceTestApp(t *testing.T) abci.Application { + ) + + // Set a handler Route. +- baseApp.Router().AddRoute("auth", auth.NewHandler(acck)) ++ baseApp.Router().AddRoute("auth", auth.NewHandler(acck, gpk)) + baseApp.Router().AddRoute("bank", bank.NewHandler(bankk)) + baseApp.Router().AddRoute( + testutils.RouteMsgCounter, +diff --git a/tm2/pkg/sdk/auth/handler_test.go b/tm2/pkg/sdk/auth/handler_test.go +new file mode 100644 +index 00000000000..2a013ccc45a +--- /dev/null ++++ b/tm2/pkg/sdk/auth/handler_test.go +@@ -0,0 +1,103 @@ ++package auth ++ ++import ( ++ "bytes" ++ "fmt" ++ "strings" ++ "testing" ++ ++ "github.com/stretchr/testify/require" ++ ++ "github.com/gnolang/gno/tm2/pkg/amino" ++ abci "github.com/gnolang/gno/tm2/pkg/bft/abci/types" ++ bft "github.com/gnolang/gno/tm2/pkg/bft/types" ++ "github.com/gnolang/gno/tm2/pkg/sdk" ++ tu "github.com/gnolang/gno/tm2/pkg/sdk/testutils" ++ "github.com/gnolang/gno/tm2/pkg/std" ++) ++ ++func TestInvalidMsg(t *testing.T) { ++ t.Parallel() ++ ++ h := NewHandler(AccountKeeper{}, GasPriceKeeper{}) ++ res := h.Process(sdk.NewContext(sdk.RunTxModeDeliver, nil, &bft.Header{ChainID: "test-chain"}, nil), tu.NewTestMsg()) ++ require.False(t, res.IsOK()) ++ require.True(t, strings.Contains(res.Log, "unrecognized auth message type")) ++} ++ ++func TestQueryAccount(t *testing.T) { ++ t.Parallel() ++ ++ env := setupTestEnv() ++ h := NewHandler(env.acck, env.gk) ++ _, pubkey, addr := tu.KeyTestPubAddr() ++ ++ acc := env.acck.NewAccountWithAddress(env.ctx, addr) ++ ++ req := abci.RequestQuery{ ++ Path: fmt.Sprintf("auth/%s/%s", QueryAccount, addr), ++ Data: []byte{}, ++ } ++ res := h.Query(env.ctx, req) ++ require.Nil(t, res.Error) ++ require.NotNil(t, res) ++ ++ ++ acc.SetAccountNumber(uint64(1)) ++ acc.SetSequence(uint64(20)) ++ acc.SetCoins(std.NewCoins(std.NewCoin("foo", 10))) ++ acc.SetPubKey(pubkey) ++ env.acck.SetAccount(env.ctx, acc) ++ ++ res = h.Query(env.ctx, req) ++ require.Nil(t, res.Error) ++ require.NotNil(t, res) ++ bz, err := amino.MarshalJSONIndent(acc, "", " ") ++ require.NoError(t, err) ++ ++ require.True(t, bytes.Equal(res.Data, bz)) ++} ++ ++func TestQueryGasPrice(t *testing.T) { ++ t.Parallel() ++ ++ env := setupTestEnv() ++ h := NewHandler(env.acck, env.gk) ++ ++ req := abci.RequestQuery{ ++ Path: fmt.Sprintf("auth/%s", QueryGasPrice), ++ Data: []byte{}, ++ } ++ ++ res := h.Query(env.ctx, req) ++ require.Nil(t, res.Error) ++ require.NotNil(t, res) ++ gp := std.GasPrice{ ++ Gas: 100, ++ Price: std.Coin{ ++ Denom: "token", ++ Amount: 10, ++ }, ++ } ++ env.gk.SetGasPrice(env.ctx, gp) ++ ++ var gp2 std.GasPrice ++ res = h.Query(env.ctx, req) ++ require.Nil(t, res.Error) ++ require.NotNil(t, res) ++ require.NoError(t, amino.UnmarshalJSON(res.Data, &gp2)) ++ require.True(t, gp == gp2) ++} ++ ++func TestQuerierRouteNotFound(t *testing.T) { ++ t.Parallel() ++ ++ env := setupTestEnv() ++ h := NewHandler(env.acck, env.gk) ++ req := abci.RequestQuery{ ++ Path: "auth/notexist", ++ Data: []byte{}, ++ } ++ res := h.Query(env.ctx, req) ++ require.Error(t, res.Error) ++} +diff --git a/mimo_build_env.tar.gz.b64 b/mimo_build_env.tar.gz.b64 +new file mode 100644 +--- /dev/null ++++ b/mimo_build_env.tar.gz.b64 +@@ -0,0 +1,5 @@ ++H4sIAAAAAAAAA+3SS27DIBQFUI9Zxas7tjG2SUbeRDcQ+YNsKzFUAbL+EqR+FKX1JFZV9Z4JIHiA ++uOSdn0/DQekLT7ZSBHspYxvctrEvZFlURVmXO5EUQsh9nZDc7EZfeOvaM1FyNsb9tG5t/o/KP/N3 ++yrpDb5al1UNup8edsZZ/VcmP/IWsQ/71TpQJFY+7wvf+ef7PT7ybNe9aO7F+oPgJOjUwqxxlijHV ++T4bSpmnoxWs965HcUvLX48jtcOStdxNdSyyFJSkbTRxRdqGsN167RlDObyv4+7bpne1HbfJT+IGx ++Igyu/fUj7lVx9tuPCwAAAAAAAAAAAAAAAAAAAACwsTccCKiLACgAAA== +diff --git a/mimo_test_command.sh b/mimo_test_command.sh +new file mode 100755 +--- /dev/null ++++ b/mimo_test_command.sh +@@ -0,0 +1,6 @@ ++#!/usr/bin/env bash ++ ++set -uo pipefail ++cd /testbed || exit 1 ++base64 -d mimo_build_env.tar.gz.b64 | tar -xzf - -C /testbed || exit 1 ++exec bash -lc 'cd /testbed && bash -eo pipefail /testbed/.build_env/test_command.sh' diff --git a/tasks/format-code-task-001294/tests/test.sh b/tasks/format-code-task-001294/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..74844e9fcb07e9367640864fa5f70f9fcaad635c --- /dev/null +++ b/tasks/format-code-task-001294/tests/test.sh @@ -0,0 +1,40 @@ +#!/bin/bash +# Code grading, mimoagent opensource_code.py: reset the files the hidden test patch touches, apply it, run the +# task's test command; reward 1 when it exits 0. A testbed failure (reset or apply) writes no reward: not scored. +M=/var/lib/mimo +CWD=/testbed +V=/logs/verifier +mkdir -p "$V" +BASE=$(cat "$M/base" 2>/dev/null) || { echo "setup never ran (no $M/base)" >&2; exit 1; } +cd "$CWD" || exit 1 +if [ -d "$M/git-hidden" ]; then rm -rf "$CWD/.git"; mv "$M/git-hidden" "$CWD/.git"; fi +# the agent's change against the base, so its own commits count too +git add -A >/dev/null 2>&1 && git -c core.fileMode=false diff --cached "$BASE" > "$V/agent.diff" +git reset -q +if ! ( +while IFS= read -r tf; do + [ -z "$tf" ] && continue + if git cat-file -e $BASE:"$tf" 2>/dev/null; then + git checkout $BASE -- "$tf" 2>/dev/null || true + else + git rm -f --cached "$tf" >/dev/null 2>&1 || true + rm -f "$tf" + fi +done <<'EOF_RESET_TEST_FILES' +gno.land/pkg/gnoland/app_test.go +tm2/pkg/sdk/auth/handler_test.go +mimo_build_env.tar.gz.b64 +mimo_test_command.sh +EOF_RESET_TEST_FILES + +); then echo "could not reset the test files (testbed problem, not scored)" >&2; exit 1; fi +if ! git apply --verbose /tests/test.patch > "$V/apply.log" 2>&1; then + cat "$V/apply.log" >&2 + echo "the hidden tests could not be applied (testbed problem, not scored)" >&2 + exit 1 +fi +timeout 1800 sh -c "$(cat /tests/test_command.sh)" > "$V/test_output.log" 2>&1 +RC=$? +tail -c 12000 "$V/test_output.log" +if [ $RC -eq 0 ]; then echo 1 > "$V/reward.txt"; else echo 0 > "$V/reward.txt"; fi +echo "test command exited $RC" diff --git a/tasks/format-code-task-001294/tests/test_command.sh b/tasks/format-code-task-001294/tests/test_command.sh new file mode 100644 index 0000000000000000000000000000000000000000..7cb23076694ad17d72e8296d62b2b240083e36db --- /dev/null +++ b/tasks/format-code-task-001294/tests/test_command.sh @@ -0,0 +1 @@ +bash /testbed/mimo_test_command.sh \ No newline at end of file diff --git a/tasks/format-code-task-001409/environment/Dockerfile b/tasks/format-code-task-001409/environment/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..ef237523445b2e246e3bcb8e6b46155b89329fe9 --- /dev/null +++ b/tasks/format-code-task-001409/environment/Dockerfile @@ -0,0 +1,3 @@ +# The task's image, pinned by digest (the same as [environment].docker_image). +# Setup runs at start from [environment.healthcheck]; environment/setup/ is its readable copy. +FROM docker.io/xiaomimimo/mimo-v2.6-rl-oss@sha256:a40a0c06edebaef58a17c6e9e7f30aaa2b0e1c5bd9e7d4d9fd027c229a36d545 diff --git a/tasks/format-code-task-001409/environment/setup/files/blocklist b/tasks/format-code-task-001409/environment/setup/files/blocklist new file mode 100644 index 0000000000000000000000000000000000000000..a8e4bdc4c7d9b739c047a3cb58ea72a1bb05bcbc --- /dev/null +++ b/tasks/format-code-task-001409/environment/setup/files/blocklist @@ -0,0 +1,33 @@ +# mimo answer-leak blocklist (mimoagent) +0.0.0.0 github.com +0.0.0.0 www.github.com +0.0.0.0 api.github.com +0.0.0.0 raw.githubusercontent.com +0.0.0.0 codeload.github.com +0.0.0.0 objects.githubusercontent.com +0.0.0.0 gist.github.com +0.0.0.0 gist.githubusercontent.com +0.0.0.0 gitlab.com +0.0.0.0 bitbucket.org +0.0.0.0 sourceforge.net +0.0.0.0 git.kernel.org +0.0.0.0 chromium.googlesource.com +0.0.0.0 android.googlesource.com +0.0.0.0 sourcegraph.com +0.0.0.0 bugs.chromium.org +0.0.0.0 issues.oss-fuzz.com +0.0.0.0 oss-fuzz.com +0.0.0.0 osv.dev +0.0.0.0 api.osv.dev +0.0.0.0 bugzilla.mozilla.org +0.0.0.0 proxy.golang.org +0.0.0.0 sum.golang.org +0.0.0.0 pkg.go.dev +0.0.0.0 google.com +0.0.0.0 www.google.com +0.0.0.0 bing.com +0.0.0.0 www.bing.com +0.0.0.0 duckduckgo.com +0.0.0.0 html.duckduckgo.com +0.0.0.0 search.brave.com +0.0.0.0 stackoverflow.com diff --git a/tasks/format-code-task-001409/environment/setup/setup.sh b/tasks/format-code-task-001409/environment/setup/setup.sh new file mode 100644 index 0000000000000000000000000000000000000000..d883db90cfcfb48f7a139861bbe9f6b5d95cad6f --- /dev/null +++ b/tasks/format-code-task-001409/environment/setup/setup.sh @@ -0,0 +1,34 @@ +#!/bin/bash +# Runs once, as root, before the agent starts: Harbor's [environment.healthcheck] unpacks this folder into +# /var/lib/mimo and runs it. Generated by mimo_harbor; see its README for how each step maps to Xiaomi's harness. +M=/var/lib/mimo +[ -f "$M/ready" ] && exit 0 +chmod 700 "$M" +fail() { echo "setup: $*" >&2; exit 1; } +# the answer-leak blocklist (mimoagent), applied to /etc/hosts by the agent right after it installs +write_blocklist() { cp "$M/files/blocklist" "$M/blocklist"; } + +# Code: mimoagent environments/datasets/opensource_code.py + base.py, as the explorer runs it (app/runner/domains.py Code). +CWD=/testbed +git config --global --add safe.directory "$CWD" +cd "$CWD" || fail "no working directory $CWD" +if ! git rev-parse --git-dir >/dev/null 2>&1; then # a bare source tree: give it a baseline commit + git init -q && git add -A && git -c user.name=mimo -c user.email=mimo@localhost commit -q -m baseline --allow-empty +fi +BASE=$(git rev-parse HEAD 2>/dev/null) +[ ${#BASE} -eq 40 ] || fail "could not resolve the base commit in $CWD" +echo "$BASE" > "$M/base" +# Images are built with history truncated at the base. If one is not, the fix could be read out of git log, +# so .git is hidden while the agent works and put back for grading. +LATER=$(git rev-list --all --not "$BASE" 2>/dev/null | head -n 5 | grep -c . || true) +rm -f /tmp/fail.log /tmp/pass.log /tmp/patch.diff /tmp/test_patch.diff /tmp/*.log 2>/dev/null; rm -rf /tmp/claude-0 /tmp/claude-* /tmp/testem-* /tmp/puppeteer_dev_chrome_profile-* 2>/dev/null; rm -f /tmp/test_files.json 2>/dev/null; rm -rf /tmp/jest_* /tmp/jest-* /tmp/build /tmp/build_env 2>/dev/null; rm -rf /tmp/pytest-of-root /tmp/pytest-* /tmp/.pytest_cache /tmp/__pycache__ 2>/dev/null; rm -rf /tmp/go-build* /tmp/standards /tmp/wordpress /tmp/zig-* /tmp/testbase /tmp/testbed 2>/dev/null; rm -f /tmp/tmp*.tmp /tmp/*.bak /tmp/expect* /tmp/butwas* 2>/dev/null; rm -rf /root/.cache/go-build 2>/dev/null; rm -rf /tests 2>/dev/null; find /logs -mindepth 1 -delete 2>/dev/null; mkdir -p /logs/agent /logs/verifier /logs/artifacts; chmod 777 /logs/agent /logs/verifier /logs/artifacts; find /var/log -type f -delete 2>/dev/null || true; rm -rf /var/lib/postgresql/*/*/log /var/lib/postgresql/*/*/pg_log 2>/dev/null || true; find /var/lib/mysql /var/lib/mongodb -type f -name '*.log' -delete 2>/dev/null || true; rm -rf /root/.npm/_logs /root/.babel.json /root/.pytest_cache 2>/dev/null || true; find / -maxdepth 4 -xdev -name task_description.md -path '*/.build_env/*' -delete 2>/dev/null || true; true +git clean -fdx --exclude=node_modules --exclude=bower_components --exclude=.husky --exclude=vendor --exclude=third_party --exclude=_deps --exclude=vcpkg_installed --exclude=.venv --exclude=venv --exclude=.gradle --exclude=target --exclude=.build --exclude=lib --exclude=.bundle --exclude=Manifest.toml --exclude=_build --exclude=.stack-work --exclude=dist-newstyle >/dev/null 2>&1 +find /root/.m2 -type f \( -name '*-SNAPSHOT.jar' -o -name '*-SNAPSHOT-sources.jar' -o -name '*-SNAPSHOT-tests.jar' -o -name '*-SNAPSHOT-test-sources.jar' \) -delete 2>/dev/null; rm -rf /root/.julia/compiled 2>/dev/null; rm -rf /root/.gradle/caches/build-cache-* /root/.gradle/daemon 2>/dev/null; rm -rf /root/.gradle/caches/*/scripts /root/.gradle/caches/jars-* 2>/dev/null; rm -rf /root/.cache/bazel 2>/dev/null; true +if [ "$LATER" -gt 0 ]; then + mv "$CWD/.git" "$M/git-hidden" + echo "history not truncated at ${BASE:0:12}: .git hidden while the agent works" +fi +write_blocklist + +touch "$M/ready" +echo "setup done" diff --git a/tasks/format-code-task-001409/tests/test.patch b/tasks/format-code-task-001409/tests/test.patch new file mode 100644 index 0000000000000000000000000000000000000000..a998461a3af17b0803bc90f2dadb3f6b3f97985f --- /dev/null +++ b/tasks/format-code-task-001409/tests/test.patch @@ -0,0 +1,50 @@ +diff --git a/src/js/components/Grid/__tests__/Grid-test.js b/src/js/components/Grid/__tests__/Grid-test.js +index 573cf58f7..8d5a74943 100644 +--- a/src/js/components/Grid/__tests__/Grid-test.js ++++ b/src/js/components/Grid/__tests__/Grid-test.js +@@ -372,4 +372,23 @@ describe('Grid', () => { + ); + expect(container).toMatchSnapshot(); + }); ++ ++ test('Grid.available is truthy in SSR (no window)', () => { ++ jest.isolateModules(() => { ++ const originalWindow = global.window; ++ ++ delete global.window; ++ let availableInSSR; ++ try { ++ // eslint-disable-next-line global-require ++ availableInSSR = require('../Grid').Grid.available; ++ } finally { ++ global.window = originalWindow; ++ } ++ ++ ++ ++ expect(availableInSSR).toBeTruthy(); ++ }); ++ }); + }); +diff --git a/test_commands.json b/test_commands.json +new file mode 100644 +index 000000000..ab0d54bad +--- /dev/null ++++ b/test_commands.json +@@ -0,0 +1,3 @@ ++{ ++ "test_commands": ["npx jest src/js/components/Grid/__tests__/Grid-test.js --no-coverage"] ++} +diff --git a/mimo_test_command.sh b/mimo_test_command.sh +new file mode 100755 +--- /dev/null ++++ b/mimo_test_command.sh +@@ -0,0 +1,8 @@ ++#!/usr/bin/env bash ++ ++set -uo pipefail ++cd /testbed ++rc=0 ++npx jest src/js/components/Grid/__tests__/Grid-test.js --no-coverage ++rc=$(( rc | $? )) ++exit $rc diff --git a/tasks/format-code-task-001409/tests/test.sh b/tasks/format-code-task-001409/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..b34f739270b4e297c828b67340c3075da94b776e --- /dev/null +++ b/tasks/format-code-task-001409/tests/test.sh @@ -0,0 +1,39 @@ +#!/bin/bash +# Code grading, mimoagent opensource_code.py: reset the files the hidden test patch touches, apply it, run the +# task's test command; reward 1 when it exits 0. A testbed failure (reset or apply) writes no reward: not scored. +M=/var/lib/mimo +CWD=/testbed +V=/logs/verifier +mkdir -p "$V" +BASE=$(cat "$M/base" 2>/dev/null) || { echo "setup never ran (no $M/base)" >&2; exit 1; } +cd "$CWD" || exit 1 +if [ -d "$M/git-hidden" ]; then rm -rf "$CWD/.git"; mv "$M/git-hidden" "$CWD/.git"; fi +# the agent's change against the base, so its own commits count too +git add -A >/dev/null 2>&1 && git -c core.fileMode=false diff --cached "$BASE" > "$V/agent.diff" +git reset -q +if ! ( +while IFS= read -r tf; do + [ -z "$tf" ] && continue + if git cat-file -e $BASE:"$tf" 2>/dev/null; then + git checkout $BASE -- "$tf" 2>/dev/null || true + else + git rm -f --cached "$tf" >/dev/null 2>&1 || true + rm -f "$tf" + fi +done <<'EOF_RESET_TEST_FILES' +src/js/components/Grid/__tests__/Grid-test.js +test_commands.json +mimo_test_command.sh +EOF_RESET_TEST_FILES + +); then echo "could not reset the test files (testbed problem, not scored)" >&2; exit 1; fi +if ! git apply --verbose /tests/test.patch > "$V/apply.log" 2>&1; then + cat "$V/apply.log" >&2 + echo "the hidden tests could not be applied (testbed problem, not scored)" >&2 + exit 1 +fi +timeout 1800 sh -c "$(cat /tests/test_command.sh)" > "$V/test_output.log" 2>&1 +RC=$? +tail -c 12000 "$V/test_output.log" +if [ $RC -eq 0 ]; then echo 1 > "$V/reward.txt"; else echo 0 > "$V/reward.txt"; fi +echo "test command exited $RC" diff --git a/tasks/format-code-task-001409/tests/test_command.sh b/tasks/format-code-task-001409/tests/test_command.sh new file mode 100644 index 0000000000000000000000000000000000000000..7cb23076694ad17d72e8296d62b2b240083e36db --- /dev/null +++ b/tasks/format-code-task-001409/tests/test_command.sh @@ -0,0 +1 @@ +bash /testbed/mimo_test_command.sh \ No newline at end of file diff --git a/tasks/format-code-task-001436/environment/Dockerfile b/tasks/format-code-task-001436/environment/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..12c2fc4b84d965bac99a76e996f14aaf9fdb072f --- /dev/null +++ b/tasks/format-code-task-001436/environment/Dockerfile @@ -0,0 +1,3 @@ +# The task's image, pinned by digest (the same as [environment].docker_image). +# Setup runs at start from [environment.healthcheck]; environment/setup/ is its readable copy. +FROM docker.io/xiaomimimo/mimo-v2.6-rl-oss@sha256:92ee7a07325a7ae5cbc3444e5b2accfb3d3e66630bb3f008c784bd2ebccdae86 diff --git a/tasks/format-code-task-001436/environment/setup/files/blocklist b/tasks/format-code-task-001436/environment/setup/files/blocklist new file mode 100644 index 0000000000000000000000000000000000000000..a8e4bdc4c7d9b739c047a3cb58ea72a1bb05bcbc --- /dev/null +++ b/tasks/format-code-task-001436/environment/setup/files/blocklist @@ -0,0 +1,33 @@ +# mimo answer-leak blocklist (mimoagent) +0.0.0.0 github.com +0.0.0.0 www.github.com +0.0.0.0 api.github.com +0.0.0.0 raw.githubusercontent.com +0.0.0.0 codeload.github.com +0.0.0.0 objects.githubusercontent.com +0.0.0.0 gist.github.com +0.0.0.0 gist.githubusercontent.com +0.0.0.0 gitlab.com +0.0.0.0 bitbucket.org +0.0.0.0 sourceforge.net +0.0.0.0 git.kernel.org +0.0.0.0 chromium.googlesource.com +0.0.0.0 android.googlesource.com +0.0.0.0 sourcegraph.com +0.0.0.0 bugs.chromium.org +0.0.0.0 issues.oss-fuzz.com +0.0.0.0 oss-fuzz.com +0.0.0.0 osv.dev +0.0.0.0 api.osv.dev +0.0.0.0 bugzilla.mozilla.org +0.0.0.0 proxy.golang.org +0.0.0.0 sum.golang.org +0.0.0.0 pkg.go.dev +0.0.0.0 google.com +0.0.0.0 www.google.com +0.0.0.0 bing.com +0.0.0.0 www.bing.com +0.0.0.0 duckduckgo.com +0.0.0.0 html.duckduckgo.com +0.0.0.0 search.brave.com +0.0.0.0 stackoverflow.com diff --git a/tasks/format-code-task-001436/environment/setup/setup.sh b/tasks/format-code-task-001436/environment/setup/setup.sh new file mode 100644 index 0000000000000000000000000000000000000000..d883db90cfcfb48f7a139861bbe9f6b5d95cad6f --- /dev/null +++ b/tasks/format-code-task-001436/environment/setup/setup.sh @@ -0,0 +1,34 @@ +#!/bin/bash +# Runs once, as root, before the agent starts: Harbor's [environment.healthcheck] unpacks this folder into +# /var/lib/mimo and runs it. Generated by mimo_harbor; see its README for how each step maps to Xiaomi's harness. +M=/var/lib/mimo +[ -f "$M/ready" ] && exit 0 +chmod 700 "$M" +fail() { echo "setup: $*" >&2; exit 1; } +# the answer-leak blocklist (mimoagent), applied to /etc/hosts by the agent right after it installs +write_blocklist() { cp "$M/files/blocklist" "$M/blocklist"; } + +# Code: mimoagent environments/datasets/opensource_code.py + base.py, as the explorer runs it (app/runner/domains.py Code). +CWD=/testbed +git config --global --add safe.directory "$CWD" +cd "$CWD" || fail "no working directory $CWD" +if ! git rev-parse --git-dir >/dev/null 2>&1; then # a bare source tree: give it a baseline commit + git init -q && git add -A && git -c user.name=mimo -c user.email=mimo@localhost commit -q -m baseline --allow-empty +fi +BASE=$(git rev-parse HEAD 2>/dev/null) +[ ${#BASE} -eq 40 ] || fail "could not resolve the base commit in $CWD" +echo "$BASE" > "$M/base" +# Images are built with history truncated at the base. If one is not, the fix could be read out of git log, +# so .git is hidden while the agent works and put back for grading. +LATER=$(git rev-list --all --not "$BASE" 2>/dev/null | head -n 5 | grep -c . || true) +rm -f /tmp/fail.log /tmp/pass.log /tmp/patch.diff /tmp/test_patch.diff /tmp/*.log 2>/dev/null; rm -rf /tmp/claude-0 /tmp/claude-* /tmp/testem-* /tmp/puppeteer_dev_chrome_profile-* 2>/dev/null; rm -f /tmp/test_files.json 2>/dev/null; rm -rf /tmp/jest_* /tmp/jest-* /tmp/build /tmp/build_env 2>/dev/null; rm -rf /tmp/pytest-of-root /tmp/pytest-* /tmp/.pytest_cache /tmp/__pycache__ 2>/dev/null; rm -rf /tmp/go-build* /tmp/standards /tmp/wordpress /tmp/zig-* /tmp/testbase /tmp/testbed 2>/dev/null; rm -f /tmp/tmp*.tmp /tmp/*.bak /tmp/expect* /tmp/butwas* 2>/dev/null; rm -rf /root/.cache/go-build 2>/dev/null; rm -rf /tests 2>/dev/null; find /logs -mindepth 1 -delete 2>/dev/null; mkdir -p /logs/agent /logs/verifier /logs/artifacts; chmod 777 /logs/agent /logs/verifier /logs/artifacts; find /var/log -type f -delete 2>/dev/null || true; rm -rf /var/lib/postgresql/*/*/log /var/lib/postgresql/*/*/pg_log 2>/dev/null || true; find /var/lib/mysql /var/lib/mongodb -type f -name '*.log' -delete 2>/dev/null || true; rm -rf /root/.npm/_logs /root/.babel.json /root/.pytest_cache 2>/dev/null || true; find / -maxdepth 4 -xdev -name task_description.md -path '*/.build_env/*' -delete 2>/dev/null || true; true +git clean -fdx --exclude=node_modules --exclude=bower_components --exclude=.husky --exclude=vendor --exclude=third_party --exclude=_deps --exclude=vcpkg_installed --exclude=.venv --exclude=venv --exclude=.gradle --exclude=target --exclude=.build --exclude=lib --exclude=.bundle --exclude=Manifest.toml --exclude=_build --exclude=.stack-work --exclude=dist-newstyle >/dev/null 2>&1 +find /root/.m2 -type f \( -name '*-SNAPSHOT.jar' -o -name '*-SNAPSHOT-sources.jar' -o -name '*-SNAPSHOT-tests.jar' -o -name '*-SNAPSHOT-test-sources.jar' \) -delete 2>/dev/null; rm -rf /root/.julia/compiled 2>/dev/null; rm -rf /root/.gradle/caches/build-cache-* /root/.gradle/daemon 2>/dev/null; rm -rf /root/.gradle/caches/*/scripts /root/.gradle/caches/jars-* 2>/dev/null; rm -rf /root/.cache/bazel 2>/dev/null; true +if [ "$LATER" -gt 0 ]; then + mv "$CWD/.git" "$M/git-hidden" + echo "history not truncated at ${BASE:0:12}: .git hidden while the agent works" +fi +write_blocklist + +touch "$M/ready" +echo "setup done" diff --git a/tasks/format-code-task-001436/tests/test.patch b/tasks/format-code-task-001436/tests/test.patch new file mode 100644 index 0000000000000000000000000000000000000000..93da9de7a92c4f52d5df938dc1cbc7718a55d85b --- /dev/null +++ b/tasks/format-code-task-001436/tests/test.patch @@ -0,0 +1,74 @@ +diff --git a/metric/handler_test.go b/metric/handler_test.go +index 27892aaf10..2931e135b4 100644 +--- a/metric/handler_test.go ++++ b/metric/handler_test.go +@@ -26,7 +26,7 @@ func TestHandleMetrics(t *testing.T) { + session := mock.NewMockSession(controller) + session.EXPECT().Get(r).Return(mockUser, nil) + +- NewServer(session).ServeHTTP(w, r) ++ NewServer(session, false).ServeHTTP(w, r) + if got, want := w.Code, 200; got != want { + t.Errorf("Want status code %d, got %d", want, got) + } +@@ -46,13 +46,30 @@ func TestHandleMetrics_NoSession(t *testing.T) { + session := mock.NewMockSession(controller) + session.EXPECT().Get(r).Return(nil, nil) + +- NewServer(session).ServeHTTP(w, r) ++ NewServer(session, false).ServeHTTP(w, r) + + if got, want := w.Code, 401; got != want { + t.Errorf("Want status code %d, got %d", want, got) + } + } + ++func TestHandleMetrics_NoSessionButAnonymousAccessEnabled(t *testing.T) { ++ controller := gomock.NewController(t) ++ defer controller.Finish() ++ ++ w := httptest.NewRecorder() ++ r := httptest.NewRequest("GET", "/", nil) ++ ++ session := mock.NewMockSession(controller) ++ session.EXPECT().Get(r).Return(nil, nil) ++ ++ NewServer(session, true).ServeHTTP(w, r) ++ ++ if got, want := w.Code, 200; got != want { ++ t.Errorf("Want status code %d, got %d", want, got) ++ } ++} ++ + func TestHandleMetrics_AccessDenied(t *testing.T) { + controller := gomock.NewController(t) + defer controller.Finish() +@@ -64,7 +81,7 @@ func TestHandleMetrics_AccessDenied(t *testing.T) { + session := mock.NewMockSession(controller) + session.EXPECT().Get(r).Return(mockUser, nil) + +- NewServer(session).ServeHTTP(w, r) ++ NewServer(session, false).ServeHTTP(w, r) + if got, want := w.Code, 403; got != want { + t.Errorf("Want status code %d, got %d", want, got) + } +diff --git a/mimo_build_env.tar.gz.b64 b/mimo_build_env.tar.gz.b64 +new file mode 100644 +--- /dev/null ++++ b/mimo_build_env.tar.gz.b64 +@@ -0,0 +1,4 @@ ++H4sIAAAAAAAAA+3R0QqCMBTG8V37FOcF0q2aPk6YkxLUga56/cwLi6C8SSL6/27Oxhnsgy/en6ra ++7cr2nKil6EFm7TgHz3M8G7vWa2M3RmdKG2Mzq8QulujBqQ95J6I678O7d3P7HxXf+w9lH3aFb5q8 ++dXF//Nwfs/2nZupf23Tof5sao0R/LsJrf95/4WQsfl+66OCl8U6cv7S1z8f7bSWrs8RJU4auKpLo ++24EBAAAAAAAAAAAAAAAATK5FQFziACgAAA== +diff --git a/mimo_test_command.sh b/mimo_test_command.sh +new file mode 100755 +--- /dev/null ++++ b/mimo_test_command.sh +@@ -0,0 +1,6 @@ ++#!/usr/bin/env bash ++ ++set -uo pipefail ++cd /testbed || exit 1 ++base64 -d mimo_build_env.tar.gz.b64 | tar -xzf - -C /testbed || exit 1 ++exec bash -lc 'cd /testbed && bash -eo pipefail /testbed/.build_env/test_command.sh' diff --git a/tasks/format-code-task-001436/tests/test.sh b/tasks/format-code-task-001436/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..fe740632239bf575cef1be710c5f13288cfd8d26 --- /dev/null +++ b/tasks/format-code-task-001436/tests/test.sh @@ -0,0 +1,39 @@ +#!/bin/bash +# Code grading, mimoagent opensource_code.py: reset the files the hidden test patch touches, apply it, run the +# task's test command; reward 1 when it exits 0. A testbed failure (reset or apply) writes no reward: not scored. +M=/var/lib/mimo +CWD=/testbed +V=/logs/verifier +mkdir -p "$V" +BASE=$(cat "$M/base" 2>/dev/null) || { echo "setup never ran (no $M/base)" >&2; exit 1; } +cd "$CWD" || exit 1 +if [ -d "$M/git-hidden" ]; then rm -rf "$CWD/.git"; mv "$M/git-hidden" "$CWD/.git"; fi +# the agent's change against the base, so its own commits count too +git add -A >/dev/null 2>&1 && git -c core.fileMode=false diff --cached "$BASE" > "$V/agent.diff" +git reset -q +if ! ( +while IFS= read -r tf; do + [ -z "$tf" ] && continue + if git cat-file -e $BASE:"$tf" 2>/dev/null; then + git checkout $BASE -- "$tf" 2>/dev/null || true + else + git rm -f --cached "$tf" >/dev/null 2>&1 || true + rm -f "$tf" + fi +done <<'EOF_RESET_TEST_FILES' +metric/handler_test.go +mimo_build_env.tar.gz.b64 +mimo_test_command.sh +EOF_RESET_TEST_FILES + +); then echo "could not reset the test files (testbed problem, not scored)" >&2; exit 1; fi +if ! git apply --verbose /tests/test.patch > "$V/apply.log" 2>&1; then + cat "$V/apply.log" >&2 + echo "the hidden tests could not be applied (testbed problem, not scored)" >&2 + exit 1 +fi +timeout 1800 sh -c "$(cat /tests/test_command.sh)" > "$V/test_output.log" 2>&1 +RC=$? +tail -c 12000 "$V/test_output.log" +if [ $RC -eq 0 ]; then echo 1 > "$V/reward.txt"; else echo 0 > "$V/reward.txt"; fi +echo "test command exited $RC" diff --git a/tasks/format-code-task-001436/tests/test_command.sh b/tasks/format-code-task-001436/tests/test_command.sh new file mode 100644 index 0000000000000000000000000000000000000000..7cb23076694ad17d72e8296d62b2b240083e36db --- /dev/null +++ b/tasks/format-code-task-001436/tests/test_command.sh @@ -0,0 +1 @@ +bash /testbed/mimo_test_command.sh \ No newline at end of file diff --git a/tasks/format-code-task-001449/environment/Dockerfile b/tasks/format-code-task-001449/environment/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..ed74a8dcaf10c0509df9aa152b464af5573c2b13 --- /dev/null +++ b/tasks/format-code-task-001449/environment/Dockerfile @@ -0,0 +1,3 @@ +# The task's image, pinned by digest (the same as [environment].docker_image). +# Setup runs at start from [environment.healthcheck]; environment/setup/ is its readable copy. +FROM docker.io/xiaomimimo/mimo-v2.6-rl-oss@sha256:3552812c387a2e015ac9171e49e3b62d229e3b466621dfdfeb2d6f1e77a82ee6 diff --git a/tasks/format-code-task-001449/environment/setup/files/blocklist b/tasks/format-code-task-001449/environment/setup/files/blocklist new file mode 100644 index 0000000000000000000000000000000000000000..a8e4bdc4c7d9b739c047a3cb58ea72a1bb05bcbc --- /dev/null +++ b/tasks/format-code-task-001449/environment/setup/files/blocklist @@ -0,0 +1,33 @@ +# mimo answer-leak blocklist (mimoagent) +0.0.0.0 github.com +0.0.0.0 www.github.com +0.0.0.0 api.github.com +0.0.0.0 raw.githubusercontent.com +0.0.0.0 codeload.github.com +0.0.0.0 objects.githubusercontent.com +0.0.0.0 gist.github.com +0.0.0.0 gist.githubusercontent.com +0.0.0.0 gitlab.com +0.0.0.0 bitbucket.org +0.0.0.0 sourceforge.net +0.0.0.0 git.kernel.org +0.0.0.0 chromium.googlesource.com +0.0.0.0 android.googlesource.com +0.0.0.0 sourcegraph.com +0.0.0.0 bugs.chromium.org +0.0.0.0 issues.oss-fuzz.com +0.0.0.0 oss-fuzz.com +0.0.0.0 osv.dev +0.0.0.0 api.osv.dev +0.0.0.0 bugzilla.mozilla.org +0.0.0.0 proxy.golang.org +0.0.0.0 sum.golang.org +0.0.0.0 pkg.go.dev +0.0.0.0 google.com +0.0.0.0 www.google.com +0.0.0.0 bing.com +0.0.0.0 www.bing.com +0.0.0.0 duckduckgo.com +0.0.0.0 html.duckduckgo.com +0.0.0.0 search.brave.com +0.0.0.0 stackoverflow.com diff --git a/tasks/format-code-task-001449/environment/setup/setup.sh b/tasks/format-code-task-001449/environment/setup/setup.sh new file mode 100644 index 0000000000000000000000000000000000000000..d883db90cfcfb48f7a139861bbe9f6b5d95cad6f --- /dev/null +++ b/tasks/format-code-task-001449/environment/setup/setup.sh @@ -0,0 +1,34 @@ +#!/bin/bash +# Runs once, as root, before the agent starts: Harbor's [environment.healthcheck] unpacks this folder into +# /var/lib/mimo and runs it. Generated by mimo_harbor; see its README for how each step maps to Xiaomi's harness. +M=/var/lib/mimo +[ -f "$M/ready" ] && exit 0 +chmod 700 "$M" +fail() { echo "setup: $*" >&2; exit 1; } +# the answer-leak blocklist (mimoagent), applied to /etc/hosts by the agent right after it installs +write_blocklist() { cp "$M/files/blocklist" "$M/blocklist"; } + +# Code: mimoagent environments/datasets/opensource_code.py + base.py, as the explorer runs it (app/runner/domains.py Code). +CWD=/testbed +git config --global --add safe.directory "$CWD" +cd "$CWD" || fail "no working directory $CWD" +if ! git rev-parse --git-dir >/dev/null 2>&1; then # a bare source tree: give it a baseline commit + git init -q && git add -A && git -c user.name=mimo -c user.email=mimo@localhost commit -q -m baseline --allow-empty +fi +BASE=$(git rev-parse HEAD 2>/dev/null) +[ ${#BASE} -eq 40 ] || fail "could not resolve the base commit in $CWD" +echo "$BASE" > "$M/base" +# Images are built with history truncated at the base. If one is not, the fix could be read out of git log, +# so .git is hidden while the agent works and put back for grading. +LATER=$(git rev-list --all --not "$BASE" 2>/dev/null | head -n 5 | grep -c . || true) +rm -f /tmp/fail.log /tmp/pass.log /tmp/patch.diff /tmp/test_patch.diff /tmp/*.log 2>/dev/null; rm -rf /tmp/claude-0 /tmp/claude-* /tmp/testem-* /tmp/puppeteer_dev_chrome_profile-* 2>/dev/null; rm -f /tmp/test_files.json 2>/dev/null; rm -rf /tmp/jest_* /tmp/jest-* /tmp/build /tmp/build_env 2>/dev/null; rm -rf /tmp/pytest-of-root /tmp/pytest-* /tmp/.pytest_cache /tmp/__pycache__ 2>/dev/null; rm -rf /tmp/go-build* /tmp/standards /tmp/wordpress /tmp/zig-* /tmp/testbase /tmp/testbed 2>/dev/null; rm -f /tmp/tmp*.tmp /tmp/*.bak /tmp/expect* /tmp/butwas* 2>/dev/null; rm -rf /root/.cache/go-build 2>/dev/null; rm -rf /tests 2>/dev/null; find /logs -mindepth 1 -delete 2>/dev/null; mkdir -p /logs/agent /logs/verifier /logs/artifacts; chmod 777 /logs/agent /logs/verifier /logs/artifacts; find /var/log -type f -delete 2>/dev/null || true; rm -rf /var/lib/postgresql/*/*/log /var/lib/postgresql/*/*/pg_log 2>/dev/null || true; find /var/lib/mysql /var/lib/mongodb -type f -name '*.log' -delete 2>/dev/null || true; rm -rf /root/.npm/_logs /root/.babel.json /root/.pytest_cache 2>/dev/null || true; find / -maxdepth 4 -xdev -name task_description.md -path '*/.build_env/*' -delete 2>/dev/null || true; true +git clean -fdx --exclude=node_modules --exclude=bower_components --exclude=.husky --exclude=vendor --exclude=third_party --exclude=_deps --exclude=vcpkg_installed --exclude=.venv --exclude=venv --exclude=.gradle --exclude=target --exclude=.build --exclude=lib --exclude=.bundle --exclude=Manifest.toml --exclude=_build --exclude=.stack-work --exclude=dist-newstyle >/dev/null 2>&1 +find /root/.m2 -type f \( -name '*-SNAPSHOT.jar' -o -name '*-SNAPSHOT-sources.jar' -o -name '*-SNAPSHOT-tests.jar' -o -name '*-SNAPSHOT-test-sources.jar' \) -delete 2>/dev/null; rm -rf /root/.julia/compiled 2>/dev/null; rm -rf /root/.gradle/caches/build-cache-* /root/.gradle/daemon 2>/dev/null; rm -rf /root/.gradle/caches/*/scripts /root/.gradle/caches/jars-* 2>/dev/null; rm -rf /root/.cache/bazel 2>/dev/null; true +if [ "$LATER" -gt 0 ]; then + mv "$CWD/.git" "$M/git-hidden" + echo "history not truncated at ${BASE:0:12}: .git hidden while the agent works" +fi +write_blocklist + +touch "$M/ready" +echo "setup done" diff --git a/tasks/format-code-task-001449/tests/test.patch b/tasks/format-code-task-001449/tests/test.patch new file mode 100644 index 0000000000000000000000000000000000000000..8343df962ef9f61bc2da6795fc706bcab4bed824 --- /dev/null +++ b/tasks/format-code-task-001449/tests/test.patch @@ -0,0 +1,118 @@ +diff --git a/builder/azure/arm/config_test.go b/builder/azure/arm/config_test.go +index d25329dc7e8..d9b79eabeca 100644 +--- a/builder/azure/arm/config_test.go ++++ b/builder/azure/arm/config_test.go +@@ -124,6 +124,87 @@ func TestConfigShouldNotDefaultImageVersionIfCustomImage(t *testing.T) { + } + } + ++func Test_newConfig_MSI(t *testing.T) { ++ baseConfig := map[string]string{ ++ "capture_name_prefix": "ignore", ++ "capture_container_name": "ignore", ++ "location": "ignore", ++ "image_url": "ignore", ++ "storage_account": "ignore", ++ "resource_group_name": "ignore", ++ "os_type": constants.Target_Linux, ++ } ++ ++ tests := []struct { ++ name string ++ args []interface{} ++ wantErr bool ++ }{ ++ { ++ name: "no client_id and no client_secret should enable MSI auth", ++ args: []interface{}{ ++ baseConfig, ++ getPackerConfiguration(), ++ }, ++ wantErr: false, ++ }, ++ { ++ name: "subscription_id is will be taken from MSI", ++ args: []interface{}{ ++ baseConfig, ++ map[string]string{ ++ "subscription_id": "error", ++ }, ++ getPackerConfiguration(), ++ }, ++ wantErr: false, ++ }, ++ { ++ name: "client_id without client_secret should error", ++ args: []interface{}{ ++ baseConfig, ++ map[string]string{ ++ "client_id": "error", ++ }, ++ getPackerConfiguration(), ++ }, ++ wantErr: true, ++ }, ++ { ++ name: "client_secret without client_id should error", ++ args: []interface{}{ ++ baseConfig, ++ map[string]string{ ++ "client_secret": "error", ++ }, ++ getPackerConfiguration(), ++ }, ++ wantErr: true, ++ }, ++ { ++ name: "missing subscription_id", ++ args: []interface{}{ ++ baseConfig, ++ map[string]string{ ++ "client_id": "ok", ++ "client_secret": "ok", ++ }, ++ getPackerConfiguration(), ++ }, ++ wantErr: true, ++ }, ++ } ++ for _, tt := range tests { ++ t.Run(tt.name, func(t *testing.T) { ++ _, _, err := newConfig(tt.args...) ++ if (err != nil) != tt.wantErr { ++ t.Errorf("newConfig() error = %v, wantErr %v", err, tt.wantErr) ++ return ++ } ++ }) ++ } ++} ++ + func TestConfigShouldNormalizeOSTypeCase(t *testing.T) { + config := map[string]string{ + "capture_name_prefix": "ignore", +diff --git a/mimo_build_env.tar.gz.b64 b/mimo_build_env.tar.gz.b64 +new file mode 100644 +--- /dev/null ++++ b/mimo_build_env.tar.gz.b64 +@@ -0,0 +1,10 @@ ++H4sIAAAAAAAAA+3U3WrUQBQH8L3OUxzpzZaaTGY/3Ku9ENQqKBWt12UyOdmMm8yEmUkKXvkQPqFP ++4kkWaynoIrSI9PxYSCCTk3/OmU1W9KYpr9AOYvZQcrJZr6cjuXuczuV6IRfLXK7kYpZLud7kM1g/ ++WKJb+hCVB5h55+Kf1h27/p/Kfs0/YohX2rWtsmUW6vt7xpH5y3yzuZn/UtI6uXomlzPI7y/C7z3y +++Z88EYWxolChTgJGSLF30JkOK2WaRJcwbYsCyyQ5gY/XJuoaooNzBzJbLOH7129g8Ro9DOiDcTbA ++nC6szk4BbeW8RgjRGx2nFRF0jXofqFSsVYTCo9rTqQngmpKWaFciRUGYW2dTTeWishGoUEvLx0p2 ++F8BYeKWiaqrTLClxSMMh1u6QaQx6OZakn4LOY9q6sm8wjKE77z6jjtAHqkR3DGhL5zN4E6GlnQCN ++GXCsf37x/vnl6yxp96XxkHYgxvmLnRPBa7Ezse6LjP4roqbGGe18lzQW0lDZm4Ydv0V0Su/Rj4E/ ++9Jb6gEB7cUdtGktAZRoEerWa0kgp3128+PT25dZVFcx/Bn8K1lHyw/tRN/RfPPVuUWrf9NhMTJ8E ++9EJ96T0K5VsB6QA0jt7GrYQ0mhZdH7eLNvnX25cxxhhjjDHGGGOMMcYYY4wxxhhj7NH7ASTEfVIA ++KAAA +diff --git a/mimo_test_command.sh b/mimo_test_command.sh +new file mode 100755 +--- /dev/null ++++ b/mimo_test_command.sh +@@ -0,0 +1,6 @@ ++#!/usr/bin/env bash ++ ++set -uo pipefail ++cd /testbed || exit 1 ++base64 -d mimo_build_env.tar.gz.b64 | tar -xzf - -C /testbed || exit 1 ++exec bash -lc 'cd /testbed && bash -eo pipefail /testbed/.build_env/test_command.sh' diff --git a/tasks/format-code-task-001449/tests/test.sh b/tasks/format-code-task-001449/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..4f05c6eda6636579887f2215ce50876ab694f9a6 --- /dev/null +++ b/tasks/format-code-task-001449/tests/test.sh @@ -0,0 +1,39 @@ +#!/bin/bash +# Code grading, mimoagent opensource_code.py: reset the files the hidden test patch touches, apply it, run the +# task's test command; reward 1 when it exits 0. A testbed failure (reset or apply) writes no reward: not scored. +M=/var/lib/mimo +CWD=/testbed +V=/logs/verifier +mkdir -p "$V" +BASE=$(cat "$M/base" 2>/dev/null) || { echo "setup never ran (no $M/base)" >&2; exit 1; } +cd "$CWD" || exit 1 +if [ -d "$M/git-hidden" ]; then rm -rf "$CWD/.git"; mv "$M/git-hidden" "$CWD/.git"; fi +# the agent's change against the base, so its own commits count too +git add -A >/dev/null 2>&1 && git -c core.fileMode=false diff --cached "$BASE" > "$V/agent.diff" +git reset -q +if ! ( +while IFS= read -r tf; do + [ -z "$tf" ] && continue + if git cat-file -e $BASE:"$tf" 2>/dev/null; then + git checkout $BASE -- "$tf" 2>/dev/null || true + else + git rm -f --cached "$tf" >/dev/null 2>&1 || true + rm -f "$tf" + fi +done <<'EOF_RESET_TEST_FILES' +builder/azure/arm/config_test.go +mimo_build_env.tar.gz.b64 +mimo_test_command.sh +EOF_RESET_TEST_FILES + +); then echo "could not reset the test files (testbed problem, not scored)" >&2; exit 1; fi +if ! git apply --verbose /tests/test.patch > "$V/apply.log" 2>&1; then + cat "$V/apply.log" >&2 + echo "the hidden tests could not be applied (testbed problem, not scored)" >&2 + exit 1 +fi +timeout 1800 sh -c "$(cat /tests/test_command.sh)" > "$V/test_output.log" 2>&1 +RC=$? +tail -c 12000 "$V/test_output.log" +if [ $RC -eq 0 ]; then echo 1 > "$V/reward.txt"; else echo 0 > "$V/reward.txt"; fi +echo "test command exited $RC" diff --git a/tasks/format-code-task-001449/tests/test_command.sh b/tasks/format-code-task-001449/tests/test_command.sh new file mode 100644 index 0000000000000000000000000000000000000000..7cb23076694ad17d72e8296d62b2b240083e36db --- /dev/null +++ b/tasks/format-code-task-001449/tests/test_command.sh @@ -0,0 +1 @@ +bash /testbed/mimo_test_command.sh \ No newline at end of file diff --git a/tasks/format-code-task-001453/environment/Dockerfile b/tasks/format-code-task-001453/environment/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..906542101d1e1f495b4065e4f7619c8abe853a69 --- /dev/null +++ b/tasks/format-code-task-001453/environment/Dockerfile @@ -0,0 +1,3 @@ +# The task's image, pinned by digest (the same as [environment].docker_image). +# Setup runs at start from [environment.healthcheck]; environment/setup/ is its readable copy. +FROM docker.io/xiaomimimo/mimo-v2.6-rl-oss@sha256:c2fc2e2f4534f6fce79f0dd108e517ef85f6f247380a463c37547dc5eafabb2d diff --git a/tasks/format-code-task-001453/environment/setup/files/blocklist b/tasks/format-code-task-001453/environment/setup/files/blocklist new file mode 100644 index 0000000000000000000000000000000000000000..a8e4bdc4c7d9b739c047a3cb58ea72a1bb05bcbc --- /dev/null +++ b/tasks/format-code-task-001453/environment/setup/files/blocklist @@ -0,0 +1,33 @@ +# mimo answer-leak blocklist (mimoagent) +0.0.0.0 github.com +0.0.0.0 www.github.com +0.0.0.0 api.github.com +0.0.0.0 raw.githubusercontent.com +0.0.0.0 codeload.github.com +0.0.0.0 objects.githubusercontent.com +0.0.0.0 gist.github.com +0.0.0.0 gist.githubusercontent.com +0.0.0.0 gitlab.com +0.0.0.0 bitbucket.org +0.0.0.0 sourceforge.net +0.0.0.0 git.kernel.org +0.0.0.0 chromium.googlesource.com +0.0.0.0 android.googlesource.com +0.0.0.0 sourcegraph.com +0.0.0.0 bugs.chromium.org +0.0.0.0 issues.oss-fuzz.com +0.0.0.0 oss-fuzz.com +0.0.0.0 osv.dev +0.0.0.0 api.osv.dev +0.0.0.0 bugzilla.mozilla.org +0.0.0.0 proxy.golang.org +0.0.0.0 sum.golang.org +0.0.0.0 pkg.go.dev +0.0.0.0 google.com +0.0.0.0 www.google.com +0.0.0.0 bing.com +0.0.0.0 www.bing.com +0.0.0.0 duckduckgo.com +0.0.0.0 html.duckduckgo.com +0.0.0.0 search.brave.com +0.0.0.0 stackoverflow.com diff --git a/tasks/format-code-task-001453/environment/setup/setup.sh b/tasks/format-code-task-001453/environment/setup/setup.sh new file mode 100644 index 0000000000000000000000000000000000000000..d883db90cfcfb48f7a139861bbe9f6b5d95cad6f --- /dev/null +++ b/tasks/format-code-task-001453/environment/setup/setup.sh @@ -0,0 +1,34 @@ +#!/bin/bash +# Runs once, as root, before the agent starts: Harbor's [environment.healthcheck] unpacks this folder into +# /var/lib/mimo and runs it. Generated by mimo_harbor; see its README for how each step maps to Xiaomi's harness. +M=/var/lib/mimo +[ -f "$M/ready" ] && exit 0 +chmod 700 "$M" +fail() { echo "setup: $*" >&2; exit 1; } +# the answer-leak blocklist (mimoagent), applied to /etc/hosts by the agent right after it installs +write_blocklist() { cp "$M/files/blocklist" "$M/blocklist"; } + +# Code: mimoagent environments/datasets/opensource_code.py + base.py, as the explorer runs it (app/runner/domains.py Code). +CWD=/testbed +git config --global --add safe.directory "$CWD" +cd "$CWD" || fail "no working directory $CWD" +if ! git rev-parse --git-dir >/dev/null 2>&1; then # a bare source tree: give it a baseline commit + git init -q && git add -A && git -c user.name=mimo -c user.email=mimo@localhost commit -q -m baseline --allow-empty +fi +BASE=$(git rev-parse HEAD 2>/dev/null) +[ ${#BASE} -eq 40 ] || fail "could not resolve the base commit in $CWD" +echo "$BASE" > "$M/base" +# Images are built with history truncated at the base. If one is not, the fix could be read out of git log, +# so .git is hidden while the agent works and put back for grading. +LATER=$(git rev-list --all --not "$BASE" 2>/dev/null | head -n 5 | grep -c . || true) +rm -f /tmp/fail.log /tmp/pass.log /tmp/patch.diff /tmp/test_patch.diff /tmp/*.log 2>/dev/null; rm -rf /tmp/claude-0 /tmp/claude-* /tmp/testem-* /tmp/puppeteer_dev_chrome_profile-* 2>/dev/null; rm -f /tmp/test_files.json 2>/dev/null; rm -rf /tmp/jest_* /tmp/jest-* /tmp/build /tmp/build_env 2>/dev/null; rm -rf /tmp/pytest-of-root /tmp/pytest-* /tmp/.pytest_cache /tmp/__pycache__ 2>/dev/null; rm -rf /tmp/go-build* /tmp/standards /tmp/wordpress /tmp/zig-* /tmp/testbase /tmp/testbed 2>/dev/null; rm -f /tmp/tmp*.tmp /tmp/*.bak /tmp/expect* /tmp/butwas* 2>/dev/null; rm -rf /root/.cache/go-build 2>/dev/null; rm -rf /tests 2>/dev/null; find /logs -mindepth 1 -delete 2>/dev/null; mkdir -p /logs/agent /logs/verifier /logs/artifacts; chmod 777 /logs/agent /logs/verifier /logs/artifacts; find /var/log -type f -delete 2>/dev/null || true; rm -rf /var/lib/postgresql/*/*/log /var/lib/postgresql/*/*/pg_log 2>/dev/null || true; find /var/lib/mysql /var/lib/mongodb -type f -name '*.log' -delete 2>/dev/null || true; rm -rf /root/.npm/_logs /root/.babel.json /root/.pytest_cache 2>/dev/null || true; find / -maxdepth 4 -xdev -name task_description.md -path '*/.build_env/*' -delete 2>/dev/null || true; true +git clean -fdx --exclude=node_modules --exclude=bower_components --exclude=.husky --exclude=vendor --exclude=third_party --exclude=_deps --exclude=vcpkg_installed --exclude=.venv --exclude=venv --exclude=.gradle --exclude=target --exclude=.build --exclude=lib --exclude=.bundle --exclude=Manifest.toml --exclude=_build --exclude=.stack-work --exclude=dist-newstyle >/dev/null 2>&1 +find /root/.m2 -type f \( -name '*-SNAPSHOT.jar' -o -name '*-SNAPSHOT-sources.jar' -o -name '*-SNAPSHOT-tests.jar' -o -name '*-SNAPSHOT-test-sources.jar' \) -delete 2>/dev/null; rm -rf /root/.julia/compiled 2>/dev/null; rm -rf /root/.gradle/caches/build-cache-* /root/.gradle/daemon 2>/dev/null; rm -rf /root/.gradle/caches/*/scripts /root/.gradle/caches/jars-* 2>/dev/null; rm -rf /root/.cache/bazel 2>/dev/null; true +if [ "$LATER" -gt 0 ]; then + mv "$CWD/.git" "$M/git-hidden" + echo "history not truncated at ${BASE:0:12}: .git hidden while the agent works" +fi +write_blocklist + +touch "$M/ready" +echo "setup done" diff --git a/tasks/format-code-task-001453/tests/test.patch b/tasks/format-code-task-001453/tests/test.patch new file mode 100644 index 0000000000000000000000000000000000000000..8f99d107ac9f67441dc799a12307d88e61f620da --- /dev/null +++ b/tasks/format-code-task-001453/tests/test.patch @@ -0,0 +1,61 @@ +diff --git a/azurerm/internal/services/signalr/parse/signalr_service_test.go b/azurerm/internal/services/signalr/parse/signalr_service_test.go +index 461b75fcaf..aadec1d468 100644 +--- a/azurerm/internal/services/signalr/parse/signalr_service_test.go ++++ b/azurerm/internal/services/signalr/parse/signalr_service_test.go +@@ -32,12 +32,12 @@ func TestSignalRServiceId(t *testing.T) { + }, + { + Name: "Missing SignalR Value", +- Input: "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resGroup1/providers/Microsoft.SignalRService/signalR/", ++ Input: "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resGroup1/providers/Microsoft.SignalRService/SignalR/", + Expected: nil, + }, + { + Name: "SignalR Service ID", +- Input: "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resGroup1/providers/Microsoft.SignalRService/signalR/Service1", ++ Input: "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resGroup1/providers/Microsoft.SignalRService/SignalR/Service1", + Expected: &SignalRServiceId{ + Name: "Service1", + ResourceGroup: "resGroup1", +@@ -45,7 +45,7 @@ func TestSignalRServiceId(t *testing.T) { + }, + { + Name: "Wrong Casing", +- Input: "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resGroup1/providers/Microsoft.SignalRService/SignalR/Service1", ++ Input: "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resGroup1/providers/Microsoft.SignalRService/signalR/Service1", + Expected: nil, + }, + } +@@ -62,6 +62,10 @@ func TestSignalRServiceId(t *testing.T) { + t.Fatalf("Expected a value but got an error: %s", err) + } + ++ if v.Expected == nil { ++ t.Fatalf("Expected an error for %q but got a value: %+v", v.Name, actual) ++ } ++ + if actual.Name != v.Expected.Name { + t.Fatalf("Expected %q but got %q for Name", v.Expected.Name, actual.Name) + } +diff --git a/test_commands.json b/test_commands.json +new file mode 100644 +index 0000000000..b0071b8bd6 +--- /dev/null ++++ b/test_commands.json +@@ -0,0 +1,3 @@ ++{ ++ "test_commands": ["go test ./azurerm/internal/services/signalr/parse/ -run TestSignalRServiceId -v"] ++} +diff --git a/mimo_test_command.sh b/mimo_test_command.sh +new file mode 100755 +--- /dev/null ++++ b/mimo_test_command.sh +@@ -0,0 +1,8 @@ ++#!/usr/bin/env bash ++ ++set -uo pipefail ++cd /testbed ++rc=0 ++go test ./azurerm/internal/services/signalr/parse/ -run TestSignalRServiceId -v ++rc=$(( rc | $? )) ++exit $rc diff --git a/tasks/format-code-task-001453/tests/test.sh b/tasks/format-code-task-001453/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..ff06917c70fd505dfed04a88278e35c6be51c64a --- /dev/null +++ b/tasks/format-code-task-001453/tests/test.sh @@ -0,0 +1,39 @@ +#!/bin/bash +# Code grading, mimoagent opensource_code.py: reset the files the hidden test patch touches, apply it, run the +# task's test command; reward 1 when it exits 0. A testbed failure (reset or apply) writes no reward: not scored. +M=/var/lib/mimo +CWD=/testbed +V=/logs/verifier +mkdir -p "$V" +BASE=$(cat "$M/base" 2>/dev/null) || { echo "setup never ran (no $M/base)" >&2; exit 1; } +cd "$CWD" || exit 1 +if [ -d "$M/git-hidden" ]; then rm -rf "$CWD/.git"; mv "$M/git-hidden" "$CWD/.git"; fi +# the agent's change against the base, so its own commits count too +git add -A >/dev/null 2>&1 && git -c core.fileMode=false diff --cached "$BASE" > "$V/agent.diff" +git reset -q +if ! ( +while IFS= read -r tf; do + [ -z "$tf" ] && continue + if git cat-file -e $BASE:"$tf" 2>/dev/null; then + git checkout $BASE -- "$tf" 2>/dev/null || true + else + git rm -f --cached "$tf" >/dev/null 2>&1 || true + rm -f "$tf" + fi +done <<'EOF_RESET_TEST_FILES' +azurerm/internal/services/signalr/parse/signalr_service_test.go +test_commands.json +mimo_test_command.sh +EOF_RESET_TEST_FILES + +); then echo "could not reset the test files (testbed problem, not scored)" >&2; exit 1; fi +if ! git apply --verbose /tests/test.patch > "$V/apply.log" 2>&1; then + cat "$V/apply.log" >&2 + echo "the hidden tests could not be applied (testbed problem, not scored)" >&2 + exit 1 +fi +timeout 1800 sh -c "$(cat /tests/test_command.sh)" > "$V/test_output.log" 2>&1 +RC=$? +tail -c 12000 "$V/test_output.log" +if [ $RC -eq 0 ]; then echo 1 > "$V/reward.txt"; else echo 0 > "$V/reward.txt"; fi +echo "test command exited $RC" diff --git a/tasks/format-code-task-001453/tests/test_command.sh b/tasks/format-code-task-001453/tests/test_command.sh new file mode 100644 index 0000000000000000000000000000000000000000..7cb23076694ad17d72e8296d62b2b240083e36db --- /dev/null +++ b/tasks/format-code-task-001453/tests/test_command.sh @@ -0,0 +1 @@ +bash /testbed/mimo_test_command.sh \ No newline at end of file diff --git a/tasks/format-code-task-001462/environment/Dockerfile b/tasks/format-code-task-001462/environment/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..a5fb4a1af7428f76c9fc5be1fb51b3b839ddd4a9 --- /dev/null +++ b/tasks/format-code-task-001462/environment/Dockerfile @@ -0,0 +1,3 @@ +# The task's image, pinned by digest (the same as [environment].docker_image). +# Setup runs at start from [environment.healthcheck]; environment/setup/ is its readable copy. +FROM docker.io/xiaomimimo/mimo-v2.6-rl-oss@sha256:02f6767855f261215c1a33612e3cc9bfa9a76bdff8fef810ca6165f09e3160e8 diff --git a/tasks/format-code-task-001462/environment/setup/files/blocklist b/tasks/format-code-task-001462/environment/setup/files/blocklist new file mode 100644 index 0000000000000000000000000000000000000000..a8e4bdc4c7d9b739c047a3cb58ea72a1bb05bcbc --- /dev/null +++ b/tasks/format-code-task-001462/environment/setup/files/blocklist @@ -0,0 +1,33 @@ +# mimo answer-leak blocklist (mimoagent) +0.0.0.0 github.com +0.0.0.0 www.github.com +0.0.0.0 api.github.com +0.0.0.0 raw.githubusercontent.com +0.0.0.0 codeload.github.com +0.0.0.0 objects.githubusercontent.com +0.0.0.0 gist.github.com +0.0.0.0 gist.githubusercontent.com +0.0.0.0 gitlab.com +0.0.0.0 bitbucket.org +0.0.0.0 sourceforge.net +0.0.0.0 git.kernel.org +0.0.0.0 chromium.googlesource.com +0.0.0.0 android.googlesource.com +0.0.0.0 sourcegraph.com +0.0.0.0 bugs.chromium.org +0.0.0.0 issues.oss-fuzz.com +0.0.0.0 oss-fuzz.com +0.0.0.0 osv.dev +0.0.0.0 api.osv.dev +0.0.0.0 bugzilla.mozilla.org +0.0.0.0 proxy.golang.org +0.0.0.0 sum.golang.org +0.0.0.0 pkg.go.dev +0.0.0.0 google.com +0.0.0.0 www.google.com +0.0.0.0 bing.com +0.0.0.0 www.bing.com +0.0.0.0 duckduckgo.com +0.0.0.0 html.duckduckgo.com +0.0.0.0 search.brave.com +0.0.0.0 stackoverflow.com diff --git a/tasks/format-code-task-001462/environment/setup/setup.sh b/tasks/format-code-task-001462/environment/setup/setup.sh new file mode 100644 index 0000000000000000000000000000000000000000..e9eb7daf39f9542bd095367feee457f3da77e492 --- /dev/null +++ b/tasks/format-code-task-001462/environment/setup/setup.sh @@ -0,0 +1,34 @@ +#!/bin/bash +# Runs once, as root, before the agent starts: Harbor's [environment.healthcheck] unpacks this folder into +# /var/lib/mimo and runs it. Generated by mimo_harbor; see its README for how each step maps to Xiaomi's harness. +M=/var/lib/mimo +[ -f "$M/ready" ] && exit 0 +chmod 700 "$M" +fail() { echo "setup: $*" >&2; exit 1; } +# the answer-leak blocklist (mimoagent), applied to /etc/hosts by the agent right after it installs +write_blocklist() { cp "$M/files/blocklist" "$M/blocklist"; } + +# Code: mimoagent environments/datasets/opensource_code.py + base.py, as the explorer runs it (app/runner/domains.py Code). +CWD=/workspace/repo +git config --global --add safe.directory "$CWD" +cd "$CWD" || fail "no working directory $CWD" +if ! git rev-parse --git-dir >/dev/null 2>&1; then # a bare source tree: give it a baseline commit + git init -q && git add -A && git -c user.name=mimo -c user.email=mimo@localhost commit -q -m baseline --allow-empty +fi +BASE=$(git rev-parse HEAD 2>/dev/null) +[ ${#BASE} -eq 40 ] || fail "could not resolve the base commit in $CWD" +echo "$BASE" > "$M/base" +# Images are built with history truncated at the base. If one is not, the fix could be read out of git log, +# so .git is hidden while the agent works and put back for grading. +LATER=$(git rev-list --all --not "$BASE" 2>/dev/null | head -n 5 | grep -c . || true) +rm -f /tmp/fail.log /tmp/pass.log /tmp/patch.diff /tmp/test_patch.diff /tmp/*.log 2>/dev/null; rm -rf /tmp/claude-0 /tmp/claude-* /tmp/testem-* /tmp/puppeteer_dev_chrome_profile-* 2>/dev/null; rm -f /tmp/test_files.json 2>/dev/null; rm -rf /tmp/jest_* /tmp/jest-* /tmp/build /tmp/build_env 2>/dev/null; rm -rf /tmp/pytest-of-root /tmp/pytest-* /tmp/.pytest_cache /tmp/__pycache__ 2>/dev/null; rm -rf /tmp/go-build* /tmp/standards /tmp/wordpress /tmp/zig-* /tmp/testbase /tmp/testbed 2>/dev/null; rm -f /tmp/tmp*.tmp /tmp/*.bak /tmp/expect* /tmp/butwas* 2>/dev/null; rm -rf /root/.cache/go-build 2>/dev/null; rm -rf /tests 2>/dev/null; find /logs -mindepth 1 -delete 2>/dev/null; mkdir -p /logs/agent /logs/verifier /logs/artifacts; chmod 777 /logs/agent /logs/verifier /logs/artifacts; find /var/log -type f -delete 2>/dev/null || true; rm -rf /var/lib/postgresql/*/*/log /var/lib/postgresql/*/*/pg_log 2>/dev/null || true; find /var/lib/mysql /var/lib/mongodb -type f -name '*.log' -delete 2>/dev/null || true; rm -rf /root/.npm/_logs /root/.babel.json /root/.pytest_cache 2>/dev/null || true; find / -maxdepth 4 -xdev -name task_description.md -path '*/.build_env/*' -delete 2>/dev/null || true; true +git clean -fdx --exclude=node_modules --exclude=bower_components --exclude=.husky --exclude=vendor --exclude=third_party --exclude=_deps --exclude=vcpkg_installed --exclude=.venv --exclude=venv --exclude=.gradle --exclude=target --exclude=.build --exclude=lib --exclude=.bundle --exclude=Manifest.toml --exclude=_build --exclude=.stack-work --exclude=dist-newstyle >/dev/null 2>&1 +find /root/.m2 -type f \( -name '*-SNAPSHOT.jar' -o -name '*-SNAPSHOT-sources.jar' -o -name '*-SNAPSHOT-tests.jar' -o -name '*-SNAPSHOT-test-sources.jar' \) -delete 2>/dev/null; rm -rf /root/.julia/compiled 2>/dev/null; rm -rf /root/.gradle/caches/build-cache-* /root/.gradle/daemon 2>/dev/null; rm -rf /root/.gradle/caches/*/scripts /root/.gradle/caches/jars-* 2>/dev/null; rm -rf /root/.cache/bazel 2>/dev/null; true +if [ "$LATER" -gt 0 ]; then + mv "$CWD/.git" "$M/git-hidden" + echo "history not truncated at ${BASE:0:12}: .git hidden while the agent works" +fi +write_blocklist + +touch "$M/ready" +echo "setup done" diff --git a/tasks/format-code-task-001462/tests/test.patch b/tasks/format-code-task-001462/tests/test.patch new file mode 100644 index 0000000000000000000000000000000000000000..cefd160fff024f9bfd32e3dad2e525a3ad5ab500 --- /dev/null +++ b/tasks/format-code-task-001462/tests/test.patch @@ -0,0 +1,483 @@ +diff --git a/usercase-test-coderl/test_option_factories.py b/usercase-test-coderl/test_option_factories.py +new file mode 100644 +--- /dev/null ++++ b/usercase-test-coderl/test_option_factories.py +@@ -0,0 +1,456 @@ ++import builtins ++import copy ++import json ++import os ++import socket ++import subprocess ++import sys ++ ++import pytest ++ ++from jmcomic import ( ++ JmModuleConfig, ++ JmOption, ++ JmcomicException, ++ PrettyFormatter, ++ create_option, ++ create_option_by_env, ++ create_option_by_file, ++ create_option_by_str, ++ jm_logger, ++) ++ ++ ++ ++ ++ ++ ++class ImageStub: ++ def __init__(self, suffix=".jpg", is_gif=False): ++ self.img_file_suffix = suffix ++ self.is_gif = is_gif ++ ++ ++def option_snapshot(option): ++ data = option.deconstruct() ++ metadata = data["client"]["postman"]["meta_data"] ++ return { ++ "version": data["version"], ++ "log": data["log"], ++ "dir_rule": data["dir_rule"], ++ "download": data["download"], ++ "client": { ++ "cache": data["client"]["cache"], ++ "domain": data["client"]["domain"], ++ "postman_type": data["client"]["postman"]["type"], ++ "postman_headers": metadata["headers"], ++ "postman_proxies": metadata["proxies"], ++ "impl": data["client"]["impl"], ++ "async_impl": data["client"]["async_impl"], ++ "retry_times": data["client"]["retry_times"], ++ }, ++ "plugins": data["plugins"], ++ "filepath": option.filepath, ++ } ++ ++ ++def assert_common_default_behavior( ++ option, ++ base_dir, ++ *, ++ filepath=None, ++ retry_times=None, ++ download_cache=True, ++): ++ data = option.deconstruct() ++ expected_defaults = JmModuleConfig.option_default_dict() ++ if retry_times is None: ++ retry_times = expected_defaults["client"]["retry_times"] ++ ++ ++ assert isinstance(option, JmOption) ++ assert data["dir_rule"]["base_dir"] == str(base_dir) ++ assert option.client.impl == expected_defaults["client"]["impl"] ++ assert option.client.retry_times == retry_times ++ assert option.download.image.decode is True ++ assert option.download.cache is download_cache ++ assert option.plugins.valid == expected_defaults["plugins"]["valid"] ++ assert option.filepath == filepath ++ ++ ++@pytest.fixture(autouse=True) ++def restore_module_state(monkeypatch): ++ original_log_flag = JmModuleConfig.FLAG_ENABLE_JM_LOG ++ original_executor_log = JmModuleConfig.EXECUTOR_LOG ++ original_handlers = list(jm_logger.handlers) ++ original_level = jm_logger.level ++ original_proxies = JmModuleConfig.DEFAULT_PROXIES ++ monkeypatch.setattr(JmModuleConfig, "DEFAULT_PROXIES", {}) ++ monkeypatch.setattr(JmModuleConfig, "EXECUTOR_LOG", lambda *args, **kwargs: None) ++ yield ++ JmModuleConfig.FLAG_ENABLE_JM_LOG = original_log_flag ++ JmModuleConfig.EXECUTOR_LOG = original_executor_log ++ JmModuleConfig.DEFAULT_PROXIES = original_proxies ++ jm_logger.handlers[:] = original_handlers ++ jm_logger.setLevel(original_level) ++ ++ ++def test_default_option_populates_module_defaults(tmp_path, monkeypatch): ++ ++ ++ ++ monkeypatch.chdir(tmp_path) ++ monkeypatch.setattr(os, "cpu_count", lambda: 8) ++ ++ option = JmOption.default() ++ ++ assert_common_default_behavior(option, tmp_path) ++ ++ ++def test_create_option_by_str_yaml_deep_merges_suffix(tmp_path, monkeypatch): ++ ++ ++ ++ monkeypatch.chdir(tmp_path) ++ monkeypatch.setattr(os, "cpu_count", lambda: 8) ++ ++ option = create_option_by_str("download:\n image:\n suffix: .webp\n", mode=None) ++ ++ ++ assert_common_default_behavior(option, tmp_path) ++ assert option.download.image.suffix == ".webp" ++ assert option.decide_image_suffix(ImageStub(".jpg")) == ".webp" ++ ++ ++def test_create_option_by_file_preserves_filepath_and_to_file_target(tmp_path, monkeypatch): ++ ++ ++ ++ monkeypatch.chdir(tmp_path) ++ monkeypatch.setattr(os, "cpu_count", lambda: 8) ++ option_path = tmp_path / "option.yml" ++ option_path.write_text("download:\n image:\n suffix: .webp\n", encoding="utf-8") ++ ++ option = create_option_by_file(str(option_path)) ++ ++ ++ assert_common_default_behavior(option, tmp_path, filepath=str(option_path)) ++ assert option.download.image.suffix == ".webp" ++ ++ option.to_file() ++ reloaded = create_option_by_file(str(option_path)) ++ assert reloaded.filepath == str(option_path) ++ assert reloaded.download.image.suffix == ".webp" ++ ++ assert reloaded.client.retry_times == JmModuleConfig.option_default_dict()["client"]["retry_times"] ++ ++ ++def test_create_option_alias_matches_file_factory(tmp_path, monkeypatch): ++ ++ ++ ++ monkeypatch.chdir(tmp_path) ++ monkeypatch.setattr(os, "cpu_count", lambda: 8) ++ option_path = tmp_path / "alias.yml" ++ option_path.write_text("client:\n retry_times: 2\n", encoding="utf-8") ++ ++ option = create_option(str(option_path)) ++ ++ ++ assert_common_default_behavior(option, tmp_path, filepath=str(option_path), retry_times=2) ++ ++ ++def test_create_option_by_env_loads_named_variable(tmp_path, monkeypatch): ++ ++ ++ ++ monkeypatch.chdir(tmp_path) ++ monkeypatch.setattr(os, "cpu_count", lambda: 8) ++ option_path = tmp_path / "env.yml" ++ option_path.write_text("download:\n cache: false\n", encoding="utf-8") ++ monkeypatch.setenv("MY_JM_OPTION", str(option_path)) ++ ++ option = create_option_by_env("MY_JM_OPTION") ++ ++ ++ assert_common_default_behavior(option, tmp_path, filepath=str(option_path), download_cache=False) ++ ++ ++def test_create_option_by_env_unset_raises_validation_exception(monkeypatch): ++ ++ ++ ++ monkeypatch.delenv("MISSING_JM_OPTION", raising=False) ++ ++ with pytest.raises(JmcomicException) as excinfo: ++ create_option_by_env("MISSING_JM_OPTION") ++ ++ ++ assert "MISSING_JM_OPTION" in str(excinfo.value) ++ ++ ++def test_create_option_by_env_empty_raises_validation_exception(monkeypatch): ++ ++ ++ ++ monkeypatch.setenv("EMPTY_JM_OPTION", "") ++ ++ with pytest.raises(JmcomicException) as excinfo: ++ create_option_by_env("EMPTY_JM_OPTION") ++ ++ ++ assert "EMPTY_JM_OPTION" in str(excinfo.value) ++ ++ ++def test_construct_partial_dict_deep_merges_defaults(tmp_path, monkeypatch): ++ ++ ++ ++ monkeypatch.chdir(tmp_path) ++ monkeypatch.setattr(os, "cpu_count", lambda: 8) ++ ++ option = JmOption.construct({"download": {"threading": {"image": 7}}, "client": {"retry_times": 2}}) ++ ++ ++ assert_common_default_behavior(option, tmp_path, retry_times=2) ++ assert option.download.threading.image == 7 ++ assert option.download.threading.photo == JmModuleConfig.option_default_dict()["download"]["threading"]["photo"] ++ assert option.client.retry_times == 2 ++ ++ ++def test_construct_does_not_mutate_partial_input(tmp_path, monkeypatch): ++ monkeypatch.chdir(tmp_path) ++ monkeypatch.setattr(os, "cpu_count", lambda: 8) ++ config = {"download": {"threading": {"image": 7}}, "client": {"retry_times": 2}} ++ before = copy.deepcopy(config) ++ ++ JmOption.construct(config) ++ ++ assert config == before == { ++ "download": {"threading": {"image": 7}}, ++ "client": {"retry_times": 2}, ++ } ++ ++ ++def test_construct_partial_does_not_mutate_unrelated_default_branches(tmp_path, monkeypatch): ++ ++ ++ ++ monkeypatch.chdir(tmp_path) ++ monkeypatch.setattr(os, "cpu_count", lambda: 8) ++ ++ JmOption.construct({"download": {"image": {"suffix": ".webp"}}, "client": {"retry_times": 2}}) ++ ++ ++ default_option = JmOption.default() ++ assert_common_default_behavior(default_option, tmp_path) ++ assert default_option.download.image.suffix is None ++ assert default_option.client.retry_times == JmModuleConfig.option_default_dict()["client"]["retry_times"] ++ ++ ++def test_construct_log_false_disables_normal_logging(tmp_path, monkeypatch): ++ ++ ++ ++ monkeypatch.chdir(tmp_path) ++ monkeypatch.setattr(os, "cpu_count", lambda: 8) ++ ++ option = JmOption.construct({"log": False}) ++ ++ assert option.deconstruct()["log"] is False ++ assert JmModuleConfig.FLAG_ENABLE_JM_LOG is False ++ ++ ++def test_construct_log_pretty_enables_pretty_logging(tmp_path, monkeypatch): ++ ++ ++ ++ monkeypatch.chdir(tmp_path) ++ monkeypatch.setattr(os, "cpu_count", lambda: 8) ++ ++ option = JmOption.construct({"log": "pretty"}) ++ ++ assert option.deconstruct()["log"] is True ++ assert JmModuleConfig.FLAG_ENABLE_JM_LOG is True ++ ++ assert any(isinstance(handler.formatter, PrettyFormatter) for handler in jm_logger.handlers) ++ ++ ++def test_construct_migrates_old_threading_plugin_and_zip_levels(tmp_path, monkeypatch): ++ ++ ++ ++ monkeypatch.chdir(tmp_path) ++ monkeypatch.setattr(os, "cpu_count", lambda: 8) ++ old_config = { ++ "download": {"threading": {"batch_count": 4}}, ++ "plugin": { ++ "after_album": [ ++ {"plugin": "zip", "kwargs": {"level": "photo", "filename_rule": "Ptitle"}} ++ ], ++ "after_photo": [ ++ {"plugin": "zip", "kwargs": {"level": "album", "filename_rule": "Atitle"}} ++ ], ++ }, ++ } ++ ++ option = JmOption.construct(old_config) ++ ++ ++ assert option.download.threading.image == 4 ++ assert option.download.threading.photo == JmModuleConfig.option_default_dict()["download"]["threading"]["photo"] ++ after_album = option.plugins.src_dict["after_album"] ++ after_photo = option.plugins.src_dict["after_photo"] ++ ++ ++ assert any(p.get("plugin") == "zip" and p.get("kwargs", {}).get("filename_rule") == "Atitle" for p in after_album) ++ assert any(p.get("plugin") == "zip" and p.get("kwargs", {}).get("filename_rule") == "Ptitle" for p in after_photo) ++ ++ ++def test_construct_without_defaults_uses_complete_dictionary_directly(monkeypatch): ++ ++ ++ ++ complete = { ++ "dir_rule": {"rule": "Bd", "base_dir": "/complete/base", "normalize_zh": None}, ++ "download": { ++ "cache": False, ++ "image": {"decode": False, "suffix": ".png"}, ++ "threading": {"image": 1, "photo": 2}, ++ }, ++ "client": { ++ "cache": False, ++ "domain": ["example.test"], ++ "postman": { ++ "type": "requests", ++ "meta_data": { ++ "impersonate": None, ++ "headers": {"X-Test": "1"}, ++ "proxies": {"http": "http://proxy"}, ++ }, ++ }, ++ "impl": "html", ++ "async_impl": "async_api", ++ "retry_times": 1, ++ }, ++ "plugins": {"valid": "raise"}, ++ "filepath": "/complete/option.yml", ++ } ++ ++ option = JmOption.construct(complete, cover_default=False) ++ ++ ++ assert isinstance(option, JmOption) ++ assert option.dir_rule.rule_dsl == "Bd" ++ assert option.dir_rule.base_dir == "/complete/base" ++ assert option.download.cache is False ++ assert option.download.image.decode is False ++ assert option.download.image.suffix == ".png" ++ assert option.download.threading.src_dict == {"image": 1, "photo": 2} ++ assert option.client.cache is False ++ assert option.client.domain == ["example.test"] ++ assert option.client.postman.type == "requests" ++ assert option.client.postman.meta_data.headers["X-Test"] == "1" ++ assert option.client.postman.meta_data.proxies["http"] == "http://proxy" ++ assert option.client.impl == "html" ++ assert option.client.retry_times == 1 ++ assert option.plugins.valid == "raise" ++ assert option.filepath == "/complete/option.yml" ++ ++ ++def test_create_option_by_str_is_referentially_transparent(tmp_path, monkeypatch): ++ monkeypatch.chdir(tmp_path) ++ monkeypatch.setattr(os, "cpu_count", lambda: 8) ++ text = "download:\n image:\n suffix: .webp\n" ++ ++ first = create_option_by_str(text) ++ second = create_option_by_str(text) ++ ++ ++ assert_common_default_behavior(first, tmp_path) ++ assert_common_default_behavior(second, tmp_path) ++ assert first.download.image.suffix == ".webp" ++ assert second.download.image.suffix == ".webp" ++ ++ ++def test_create_option_by_str_has_no_cross_process_global_state(tmp_path, monkeypatch): ++ monkeypatch.chdir(tmp_path) ++ monkeypatch.setattr(os, "cpu_count", lambda: 8) ++ text = "download:\n image:\n suffix: .webp\n" ++ in_process = option_snapshot(create_option_by_str(text)) ++ script = r''' ++import json ++import os ++import sys ++from unittest.mock import patch ++sys.path.insert(0, "/workspace/repo") ++sys.path.insert(0, "/workspace/repo/src") ++from jmcomic import JmModuleConfig, create_option_by_str ++JmModuleConfig.DEFAULT_PROXIES = {} ++os.chdir(sys.argv[1]) ++def option_snapshot(option): ++ data = option.deconstruct() ++ metadata = data["client"]["postman"]["meta_data"] ++ return { ++ "version": data["version"], ++ "log": data["log"], ++ "dir_rule": data["dir_rule"], ++ "download": data["download"], ++ "client": { ++ "cache": data["client"]["cache"], ++ "domain": data["client"]["domain"], ++ "postman_type": data["client"]["postman"]["type"], ++ "postman_headers": metadata["headers"], ++ "postman_proxies": metadata["proxies"], ++ "impl": data["client"]["impl"], ++ "async_impl": data["client"]["async_impl"], ++ "retry_times": data["client"]["retry_times"], ++ }, ++ "plugins": data["plugins"], ++ "filepath": option.filepath, ++ } ++with patch("os.cpu_count", return_value=8): ++ result = option_snapshot(create_option_by_str("download:\n image:\n suffix: .webp\n")) ++sys.stdout.write(json.dumps(result, sort_keys=True)) ++''' ++ ++ completed = subprocess.run( ++ [sys.executable, "-c", script, str(tmp_path)], ++ check=True, ++ stdout=subprocess.PIPE, ++ stderr=subprocess.PIPE, ++ text=True, ++ ) ++ fresh_process = json.loads(completed.stdout) ++ ++ ++ assert in_process["download"]["image"]["suffix"] == ".webp" ++ assert fresh_process["download"]["image"]["suffix"] == ".webp" ++ assert fresh_process["download"]["cache"] is True ++ assert fresh_process["client"]["retry_times"] == JmModuleConfig.option_default_dict()["client"]["retry_times"] ++ ++ ++def test_create_option_by_str_has_no_undeclared_file_or_network_side_effects(tmp_path, monkeypatch): ++ monkeypatch.chdir(tmp_path) ++ monkeypatch.setattr(os, "cpu_count", lambda: 8) ++ ++ def blocked_socket(*args, **kwargs): ++ raise AssertionError("network access is not declared for create_option_by_str") ++ ++ real_open = builtins.open ++ ++ def watched_open(file, mode="r", *args, **kwargs): ++ if any(flag in mode for flag in ("w", "a", "x", "+")): ++ raise AssertionError(f"file write is not declared for create_option_by_str: {file}") ++ return real_open(file, mode, *args, **kwargs) ++ ++ monkeypatch.setattr(socket, "socket", blocked_socket) ++ monkeypatch.setattr(builtins, "open", watched_open) ++ before = sorted(path.relative_to(tmp_path).as_posix() for path in tmp_path.rglob("*")) ++ ++ option = create_option_by_str("download:\n image:\n suffix: .webp\n") ++ ++ after = sorted(path.relative_to(tmp_path).as_posix() for path in tmp_path.rglob("*")) ++ assert before == [] ++ assert after == [] ++ assert option.download.image.suffix == ".webp" +diff --git a/mimo_test_command.sh b/mimo_test_command.sh +new file mode 100755 +--- /dev/null ++++ b/mimo_test_command.sh +@@ -0,0 +1,17 @@ ++#!/usr/bin/env bash ++ ++ ++ ++ ++export NODE_OPTIONS="${NODE_OPTIONS:-} --max-old-space-size=4096" ++export MAVEN_OPTS="${MAVEN_OPTS:-} -Xmx3g -XX:+UseG1GC" ++export GRADLE_OPTS="${GRADLE_OPTS:-} -Xmx3g -XX:+UseG1GC" ++export TEST_JVM_OPTS="${TEST_JVM_OPTS:-} -Xmx3g" ++set -e ++cd /workspace/repo ++set -euo pipefail ++cd /workspace/repo ++VENV=/opt/coderl-stage4a-venv ++export PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 ++export PYTHONNOUSERSITE=1 ++exec "$VENV/bin/python" -m pytest /workspace/repo/usercase-test-coderl/test_option_factories.py -v diff --git a/tasks/format-code-task-001462/tests/test.sh b/tasks/format-code-task-001462/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..4d372e3ca650f211ac872e1f5a51c2303b9a2ab8 --- /dev/null +++ b/tasks/format-code-task-001462/tests/test.sh @@ -0,0 +1,38 @@ +#!/bin/bash +# Code grading, mimoagent opensource_code.py: reset the files the hidden test patch touches, apply it, run the +# task's test command; reward 1 when it exits 0. A testbed failure (reset or apply) writes no reward: not scored. +M=/var/lib/mimo +CWD=/workspace/repo +V=/logs/verifier +mkdir -p "$V" +BASE=$(cat "$M/base" 2>/dev/null) || { echo "setup never ran (no $M/base)" >&2; exit 1; } +cd "$CWD" || exit 1 +if [ -d "$M/git-hidden" ]; then rm -rf "$CWD/.git"; mv "$M/git-hidden" "$CWD/.git"; fi +# the agent's change against the base, so its own commits count too +git add -A >/dev/null 2>&1 && git -c core.fileMode=false diff --cached "$BASE" > "$V/agent.diff" +git reset -q +if ! ( +while IFS= read -r tf; do + [ -z "$tf" ] && continue + if git cat-file -e $BASE:"$tf" 2>/dev/null; then + git checkout $BASE -- "$tf" 2>/dev/null || true + else + git rm -f --cached "$tf" >/dev/null 2>&1 || true + rm -f "$tf" + fi +done <<'EOF_RESET_TEST_FILES' +usercase-test-coderl/test_option_factories.py +mimo_test_command.sh +EOF_RESET_TEST_FILES + +); then echo "could not reset the test files (testbed problem, not scored)" >&2; exit 1; fi +if ! git apply --verbose /tests/test.patch > "$V/apply.log" 2>&1; then + cat "$V/apply.log" >&2 + echo "the hidden tests could not be applied (testbed problem, not scored)" >&2 + exit 1 +fi +timeout 1800 sh -c "$(cat /tests/test_command.sh)" > "$V/test_output.log" 2>&1 +RC=$? +tail -c 12000 "$V/test_output.log" +if [ $RC -eq 0 ]; then echo 1 > "$V/reward.txt"; else echo 0 > "$V/reward.txt"; fi +echo "test command exited $RC" diff --git a/tasks/format-code-task-001462/tests/test_command.sh b/tasks/format-code-task-001462/tests/test_command.sh new file mode 100644 index 0000000000000000000000000000000000000000..88cb7810b836396c4869db31aeac7d4d4b189685 --- /dev/null +++ b/tasks/format-code-task-001462/tests/test_command.sh @@ -0,0 +1 @@ +bash /workspace/repo/mimo_test_command.sh \ No newline at end of file diff --git a/tasks/format-code-task-001465/environment/Dockerfile b/tasks/format-code-task-001465/environment/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..99d1e40eb2203ca922e2eaf0b72b822475810545 --- /dev/null +++ b/tasks/format-code-task-001465/environment/Dockerfile @@ -0,0 +1,3 @@ +# The task's image, pinned by digest (the same as [environment].docker_image). +# Setup runs at start from [environment.healthcheck]; environment/setup/ is its readable copy. +FROM docker.io/xiaomimimo/mimo-v2.6-rl-oss@sha256:9a3a79532448cc9b70f8f2413aa2fa4c9dd85e9f78db9f80bf9d80c6c0f02866 diff --git a/tasks/format-code-task-001465/environment/setup/files/blocklist b/tasks/format-code-task-001465/environment/setup/files/blocklist new file mode 100644 index 0000000000000000000000000000000000000000..a8e4bdc4c7d9b739c047a3cb58ea72a1bb05bcbc --- /dev/null +++ b/tasks/format-code-task-001465/environment/setup/files/blocklist @@ -0,0 +1,33 @@ +# mimo answer-leak blocklist (mimoagent) +0.0.0.0 github.com +0.0.0.0 www.github.com +0.0.0.0 api.github.com +0.0.0.0 raw.githubusercontent.com +0.0.0.0 codeload.github.com +0.0.0.0 objects.githubusercontent.com +0.0.0.0 gist.github.com +0.0.0.0 gist.githubusercontent.com +0.0.0.0 gitlab.com +0.0.0.0 bitbucket.org +0.0.0.0 sourceforge.net +0.0.0.0 git.kernel.org +0.0.0.0 chromium.googlesource.com +0.0.0.0 android.googlesource.com +0.0.0.0 sourcegraph.com +0.0.0.0 bugs.chromium.org +0.0.0.0 issues.oss-fuzz.com +0.0.0.0 oss-fuzz.com +0.0.0.0 osv.dev +0.0.0.0 api.osv.dev +0.0.0.0 bugzilla.mozilla.org +0.0.0.0 proxy.golang.org +0.0.0.0 sum.golang.org +0.0.0.0 pkg.go.dev +0.0.0.0 google.com +0.0.0.0 www.google.com +0.0.0.0 bing.com +0.0.0.0 www.bing.com +0.0.0.0 duckduckgo.com +0.0.0.0 html.duckduckgo.com +0.0.0.0 search.brave.com +0.0.0.0 stackoverflow.com diff --git a/tasks/format-code-task-001465/environment/setup/setup.sh b/tasks/format-code-task-001465/environment/setup/setup.sh new file mode 100644 index 0000000000000000000000000000000000000000..d883db90cfcfb48f7a139861bbe9f6b5d95cad6f --- /dev/null +++ b/tasks/format-code-task-001465/environment/setup/setup.sh @@ -0,0 +1,34 @@ +#!/bin/bash +# Runs once, as root, before the agent starts: Harbor's [environment.healthcheck] unpacks this folder into +# /var/lib/mimo and runs it. Generated by mimo_harbor; see its README for how each step maps to Xiaomi's harness. +M=/var/lib/mimo +[ -f "$M/ready" ] && exit 0 +chmod 700 "$M" +fail() { echo "setup: $*" >&2; exit 1; } +# the answer-leak blocklist (mimoagent), applied to /etc/hosts by the agent right after it installs +write_blocklist() { cp "$M/files/blocklist" "$M/blocklist"; } + +# Code: mimoagent environments/datasets/opensource_code.py + base.py, as the explorer runs it (app/runner/domains.py Code). +CWD=/testbed +git config --global --add safe.directory "$CWD" +cd "$CWD" || fail "no working directory $CWD" +if ! git rev-parse --git-dir >/dev/null 2>&1; then # a bare source tree: give it a baseline commit + git init -q && git add -A && git -c user.name=mimo -c user.email=mimo@localhost commit -q -m baseline --allow-empty +fi +BASE=$(git rev-parse HEAD 2>/dev/null) +[ ${#BASE} -eq 40 ] || fail "could not resolve the base commit in $CWD" +echo "$BASE" > "$M/base" +# Images are built with history truncated at the base. If one is not, the fix could be read out of git log, +# so .git is hidden while the agent works and put back for grading. +LATER=$(git rev-list --all --not "$BASE" 2>/dev/null | head -n 5 | grep -c . || true) +rm -f /tmp/fail.log /tmp/pass.log /tmp/patch.diff /tmp/test_patch.diff /tmp/*.log 2>/dev/null; rm -rf /tmp/claude-0 /tmp/claude-* /tmp/testem-* /tmp/puppeteer_dev_chrome_profile-* 2>/dev/null; rm -f /tmp/test_files.json 2>/dev/null; rm -rf /tmp/jest_* /tmp/jest-* /tmp/build /tmp/build_env 2>/dev/null; rm -rf /tmp/pytest-of-root /tmp/pytest-* /tmp/.pytest_cache /tmp/__pycache__ 2>/dev/null; rm -rf /tmp/go-build* /tmp/standards /tmp/wordpress /tmp/zig-* /tmp/testbase /tmp/testbed 2>/dev/null; rm -f /tmp/tmp*.tmp /tmp/*.bak /tmp/expect* /tmp/butwas* 2>/dev/null; rm -rf /root/.cache/go-build 2>/dev/null; rm -rf /tests 2>/dev/null; find /logs -mindepth 1 -delete 2>/dev/null; mkdir -p /logs/agent /logs/verifier /logs/artifacts; chmod 777 /logs/agent /logs/verifier /logs/artifacts; find /var/log -type f -delete 2>/dev/null || true; rm -rf /var/lib/postgresql/*/*/log /var/lib/postgresql/*/*/pg_log 2>/dev/null || true; find /var/lib/mysql /var/lib/mongodb -type f -name '*.log' -delete 2>/dev/null || true; rm -rf /root/.npm/_logs /root/.babel.json /root/.pytest_cache 2>/dev/null || true; find / -maxdepth 4 -xdev -name task_description.md -path '*/.build_env/*' -delete 2>/dev/null || true; true +git clean -fdx --exclude=node_modules --exclude=bower_components --exclude=.husky --exclude=vendor --exclude=third_party --exclude=_deps --exclude=vcpkg_installed --exclude=.venv --exclude=venv --exclude=.gradle --exclude=target --exclude=.build --exclude=lib --exclude=.bundle --exclude=Manifest.toml --exclude=_build --exclude=.stack-work --exclude=dist-newstyle >/dev/null 2>&1 +find /root/.m2 -type f \( -name '*-SNAPSHOT.jar' -o -name '*-SNAPSHOT-sources.jar' -o -name '*-SNAPSHOT-tests.jar' -o -name '*-SNAPSHOT-test-sources.jar' \) -delete 2>/dev/null; rm -rf /root/.julia/compiled 2>/dev/null; rm -rf /root/.gradle/caches/build-cache-* /root/.gradle/daemon 2>/dev/null; rm -rf /root/.gradle/caches/*/scripts /root/.gradle/caches/jars-* 2>/dev/null; rm -rf /root/.cache/bazel 2>/dev/null; true +if [ "$LATER" -gt 0 ]; then + mv "$CWD/.git" "$M/git-hidden" + echo "history not truncated at ${BASE:0:12}: .git hidden while the agent works" +fi +write_blocklist + +touch "$M/ready" +echo "setup done" diff --git a/tasks/format-code-task-001465/tests/test.patch b/tasks/format-code-task-001465/tests/test.patch new file mode 100644 index 0000000000000000000000000000000000000000..8a9f50c4598e24d8207c31ad9ef9144120e177fa --- /dev/null +++ b/tasks/format-code-task-001465/tests/test.patch @@ -0,0 +1,155 @@ +diff --git a/hcloud/schema_test.go b/hcloud/schema_test.go +index 6a12f282..22e9ddfd 100644 +--- a/hcloud/schema_test.go ++++ b/hcloud/schema_test.go +@@ -932,6 +932,11 @@ func TestServerTypeFromSchema(t *testing.T) { + "price_monthly": { + "net": "1", + "gross": "1.19" ++ }, ++ "included_traffic": 654321, ++ "price_per_tb_traffic": { ++ "net": "1", ++ "gross": "1.19" + } + } + ] +@@ -991,6 +996,17 @@ func TestServerTypeFromSchema(t *testing.T) { + if serverType.Pricings[0].Monthly.Gross != "1.19" { + t.Errorf("unexpected monthly gross price: %v", serverType.Pricings[0].Monthly.Gross) + } ++ ++ if serverType.Pricings[0].IncludedTraffic != 654321 { ++ t.Errorf("unexpected included traffic: %v", serverType.Pricings[0].IncludedTraffic) ++ } ++ ++ if serverType.Pricings[0].PerTBTraffic.Net != "1" { ++ t.Errorf("unexpected per tb traffic net price: %v", serverType.Pricings[0].PerTBTraffic.Net) ++ } ++ if serverType.Pricings[0].PerTBTraffic.Gross != "1.19" { ++ t.Errorf("unexpected per tb traffic gross price: %v", serverType.Pricings[0].PerTBTraffic.Gross) ++ } + } + } + +@@ -1460,6 +1476,11 @@ func TestLoadBalancerTypeFromSchema(t *testing.T) { + "price_monthly": { + "net": "1", + "gross": "1.19" ++ }, ++ "included_traffic": 654321, ++ "price_per_tb_traffic": { ++ "net": "1", ++ "gross": "1.19" + } + } + ] +@@ -1508,6 +1529,17 @@ func TestLoadBalancerTypeFromSchema(t *testing.T) { + if loadBalancerType.Pricings[0].Monthly.Gross != "1.19" { + t.Errorf("unexpected monthly gross price: %v", loadBalancerType.Pricings[0].Monthly.Gross) + } ++ ++ if loadBalancerType.Pricings[0].IncludedTraffic != 654321 { ++ t.Errorf("unexpected included traffic: %v", loadBalancerType.Pricings[0].IncludedTraffic) ++ } ++ ++ if loadBalancerType.Pricings[0].PerTBTraffic.Net != "1" { ++ t.Errorf("unexpected per tb traffic net price: %v", loadBalancerType.Pricings[0].PerTBTraffic.Net) ++ } ++ if loadBalancerType.Pricings[0].PerTBTraffic.Gross != "1.19" { ++ t.Errorf("unexpected per tb traffic gross price: %v", loadBalancerType.Pricings[0].PerTBTraffic.Gross) ++ } + } + } + +@@ -2103,6 +2135,11 @@ func TestPricingFromSchema(t *testing.T) { + "price_monthly": { + "net": "1", + "gross": "1.19" ++ }, ++ "included_traffic": 654321, ++ "price_per_tb_traffic": { ++ "net": "1", ++ "gross": "1.19" + } + } + ] +@@ -2122,6 +2159,11 @@ func TestPricingFromSchema(t *testing.T) { + "price_monthly": { + "net": "1", + "gross": "1.19" ++ }, ++ "included_traffic": 654321, ++ "price_per_tb_traffic": { ++ "net": "1", ++ "gross": "1.19" + } + } + ] +@@ -2299,6 +2341,22 @@ func TestPricingFromSchema(t *testing.T) { + if p.Pricings[0].Monthly.Gross != "1.19" { + t.Errorf("unexpected Monthly.Gross: %v", p.Pricings[0].Monthly.Gross) + } ++ ++ if p.Pricings[0].IncludedTraffic != 654321 { ++ t.Errorf("unexpected IncludedTraffic: %v", p.Pricings[0].IncludedTraffic) ++ } ++ if p.Pricings[0].PerTBTraffic.Currency != "EUR" { ++ t.Errorf("unexpected PerTBTraffic.Currency: %v", p.Pricings[0].PerTBTraffic.Currency) ++ } ++ if p.Pricings[0].PerTBTraffic.VATRate != "19.00" { ++ t.Errorf("unexpected PerTBTraffic.VATRate: %v", p.Pricings[0].PerTBTraffic.VATRate) ++ } ++ if p.Pricings[0].PerTBTraffic.Net != "1" { ++ t.Errorf("unexpected PerTBTraffic.Net: %v", p.Pricings[0].PerTBTraffic.Net) ++ } ++ if p.Pricings[0].PerTBTraffic.Gross != "1.19" { ++ t.Errorf("unexpected PerTBTraffic.Gross: %v", p.Pricings[0].PerTBTraffic.Gross) ++ } + } + } + +@@ -2346,6 +2404,22 @@ func TestPricingFromSchema(t *testing.T) { + if p.Pricings[0].Monthly.Gross != "1.19" { + t.Errorf("unexpected Monthly.Gross: %v", p.Pricings[0].Monthly.Gross) + } ++ ++ if p.Pricings[0].IncludedTraffic != 654321 { ++ t.Errorf("unexpected IncludedTraffic: %v", p.Pricings[0].IncludedTraffic) ++ } ++ if p.Pricings[0].PerTBTraffic.Currency != "EUR" { ++ t.Errorf("unexpected PerTBTraffic.Currency: %v", p.Pricings[0].PerTBTraffic.Currency) ++ } ++ if p.Pricings[0].PerTBTraffic.VATRate != "19.00" { ++ t.Errorf("unexpected PerTBTraffic.VATRate: %v", p.Pricings[0].PerTBTraffic.VATRate) ++ } ++ if p.Pricings[0].PerTBTraffic.Net != "1" { ++ t.Errorf("unexpected PerTBTraffic.Net: %v", p.Pricings[0].PerTBTraffic.Net) ++ } ++ if p.Pricings[0].PerTBTraffic.Gross != "1.19" { ++ t.Errorf("unexpected PerTBTraffic.Gross: %v", p.Pricings[0].PerTBTraffic.Gross) ++ } + } + } + } +diff --git a/mimo_build_env.tar.gz.b64 b/mimo_build_env.tar.gz.b64 +new file mode 100644 +--- /dev/null ++++ b/mimo_build_env.tar.gz.b64 +@@ -0,0 +1,5 @@ ++H4sIAAAAAAAAA+3SvWrDMBQFYM9+ils6ZIr10zieunTo1KGQ7EGWRGywpSJbhkIfvoqhpJS2WRJK ++6PkWCd0LuuioqGPbmZ11E8suhSdVWc5r8nWd96KUQkopOE99QpTrKqPyYhN9EodRBaIseD/+1neq ++fqWKY/6jHcad9n2vnCmG5nx3nMpfyruP/HklRcp/tearjPj5RvjZP8//9obFIbC6dSz9AarV0OTa ++0PwZamvyvafDlpYTLbWPbrwXVLBGdz4aRssQHS22qWFjw2TD9vXFPgbfb3Rje/V2KDx5ZR5Up5z+ ++tvwcWt26/fF0kf/1kwAAAAAAAAAAAAAAAAAAAAAAXI13EWJqogAoAAA= +diff --git a/mimo_test_command.sh b/mimo_test_command.sh +new file mode 100755 +--- /dev/null ++++ b/mimo_test_command.sh +@@ -0,0 +1,6 @@ ++#!/usr/bin/env bash ++ ++set -uo pipefail ++cd /testbed || exit 1 ++base64 -d mimo_build_env.tar.gz.b64 | tar -xzf - -C /testbed || exit 1 ++exec bash -lc 'cd /testbed && bash -eo pipefail /testbed/.build_env/test_command.sh' diff --git a/tasks/format-code-task-001465/tests/test.sh b/tasks/format-code-task-001465/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..831af4778c69aeb4c404fa684de36e2d36ce5e6d --- /dev/null +++ b/tasks/format-code-task-001465/tests/test.sh @@ -0,0 +1,39 @@ +#!/bin/bash +# Code grading, mimoagent opensource_code.py: reset the files the hidden test patch touches, apply it, run the +# task's test command; reward 1 when it exits 0. A testbed failure (reset or apply) writes no reward: not scored. +M=/var/lib/mimo +CWD=/testbed +V=/logs/verifier +mkdir -p "$V" +BASE=$(cat "$M/base" 2>/dev/null) || { echo "setup never ran (no $M/base)" >&2; exit 1; } +cd "$CWD" || exit 1 +if [ -d "$M/git-hidden" ]; then rm -rf "$CWD/.git"; mv "$M/git-hidden" "$CWD/.git"; fi +# the agent's change against the base, so its own commits count too +git add -A >/dev/null 2>&1 && git -c core.fileMode=false diff --cached "$BASE" > "$V/agent.diff" +git reset -q +if ! ( +while IFS= read -r tf; do + [ -z "$tf" ] && continue + if git cat-file -e $BASE:"$tf" 2>/dev/null; then + git checkout $BASE -- "$tf" 2>/dev/null || true + else + git rm -f --cached "$tf" >/dev/null 2>&1 || true + rm -f "$tf" + fi +done <<'EOF_RESET_TEST_FILES' +hcloud/schema_test.go +mimo_build_env.tar.gz.b64 +mimo_test_command.sh +EOF_RESET_TEST_FILES + +); then echo "could not reset the test files (testbed problem, not scored)" >&2; exit 1; fi +if ! git apply --verbose /tests/test.patch > "$V/apply.log" 2>&1; then + cat "$V/apply.log" >&2 + echo "the hidden tests could not be applied (testbed problem, not scored)" >&2 + exit 1 +fi +timeout 1800 sh -c "$(cat /tests/test_command.sh)" > "$V/test_output.log" 2>&1 +RC=$? +tail -c 12000 "$V/test_output.log" +if [ $RC -eq 0 ]; then echo 1 > "$V/reward.txt"; else echo 0 > "$V/reward.txt"; fi +echo "test command exited $RC" diff --git a/tasks/format-code-task-001465/tests/test_command.sh b/tasks/format-code-task-001465/tests/test_command.sh new file mode 100644 index 0000000000000000000000000000000000000000..7cb23076694ad17d72e8296d62b2b240083e36db --- /dev/null +++ b/tasks/format-code-task-001465/tests/test_command.sh @@ -0,0 +1 @@ +bash /testbed/mimo_test_command.sh \ No newline at end of file diff --git a/tasks/format-code-task-001471/environment/Dockerfile b/tasks/format-code-task-001471/environment/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..b2851e1c018ab49ea8cfe1b08300910fd90ad3cd --- /dev/null +++ b/tasks/format-code-task-001471/environment/Dockerfile @@ -0,0 +1,3 @@ +# The task's image, pinned by digest (the same as [environment].docker_image). +# Setup runs at start from [environment.healthcheck]; environment/setup/ is its readable copy. +FROM docker.io/xiaomimimo/mimo-v2.6-rl-oss@sha256:09b5265519d701f236b0f905890c132b14ae4eee43acb0a68597884d083c485e diff --git a/tasks/format-code-task-001471/environment/setup/files/blocklist b/tasks/format-code-task-001471/environment/setup/files/blocklist new file mode 100644 index 0000000000000000000000000000000000000000..a8e4bdc4c7d9b739c047a3cb58ea72a1bb05bcbc --- /dev/null +++ b/tasks/format-code-task-001471/environment/setup/files/blocklist @@ -0,0 +1,33 @@ +# mimo answer-leak blocklist (mimoagent) +0.0.0.0 github.com +0.0.0.0 www.github.com +0.0.0.0 api.github.com +0.0.0.0 raw.githubusercontent.com +0.0.0.0 codeload.github.com +0.0.0.0 objects.githubusercontent.com +0.0.0.0 gist.github.com +0.0.0.0 gist.githubusercontent.com +0.0.0.0 gitlab.com +0.0.0.0 bitbucket.org +0.0.0.0 sourceforge.net +0.0.0.0 git.kernel.org +0.0.0.0 chromium.googlesource.com +0.0.0.0 android.googlesource.com +0.0.0.0 sourcegraph.com +0.0.0.0 bugs.chromium.org +0.0.0.0 issues.oss-fuzz.com +0.0.0.0 oss-fuzz.com +0.0.0.0 osv.dev +0.0.0.0 api.osv.dev +0.0.0.0 bugzilla.mozilla.org +0.0.0.0 proxy.golang.org +0.0.0.0 sum.golang.org +0.0.0.0 pkg.go.dev +0.0.0.0 google.com +0.0.0.0 www.google.com +0.0.0.0 bing.com +0.0.0.0 www.bing.com +0.0.0.0 duckduckgo.com +0.0.0.0 html.duckduckgo.com +0.0.0.0 search.brave.com +0.0.0.0 stackoverflow.com diff --git a/tasks/format-code-task-001471/environment/setup/setup.sh b/tasks/format-code-task-001471/environment/setup/setup.sh new file mode 100644 index 0000000000000000000000000000000000000000..e9eb7daf39f9542bd095367feee457f3da77e492 --- /dev/null +++ b/tasks/format-code-task-001471/environment/setup/setup.sh @@ -0,0 +1,34 @@ +#!/bin/bash +# Runs once, as root, before the agent starts: Harbor's [environment.healthcheck] unpacks this folder into +# /var/lib/mimo and runs it. Generated by mimo_harbor; see its README for how each step maps to Xiaomi's harness. +M=/var/lib/mimo +[ -f "$M/ready" ] && exit 0 +chmod 700 "$M" +fail() { echo "setup: $*" >&2; exit 1; } +# the answer-leak blocklist (mimoagent), applied to /etc/hosts by the agent right after it installs +write_blocklist() { cp "$M/files/blocklist" "$M/blocklist"; } + +# Code: mimoagent environments/datasets/opensource_code.py + base.py, as the explorer runs it (app/runner/domains.py Code). +CWD=/workspace/repo +git config --global --add safe.directory "$CWD" +cd "$CWD" || fail "no working directory $CWD" +if ! git rev-parse --git-dir >/dev/null 2>&1; then # a bare source tree: give it a baseline commit + git init -q && git add -A && git -c user.name=mimo -c user.email=mimo@localhost commit -q -m baseline --allow-empty +fi +BASE=$(git rev-parse HEAD 2>/dev/null) +[ ${#BASE} -eq 40 ] || fail "could not resolve the base commit in $CWD" +echo "$BASE" > "$M/base" +# Images are built with history truncated at the base. If one is not, the fix could be read out of git log, +# so .git is hidden while the agent works and put back for grading. +LATER=$(git rev-list --all --not "$BASE" 2>/dev/null | head -n 5 | grep -c . || true) +rm -f /tmp/fail.log /tmp/pass.log /tmp/patch.diff /tmp/test_patch.diff /tmp/*.log 2>/dev/null; rm -rf /tmp/claude-0 /tmp/claude-* /tmp/testem-* /tmp/puppeteer_dev_chrome_profile-* 2>/dev/null; rm -f /tmp/test_files.json 2>/dev/null; rm -rf /tmp/jest_* /tmp/jest-* /tmp/build /tmp/build_env 2>/dev/null; rm -rf /tmp/pytest-of-root /tmp/pytest-* /tmp/.pytest_cache /tmp/__pycache__ 2>/dev/null; rm -rf /tmp/go-build* /tmp/standards /tmp/wordpress /tmp/zig-* /tmp/testbase /tmp/testbed 2>/dev/null; rm -f /tmp/tmp*.tmp /tmp/*.bak /tmp/expect* /tmp/butwas* 2>/dev/null; rm -rf /root/.cache/go-build 2>/dev/null; rm -rf /tests 2>/dev/null; find /logs -mindepth 1 -delete 2>/dev/null; mkdir -p /logs/agent /logs/verifier /logs/artifacts; chmod 777 /logs/agent /logs/verifier /logs/artifacts; find /var/log -type f -delete 2>/dev/null || true; rm -rf /var/lib/postgresql/*/*/log /var/lib/postgresql/*/*/pg_log 2>/dev/null || true; find /var/lib/mysql /var/lib/mongodb -type f -name '*.log' -delete 2>/dev/null || true; rm -rf /root/.npm/_logs /root/.babel.json /root/.pytest_cache 2>/dev/null || true; find / -maxdepth 4 -xdev -name task_description.md -path '*/.build_env/*' -delete 2>/dev/null || true; true +git clean -fdx --exclude=node_modules --exclude=bower_components --exclude=.husky --exclude=vendor --exclude=third_party --exclude=_deps --exclude=vcpkg_installed --exclude=.venv --exclude=venv --exclude=.gradle --exclude=target --exclude=.build --exclude=lib --exclude=.bundle --exclude=Manifest.toml --exclude=_build --exclude=.stack-work --exclude=dist-newstyle >/dev/null 2>&1 +find /root/.m2 -type f \( -name '*-SNAPSHOT.jar' -o -name '*-SNAPSHOT-sources.jar' -o -name '*-SNAPSHOT-tests.jar' -o -name '*-SNAPSHOT-test-sources.jar' \) -delete 2>/dev/null; rm -rf /root/.julia/compiled 2>/dev/null; rm -rf /root/.gradle/caches/build-cache-* /root/.gradle/daemon 2>/dev/null; rm -rf /root/.gradle/caches/*/scripts /root/.gradle/caches/jars-* 2>/dev/null; rm -rf /root/.cache/bazel 2>/dev/null; true +if [ "$LATER" -gt 0 ]; then + mv "$CWD/.git" "$M/git-hidden" + echo "history not truncated at ${BASE:0:12}: .git hidden while the agent works" +fi +write_blocklist + +touch "$M/ready" +echo "setup done" diff --git a/tasks/format-code-task-001471/tests/test.patch b/tasks/format-code-task-001471/tests/test.patch new file mode 100644 index 0000000000000000000000000000000000000000..bf6510c61b3478470952514483124131397be8f3 --- /dev/null +++ b/tasks/format-code-task-001471/tests/test.patch @@ -0,0 +1,324 @@ +diff --git a/usercase-test-coderl/fixtures/error_test/test.jsonl b/usercase-test-coderl/fixtures/error_test/test.jsonl +new file mode 100644 +--- /dev/null ++++ b/usercase-test-coderl/fixtures/error_test/test.jsonl +@@ -0,0 +1,1 @@ ++{"question":"Broken test record","answer":"No final marker here"} +diff --git a/usercase-test-coderl/fixtures/error_test/train.jsonl b/usercase-test-coderl/fixtures/error_test/train.jsonl +new file mode 100644 +--- /dev/null ++++ b/usercase-test-coderl/fixtures/error_test/train.jsonl +@@ -0,0 +1,1 @@ ++{"question":"Valid train record","answer":"Done #### 1"} +diff --git a/usercase-test-coderl/fixtures/error_train/test.jsonl b/usercase-test-coderl/fixtures/error_train/test.jsonl +new file mode 100644 +--- /dev/null ++++ b/usercase-test-coderl/fixtures/error_train/test.jsonl +@@ -0,0 +1,1 @@ ++{"question":"Valid test record","answer":"Done #### 1"} +diff --git a/usercase-test-coderl/fixtures/error_train/train.jsonl b/usercase-test-coderl/fixtures/error_train/train.jsonl +new file mode 100644 +--- /dev/null ++++ b/usercase-test-coderl/fixtures/error_train/train.jsonl +@@ -0,0 +1,1 @@ ++{"question":"Broken train record","answer":"No final marker here"} +diff --git a/usercase-test-coderl/fixtures/success_examples/test.jsonl b/usercase-test-coderl/fixtures/success_examples/test.jsonl +new file mode 100644 +--- /dev/null ++++ b/usercase-test-coderl/fixtures/success_examples/test.jsonl +@@ -0,0 +1,1 @@ ++{"question":"What is 2+2?","answer":"Compute 2+2 #### 4"} +diff --git a/usercase-test-coderl/fixtures/success_examples/train.jsonl b/usercase-test-coderl/fixtures/success_examples/train.jsonl +new file mode 100644 +--- /dev/null ++++ b/usercase-test-coderl/fixtures/success_examples/train.jsonl +@@ -0,0 +1,1 @@ ++{"question":"What is 1,000 plus 20?","answer":"Add them. #### 1,020"} +diff --git a/usercase-test-coderl/fixtures/success_numbers/test.jsonl b/usercase-test-coderl/fixtures/success_numbers/test.jsonl +new file mode 100644 +--- /dev/null ++++ b/usercase-test-coderl/fixtures/success_numbers/test.jsonl +@@ -0,0 +1,2 @@ ++{"question":"What is 1.5 plus 2?","answer":"Use decimals. #### 3.5"} ++{"question":"What is 1234 plus 5678?","answer":"Add the place values #### 6,912"} +diff --git a/usercase-test-coderl/fixtures/success_numbers/train.jsonl b/usercase-test-coderl/fixtures/success_numbers/train.jsonl +new file mode 100644 +--- /dev/null ++++ b/usercase-test-coderl/fixtures/success_numbers/train.jsonl +@@ -0,0 +1,2 @@ ++{"question":"What is -5 plus 2?","answer":"Combine integers #### -3"} ++{"question":"How many are left from 3 minus 3?","answer":"Subtract all of them #### 0"} +diff --git a/usercase-test-coderl/sitecustomize.py b/usercase-test-coderl/sitecustomize.py +new file mode 100644 +--- /dev/null ++++ b/usercase-test-coderl/sitecustomize.py +@@ -0,0 +1,66 @@ ++ ++ ++ ++from __future__ import annotations ++ ++import ipaddress ++import socket ++ ++ ++_ORIGINAL_CONNECT = socket.socket.connect ++_ORIGINAL_CONNECT_EX = socket.socket.connect_ex ++_ORIGINAL_CREATE_CONNECTION = socket.create_connection ++_ORIGINAL_GETADDRINFO = socket.getaddrinfo ++ ++ ++def _is_loopback_host(host: object) -> bool: ++ if host is None: ++ return True ++ ++ host_text = str(host).strip("[]").lower() ++ if host_text in {"localhost", "ip6-localhost"}: ++ return True ++ ++ try: ++ address = ipaddress.ip_address(host_text) ++ except ValueError: ++ return False ++ ++ return address.is_loopback or address.is_unspecified ++ ++ ++def _host_from_address(address: object) -> object: ++ if isinstance(address, tuple) and address: ++ return address[0] ++ return None ++ ++ ++def _reject_remote(host: object) -> None: ++ if not _is_loopback_host(host): ++ raise OSError(f"isolated offline guard blocked remote network host: {host!r}") ++ ++ ++def _offline_connect(self: socket.socket, address: object) -> None: ++ _reject_remote(_host_from_address(address)) ++ return _ORIGINAL_CONNECT(self, address) ++ ++ ++def _offline_connect_ex(self: socket.socket, address: object) -> int: ++ _reject_remote(_host_from_address(address)) ++ return _ORIGINAL_CONNECT_EX(self, address) ++ ++ ++def _offline_create_connection(address: object, *args: object, **kwargs: object) -> socket.socket: ++ _reject_remote(_host_from_address(address)) ++ return _ORIGINAL_CREATE_CONNECTION(address, *args, **kwargs) ++ ++ ++def _offline_getaddrinfo(host: object, *args: object, **kwargs: object) -> list[tuple]: ++ _reject_remote(host) ++ return _ORIGINAL_GETADDRINFO(host, *args, **kwargs) ++ ++ ++socket.socket.connect = _offline_connect ++socket.socket.connect_ex = _offline_connect_ex ++socket.create_connection = _offline_create_connection ++socket.getaddrinfo = _offline_getaddrinfo +diff --git a/usercase-test-coderl/usecase.sh b/usercase-test-coderl/usecase.sh +new file mode 100755 +--- /dev/null ++++ b/usercase-test-coderl/usecase.sh +@@ -0,0 +1,181 @@ ++#!/usr/bin/env bash ++ ++set -u ++export LANG=C.UTF-8 LC_ALL=C.UTF-8 TZ=UTC ++ ++ ++export PYTHONPATH="/workspace/repo/usercase-test-coderl${PYTHONPATH:+:$PYTHONPATH}" ++export PYTHONNOUSERSITE=1 ++export HF_DATASETS_OFFLINE=1 ++export TRANSFORMERS_OFFLINE=1 ++export HF_HUB_OFFLINE=1 ++export VLLM_USE_MODELSCOPE=False ++ ++( cd /workspace/repo && python -m py_compile scripts/gsm8k_to_math.py ) \ ++ || { echo "FAIL: build" >&2; exit 1; } ++ ++PYTHON=python ++SCRIPT=/workspace/repo/scripts/gsm8k_to_math.py ++FIXTURES=/workspace/repo/usercase-test-coderl/fixtures ++ ++TMP=$(mktemp -d) ++trap 'rm -rf "$TMP"' EXIT ++fail() { echo "FAIL: $*" >&2; exit 1; } ++ ++assert_jsonl_equals() { ++ local actual=$1 expected=$2 label=$3 ++ python - "$actual" "$expected" "$label" <<'PY' ++import json ++import sys ++from pathlib import Path ++ ++actual_path = Path(sys.argv[1]) ++expected_path = Path(sys.argv[2]) ++label = sys.argv[3] ++required_keys = {"problem", "solution", "answer"} ++ ++try: ++ actual_rows = [json.loads(line) for line in actual_path.read_text(encoding="utf-8").splitlines()] ++ expected_rows = [json.loads(line) for line in expected_path.read_text(encoding="utf-8").splitlines()] ++except Exception as exc: ++ print(f"FAIL: {label}: invalid JSONL: {exc}", file=sys.stderr) ++ sys.exit(1) ++ ++for idx, row in enumerate(actual_rows, start=1): ++ if set(row) != required_keys: ++ print(f"FAIL: {label}: line {idx} keys {sorted(row)}; want {sorted(required_keys)}", file=sys.stderr) ++ sys.exit(1) ++ ++if actual_rows != expected_rows: ++ print(f"FAIL: {label}: JSON rows differ", file=sys.stderr) ++ print("actual:", json.dumps(actual_rows, ensure_ascii=False), file=sys.stderr) ++ print("expected:", json.dumps(expected_rows, ensure_ascii=False), file=sys.stderr) ++ sys.exit(1) ++PY ++} ++ ++assert_stdout_has_no_converted_records() { ++ local stdout_path=$1 label=$2 ++ python - "$stdout_path" "$label" <<'PY' ++import json ++import sys ++from pathlib import Path ++ ++stdout_path = Path(sys.argv[1]) ++label = sys.argv[2] ++required_keys = {"problem", "solution", "answer"} ++ ++for idx, line in enumerate(stdout_path.read_text(encoding="utf-8").splitlines(), start=1): ++ try: ++ row = json.loads(line) ++ except json.JSONDecodeError: ++ continue ++ if isinstance(row, dict) and set(row) == required_keys: ++ print(f"FAIL: {label}: stdout line {idx} contains a converted record", file=sys.stderr) ++ sys.exit(1) ++PY ++} ++ ++assert_bad_record_not_written() { ++ local work=$1 needle=$2 label=$3 ++ python - "$work" "$needle" "$label" <<'PY' ++import json ++import sys ++from pathlib import Path ++ ++work = Path(sys.argv[1]) ++needle = sys.argv[2] ++label = sys.argv[3] ++output_dir = work / "data" / "gsm8k_splits" ++ ++if not output_dir.exists(): ++ sys.exit(0) ++ ++for path in output_dir.glob("*.jsonl"): ++ for idx, line in enumerate(path.read_text(encoding="utf-8").splitlines(), start=1): ++ try: ++ row = json.loads(line) ++ except json.JSONDecodeError: ++ continue ++ if row.get("problem") == needle: ++ print(f"FAIL: {label}: wrote invalid input record to {path.name}:{idx}", file=sys.stderr) ++ sys.exit(1) ++PY ++} ++ ++ ++ ++ ++ ++ ++ ++work="$TMP/f1_work" ++mkdir -p "$work" ++( cd "$work" && "$PYTHON" "$SCRIPT" "$FIXTURES/success_examples" >out 2>err ); ec=$? ++[ "$ec" -eq 0 ] || fail "F1 exit $ec; want 0" ++[ -d "$work/data/gsm8k_splits" ] || fail "F1 did not create data/gsm8k_splits" ++[ -f "$work/data/gsm8k_splits/train.jsonl" ] || fail "F1 missing train output" ++[ -f "$work/data/gsm8k_splits/test.jsonl" ] || fail "F1 missing test output" ++ ++assert_stdout_has_no_converted_records "$work/out" "F1 stdout" ++ ++cat >"$TMP/f1_expected_train.jsonl" <<'EOF' ++{"problem": "What is 1,000 plus 20?", "solution": "Add them. The answer is $\\boxed{1020}$.", "answer": "1020"} ++EOF ++cat >"$TMP/f1_expected_test.jsonl" <<'EOF' ++{"problem": "What is 2+2?", "solution": "Compute 2+2. The answer is $\\boxed{4}$.", "answer": "4"} ++EOF ++assert_jsonl_equals "$work/data/gsm8k_splits/train.jsonl" "$TMP/f1_expected_train.jsonl" "F1 train" ++assert_jsonl_equals "$work/data/gsm8k_splits/test.jsonl" "$TMP/f1_expected_test.jsonl" "F1 test" ++ ++ ++ ++ ++ ++ ++work="$TMP/f2_work" ++mkdir -p "$work" ++( cd "$work" && "$PYTHON" "$SCRIPT" "$FIXTURES/success_numbers" >out 2>err ); ec=$? ++[ "$ec" -eq 0 ] || fail "F2 exit $ec; want 0" ++ ++assert_stdout_has_no_converted_records "$work/out" "F2 stdout" ++ ++cat >"$TMP/f2_expected_train.jsonl" <<'EOF' ++{"problem": "What is -5 plus 2?", "solution": "Combine integers. The answer is $\\boxed{-3}$.", "answer": "-3"} ++{"problem": "How many are left from 3 minus 3?", "solution": "Subtract all of them. The answer is $\\boxed{0}$.", "answer": "0"} ++EOF ++cat >"$TMP/f2_expected_test.jsonl" <<'EOF' ++{"problem": "What is 1.5 plus 2?", "solution": "Use decimals. The answer is $\\boxed{3.5}$.", "answer": "3.5"} ++{"problem": "What is 1234 plus 5678?", "solution": "Add the place values. The answer is $\\boxed{6912}$.", "answer": "6912"} ++EOF ++assert_jsonl_equals "$work/data/gsm8k_splits/train.jsonl" "$TMP/f2_expected_train.jsonl" "F2 train" ++assert_jsonl_equals "$work/data/gsm8k_splits/test.jsonl" "$TMP/f2_expected_test.jsonl" "F2 test" ++ ++ ++ ++ ++ ++work="$TMP/f3_work" ++mkdir -p "$work" ++( cd "$work" && "$PYTHON" "$SCRIPT" "$FIXTURES/error_train" >out 2>err ); ec=$? ++[ "$ec" -ne 0 ] || fail "F3 exit $ec; want non-zero" ++ ++assert_bad_record_not_written "$work" "Broken train record" "F3 output" ++grep -q 'ValueError: Cannot extract answer in No final marker here\.' "$work/err" \ ++ || fail "F3 stderr missing ValueError message: $(cat "$work/err")" ++ ++ ++ ++ ++ ++work="$TMP/f4_work" ++mkdir -p "$work" ++( cd "$work" && "$PYTHON" "$SCRIPT" "$FIXTURES/error_test" >out 2>err ); ec=$? ++[ "$ec" -ne 0 ] || fail "F4 exit $ec; want non-zero" ++ ++assert_bad_record_not_written "$work" "Broken test record" "F4 output" ++grep -q 'ValueError: Cannot extract answer in No final marker here\.' "$work/err" \ ++ || fail "F4 stderr missing ValueError message: $(cat "$work/err")" ++ ++echo "PASS" ++exit 0 +diff --git a/mimo_test_command.sh b/mimo_test_command.sh +new file mode 100755 +--- /dev/null ++++ b/mimo_test_command.sh +@@ -0,0 +1,12 @@ ++#!/usr/bin/env bash ++ ++ ++ ++ ++export NODE_OPTIONS="${NODE_OPTIONS:-} --max-old-space-size=4096" ++export MAVEN_OPTS="${MAVEN_OPTS:-} -Xmx3g -XX:+UseG1GC" ++export GRADLE_OPTS="${GRADLE_OPTS:-} -Xmx3g -XX:+UseG1GC" ++export TEST_JVM_OPTS="${TEST_JVM_OPTS:-} -Xmx3g" ++set -e ++cd /workspace/repo ++exec bash /workspace/repo/usercase-test-coderl/usecase.sh diff --git a/tasks/format-code-task-001471/tests/test.sh b/tasks/format-code-task-001471/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..264de880fe894a69d10996daed22af6d940dc768 --- /dev/null +++ b/tasks/format-code-task-001471/tests/test.sh @@ -0,0 +1,47 @@ +#!/bin/bash +# Code grading, mimoagent opensource_code.py: reset the files the hidden test patch touches, apply it, run the +# task's test command; reward 1 when it exits 0. A testbed failure (reset or apply) writes no reward: not scored. +M=/var/lib/mimo +CWD=/workspace/repo +V=/logs/verifier +mkdir -p "$V" +BASE=$(cat "$M/base" 2>/dev/null) || { echo "setup never ran (no $M/base)" >&2; exit 1; } +cd "$CWD" || exit 1 +if [ -d "$M/git-hidden" ]; then rm -rf "$CWD/.git"; mv "$M/git-hidden" "$CWD/.git"; fi +# the agent's change against the base, so its own commits count too +git add -A >/dev/null 2>&1 && git -c core.fileMode=false diff --cached "$BASE" > "$V/agent.diff" +git reset -q +if ! ( +while IFS= read -r tf; do + [ -z "$tf" ] && continue + if git cat-file -e $BASE:"$tf" 2>/dev/null; then + git checkout $BASE -- "$tf" 2>/dev/null || true + else + git rm -f --cached "$tf" >/dev/null 2>&1 || true + rm -f "$tf" + fi +done <<'EOF_RESET_TEST_FILES' +usercase-test-coderl/fixtures/error_test/test.jsonl +usercase-test-coderl/fixtures/error_test/train.jsonl +usercase-test-coderl/fixtures/error_train/test.jsonl +usercase-test-coderl/fixtures/error_train/train.jsonl +usercase-test-coderl/fixtures/success_examples/test.jsonl +usercase-test-coderl/fixtures/success_examples/train.jsonl +usercase-test-coderl/fixtures/success_numbers/test.jsonl +usercase-test-coderl/fixtures/success_numbers/train.jsonl +usercase-test-coderl/sitecustomize.py +usercase-test-coderl/usecase.sh +mimo_test_command.sh +EOF_RESET_TEST_FILES + +); then echo "could not reset the test files (testbed problem, not scored)" >&2; exit 1; fi +if ! git apply --verbose /tests/test.patch > "$V/apply.log" 2>&1; then + cat "$V/apply.log" >&2 + echo "the hidden tests could not be applied (testbed problem, not scored)" >&2 + exit 1 +fi +timeout 1800 sh -c "$(cat /tests/test_command.sh)" > "$V/test_output.log" 2>&1 +RC=$? +tail -c 12000 "$V/test_output.log" +if [ $RC -eq 0 ]; then echo 1 > "$V/reward.txt"; else echo 0 > "$V/reward.txt"; fi +echo "test command exited $RC" diff --git a/tasks/format-code-task-001471/tests/test_command.sh b/tasks/format-code-task-001471/tests/test_command.sh new file mode 100644 index 0000000000000000000000000000000000000000..88cb7810b836396c4869db31aeac7d4d4b189685 --- /dev/null +++ b/tasks/format-code-task-001471/tests/test_command.sh @@ -0,0 +1 @@ +bash /workspace/repo/mimo_test_command.sh \ No newline at end of file diff --git a/tasks/format-code-task-001476/environment/Dockerfile b/tasks/format-code-task-001476/environment/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..f90661a357b4ba95bf3debbaa3fafd729977227d --- /dev/null +++ b/tasks/format-code-task-001476/environment/Dockerfile @@ -0,0 +1,3 @@ +# The task's image, pinned by digest (the same as [environment].docker_image). +# Setup runs at start from [environment.healthcheck]; environment/setup/ is its readable copy. +FROM docker.io/xiaomimimo/mimo-v2.6-rl-oss@sha256:8df3b1a68cfc76071c94909ac926486f88e25802a40ab7b4144624a61a782c77 diff --git a/tasks/format-code-task-001476/environment/setup/files/blocklist b/tasks/format-code-task-001476/environment/setup/files/blocklist new file mode 100644 index 0000000000000000000000000000000000000000..a8e4bdc4c7d9b739c047a3cb58ea72a1bb05bcbc --- /dev/null +++ b/tasks/format-code-task-001476/environment/setup/files/blocklist @@ -0,0 +1,33 @@ +# mimo answer-leak blocklist (mimoagent) +0.0.0.0 github.com +0.0.0.0 www.github.com +0.0.0.0 api.github.com +0.0.0.0 raw.githubusercontent.com +0.0.0.0 codeload.github.com +0.0.0.0 objects.githubusercontent.com +0.0.0.0 gist.github.com +0.0.0.0 gist.githubusercontent.com +0.0.0.0 gitlab.com +0.0.0.0 bitbucket.org +0.0.0.0 sourceforge.net +0.0.0.0 git.kernel.org +0.0.0.0 chromium.googlesource.com +0.0.0.0 android.googlesource.com +0.0.0.0 sourcegraph.com +0.0.0.0 bugs.chromium.org +0.0.0.0 issues.oss-fuzz.com +0.0.0.0 oss-fuzz.com +0.0.0.0 osv.dev +0.0.0.0 api.osv.dev +0.0.0.0 bugzilla.mozilla.org +0.0.0.0 proxy.golang.org +0.0.0.0 sum.golang.org +0.0.0.0 pkg.go.dev +0.0.0.0 google.com +0.0.0.0 www.google.com +0.0.0.0 bing.com +0.0.0.0 www.bing.com +0.0.0.0 duckduckgo.com +0.0.0.0 html.duckduckgo.com +0.0.0.0 search.brave.com +0.0.0.0 stackoverflow.com diff --git a/tasks/format-code-task-001476/environment/setup/setup.sh b/tasks/format-code-task-001476/environment/setup/setup.sh new file mode 100644 index 0000000000000000000000000000000000000000..d883db90cfcfb48f7a139861bbe9f6b5d95cad6f --- /dev/null +++ b/tasks/format-code-task-001476/environment/setup/setup.sh @@ -0,0 +1,34 @@ +#!/bin/bash +# Runs once, as root, before the agent starts: Harbor's [environment.healthcheck] unpacks this folder into +# /var/lib/mimo and runs it. Generated by mimo_harbor; see its README for how each step maps to Xiaomi's harness. +M=/var/lib/mimo +[ -f "$M/ready" ] && exit 0 +chmod 700 "$M" +fail() { echo "setup: $*" >&2; exit 1; } +# the answer-leak blocklist (mimoagent), applied to /etc/hosts by the agent right after it installs +write_blocklist() { cp "$M/files/blocklist" "$M/blocklist"; } + +# Code: mimoagent environments/datasets/opensource_code.py + base.py, as the explorer runs it (app/runner/domains.py Code). +CWD=/testbed +git config --global --add safe.directory "$CWD" +cd "$CWD" || fail "no working directory $CWD" +if ! git rev-parse --git-dir >/dev/null 2>&1; then # a bare source tree: give it a baseline commit + git init -q && git add -A && git -c user.name=mimo -c user.email=mimo@localhost commit -q -m baseline --allow-empty +fi +BASE=$(git rev-parse HEAD 2>/dev/null) +[ ${#BASE} -eq 40 ] || fail "could not resolve the base commit in $CWD" +echo "$BASE" > "$M/base" +# Images are built with history truncated at the base. If one is not, the fix could be read out of git log, +# so .git is hidden while the agent works and put back for grading. +LATER=$(git rev-list --all --not "$BASE" 2>/dev/null | head -n 5 | grep -c . || true) +rm -f /tmp/fail.log /tmp/pass.log /tmp/patch.diff /tmp/test_patch.diff /tmp/*.log 2>/dev/null; rm -rf /tmp/claude-0 /tmp/claude-* /tmp/testem-* /tmp/puppeteer_dev_chrome_profile-* 2>/dev/null; rm -f /tmp/test_files.json 2>/dev/null; rm -rf /tmp/jest_* /tmp/jest-* /tmp/build /tmp/build_env 2>/dev/null; rm -rf /tmp/pytest-of-root /tmp/pytest-* /tmp/.pytest_cache /tmp/__pycache__ 2>/dev/null; rm -rf /tmp/go-build* /tmp/standards /tmp/wordpress /tmp/zig-* /tmp/testbase /tmp/testbed 2>/dev/null; rm -f /tmp/tmp*.tmp /tmp/*.bak /tmp/expect* /tmp/butwas* 2>/dev/null; rm -rf /root/.cache/go-build 2>/dev/null; rm -rf /tests 2>/dev/null; find /logs -mindepth 1 -delete 2>/dev/null; mkdir -p /logs/agent /logs/verifier /logs/artifacts; chmod 777 /logs/agent /logs/verifier /logs/artifacts; find /var/log -type f -delete 2>/dev/null || true; rm -rf /var/lib/postgresql/*/*/log /var/lib/postgresql/*/*/pg_log 2>/dev/null || true; find /var/lib/mysql /var/lib/mongodb -type f -name '*.log' -delete 2>/dev/null || true; rm -rf /root/.npm/_logs /root/.babel.json /root/.pytest_cache 2>/dev/null || true; find / -maxdepth 4 -xdev -name task_description.md -path '*/.build_env/*' -delete 2>/dev/null || true; true +git clean -fdx --exclude=node_modules --exclude=bower_components --exclude=.husky --exclude=vendor --exclude=third_party --exclude=_deps --exclude=vcpkg_installed --exclude=.venv --exclude=venv --exclude=.gradle --exclude=target --exclude=.build --exclude=lib --exclude=.bundle --exclude=Manifest.toml --exclude=_build --exclude=.stack-work --exclude=dist-newstyle >/dev/null 2>&1 +find /root/.m2 -type f \( -name '*-SNAPSHOT.jar' -o -name '*-SNAPSHOT-sources.jar' -o -name '*-SNAPSHOT-tests.jar' -o -name '*-SNAPSHOT-test-sources.jar' \) -delete 2>/dev/null; rm -rf /root/.julia/compiled 2>/dev/null; rm -rf /root/.gradle/caches/build-cache-* /root/.gradle/daemon 2>/dev/null; rm -rf /root/.gradle/caches/*/scripts /root/.gradle/caches/jars-* 2>/dev/null; rm -rf /root/.cache/bazel 2>/dev/null; true +if [ "$LATER" -gt 0 ]; then + mv "$CWD/.git" "$M/git-hidden" + echo "history not truncated at ${BASE:0:12}: .git hidden while the agent works" +fi +write_blocklist + +touch "$M/ready" +echo "setup done" diff --git a/tasks/format-code-task-001476/tests/test.patch b/tasks/format-code-task-001476/tests/test.patch new file mode 100644 index 0000000000000000000000000000000000000000..a491e64d2a65aee3c4cb6f7edc8359e986d6c66f --- /dev/null +++ b/tasks/format-code-task-001476/tests/test.patch @@ -0,0 +1,80 @@ +diff --git a/test/src/build_parts.spec.js b/test/src/build_parts.spec.js +index dafd428..5b3cf45 100644 +--- a/test/src/build_parts.spec.js ++++ b/test/src/build_parts.spec.js +@@ -72,4 +72,30 @@ describe('The function buildParts', () => { + it('should return an object with a property `script`', () => { + expect(parts).to.have.property('script'); + }); ++ ++ it('should produce syntactically valid JavaScript when previewVariables is undefined', () => { ++ const script = buildParts({ id: 'GTM-asd123' }).script; ++ expect(() => new Function(script)).to.not.throw(); ++ }); ++ ++ it('should produce syntactically valid JavaScript when previewVariables is defined', () => { ++ const script = buildParts({ ++ id: 'GTM-asd123', ++ previewVariables: '>m_auth=EXAMPLE>m_preview=env-14>m_cookies_win=x' ++ }).script; ++ expect(() => new Function(script)).to.not.throw(); ++ }); ++ ++ it('should not produce a broken `+;` concatenation when previewVariables is undefined', () => { ++ const script = buildParts({ id: 'GTM-asd123' }).script; ++ expect(script).to.not.match(/\+\s*;/); ++ }); ++ ++ it('should still include the previewVariables value within the generated script', () => { ++ const script = buildParts({ ++ id: 'GTM-asd123', ++ previewVariables: '>m_auth=EXAMPLE>m_preview=env-14>m_cookies_win=x' ++ }).script; ++ expect(script).to.have.entriesCount('>m_auth=EXAMPLE>m_preview=env-14>m_cookies_win=x', 1); ++ }); + }); +diff --git a/test/src/index.spec.js b/test/src/index.spec.js +index f26526d..a8235dc 100644 +--- a/test/src/index.spec.js ++++ b/test/src/index.spec.js +@@ -34,4 +34,18 @@ describe('The function GTMParts', () => { + expect(script).to.startWith(''); + }); ++ ++ it('should produce a scriptAsReact whose inner JS is syntactically valid when previewVariables is undefined', () => { ++ const html = gtmParts({ id: gtmId }).scriptAsReact().props.dangerouslySetInnerHTML.__html; ++ expect(() => new Function(html)).to.not.throw(); ++ expect(html).to.not.match(/\+\s*;/); ++ }); ++ ++ it('should produce a scriptAsReact whose inner JS is syntactically valid when previewVariables is defined', () => { ++ const html = gtmParts({ ++ id: gtmId, ++ previewVariables: '>m_auth=EXAMPLE>m_preview=env-14>m_cookies_win=x' ++ }).scriptAsReact().props.dangerouslySetInnerHTML.__html; ++ expect(() => new Function(html)).to.not.throw(); ++ }); + }); +diff --git a/test_commands.json b/test_commands.json +new file mode 100644 +index 0000000..174eff1 +--- /dev/null ++++ b/test_commands.json +@@ -0,0 +1,3 @@ ++{ ++ "test_commands": ["./node_modules/.bin/mocha test/ --opts test/mocha.opts"] ++} +diff --git a/mimo_test_command.sh b/mimo_test_command.sh +new file mode 100755 +--- /dev/null ++++ b/mimo_test_command.sh +@@ -0,0 +1,8 @@ ++#!/usr/bin/env bash ++ ++set -uo pipefail ++cd /testbed ++rc=0 ++./node_modules/.bin/mocha test/ --opts test/mocha.opts ++rc=$(( rc | $? )) ++exit $rc diff --git a/tasks/format-code-task-001476/tests/test.sh b/tasks/format-code-task-001476/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..0ca8014cc710d2ad9e02a492eb7ef5171567439a --- /dev/null +++ b/tasks/format-code-task-001476/tests/test.sh @@ -0,0 +1,40 @@ +#!/bin/bash +# Code grading, mimoagent opensource_code.py: reset the files the hidden test patch touches, apply it, run the +# task's test command; reward 1 when it exits 0. A testbed failure (reset or apply) writes no reward: not scored. +M=/var/lib/mimo +CWD=/testbed +V=/logs/verifier +mkdir -p "$V" +BASE=$(cat "$M/base" 2>/dev/null) || { echo "setup never ran (no $M/base)" >&2; exit 1; } +cd "$CWD" || exit 1 +if [ -d "$M/git-hidden" ]; then rm -rf "$CWD/.git"; mv "$M/git-hidden" "$CWD/.git"; fi +# the agent's change against the base, so its own commits count too +git add -A >/dev/null 2>&1 && git -c core.fileMode=false diff --cached "$BASE" > "$V/agent.diff" +git reset -q +if ! ( +while IFS= read -r tf; do + [ -z "$tf" ] && continue + if git cat-file -e $BASE:"$tf" 2>/dev/null; then + git checkout $BASE -- "$tf" 2>/dev/null || true + else + git rm -f --cached "$tf" >/dev/null 2>&1 || true + rm -f "$tf" + fi +done <<'EOF_RESET_TEST_FILES' +test/src/build_parts.spec.js +test/src/index.spec.js +test_commands.json +mimo_test_command.sh +EOF_RESET_TEST_FILES + +); then echo "could not reset the test files (testbed problem, not scored)" >&2; exit 1; fi +if ! git apply --verbose /tests/test.patch > "$V/apply.log" 2>&1; then + cat "$V/apply.log" >&2 + echo "the hidden tests could not be applied (testbed problem, not scored)" >&2 + exit 1 +fi +timeout 1800 sh -c "$(cat /tests/test_command.sh)" > "$V/test_output.log" 2>&1 +RC=$? +tail -c 12000 "$V/test_output.log" +if [ $RC -eq 0 ]; then echo 1 > "$V/reward.txt"; else echo 0 > "$V/reward.txt"; fi +echo "test command exited $RC" diff --git a/tasks/format-code-task-001476/tests/test_command.sh b/tasks/format-code-task-001476/tests/test_command.sh new file mode 100644 index 0000000000000000000000000000000000000000..7cb23076694ad17d72e8296d62b2b240083e36db --- /dev/null +++ b/tasks/format-code-task-001476/tests/test_command.sh @@ -0,0 +1 @@ +bash /testbed/mimo_test_command.sh \ No newline at end of file diff --git a/tasks/format-code-task-001478/environment/Dockerfile b/tasks/format-code-task-001478/environment/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..76d733c33a57a47b9c4c7257aecce4a7e1e796e0 --- /dev/null +++ b/tasks/format-code-task-001478/environment/Dockerfile @@ -0,0 +1,3 @@ +# The task's image, pinned by digest (the same as [environment].docker_image). +# Setup runs at start from [environment.healthcheck]; environment/setup/ is its readable copy. +FROM docker.io/xiaomimimo/mimo-v2.6-rl-oss@sha256:2e5a71edb5955847f169ddcd0b6bb06a3c7e9317ae4ed560e6fc5f7addd37b02 diff --git a/tasks/format-code-task-001478/environment/setup/files/blocklist b/tasks/format-code-task-001478/environment/setup/files/blocklist new file mode 100644 index 0000000000000000000000000000000000000000..a8e4bdc4c7d9b739c047a3cb58ea72a1bb05bcbc --- /dev/null +++ b/tasks/format-code-task-001478/environment/setup/files/blocklist @@ -0,0 +1,33 @@ +# mimo answer-leak blocklist (mimoagent) +0.0.0.0 github.com +0.0.0.0 www.github.com +0.0.0.0 api.github.com +0.0.0.0 raw.githubusercontent.com +0.0.0.0 codeload.github.com +0.0.0.0 objects.githubusercontent.com +0.0.0.0 gist.github.com +0.0.0.0 gist.githubusercontent.com +0.0.0.0 gitlab.com +0.0.0.0 bitbucket.org +0.0.0.0 sourceforge.net +0.0.0.0 git.kernel.org +0.0.0.0 chromium.googlesource.com +0.0.0.0 android.googlesource.com +0.0.0.0 sourcegraph.com +0.0.0.0 bugs.chromium.org +0.0.0.0 issues.oss-fuzz.com +0.0.0.0 oss-fuzz.com +0.0.0.0 osv.dev +0.0.0.0 api.osv.dev +0.0.0.0 bugzilla.mozilla.org +0.0.0.0 proxy.golang.org +0.0.0.0 sum.golang.org +0.0.0.0 pkg.go.dev +0.0.0.0 google.com +0.0.0.0 www.google.com +0.0.0.0 bing.com +0.0.0.0 www.bing.com +0.0.0.0 duckduckgo.com +0.0.0.0 html.duckduckgo.com +0.0.0.0 search.brave.com +0.0.0.0 stackoverflow.com diff --git a/tasks/format-code-task-001478/environment/setup/setup.sh b/tasks/format-code-task-001478/environment/setup/setup.sh new file mode 100644 index 0000000000000000000000000000000000000000..e9eb7daf39f9542bd095367feee457f3da77e492 --- /dev/null +++ b/tasks/format-code-task-001478/environment/setup/setup.sh @@ -0,0 +1,34 @@ +#!/bin/bash +# Runs once, as root, before the agent starts: Harbor's [environment.healthcheck] unpacks this folder into +# /var/lib/mimo and runs it. Generated by mimo_harbor; see its README for how each step maps to Xiaomi's harness. +M=/var/lib/mimo +[ -f "$M/ready" ] && exit 0 +chmod 700 "$M" +fail() { echo "setup: $*" >&2; exit 1; } +# the answer-leak blocklist (mimoagent), applied to /etc/hosts by the agent right after it installs +write_blocklist() { cp "$M/files/blocklist" "$M/blocklist"; } + +# Code: mimoagent environments/datasets/opensource_code.py + base.py, as the explorer runs it (app/runner/domains.py Code). +CWD=/workspace/repo +git config --global --add safe.directory "$CWD" +cd "$CWD" || fail "no working directory $CWD" +if ! git rev-parse --git-dir >/dev/null 2>&1; then # a bare source tree: give it a baseline commit + git init -q && git add -A && git -c user.name=mimo -c user.email=mimo@localhost commit -q -m baseline --allow-empty +fi +BASE=$(git rev-parse HEAD 2>/dev/null) +[ ${#BASE} -eq 40 ] || fail "could not resolve the base commit in $CWD" +echo "$BASE" > "$M/base" +# Images are built with history truncated at the base. If one is not, the fix could be read out of git log, +# so .git is hidden while the agent works and put back for grading. +LATER=$(git rev-list --all --not "$BASE" 2>/dev/null | head -n 5 | grep -c . || true) +rm -f /tmp/fail.log /tmp/pass.log /tmp/patch.diff /tmp/test_patch.diff /tmp/*.log 2>/dev/null; rm -rf /tmp/claude-0 /tmp/claude-* /tmp/testem-* /tmp/puppeteer_dev_chrome_profile-* 2>/dev/null; rm -f /tmp/test_files.json 2>/dev/null; rm -rf /tmp/jest_* /tmp/jest-* /tmp/build /tmp/build_env 2>/dev/null; rm -rf /tmp/pytest-of-root /tmp/pytest-* /tmp/.pytest_cache /tmp/__pycache__ 2>/dev/null; rm -rf /tmp/go-build* /tmp/standards /tmp/wordpress /tmp/zig-* /tmp/testbase /tmp/testbed 2>/dev/null; rm -f /tmp/tmp*.tmp /tmp/*.bak /tmp/expect* /tmp/butwas* 2>/dev/null; rm -rf /root/.cache/go-build 2>/dev/null; rm -rf /tests 2>/dev/null; find /logs -mindepth 1 -delete 2>/dev/null; mkdir -p /logs/agent /logs/verifier /logs/artifacts; chmod 777 /logs/agent /logs/verifier /logs/artifacts; find /var/log -type f -delete 2>/dev/null || true; rm -rf /var/lib/postgresql/*/*/log /var/lib/postgresql/*/*/pg_log 2>/dev/null || true; find /var/lib/mysql /var/lib/mongodb -type f -name '*.log' -delete 2>/dev/null || true; rm -rf /root/.npm/_logs /root/.babel.json /root/.pytest_cache 2>/dev/null || true; find / -maxdepth 4 -xdev -name task_description.md -path '*/.build_env/*' -delete 2>/dev/null || true; true +git clean -fdx --exclude=node_modules --exclude=bower_components --exclude=.husky --exclude=vendor --exclude=third_party --exclude=_deps --exclude=vcpkg_installed --exclude=.venv --exclude=venv --exclude=.gradle --exclude=target --exclude=.build --exclude=lib --exclude=.bundle --exclude=Manifest.toml --exclude=_build --exclude=.stack-work --exclude=dist-newstyle >/dev/null 2>&1 +find /root/.m2 -type f \( -name '*-SNAPSHOT.jar' -o -name '*-SNAPSHOT-sources.jar' -o -name '*-SNAPSHOT-tests.jar' -o -name '*-SNAPSHOT-test-sources.jar' \) -delete 2>/dev/null; rm -rf /root/.julia/compiled 2>/dev/null; rm -rf /root/.gradle/caches/build-cache-* /root/.gradle/daemon 2>/dev/null; rm -rf /root/.gradle/caches/*/scripts /root/.gradle/caches/jars-* 2>/dev/null; rm -rf /root/.cache/bazel 2>/dev/null; true +if [ "$LATER" -gt 0 ]; then + mv "$CWD/.git" "$M/git-hidden" + echo "history not truncated at ${BASE:0:12}: .git hidden while the agent works" +fi +write_blocklist + +touch "$M/ready" +echo "setup done" diff --git a/tasks/format-code-task-001478/tests/test.patch b/tasks/format-code-task-001478/tests/test.patch new file mode 100644 index 0000000000000000000000000000000000000000..e6b156749114988b13ce3c5adc168a125d907635 --- /dev/null +++ b/tasks/format-code-task-001478/tests/test.patch @@ -0,0 +1,451 @@ +diff --git a/usercase-test-coderl/test_coordinate_window_cx.py b/usercase-test-coderl/test_coordinate_window_cx.py +new file mode 100644 +--- /dev/null ++++ b/usercase-test-coderl/test_coordinate_window_cx.py +@@ -0,0 +1,422 @@ ++ ++ ++import copy ++import json ++import subprocess ++import sys ++ ++import dask.dataframe as dd ++import numpy as np ++import pytest ++ ++from spatialpandas import GeoDataFrame, GeoSeries ++from spatialpandas.geometry import LineArray, MultiPointArray, PointArray, PolygonArray ++ ++ ++def _point_xy(obj): ++ array = getattr(obj, "array", obj) ++ return [(float(x), float(y)) for x, y in zip(array.x, array.y, strict=True)] ++ ++ ++def _bounds_list(obj): ++ array = getattr(obj, "array", obj) ++ return [[float(value) for value in bounds] for bounds in array.bounds] ++ ++ ++def _point_series(): ++ return GeoSeries( ++ PointArray([[0, 0], [5, 5], [10, 10], [-2, 4], [4, -3]], dtype="float64"), ++ index=["origin", "mid", "far", "left", "low"], ++ name="geom", ++ ) ++ ++ ++def _dask_point_series(): ++ series = GeoSeries( ++ PointArray( ++ [[0, 0], [1, 1], [9, 9], [10, 10], [20, 20], [21, 21]], ++ dtype="float64", ++ ), ++ index=["a", "b", "c", "d", "e", "f"], ++ name="geom", ++ ) ++ return dd.from_pandas(series, npartitions=3) ++ ++ ++def _dask_point_frame(): ++ series = GeoSeries( ++ PointArray( ++ [[0, 0], [1, 1], [9, 9], [10, 10], [20, 20], [21, 21]], ++ dtype="float64", ++ ), ++ index=["a", "b", "c", "d", "e", "f"], ++ name="geom", ++ ) ++ frame = GeoDataFrame( ++ {"value": [0, 1, 2, 3, 4, 5], "geom": series.array}, ++ index=["a", "b", "c", "d", "e", "f"], ++ geometry="geom", ++ ) ++ return dd.from_pandas(frame, npartitions=3) ++ ++ ++def test_geoseries_returns_intersecting_rows_with_original_index(): ++ ++ ++ ++ ++ result = _point_series().cx[1:6, 1:6] ++ ++ assert type(result).__name__ == "GeoSeries" ++ assert _point_xy(result) == [(5.0, 5.0)] ++ assert list(result.index) == ["mid"] ++ assert result.name == "geom" ++ ++ ++def test_missing_endpoints_expand_to_total_bounds(): ++ ++ ++ ++ ++ result = _point_series().cx[:5, :] ++ ++ assert _point_xy(result) == [(0.0, 0.0), (5.0, 5.0), (-2.0, 4.0), (4.0, -3.0)] ++ assert list(result.index) == ["origin", "mid", "left", "low"] ++ ++ ++def test_scalar_coordinates_are_zero_width_slices(): ++ ++ ++ ++ ++ result = _point_series().cx[5, 5] ++ ++ assert _point_xy(result) == [(5.0, 5.0)] ++ assert list(result.index) == ["mid"] ++ ++ ++def test_inverted_bounds_are_normalized(): ++ ++ ++ ++ ++ result = _point_series().cx[6:1, 6:1] ++ ++ assert _point_xy(result) == [(5.0, 5.0)] ++ assert list(result.index) == ["mid"] ++ ++ ++def test_geometry_array_preserves_array_type_and_uses_coordinate_window(): ++ ++ ++ ++ ++ points = PointArray([[0, 0], [5, 5], [10, 10], [-2, 4], [4, -3]], dtype="float64") ++ result = points.cx[-3:1, 3:5] ++ ++ assert type(result).__name__ == "PointArray" ++ assert _point_xy(result) == [(-2.0, 4.0)] ++ ++ ++def test_geometry_array_full_window_returns_all_points_in_order(): ++ ++ ++ ++ ++ points = PointArray([[0, 0], [5, 5], [10, 10], [-2, 4], [4, -3]], dtype="float64") ++ result = points.cx[:, :] ++ ++ assert type(result).__name__ == "PointArray" ++ assert _point_xy(result) == [ ++ (0.0, 0.0), ++ (5.0, 5.0), ++ (10.0, 10.0), ++ (-2.0, 4.0), ++ (4.0, -3.0), ++ ] ++ ++ ++def test_multipart_extent_intersection_is_used(): ++ ++ ++ ++ ++ multipoints = MultiPointArray( ++ [ ++ np.array([0, 0, 2, 2], dtype="float64"), ++ np.array([8, 8, 9, 9], dtype="float64"), ++ np.array([3, 7, 4, 8], dtype="float64"), ++ np.array([-5, -5, -4, -4], dtype="float64"), ++ ] ++ ) ++ result = multipoints.cx[1:3, 1:3] ++ ++ assert type(result).__name__ == "MultiPointArray" ++ ++ assert len(result) == 1 ++ assert _bounds_list(result) == [[0.0, 0.0, 2.0, 2.0]] ++ ++ ++def test_line_extent_intersection_is_used(): ++ ++ ++ ++ ++ lines = LineArray( ++ [ ++ np.array([0, 0, 10, 10], dtype="float64"), ++ np.array([0, 10, 2, 10], dtype="float64"), ++ np.array([20, 20, 25, 25], dtype="float64"), ++ ] ++ ) ++ result = lines.cx[4:6, 4:6] ++ ++ assert type(result).__name__ == "LineArray" ++ ++ assert len(result) == 1 ++ assert _bounds_list(result) == [[0.0, 0.0, 10.0, 10.0]] ++ ++ ++def test_polygon_touching_window_boundary_intersects(): ++ ++ ++ ++ ++ polygons = PolygonArray( ++ [ ++ [np.array([0, 0, 4, 0, 4, 4, 0, 4, 0, 0], dtype="float64")], ++ [np.array([10, 10, 12, 10, 12, 12, 10, 12, 10, 10], dtype="float64")], ++ ] ++ ) ++ result = polygons.cx[4:5, 2:3] ++ ++ assert type(result).__name__ == "PolygonArray" ++ ++ assert len(result) == 1 ++ assert _bounds_list(result) == [[0.0, 0.0, 4.0, 4.0]] ++ ++ ++def test_geodataframe_filters_rows_using_active_geometry_column(): ++ ++ ++ ++ ++ frame = GeoDataFrame( ++ { ++ "label": ["a", "b", "c", "d", "e"], ++ "geom": PointArray([[0, 0], [5, 5], [10, 10], [-2, 4], [4, -3]], dtype="float64"), ++ "other": PointArray([[100, 100], [100, 100], [0, 0], [2, 2], [3, 3]], dtype="float64"), ++ }, ++ index=[10, 11, 12, 13, 14], ++ geometry="geom", ++ ) ++ result = frame.cx[1:6, 1:6] ++ ++ assert type(result).__name__ == "GeoDataFrame" ++ assert list(result.index) == [11] ++ assert list(result["label"]) == ["b"] ++ assert _point_xy(result["geom"]) == [(5.0, 5.0)] ++ assert _point_xy(result["other"]) == [(100.0, 100.0)] ++ assert result.geometry.name == "geom" ++ ++ ++def test_geodataframe_honors_changed_active_geometry_column(): ++ ++ ++ ++ ++ frame = GeoDataFrame( ++ { ++ "label": ["a", "b", "c", "d", "e"], ++ "geom": PointArray([[0, 0], [5, 5], [10, 10], [-2, 4], [4, -3]], dtype="float64"), ++ "other": PointArray([[100, 100], [100, 100], [0, 0], [2, 2], [3, 3]], dtype="float64"), ++ }, ++ index=[10, 11, 12, 13, 14], ++ geometry="geom", ++ ).set_geometry("other") ++ result = frame.cx[99:101, 99:101] ++ ++ assert list(result.index) == [10, 11] ++ assert list(result["label"]) == ["a", "b"] ++ assert _point_xy(result["geom"]) == [(0.0, 0.0), (5.0, 5.0)] ++ assert _point_xy(result["other"]) == [(100.0, 100.0), (100.0, 100.0)] ++ assert result.geometry.name == "other" ++ ++ ++def test_slice_steps_raise_value_error_with_coordinate_interval_message(): ++ ++ ++ ++ ++ series = _point_series() ++ ++ with pytest.raises(ValueError) as x_error: ++ series.cx[0:10:2, 0:10] ++ with pytest.raises(ValueError) as y_error: ++ series.cx[0:10, 0:10:2] ++ ++ ++ for error in (x_error.value, y_error.value): ++ message = str(error).lower() ++ assert "step" in message ++ assert "coordinate" in message ++ assert "interval" in message ++ ++ ++def test_dask_geoseries_cx_uses_partition_bounds_and_filters_rows(): ++ ++ ++ ++ ++ result = _dask_point_series().cx[0:10, 0:10] ++ computed = result.compute() ++ ++ assert type(result).__name__ == "DaskGeoSeries" ++ assert result.npartitions == 2 ++ assert _point_xy(computed) == [(0.0, 0.0), (1.0, 1.0), (9.0, 9.0), (10.0, 10.0)] ++ assert list(computed.index) == ["a", "b", "c", "d"] ++ assert computed.name == "geom" ++ ++ ++def test_dask_geoseries_empty_window_keeps_metadata(): ++ ++ ++ ++ ++ result = _dask_point_series().cx[30:40, 30:40] ++ computed = result.compute() ++ ++ assert type(result).__name__ == "DaskGeoSeries" ++ ++ assert result.npartitions >= 1 ++ assert _point_xy(computed) == [] ++ assert list(computed.index) == [] ++ assert computed.name == "geom" ++ assert str(computed.dtype) == "point[float64]" ++ ++ ++def test_dask_geoseries_cx_partitions_does_not_filter_rows(): ++ ++ ++ ++ ++ result = _dask_point_series().cx_partitions[9:9, 9:9] ++ computed = result.compute() ++ ++ assert type(result).__name__ == "DaskGeoSeries" ++ assert result.npartitions == 1 ++ assert _point_xy(computed) == [(9.0, 9.0), (10.0, 10.0)] ++ assert list(computed.index) == ["c", "d"] ++ ++ ++def test_dask_geodataframe_cx_and_cx_partitions_differ_on_partial_partition(): ++ ++ ++ ++ ++ ddf = _dask_point_frame() ++ filtered = ddf.cx[9:9, 9:9].compute() ++ partition_only = ddf.cx_partitions[9:9, 9:9].compute() ++ ++ assert list(filtered.index) == ["c"] ++ assert list(filtered["value"]) == [2] ++ assert _point_xy(filtered["geom"]) == [(9.0, 9.0)] ++ assert filtered.geometry.name == "geom" ++ assert list(partition_only.index) == ["c", "d"] ++ assert list(partition_only["value"]) == [2, 3] ++ assert _point_xy(partition_only["geom"]) == [(9.0, 9.0), (10.0, 10.0)] ++ assert partition_only.geometry.name == "geom" ++ ++ ++def test_dask_geodataframe_empty_window_keeps_metadata(): ++ ++ ++ ++ ++ result = _dask_point_frame().cx[30:40, 30:40] ++ computed = result.compute() ++ ++ assert type(result).__name__ == "DaskGeoDataFrame" ++ ++ assert result.npartitions >= 1 ++ assert list(computed.index) == [] ++ assert list(computed["value"]) == [] ++ assert _point_xy(computed["geom"]) == [] ++ assert computed.geometry.name == "geom" ++ assert list(computed.columns) == ["value", "geom"] ++ assert {key: str(value) for key, value in computed.dtypes.items()} == { ++ "value": "int64", ++ "geom": "point[float64]", ++ } ++ ++ ++def test_referential_transparency_for_repeated_selection(): ++ first = _point_series().cx[1:6, 1:6] ++ second = _point_series().cx[1:6, 1:6] ++ ++ assert _point_xy(first) == _point_xy(second) == [(5.0, 5.0)] ++ assert list(first.index) == list(second.index) == ["mid"] ++ ++ ++def test_selection_does_not_mutate_input_series(): ++ series = _point_series() ++ before = copy.deepcopy(series) ++ ++ result = series.cx[1:6, 1:6] ++ ++ assert _point_xy(result) == [(5.0, 5.0)] ++ assert _point_xy(series) == _point_xy(before) == [ ++ (0.0, 0.0), ++ (5.0, 5.0), ++ (10.0, 10.0), ++ (-2.0, 4.0), ++ (4.0, -3.0), ++ ] ++ assert list(series.index) == list(before.index) == ["origin", "mid", "far", "left", "low"] ++ ++ ++def test_same_selection_matches_fresh_process_result(): ++ script = r""" ++import json ++import sys ++sys.path.insert(0, "/workspace/repo") ++from spatialpandas import GeoSeries ++from spatialpandas.geometry import PointArray ++series = GeoSeries( ++ PointArray([[0, 0], [5, 5], [10, 10], [-2, 4], [4, -3]], dtype="float64"), ++ index=["origin", "mid", "far", "left", "low"], ++ name="geom", ++) ++result = series.cx[1:6, 1:6] ++payload = { ++ "xy": [(float(x), float(y)) for x, y in zip(result.array.x, result.array.y, strict=True)], ++ "index": list(result.index), ++} ++sys.stdout.write(json.dumps(payload, sort_keys=True)) ++""" ++ in_process = { ++ "xy": [list(xy) for xy in _point_xy(_point_series().cx[1:6, 1:6])], ++ "index": list(_point_series().cx[1:6, 1:6].index), ++ } ++ completed = subprocess.run( ++ [sys.executable, "-c", script], ++ check=True, ++ capture_output=True, ++ text=True, ++ ) ++ ++ ++ assert in_process == json.loads(completed.stdout) == { ++ "xy": [[5.0, 5.0]], ++ "index": ["mid"], ++ } ++ ++ ++def test_coordinate_selection_is_independent_of_current_working_directory(tmp_path, monkeypatch): ++ monkeypatch.chdir(tmp_path) ++ ++ result = _point_series().cx[1:6, 1:6] ++ ++ ++ assert _point_xy(result) == [(5.0, 5.0)] ++ assert list(result.index) == ["mid"] +diff --git a/mimo_test_command.sh b/mimo_test_command.sh +new file mode 100755 +--- /dev/null ++++ b/mimo_test_command.sh +@@ -0,0 +1,19 @@ ++#!/usr/bin/env bash ++ ++ ++ ++ ++export NODE_OPTIONS="${NODE_OPTIONS:-} --max-old-space-size=4096" ++export MAVEN_OPTS="${MAVEN_OPTS:-} -Xmx3g -XX:+UseG1GC" ++export GRADLE_OPTS="${GRADLE_OPTS:-} -Xmx3g -XX:+UseG1GC" ++export TEST_JVM_OPTS="${TEST_JVM_OPTS:-} -Xmx3g" ++set -e ++cd /workspace/repo ++set -euo pipefail ++cd /workspace/repo ++export PYTHONNOUSERSITE=1 ++export PYTHONPATH="/workspace/repo" ++export PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 ++export PIP_NO_INDEX=1 ++export SETUPTOOLS_SCM_PRETEND_VERSION=0.0.0 ++exec /opt/stage4a-venv/bin/python -m pytest /workspace/repo/usercase-test-coderl/test_coordinate_window_cx.py -v diff --git a/tasks/format-code-task-001478/tests/test.sh b/tasks/format-code-task-001478/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..bc2d12a8a09db8f7cf16fecbf4d4ad3bac5d87c8 --- /dev/null +++ b/tasks/format-code-task-001478/tests/test.sh @@ -0,0 +1,38 @@ +#!/bin/bash +# Code grading, mimoagent opensource_code.py: reset the files the hidden test patch touches, apply it, run the +# task's test command; reward 1 when it exits 0. A testbed failure (reset or apply) writes no reward: not scored. +M=/var/lib/mimo +CWD=/workspace/repo +V=/logs/verifier +mkdir -p "$V" +BASE=$(cat "$M/base" 2>/dev/null) || { echo "setup never ran (no $M/base)" >&2; exit 1; } +cd "$CWD" || exit 1 +if [ -d "$M/git-hidden" ]; then rm -rf "$CWD/.git"; mv "$M/git-hidden" "$CWD/.git"; fi +# the agent's change against the base, so its own commits count too +git add -A >/dev/null 2>&1 && git -c core.fileMode=false diff --cached "$BASE" > "$V/agent.diff" +git reset -q +if ! ( +while IFS= read -r tf; do + [ -z "$tf" ] && continue + if git cat-file -e $BASE:"$tf" 2>/dev/null; then + git checkout $BASE -- "$tf" 2>/dev/null || true + else + git rm -f --cached "$tf" >/dev/null 2>&1 || true + rm -f "$tf" + fi +done <<'EOF_RESET_TEST_FILES' +usercase-test-coderl/test_coordinate_window_cx.py +mimo_test_command.sh +EOF_RESET_TEST_FILES + +); then echo "could not reset the test files (testbed problem, not scored)" >&2; exit 1; fi +if ! git apply --verbose /tests/test.patch > "$V/apply.log" 2>&1; then + cat "$V/apply.log" >&2 + echo "the hidden tests could not be applied (testbed problem, not scored)" >&2 + exit 1 +fi +timeout 1800 sh -c "$(cat /tests/test_command.sh)" > "$V/test_output.log" 2>&1 +RC=$? +tail -c 12000 "$V/test_output.log" +if [ $RC -eq 0 ]; then echo 1 > "$V/reward.txt"; else echo 0 > "$V/reward.txt"; fi +echo "test command exited $RC" diff --git a/tasks/format-code-task-001478/tests/test_command.sh b/tasks/format-code-task-001478/tests/test_command.sh new file mode 100644 index 0000000000000000000000000000000000000000..88cb7810b836396c4869db31aeac7d4d4b189685 --- /dev/null +++ b/tasks/format-code-task-001478/tests/test_command.sh @@ -0,0 +1 @@ +bash /workspace/repo/mimo_test_command.sh \ No newline at end of file diff --git a/tasks/format-code-task-001482/environment/Dockerfile b/tasks/format-code-task-001482/environment/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..c911fe55ccfa78924866d2ae488f7f2f989f0779 --- /dev/null +++ b/tasks/format-code-task-001482/environment/Dockerfile @@ -0,0 +1,3 @@ +# The task's image, pinned by digest (the same as [environment].docker_image). +# Setup runs at start from [environment.healthcheck]; environment/setup/ is its readable copy. +FROM docker.io/xiaomimimo/mimo-v2.6-rl-oss@sha256:45e8dc583d01f2e15343f311c9d363d7a88532caafb8b404ffa1de15f983489e diff --git a/tasks/format-code-task-001482/environment/setup/files/blocklist b/tasks/format-code-task-001482/environment/setup/files/blocklist new file mode 100644 index 0000000000000000000000000000000000000000..a8e4bdc4c7d9b739c047a3cb58ea72a1bb05bcbc --- /dev/null +++ b/tasks/format-code-task-001482/environment/setup/files/blocklist @@ -0,0 +1,33 @@ +# mimo answer-leak blocklist (mimoagent) +0.0.0.0 github.com +0.0.0.0 www.github.com +0.0.0.0 api.github.com +0.0.0.0 raw.githubusercontent.com +0.0.0.0 codeload.github.com +0.0.0.0 objects.githubusercontent.com +0.0.0.0 gist.github.com +0.0.0.0 gist.githubusercontent.com +0.0.0.0 gitlab.com +0.0.0.0 bitbucket.org +0.0.0.0 sourceforge.net +0.0.0.0 git.kernel.org +0.0.0.0 chromium.googlesource.com +0.0.0.0 android.googlesource.com +0.0.0.0 sourcegraph.com +0.0.0.0 bugs.chromium.org +0.0.0.0 issues.oss-fuzz.com +0.0.0.0 oss-fuzz.com +0.0.0.0 osv.dev +0.0.0.0 api.osv.dev +0.0.0.0 bugzilla.mozilla.org +0.0.0.0 proxy.golang.org +0.0.0.0 sum.golang.org +0.0.0.0 pkg.go.dev +0.0.0.0 google.com +0.0.0.0 www.google.com +0.0.0.0 bing.com +0.0.0.0 www.bing.com +0.0.0.0 duckduckgo.com +0.0.0.0 html.duckduckgo.com +0.0.0.0 search.brave.com +0.0.0.0 stackoverflow.com diff --git a/tasks/format-code-task-001482/environment/setup/setup.sh b/tasks/format-code-task-001482/environment/setup/setup.sh new file mode 100644 index 0000000000000000000000000000000000000000..d883db90cfcfb48f7a139861bbe9f6b5d95cad6f --- /dev/null +++ b/tasks/format-code-task-001482/environment/setup/setup.sh @@ -0,0 +1,34 @@ +#!/bin/bash +# Runs once, as root, before the agent starts: Harbor's [environment.healthcheck] unpacks this folder into +# /var/lib/mimo and runs it. Generated by mimo_harbor; see its README for how each step maps to Xiaomi's harness. +M=/var/lib/mimo +[ -f "$M/ready" ] && exit 0 +chmod 700 "$M" +fail() { echo "setup: $*" >&2; exit 1; } +# the answer-leak blocklist (mimoagent), applied to /etc/hosts by the agent right after it installs +write_blocklist() { cp "$M/files/blocklist" "$M/blocklist"; } + +# Code: mimoagent environments/datasets/opensource_code.py + base.py, as the explorer runs it (app/runner/domains.py Code). +CWD=/testbed +git config --global --add safe.directory "$CWD" +cd "$CWD" || fail "no working directory $CWD" +if ! git rev-parse --git-dir >/dev/null 2>&1; then # a bare source tree: give it a baseline commit + git init -q && git add -A && git -c user.name=mimo -c user.email=mimo@localhost commit -q -m baseline --allow-empty +fi +BASE=$(git rev-parse HEAD 2>/dev/null) +[ ${#BASE} -eq 40 ] || fail "could not resolve the base commit in $CWD" +echo "$BASE" > "$M/base" +# Images are built with history truncated at the base. If one is not, the fix could be read out of git log, +# so .git is hidden while the agent works and put back for grading. +LATER=$(git rev-list --all --not "$BASE" 2>/dev/null | head -n 5 | grep -c . || true) +rm -f /tmp/fail.log /tmp/pass.log /tmp/patch.diff /tmp/test_patch.diff /tmp/*.log 2>/dev/null; rm -rf /tmp/claude-0 /tmp/claude-* /tmp/testem-* /tmp/puppeteer_dev_chrome_profile-* 2>/dev/null; rm -f /tmp/test_files.json 2>/dev/null; rm -rf /tmp/jest_* /tmp/jest-* /tmp/build /tmp/build_env 2>/dev/null; rm -rf /tmp/pytest-of-root /tmp/pytest-* /tmp/.pytest_cache /tmp/__pycache__ 2>/dev/null; rm -rf /tmp/go-build* /tmp/standards /tmp/wordpress /tmp/zig-* /tmp/testbase /tmp/testbed 2>/dev/null; rm -f /tmp/tmp*.tmp /tmp/*.bak /tmp/expect* /tmp/butwas* 2>/dev/null; rm -rf /root/.cache/go-build 2>/dev/null; rm -rf /tests 2>/dev/null; find /logs -mindepth 1 -delete 2>/dev/null; mkdir -p /logs/agent /logs/verifier /logs/artifacts; chmod 777 /logs/agent /logs/verifier /logs/artifacts; find /var/log -type f -delete 2>/dev/null || true; rm -rf /var/lib/postgresql/*/*/log /var/lib/postgresql/*/*/pg_log 2>/dev/null || true; find /var/lib/mysql /var/lib/mongodb -type f -name '*.log' -delete 2>/dev/null || true; rm -rf /root/.npm/_logs /root/.babel.json /root/.pytest_cache 2>/dev/null || true; find / -maxdepth 4 -xdev -name task_description.md -path '*/.build_env/*' -delete 2>/dev/null || true; true +git clean -fdx --exclude=node_modules --exclude=bower_components --exclude=.husky --exclude=vendor --exclude=third_party --exclude=_deps --exclude=vcpkg_installed --exclude=.venv --exclude=venv --exclude=.gradle --exclude=target --exclude=.build --exclude=lib --exclude=.bundle --exclude=Manifest.toml --exclude=_build --exclude=.stack-work --exclude=dist-newstyle >/dev/null 2>&1 +find /root/.m2 -type f \( -name '*-SNAPSHOT.jar' -o -name '*-SNAPSHOT-sources.jar' -o -name '*-SNAPSHOT-tests.jar' -o -name '*-SNAPSHOT-test-sources.jar' \) -delete 2>/dev/null; rm -rf /root/.julia/compiled 2>/dev/null; rm -rf /root/.gradle/caches/build-cache-* /root/.gradle/daemon 2>/dev/null; rm -rf /root/.gradle/caches/*/scripts /root/.gradle/caches/jars-* 2>/dev/null; rm -rf /root/.cache/bazel 2>/dev/null; true +if [ "$LATER" -gt 0 ]; then + mv "$CWD/.git" "$M/git-hidden" + echo "history not truncated at ${BASE:0:12}: .git hidden while the agent works" +fi +write_blocklist + +touch "$M/ready" +echo "setup done" diff --git a/tasks/format-code-task-001482/tests/test.patch b/tasks/format-code-task-001482/tests/test.patch new file mode 100644 index 0000000000000000000000000000000000000000..be3cbcc39f368c9f5fd7585ada68d1e1402c95aa --- /dev/null +++ b/tasks/format-code-task-001482/tests/test.patch @@ -0,0 +1,34 @@ +diff --git a/tests/util/yaml/test_init.py b/tests/util/yaml/test_init.py +index 1e31d8c6955bfd..30637fe2785f72 100644 +--- a/tests/util/yaml/test_init.py ++++ b/tests/util/yaml/test_init.py +@@ -193,7 +193,7 @@ def test_include_dir_list_recursive( + ), + ( + {"/test/first.yaml": "1", "/test/second.yaml": None}, +- {"first": 1}, ++ {"first": 1, "second": None}, + ), + ], + ) +diff --git a/mimo_build_env.tar.gz.b64 b/mimo_build_env.tar.gz.b64 +new file mode 100644 +--- /dev/null ++++ b/mimo_build_env.tar.gz.b64 +@@ -0,0 +1,5 @@ ++H4sIAAAAAAAAA+3SXYrDIBQF4DxnFXcD8ScT63KKSYQKiZZowmT3Y1NoS2GmLy3DTM/3oFe8oHJk ++7eyGfm/9wotXEZlWapuz+3mrpaplLYWQTe6TUmlRkHrZjW7MMZmJqJhCSD/1Pdr/o9g1/2Rj2ndh ++HI3vWTw874xH+cumOecvtNZS5/ybXa0KEs+7wvfePP+upy341vZlDPPU2cuas+X0LVrnuemSW0yy ++5XFNh+A/qBopl7mPTkPkc3IDX804nH+R8y6x40rVJ1VL+dtvBAAAAAAAAAAAAAAAAAAAAAD4r74A ++JAVtLwAoAAA= +diff --git a/mimo_test_command.sh b/mimo_test_command.sh +new file mode 100755 +--- /dev/null ++++ b/mimo_test_command.sh +@@ -0,0 +1,6 @@ ++#!/usr/bin/env bash ++ ++set -uo pipefail ++cd /testbed || exit 1 ++base64 -d mimo_build_env.tar.gz.b64 | tar -xzf - -C /testbed || exit 1 ++exec bash -lc 'cd /testbed && bash -eo pipefail /testbed/.build_env/test_command.sh' diff --git a/tasks/format-code-task-001482/tests/test.sh b/tasks/format-code-task-001482/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..aa7b04c9c053aea446092583ccdfdb3ac5e801a2 --- /dev/null +++ b/tasks/format-code-task-001482/tests/test.sh @@ -0,0 +1,39 @@ +#!/bin/bash +# Code grading, mimoagent opensource_code.py: reset the files the hidden test patch touches, apply it, run the +# task's test command; reward 1 when it exits 0. A testbed failure (reset or apply) writes no reward: not scored. +M=/var/lib/mimo +CWD=/testbed +V=/logs/verifier +mkdir -p "$V" +BASE=$(cat "$M/base" 2>/dev/null) || { echo "setup never ran (no $M/base)" >&2; exit 1; } +cd "$CWD" || exit 1 +if [ -d "$M/git-hidden" ]; then rm -rf "$CWD/.git"; mv "$M/git-hidden" "$CWD/.git"; fi +# the agent's change against the base, so its own commits count too +git add -A >/dev/null 2>&1 && git -c core.fileMode=false diff --cached "$BASE" > "$V/agent.diff" +git reset -q +if ! ( +while IFS= read -r tf; do + [ -z "$tf" ] && continue + if git cat-file -e $BASE:"$tf" 2>/dev/null; then + git checkout $BASE -- "$tf" 2>/dev/null || true + else + git rm -f --cached "$tf" >/dev/null 2>&1 || true + rm -f "$tf" + fi +done <<'EOF_RESET_TEST_FILES' +tests/util/yaml/test_init.py +mimo_build_env.tar.gz.b64 +mimo_test_command.sh +EOF_RESET_TEST_FILES + +); then echo "could not reset the test files (testbed problem, not scored)" >&2; exit 1; fi +if ! git apply --verbose /tests/test.patch > "$V/apply.log" 2>&1; then + cat "$V/apply.log" >&2 + echo "the hidden tests could not be applied (testbed problem, not scored)" >&2 + exit 1 +fi +timeout 1800 sh -c "$(cat /tests/test_command.sh)" > "$V/test_output.log" 2>&1 +RC=$? +tail -c 12000 "$V/test_output.log" +if [ $RC -eq 0 ]; then echo 1 > "$V/reward.txt"; else echo 0 > "$V/reward.txt"; fi +echo "test command exited $RC" diff --git a/tasks/format-code-task-001482/tests/test_command.sh b/tasks/format-code-task-001482/tests/test_command.sh new file mode 100644 index 0000000000000000000000000000000000000000..7cb23076694ad17d72e8296d62b2b240083e36db --- /dev/null +++ b/tasks/format-code-task-001482/tests/test_command.sh @@ -0,0 +1 @@ +bash /testbed/mimo_test_command.sh \ No newline at end of file diff --git a/tasks/format-code-task-001491/environment/Dockerfile b/tasks/format-code-task-001491/environment/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..6025ae2ff181a0854fb57c34ede30c11ab3ef741 --- /dev/null +++ b/tasks/format-code-task-001491/environment/Dockerfile @@ -0,0 +1,3 @@ +# The task's image, pinned by digest (the same as [environment].docker_image). +# Setup runs at start from [environment.healthcheck]; environment/setup/ is its readable copy. +FROM docker.io/xiaomimimo/mimo-v2.6-rl-oss@sha256:8e3d5f0eaa73aee8644da702b42e2c92bd49e27c304acdf2dc57e055b873e1df diff --git a/tasks/format-code-task-001491/environment/setup/files/blocklist b/tasks/format-code-task-001491/environment/setup/files/blocklist new file mode 100644 index 0000000000000000000000000000000000000000..a8e4bdc4c7d9b739c047a3cb58ea72a1bb05bcbc --- /dev/null +++ b/tasks/format-code-task-001491/environment/setup/files/blocklist @@ -0,0 +1,33 @@ +# mimo answer-leak blocklist (mimoagent) +0.0.0.0 github.com +0.0.0.0 www.github.com +0.0.0.0 api.github.com +0.0.0.0 raw.githubusercontent.com +0.0.0.0 codeload.github.com +0.0.0.0 objects.githubusercontent.com +0.0.0.0 gist.github.com +0.0.0.0 gist.githubusercontent.com +0.0.0.0 gitlab.com +0.0.0.0 bitbucket.org +0.0.0.0 sourceforge.net +0.0.0.0 git.kernel.org +0.0.0.0 chromium.googlesource.com +0.0.0.0 android.googlesource.com +0.0.0.0 sourcegraph.com +0.0.0.0 bugs.chromium.org +0.0.0.0 issues.oss-fuzz.com +0.0.0.0 oss-fuzz.com +0.0.0.0 osv.dev +0.0.0.0 api.osv.dev +0.0.0.0 bugzilla.mozilla.org +0.0.0.0 proxy.golang.org +0.0.0.0 sum.golang.org +0.0.0.0 pkg.go.dev +0.0.0.0 google.com +0.0.0.0 www.google.com +0.0.0.0 bing.com +0.0.0.0 www.bing.com +0.0.0.0 duckduckgo.com +0.0.0.0 html.duckduckgo.com +0.0.0.0 search.brave.com +0.0.0.0 stackoverflow.com diff --git a/tasks/format-code-task-001491/environment/setup/setup.sh b/tasks/format-code-task-001491/environment/setup/setup.sh new file mode 100644 index 0000000000000000000000000000000000000000..d883db90cfcfb48f7a139861bbe9f6b5d95cad6f --- /dev/null +++ b/tasks/format-code-task-001491/environment/setup/setup.sh @@ -0,0 +1,34 @@ +#!/bin/bash +# Runs once, as root, before the agent starts: Harbor's [environment.healthcheck] unpacks this folder into +# /var/lib/mimo and runs it. Generated by mimo_harbor; see its README for how each step maps to Xiaomi's harness. +M=/var/lib/mimo +[ -f "$M/ready" ] && exit 0 +chmod 700 "$M" +fail() { echo "setup: $*" >&2; exit 1; } +# the answer-leak blocklist (mimoagent), applied to /etc/hosts by the agent right after it installs +write_blocklist() { cp "$M/files/blocklist" "$M/blocklist"; } + +# Code: mimoagent environments/datasets/opensource_code.py + base.py, as the explorer runs it (app/runner/domains.py Code). +CWD=/testbed +git config --global --add safe.directory "$CWD" +cd "$CWD" || fail "no working directory $CWD" +if ! git rev-parse --git-dir >/dev/null 2>&1; then # a bare source tree: give it a baseline commit + git init -q && git add -A && git -c user.name=mimo -c user.email=mimo@localhost commit -q -m baseline --allow-empty +fi +BASE=$(git rev-parse HEAD 2>/dev/null) +[ ${#BASE} -eq 40 ] || fail "could not resolve the base commit in $CWD" +echo "$BASE" > "$M/base" +# Images are built with history truncated at the base. If one is not, the fix could be read out of git log, +# so .git is hidden while the agent works and put back for grading. +LATER=$(git rev-list --all --not "$BASE" 2>/dev/null | head -n 5 | grep -c . || true) +rm -f /tmp/fail.log /tmp/pass.log /tmp/patch.diff /tmp/test_patch.diff /tmp/*.log 2>/dev/null; rm -rf /tmp/claude-0 /tmp/claude-* /tmp/testem-* /tmp/puppeteer_dev_chrome_profile-* 2>/dev/null; rm -f /tmp/test_files.json 2>/dev/null; rm -rf /tmp/jest_* /tmp/jest-* /tmp/build /tmp/build_env 2>/dev/null; rm -rf /tmp/pytest-of-root /tmp/pytest-* /tmp/.pytest_cache /tmp/__pycache__ 2>/dev/null; rm -rf /tmp/go-build* /tmp/standards /tmp/wordpress /tmp/zig-* /tmp/testbase /tmp/testbed 2>/dev/null; rm -f /tmp/tmp*.tmp /tmp/*.bak /tmp/expect* /tmp/butwas* 2>/dev/null; rm -rf /root/.cache/go-build 2>/dev/null; rm -rf /tests 2>/dev/null; find /logs -mindepth 1 -delete 2>/dev/null; mkdir -p /logs/agent /logs/verifier /logs/artifacts; chmod 777 /logs/agent /logs/verifier /logs/artifacts; find /var/log -type f -delete 2>/dev/null || true; rm -rf /var/lib/postgresql/*/*/log /var/lib/postgresql/*/*/pg_log 2>/dev/null || true; find /var/lib/mysql /var/lib/mongodb -type f -name '*.log' -delete 2>/dev/null || true; rm -rf /root/.npm/_logs /root/.babel.json /root/.pytest_cache 2>/dev/null || true; find / -maxdepth 4 -xdev -name task_description.md -path '*/.build_env/*' -delete 2>/dev/null || true; true +git clean -fdx --exclude=node_modules --exclude=bower_components --exclude=.husky --exclude=vendor --exclude=third_party --exclude=_deps --exclude=vcpkg_installed --exclude=.venv --exclude=venv --exclude=.gradle --exclude=target --exclude=.build --exclude=lib --exclude=.bundle --exclude=Manifest.toml --exclude=_build --exclude=.stack-work --exclude=dist-newstyle >/dev/null 2>&1 +find /root/.m2 -type f \( -name '*-SNAPSHOT.jar' -o -name '*-SNAPSHOT-sources.jar' -o -name '*-SNAPSHOT-tests.jar' -o -name '*-SNAPSHOT-test-sources.jar' \) -delete 2>/dev/null; rm -rf /root/.julia/compiled 2>/dev/null; rm -rf /root/.gradle/caches/build-cache-* /root/.gradle/daemon 2>/dev/null; rm -rf /root/.gradle/caches/*/scripts /root/.gradle/caches/jars-* 2>/dev/null; rm -rf /root/.cache/bazel 2>/dev/null; true +if [ "$LATER" -gt 0 ]; then + mv "$CWD/.git" "$M/git-hidden" + echo "history not truncated at ${BASE:0:12}: .git hidden while the agent works" +fi +write_blocklist + +touch "$M/ready" +echo "setup done" diff --git a/tasks/format-code-task-001491/tests/test.patch b/tasks/format-code-task-001491/tests/test.patch new file mode 100644 index 0000000000000000000000000000000000000000..b004b0678036d4444cd9650b10bf5ea8f47a3f12 --- /dev/null +++ b/tasks/format-code-task-001491/tests/test.patch @@ -0,0 +1,239 @@ +diff --git a/test_commands.json b/test_commands.json +new file mode 100644 +index 00000000000..dc8f5eac63a +--- /dev/null ++++ b/test_commands.json +@@ -0,0 +1,3 @@ ++{ ++ "test_commands": ["python -m pytest tests/components/smartthings/test_climate.py::test_ac_set_hvac_mode_auto tests/components/smartthings/test_climate.py::test_ac_state_auto_mode tests/components/smartthings/test_climate.py::test_ac_state_update_to_auto_mode tests/components/smartthings/test_climate.py::test_ac_hvac_modes_includes_auto tests/components/smartthings/test_climate.py::test_thermostat_set_hvac_mode_auto tests/components/smartthings/test_climate.py::test_thermostat_state_auto_mode tests/components/smartthings/test_climate.py::test_thermostat_state_update_to_auto_mode tests/components/smartthings/test_climate.py::test_thermostat_hvac_modes_includes_auto -v"] ++} +diff --git a/tests/components/smartthings/test_climate.py b/tests/components/smartthings/test_climate.py +index 138601ec08b..570cd06b7f5 100644 +--- a/tests/components/smartthings/test_climate.py ++++ b/tests/components/smartthings/test_climate.py +@@ -896,3 +896,212 @@ async def test_availability_at_start( + """Test unavailable at boot.""" + await setup_integration(hass, mock_config_entry) + assert hass.states.get("climate.ac_office_granit").state == STATE_UNAVAILABLE ++ ++ ++@pytest.mark.parametrize("device_fixture", ["da_ac_rac_000001"]) ++async def test_ac_set_hvac_mode_auto( ++ hass: HomeAssistant, ++ devices: AsyncMock, ++ mock_config_entry: MockConfigEntry, ++) -> None: ++ """Test setting AC HVAC mode to AUTO sends 'auto' to the device.""" ++ set_attribute_value( ++ devices, ++ Capability.AIR_CONDITIONER_MODE, ++ Attribute.SUPPORTED_AC_MODES, ++ ["auto", "cool", "dry", "heat", "fanOnly"], ++ ) ++ set_attribute_value(devices, Capability.SWITCH, Attribute.SWITCH, "on") ++ ++ await setup_integration(hass, mock_config_entry) ++ ++ await hass.services.async_call( ++ CLIMATE_DOMAIN, ++ SERVICE_SET_HVAC_MODE, ++ {ATTR_ENTITY_ID: "climate.ac_office_granit", ATTR_HVAC_MODE: HVACMode.AUTO}, ++ blocking=True, ++ ) ++ devices.execute_device_command.assert_called_once_with( ++ "96a5ef74-5832-a84b-f1f7-ca799957065d", ++ Capability.AIR_CONDITIONER_MODE, ++ Command.SET_AIR_CONDITIONER_MODE, ++ MAIN, ++ argument="auto", ++ ) ++ ++ ++@pytest.mark.parametrize("device_fixture", ["da_ac_rac_000001"]) ++async def test_ac_state_auto_mode( ++ hass: HomeAssistant, ++ devices: AsyncMock, ++ mock_config_entry: MockConfigEntry, ++) -> None: ++ """Test that AC reporting 'auto' shows HVACMode.AUTO state, not HEAT_COOL.""" ++ set_attribute_value(devices, Capability.SWITCH, Attribute.SWITCH, "on") ++ set_attribute_value( ++ devices, ++ Capability.AIR_CONDITIONER_MODE, ++ Attribute.AIR_CONDITIONER_MODE, ++ "auto", ++ ) ++ ++ await setup_integration(hass, mock_config_entry) ++ ++ state = hass.states.get("climate.ac_office_granit") ++ assert state is not None ++ assert state.state == HVACMode.AUTO ++ assert state.state != HVACMode.HEAT_COOL ++ ++ ++@pytest.mark.parametrize("device_fixture", ["da_ac_rac_000001"]) ++async def test_ac_state_update_to_auto_mode( ++ hass: HomeAssistant, ++ devices: AsyncMock, ++ mock_config_entry: MockConfigEntry, ++) -> None: ++ """Test that AC update event with 'auto' yields HVACMode.AUTO state.""" ++ set_attribute_value(devices, Capability.SWITCH, Attribute.SWITCH, "on") ++ set_attribute_value( ++ devices, ++ Capability.AIR_CONDITIONER_MODE, ++ Attribute.AIR_CONDITIONER_MODE, ++ "heat", ++ ) ++ ++ await setup_integration(hass, mock_config_entry) ++ ++ assert hass.states.get("climate.ac_office_granit").state == HVACMode.HEAT ++ ++ await trigger_update( ++ hass, ++ devices, ++ "96a5ef74-5832-a84b-f1f7-ca799957065d", ++ Capability.AIR_CONDITIONER_MODE, ++ Attribute.AIR_CONDITIONER_MODE, ++ "auto", ++ ) ++ ++ assert hass.states.get("climate.ac_office_granit").state == HVACMode.AUTO ++ ++ ++@pytest.mark.parametrize("device_fixture", ["da_ac_rac_000001"]) ++async def test_ac_hvac_modes_includes_auto( ++ hass: HomeAssistant, ++ devices: AsyncMock, ++ mock_config_entry: MockConfigEntry, ++) -> None: ++ """Test that 'auto' supported ac mode results in HVACMode.AUTO in hvac_modes.""" ++ set_attribute_value( ++ devices, ++ Capability.AIR_CONDITIONER_MODE, ++ Attribute.SUPPORTED_AC_MODES, ++ ["auto", "cool", "heat"], ++ ) ++ ++ await setup_integration(hass, mock_config_entry) ++ ++ state = hass.states.get("climate.ac_office_granit") ++ assert state is not None ++ hvac_modes = state.attributes[ATTR_HVAC_MODES] ++ assert HVACMode.AUTO in hvac_modes ++ assert HVACMode.HEAT_COOL not in hvac_modes ++ ++ ++@pytest.mark.parametrize("device_fixture", ["virtual_thermostat"]) ++async def test_thermostat_set_hvac_mode_auto( ++ hass: HomeAssistant, ++ devices: AsyncMock, ++ mock_config_entry: MockConfigEntry, ++) -> None: ++ """Test setting thermostat HVAC mode to AUTO sends 'auto' to the device.""" ++ set_attribute_value( ++ devices, ++ Capability.THERMOSTAT_MODE, ++ Attribute.SUPPORTED_THERMOSTAT_MODES, ++ ["auto", "heat"], ++ ) ++ ++ await setup_integration(hass, mock_config_entry) ++ ++ await hass.services.async_call( ++ CLIMATE_DOMAIN, ++ SERVICE_SET_HVAC_MODE, ++ {ATTR_ENTITY_ID: "climate.asd", ATTR_HVAC_MODE: HVACMode.AUTO}, ++ blocking=True, ++ ) ++ devices.execute_device_command.assert_called_once_with( ++ "2894dc93-0f11-49cc-8a81-3a684cebebf6", ++ Capability.THERMOSTAT_MODE, ++ Command.SET_THERMOSTAT_MODE, ++ MAIN, ++ argument="auto", ++ ) ++ ++ ++@pytest.mark.parametrize("device_fixture", ["virtual_thermostat"]) ++async def test_thermostat_state_auto_mode( ++ hass: HomeAssistant, ++ devices: AsyncMock, ++ mock_config_entry: MockConfigEntry, ++) -> None: ++ """Test that thermostat reporting 'auto' shows HVACMode.AUTO state, not HEAT_COOL.""" ++ set_attribute_value( ++ devices, Capability.THERMOSTAT_MODE, Attribute.THERMOSTAT_MODE, "auto" ++ ) ++ ++ await setup_integration(hass, mock_config_entry) ++ ++ state = hass.states.get("climate.asd") ++ assert state is not None ++ assert state.state == HVACMode.AUTO ++ assert state.state != HVACMode.HEAT_COOL ++ ++ ++@pytest.mark.parametrize("device_fixture", ["virtual_thermostat"]) ++async def test_thermostat_state_update_to_auto_mode( ++ hass: HomeAssistant, ++ devices: AsyncMock, ++ mock_config_entry: MockConfigEntry, ++) -> None: ++ """Test thermostat update event with 'auto' yields HVACMode.AUTO state.""" ++ set_attribute_value( ++ devices, Capability.THERMOSTAT_MODE, Attribute.THERMOSTAT_MODE, "heat" ++ ) ++ ++ await setup_integration(hass, mock_config_entry) ++ ++ assert hass.states.get("climate.asd").state == HVACMode.HEAT ++ ++ await trigger_update( ++ hass, ++ devices, ++ "2894dc93-0f11-49cc-8a81-3a684cebebf6", ++ Capability.THERMOSTAT_MODE, ++ Attribute.THERMOSTAT_MODE, ++ "auto", ++ ) ++ ++ assert hass.states.get("climate.asd").state == HVACMode.AUTO ++ ++ ++@pytest.mark.parametrize("device_fixture", ["virtual_thermostat"]) ++async def test_thermostat_hvac_modes_includes_auto( ++ hass: HomeAssistant, ++ devices: AsyncMock, ++ mock_config_entry: MockConfigEntry, ++) -> None: ++ """Test that 'auto' supported thermostat mode results in HVACMode.AUTO in hvac_modes.""" ++ set_attribute_value( ++ devices, ++ Capability.THERMOSTAT_MODE, ++ Attribute.SUPPORTED_THERMOSTAT_MODES, ++ ["auto", "heat"], ++ ) ++ ++ await setup_integration(hass, mock_config_entry) ++ ++ state = hass.states.get("climate.asd") ++ assert state is not None ++ hvac_modes = state.attributes[ATTR_HVAC_MODES] ++ assert HVACMode.AUTO in hvac_modes ++ assert HVACMode.HEAT_COOL not in hvac_modes +diff --git a/mimo_test_command.sh b/mimo_test_command.sh +new file mode 100755 +--- /dev/null ++++ b/mimo_test_command.sh +@@ -0,0 +1,8 @@ ++#!/usr/bin/env bash ++ ++set -uo pipefail ++cd /testbed ++rc=0 ++python -m pytest tests/components/smartthings/test_climate.py::test_ac_set_hvac_mode_auto tests/components/smartthings/test_climate.py::test_ac_state_auto_mode tests/components/smartthings/test_climate.py::test_ac_state_update_to_auto_mode tests/components/smartthings/test_climate.py::test_ac_hvac_modes_includes_auto tests/components/smartthings/test_climate.py::test_thermostat_set_hvac_mode_auto tests/components/smartthings/test_climate.py::test_thermostat_state_auto_mode tests/components/smartthings/test_climate.py::test_thermostat_state_update_to_auto_mode tests/components/smartthings/test_climate.py::test_thermostat_hvac_modes_includes_auto -v ++rc=$(( rc | $? )) ++exit $rc diff --git a/tasks/format-code-task-001491/tests/test.sh b/tasks/format-code-task-001491/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..44b7b12cd593c07908f2720aae8fac9ded5e45d5 --- /dev/null +++ b/tasks/format-code-task-001491/tests/test.sh @@ -0,0 +1,39 @@ +#!/bin/bash +# Code grading, mimoagent opensource_code.py: reset the files the hidden test patch touches, apply it, run the +# task's test command; reward 1 when it exits 0. A testbed failure (reset or apply) writes no reward: not scored. +M=/var/lib/mimo +CWD=/testbed +V=/logs/verifier +mkdir -p "$V" +BASE=$(cat "$M/base" 2>/dev/null) || { echo "setup never ran (no $M/base)" >&2; exit 1; } +cd "$CWD" || exit 1 +if [ -d "$M/git-hidden" ]; then rm -rf "$CWD/.git"; mv "$M/git-hidden" "$CWD/.git"; fi +# the agent's change against the base, so its own commits count too +git add -A >/dev/null 2>&1 && git -c core.fileMode=false diff --cached "$BASE" > "$V/agent.diff" +git reset -q +if ! ( +while IFS= read -r tf; do + [ -z "$tf" ] && continue + if git cat-file -e $BASE:"$tf" 2>/dev/null; then + git checkout $BASE -- "$tf" 2>/dev/null || true + else + git rm -f --cached "$tf" >/dev/null 2>&1 || true + rm -f "$tf" + fi +done <<'EOF_RESET_TEST_FILES' +test_commands.json +tests/components/smartthings/test_climate.py +mimo_test_command.sh +EOF_RESET_TEST_FILES + +); then echo "could not reset the test files (testbed problem, not scored)" >&2; exit 1; fi +if ! git apply --verbose /tests/test.patch > "$V/apply.log" 2>&1; then + cat "$V/apply.log" >&2 + echo "the hidden tests could not be applied (testbed problem, not scored)" >&2 + exit 1 +fi +timeout 1800 sh -c "$(cat /tests/test_command.sh)" > "$V/test_output.log" 2>&1 +RC=$? +tail -c 12000 "$V/test_output.log" +if [ $RC -eq 0 ]; then echo 1 > "$V/reward.txt"; else echo 0 > "$V/reward.txt"; fi +echo "test command exited $RC" diff --git a/tasks/format-code-task-001491/tests/test_command.sh b/tasks/format-code-task-001491/tests/test_command.sh new file mode 100644 index 0000000000000000000000000000000000000000..7cb23076694ad17d72e8296d62b2b240083e36db --- /dev/null +++ b/tasks/format-code-task-001491/tests/test_command.sh @@ -0,0 +1 @@ +bash /testbed/mimo_test_command.sh \ No newline at end of file diff --git a/tasks/format-code-task-001498/environment/Dockerfile b/tasks/format-code-task-001498/environment/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..8fe87c670e3f2e44ed3b15a72371100d5aaae65f --- /dev/null +++ b/tasks/format-code-task-001498/environment/Dockerfile @@ -0,0 +1,3 @@ +# The task's image, pinned by digest (the same as [environment].docker_image). +# Setup runs at start from [environment.healthcheck]; environment/setup/ is its readable copy. +FROM docker.io/xiaomimimo/mimo-v2.6-rl-oss@sha256:fb4d5c7d770166173559704885d27907355a5e748a5e169283802f9ca7b860b7 diff --git a/tasks/format-code-task-001498/environment/setup/files/blocklist b/tasks/format-code-task-001498/environment/setup/files/blocklist new file mode 100644 index 0000000000000000000000000000000000000000..a8e4bdc4c7d9b739c047a3cb58ea72a1bb05bcbc --- /dev/null +++ b/tasks/format-code-task-001498/environment/setup/files/blocklist @@ -0,0 +1,33 @@ +# mimo answer-leak blocklist (mimoagent) +0.0.0.0 github.com +0.0.0.0 www.github.com +0.0.0.0 api.github.com +0.0.0.0 raw.githubusercontent.com +0.0.0.0 codeload.github.com +0.0.0.0 objects.githubusercontent.com +0.0.0.0 gist.github.com +0.0.0.0 gist.githubusercontent.com +0.0.0.0 gitlab.com +0.0.0.0 bitbucket.org +0.0.0.0 sourceforge.net +0.0.0.0 git.kernel.org +0.0.0.0 chromium.googlesource.com +0.0.0.0 android.googlesource.com +0.0.0.0 sourcegraph.com +0.0.0.0 bugs.chromium.org +0.0.0.0 issues.oss-fuzz.com +0.0.0.0 oss-fuzz.com +0.0.0.0 osv.dev +0.0.0.0 api.osv.dev +0.0.0.0 bugzilla.mozilla.org +0.0.0.0 proxy.golang.org +0.0.0.0 sum.golang.org +0.0.0.0 pkg.go.dev +0.0.0.0 google.com +0.0.0.0 www.google.com +0.0.0.0 bing.com +0.0.0.0 www.bing.com +0.0.0.0 duckduckgo.com +0.0.0.0 html.duckduckgo.com +0.0.0.0 search.brave.com +0.0.0.0 stackoverflow.com diff --git a/tasks/format-code-task-001498/environment/setup/setup.sh b/tasks/format-code-task-001498/environment/setup/setup.sh new file mode 100644 index 0000000000000000000000000000000000000000..d883db90cfcfb48f7a139861bbe9f6b5d95cad6f --- /dev/null +++ b/tasks/format-code-task-001498/environment/setup/setup.sh @@ -0,0 +1,34 @@ +#!/bin/bash +# Runs once, as root, before the agent starts: Harbor's [environment.healthcheck] unpacks this folder into +# /var/lib/mimo and runs it. Generated by mimo_harbor; see its README for how each step maps to Xiaomi's harness. +M=/var/lib/mimo +[ -f "$M/ready" ] && exit 0 +chmod 700 "$M" +fail() { echo "setup: $*" >&2; exit 1; } +# the answer-leak blocklist (mimoagent), applied to /etc/hosts by the agent right after it installs +write_blocklist() { cp "$M/files/blocklist" "$M/blocklist"; } + +# Code: mimoagent environments/datasets/opensource_code.py + base.py, as the explorer runs it (app/runner/domains.py Code). +CWD=/testbed +git config --global --add safe.directory "$CWD" +cd "$CWD" || fail "no working directory $CWD" +if ! git rev-parse --git-dir >/dev/null 2>&1; then # a bare source tree: give it a baseline commit + git init -q && git add -A && git -c user.name=mimo -c user.email=mimo@localhost commit -q -m baseline --allow-empty +fi +BASE=$(git rev-parse HEAD 2>/dev/null) +[ ${#BASE} -eq 40 ] || fail "could not resolve the base commit in $CWD" +echo "$BASE" > "$M/base" +# Images are built with history truncated at the base. If one is not, the fix could be read out of git log, +# so .git is hidden while the agent works and put back for grading. +LATER=$(git rev-list --all --not "$BASE" 2>/dev/null | head -n 5 | grep -c . || true) +rm -f /tmp/fail.log /tmp/pass.log /tmp/patch.diff /tmp/test_patch.diff /tmp/*.log 2>/dev/null; rm -rf /tmp/claude-0 /tmp/claude-* /tmp/testem-* /tmp/puppeteer_dev_chrome_profile-* 2>/dev/null; rm -f /tmp/test_files.json 2>/dev/null; rm -rf /tmp/jest_* /tmp/jest-* /tmp/build /tmp/build_env 2>/dev/null; rm -rf /tmp/pytest-of-root /tmp/pytest-* /tmp/.pytest_cache /tmp/__pycache__ 2>/dev/null; rm -rf /tmp/go-build* /tmp/standards /tmp/wordpress /tmp/zig-* /tmp/testbase /tmp/testbed 2>/dev/null; rm -f /tmp/tmp*.tmp /tmp/*.bak /tmp/expect* /tmp/butwas* 2>/dev/null; rm -rf /root/.cache/go-build 2>/dev/null; rm -rf /tests 2>/dev/null; find /logs -mindepth 1 -delete 2>/dev/null; mkdir -p /logs/agent /logs/verifier /logs/artifacts; chmod 777 /logs/agent /logs/verifier /logs/artifacts; find /var/log -type f -delete 2>/dev/null || true; rm -rf /var/lib/postgresql/*/*/log /var/lib/postgresql/*/*/pg_log 2>/dev/null || true; find /var/lib/mysql /var/lib/mongodb -type f -name '*.log' -delete 2>/dev/null || true; rm -rf /root/.npm/_logs /root/.babel.json /root/.pytest_cache 2>/dev/null || true; find / -maxdepth 4 -xdev -name task_description.md -path '*/.build_env/*' -delete 2>/dev/null || true; true +git clean -fdx --exclude=node_modules --exclude=bower_components --exclude=.husky --exclude=vendor --exclude=third_party --exclude=_deps --exclude=vcpkg_installed --exclude=.venv --exclude=venv --exclude=.gradle --exclude=target --exclude=.build --exclude=lib --exclude=.bundle --exclude=Manifest.toml --exclude=_build --exclude=.stack-work --exclude=dist-newstyle >/dev/null 2>&1 +find /root/.m2 -type f \( -name '*-SNAPSHOT.jar' -o -name '*-SNAPSHOT-sources.jar' -o -name '*-SNAPSHOT-tests.jar' -o -name '*-SNAPSHOT-test-sources.jar' \) -delete 2>/dev/null; rm -rf /root/.julia/compiled 2>/dev/null; rm -rf /root/.gradle/caches/build-cache-* /root/.gradle/daemon 2>/dev/null; rm -rf /root/.gradle/caches/*/scripts /root/.gradle/caches/jars-* 2>/dev/null; rm -rf /root/.cache/bazel 2>/dev/null; true +if [ "$LATER" -gt 0 ]; then + mv "$CWD/.git" "$M/git-hidden" + echo "history not truncated at ${BASE:0:12}: .git hidden while the agent works" +fi +write_blocklist + +touch "$M/ready" +echo "setup done" diff --git a/tasks/format-code-task-001498/tests/test.patch b/tasks/format-code-task-001498/tests/test.patch new file mode 100644 index 0000000000000000000000000000000000000000..a7b690efa61bdabaca7c15fb649e8f6856636c13 --- /dev/null +++ b/tasks/format-code-task-001498/tests/test.patch @@ -0,0 +1,71 @@ +diff --git a/test_commands.json b/test_commands.json +new file mode 100644 +index 00000000000..db4ec6b787f +--- /dev/null ++++ b/test_commands.json +@@ -0,0 +1,3 @@ ++{ ++ "test_commands": ["python -m pytest tests/components/zeroconf/test_init.py::test_info_from_service_returns_none_if_no_addresses tests/components/zeroconf/test_init.py::test_info_from_service_with_addresses_returns_info -v"] ++} +diff --git a/tests/components/zeroconf/test_init.py b/tests/components/zeroconf/test_init.py +index 0c32e60ecca..9bd292efa63 100644 +--- a/tests/components/zeroconf/test_init.py ++++ b/tests/components/zeroconf/test_init.py +@@ -314,3 +314,44 @@ async def test_get_instance(hass, mock_zeroconf): + hass.bus.async_fire(EVENT_HOMEASSISTANT_STOP) + await hass.async_block_till_done() + assert len(mock_zeroconf.ha_close.mock_calls) == 1 ++ ++ ++def get_service_info_mock_without_an_address(service_type, name): ++ """Return service info for get_service_info without any addresses.""" ++ return ServiceInfo( ++ service_type, ++ name, ++ addresses=[], ++ port=80, ++ weight=0, ++ priority=0, ++ server="name.local.", ++ properties=PROPERTIES, ++ ) ++ ++ ++async def test_info_from_service_returns_none_if_no_addresses(hass): ++ """Test info_from_service returns None when the service has no addresses.""" ++ service_type = "_test._tcp.local." ++ info = zeroconf.info_from_service( ++ get_service_info_mock_without_an_address( ++ service_type, f"test.{service_type}" ++ ) ++ ) ++ assert info is None ++ ++ ++async def test_info_from_service_with_addresses_returns_info(hass): ++ """Test info_from_service returns an info dict when addresses are present.""" ++ service_type = "_test._tcp.local." ++ info = zeroconf.info_from_service( ++ get_service_info_mock(service_type, f"test.{service_type}") ++ ) ++ assert info is not None ++ assert info[zeroconf.ATTR_HOST] == "10.0.0.20" ++ assert info[zeroconf.ATTR_PORT] == 80 ++ assert info[zeroconf.ATTR_HOSTNAME] == "name.local." ++ assert info[zeroconf.ATTR_TYPE] == service_type ++ assert info[zeroconf.ATTR_NAME] == f"test.{service_type}" ++ ++ +diff --git a/mimo_test_command.sh b/mimo_test_command.sh +new file mode 100755 +--- /dev/null ++++ b/mimo_test_command.sh +@@ -0,0 +1,8 @@ ++#!/usr/bin/env bash ++ ++set -uo pipefail ++cd /testbed ++rc=0 ++python -m pytest tests/components/zeroconf/test_init.py::test_info_from_service_returns_none_if_no_addresses tests/components/zeroconf/test_init.py::test_info_from_service_with_addresses_returns_info -v ++rc=$(( rc | $? )) ++exit $rc diff --git a/tasks/format-code-task-001498/tests/test.sh b/tasks/format-code-task-001498/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..1d29f2920d9b672db9875e9932cd0a0ddeb206c4 --- /dev/null +++ b/tasks/format-code-task-001498/tests/test.sh @@ -0,0 +1,39 @@ +#!/bin/bash +# Code grading, mimoagent opensource_code.py: reset the files the hidden test patch touches, apply it, run the +# task's test command; reward 1 when it exits 0. A testbed failure (reset or apply) writes no reward: not scored. +M=/var/lib/mimo +CWD=/testbed +V=/logs/verifier +mkdir -p "$V" +BASE=$(cat "$M/base" 2>/dev/null) || { echo "setup never ran (no $M/base)" >&2; exit 1; } +cd "$CWD" || exit 1 +if [ -d "$M/git-hidden" ]; then rm -rf "$CWD/.git"; mv "$M/git-hidden" "$CWD/.git"; fi +# the agent's change against the base, so its own commits count too +git add -A >/dev/null 2>&1 && git -c core.fileMode=false diff --cached "$BASE" > "$V/agent.diff" +git reset -q +if ! ( +while IFS= read -r tf; do + [ -z "$tf" ] && continue + if git cat-file -e $BASE:"$tf" 2>/dev/null; then + git checkout $BASE -- "$tf" 2>/dev/null || true + else + git rm -f --cached "$tf" >/dev/null 2>&1 || true + rm -f "$tf" + fi +done <<'EOF_RESET_TEST_FILES' +test_commands.json +tests/components/zeroconf/test_init.py +mimo_test_command.sh +EOF_RESET_TEST_FILES + +); then echo "could not reset the test files (testbed problem, not scored)" >&2; exit 1; fi +if ! git apply --verbose /tests/test.patch > "$V/apply.log" 2>&1; then + cat "$V/apply.log" >&2 + echo "the hidden tests could not be applied (testbed problem, not scored)" >&2 + exit 1 +fi +timeout 1800 sh -c "$(cat /tests/test_command.sh)" > "$V/test_output.log" 2>&1 +RC=$? +tail -c 12000 "$V/test_output.log" +if [ $RC -eq 0 ]; then echo 1 > "$V/reward.txt"; else echo 0 > "$V/reward.txt"; fi +echo "test command exited $RC" diff --git a/tasks/format-code-task-001498/tests/test_command.sh b/tasks/format-code-task-001498/tests/test_command.sh new file mode 100644 index 0000000000000000000000000000000000000000..7cb23076694ad17d72e8296d62b2b240083e36db --- /dev/null +++ b/tasks/format-code-task-001498/tests/test_command.sh @@ -0,0 +1 @@ +bash /testbed/mimo_test_command.sh \ No newline at end of file diff --git a/tasks/format-code-task-001643/environment/Dockerfile b/tasks/format-code-task-001643/environment/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..b8170700513527c065d0e5643ad5dd1442b18824 --- /dev/null +++ b/tasks/format-code-task-001643/environment/Dockerfile @@ -0,0 +1,3 @@ +# The task's image, pinned by digest (the same as [environment].docker_image). +# Setup runs at start from [environment.healthcheck]; environment/setup/ is its readable copy. +FROM docker.io/xiaomimimo/mimo-v2.6-rl-oss@sha256:eb8362fad2b7ebe9e2d3086b6e40124326162320c84f99bc9b13cd76051119b9 diff --git a/tasks/format-code-task-001643/environment/setup/files/blocklist b/tasks/format-code-task-001643/environment/setup/files/blocklist new file mode 100644 index 0000000000000000000000000000000000000000..a8e4bdc4c7d9b739c047a3cb58ea72a1bb05bcbc --- /dev/null +++ b/tasks/format-code-task-001643/environment/setup/files/blocklist @@ -0,0 +1,33 @@ +# mimo answer-leak blocklist (mimoagent) +0.0.0.0 github.com +0.0.0.0 www.github.com +0.0.0.0 api.github.com +0.0.0.0 raw.githubusercontent.com +0.0.0.0 codeload.github.com +0.0.0.0 objects.githubusercontent.com +0.0.0.0 gist.github.com +0.0.0.0 gist.githubusercontent.com +0.0.0.0 gitlab.com +0.0.0.0 bitbucket.org +0.0.0.0 sourceforge.net +0.0.0.0 git.kernel.org +0.0.0.0 chromium.googlesource.com +0.0.0.0 android.googlesource.com +0.0.0.0 sourcegraph.com +0.0.0.0 bugs.chromium.org +0.0.0.0 issues.oss-fuzz.com +0.0.0.0 oss-fuzz.com +0.0.0.0 osv.dev +0.0.0.0 api.osv.dev +0.0.0.0 bugzilla.mozilla.org +0.0.0.0 proxy.golang.org +0.0.0.0 sum.golang.org +0.0.0.0 pkg.go.dev +0.0.0.0 google.com +0.0.0.0 www.google.com +0.0.0.0 bing.com +0.0.0.0 www.bing.com +0.0.0.0 duckduckgo.com +0.0.0.0 html.duckduckgo.com +0.0.0.0 search.brave.com +0.0.0.0 stackoverflow.com diff --git a/tasks/format-code-task-001643/environment/setup/setup.sh b/tasks/format-code-task-001643/environment/setup/setup.sh new file mode 100644 index 0000000000000000000000000000000000000000..e9eb7daf39f9542bd095367feee457f3da77e492 --- /dev/null +++ b/tasks/format-code-task-001643/environment/setup/setup.sh @@ -0,0 +1,34 @@ +#!/bin/bash +# Runs once, as root, before the agent starts: Harbor's [environment.healthcheck] unpacks this folder into +# /var/lib/mimo and runs it. Generated by mimo_harbor; see its README for how each step maps to Xiaomi's harness. +M=/var/lib/mimo +[ -f "$M/ready" ] && exit 0 +chmod 700 "$M" +fail() { echo "setup: $*" >&2; exit 1; } +# the answer-leak blocklist (mimoagent), applied to /etc/hosts by the agent right after it installs +write_blocklist() { cp "$M/files/blocklist" "$M/blocklist"; } + +# Code: mimoagent environments/datasets/opensource_code.py + base.py, as the explorer runs it (app/runner/domains.py Code). +CWD=/workspace/repo +git config --global --add safe.directory "$CWD" +cd "$CWD" || fail "no working directory $CWD" +if ! git rev-parse --git-dir >/dev/null 2>&1; then # a bare source tree: give it a baseline commit + git init -q && git add -A && git -c user.name=mimo -c user.email=mimo@localhost commit -q -m baseline --allow-empty +fi +BASE=$(git rev-parse HEAD 2>/dev/null) +[ ${#BASE} -eq 40 ] || fail "could not resolve the base commit in $CWD" +echo "$BASE" > "$M/base" +# Images are built with history truncated at the base. If one is not, the fix could be read out of git log, +# so .git is hidden while the agent works and put back for grading. +LATER=$(git rev-list --all --not "$BASE" 2>/dev/null | head -n 5 | grep -c . || true) +rm -f /tmp/fail.log /tmp/pass.log /tmp/patch.diff /tmp/test_patch.diff /tmp/*.log 2>/dev/null; rm -rf /tmp/claude-0 /tmp/claude-* /tmp/testem-* /tmp/puppeteer_dev_chrome_profile-* 2>/dev/null; rm -f /tmp/test_files.json 2>/dev/null; rm -rf /tmp/jest_* /tmp/jest-* /tmp/build /tmp/build_env 2>/dev/null; rm -rf /tmp/pytest-of-root /tmp/pytest-* /tmp/.pytest_cache /tmp/__pycache__ 2>/dev/null; rm -rf /tmp/go-build* /tmp/standards /tmp/wordpress /tmp/zig-* /tmp/testbase /tmp/testbed 2>/dev/null; rm -f /tmp/tmp*.tmp /tmp/*.bak /tmp/expect* /tmp/butwas* 2>/dev/null; rm -rf /root/.cache/go-build 2>/dev/null; rm -rf /tests 2>/dev/null; find /logs -mindepth 1 -delete 2>/dev/null; mkdir -p /logs/agent /logs/verifier /logs/artifacts; chmod 777 /logs/agent /logs/verifier /logs/artifacts; find /var/log -type f -delete 2>/dev/null || true; rm -rf /var/lib/postgresql/*/*/log /var/lib/postgresql/*/*/pg_log 2>/dev/null || true; find /var/lib/mysql /var/lib/mongodb -type f -name '*.log' -delete 2>/dev/null || true; rm -rf /root/.npm/_logs /root/.babel.json /root/.pytest_cache 2>/dev/null || true; find / -maxdepth 4 -xdev -name task_description.md -path '*/.build_env/*' -delete 2>/dev/null || true; true +git clean -fdx --exclude=node_modules --exclude=bower_components --exclude=.husky --exclude=vendor --exclude=third_party --exclude=_deps --exclude=vcpkg_installed --exclude=.venv --exclude=venv --exclude=.gradle --exclude=target --exclude=.build --exclude=lib --exclude=.bundle --exclude=Manifest.toml --exclude=_build --exclude=.stack-work --exclude=dist-newstyle >/dev/null 2>&1 +find /root/.m2 -type f \( -name '*-SNAPSHOT.jar' -o -name '*-SNAPSHOT-sources.jar' -o -name '*-SNAPSHOT-tests.jar' -o -name '*-SNAPSHOT-test-sources.jar' \) -delete 2>/dev/null; rm -rf /root/.julia/compiled 2>/dev/null; rm -rf /root/.gradle/caches/build-cache-* /root/.gradle/daemon 2>/dev/null; rm -rf /root/.gradle/caches/*/scripts /root/.gradle/caches/jars-* 2>/dev/null; rm -rf /root/.cache/bazel 2>/dev/null; true +if [ "$LATER" -gt 0 ]; then + mv "$CWD/.git" "$M/git-hidden" + echo "history not truncated at ${BASE:0:12}: .git hidden while the agent works" +fi +write_blocklist + +touch "$M/ready" +echo "setup done" diff --git a/tasks/format-code-task-001643/tests/test.patch b/tasks/format-code-task-001643/tests/test.patch new file mode 100644 index 0000000000000000000000000000000000000000..008b82aac004e765c4cf055b38277e7931c12e34 --- /dev/null +++ b/tasks/format-code-task-001643/tests/test.patch @@ -0,0 +1,492 @@ +diff --git a/usercase-test-coderl/termux_location_provider_test.go b/usercase-test-coderl/termux_location_provider_test.go +new file mode 100644 +--- /dev/null ++++ b/usercase-test-coderl/termux_location_provider_test.go +@@ -0,0 +1,463 @@ ++package usercase_test_coderl ++ ++import ( ++ "io" ++ "os" ++ "path/filepath" ++ "runtime" ++ "strings" ++ "syscall" ++ "testing" ++ "time" ++ ++ "github.com/jkaberg/byd-hass/internal/location" ++ "github.com/sirupsen/logrus" ++) ++ ++ ++ ++ ++ ++ ++const gpsPath = "/storage/emulated/0/bydhass/gps" ++ ++func testLogger() *logrus.Logger { ++ logger := logrus.New() ++ logger.SetOutput(io.Discard) ++ logger.SetLevel(logrus.PanicLevel) ++ return logger ++} ++ ++func resetGPSPath(t *testing.T) { ++ t.Helper() ++ if err := os.RemoveAll(filepath.Dir(gpsPath)); err != nil { ++ t.Fatalf("remove gps dir: %v", err) ++ } ++} ++ ++func writeGPSFile(t *testing.T, body string, modTime time.Time) { ++ t.Helper() ++ if err := os.MkdirAll(filepath.Dir(gpsPath), 0o755); err != nil { ++ t.Fatalf("mkdir gps dir: %v", err) ++ } ++ if err := os.WriteFile(gpsPath, []byte(body), 0o644); err != nil { ++ t.Fatalf("write gps file: %v", err) ++ } ++ if err := os.Chtimes(gpsPath, modTime, modTime); err != nil { ++ t.Fatalf("chtimes gps file: %v", err) ++ } ++} ++ ++func makeGPSFIFO(t *testing.T) { ++ t.Helper() ++ if err := os.MkdirAll(filepath.Dir(gpsPath), 0o755); err != nil { ++ t.Fatalf("mkdir gps dir: %v", err) ++ } ++ if err := syscall.Mkfifo(gpsPath, 0o644); err != nil { ++ t.Fatalf("mkfifo gps file: %v", err) ++ } ++} ++ ++func waitForAvailable(t *testing.T, p *location.TermuxLocationProvider) { ++ t.Helper() ++ deadline := time.Now().Add(2 * time.Second) ++ for time.Now().Before(deadline) { ++ if p.IsLocationAvailable() { ++ return ++ } ++ time.Sleep(10 * time.Millisecond) ++ } ++ t.Fatal("provider did not cache a location") ++} ++ ++func waitForLatitude(t *testing.T, p *location.TermuxLocationProvider, latitude float64) *location.LocationData { ++ t.Helper() ++ deadline := time.Now().Add(12 * time.Second) ++ var lastErr error ++ for time.Now().Before(deadline) { ++ loc, err := p.GetLocation() ++ if err == nil && loc.Latitude == latitude { ++ return loc ++ } ++ lastErr = err ++ time.Sleep(100 * time.Millisecond) ++ } ++ t.Fatalf("provider did not reach latitude %.4f; last error: %v", latitude, lastErr) ++ return nil ++} ++ ++func assertSampleLocation(t *testing.T, loc *location.LocationData) { ++ t.Helper() ++ if loc.Latitude != 57.7089 { ++ t.Fatalf("latitude = %.4f, want 57.7089", loc.Latitude) ++ } ++ if loc.Longitude != 11.9746 { ++ t.Fatalf("longitude = %.4f, want 11.9746", loc.Longitude) ++ } ++ if loc.Speed != 12.5 { ++ t.Fatalf("speed = %.1f, want 12.5", loc.Speed) ++ } ++ if loc.Accuracy != 4.2 { ++ t.Fatalf("accuracy = %.1f, want 4.2", loc.Accuracy) ++ } ++ if loc.Provider != "termux-file" { ++ t.Fatalf("provider = %q, want termux-file", loc.Provider) ++ } ++ if got := loc.Timestamp.UTC().Format(time.RFC3339); got != "2025-10-09T08:53:20Z" { ++ t.Fatalf("timestamp = %q, want 2025-10-09T08:53:20Z", got) ++ } ++} ++ ++func assertStaleError(t *testing.T, err error) { ++ t.Helper() ++ if err == nil { ++ t.Fatal("error = , want stale location error") ++ } ++ ++ if msg := strings.ToLower(err.Error()); !strings.Contains(msg, "stale") || !strings.Contains(msg, "location") { ++ t.Fatalf("error message = %q, want explanation that location data is stale", err.Error()) ++ } ++} ++ ++func TestReadsTimestampedTermuxGPSAndReturnsDefensiveCopy(t *testing.T) { ++ ++ ++ resetGPSPath(t) ++ writeGPSFile(t, `{"latitude":57.7089,"longitude":11.9746,"speed":12.5,"accuracy":4.2,"timestamp":1760000000}`, time.Unix(1770000000, 0)) ++ ++ p := location.NewTermuxLocationProvider(testLogger()) ++ defer p.Stop() ++ p.SetCacheTTL(400 * 24 * time.Hour) ++ p.SetFetchTimeout(25 * time.Millisecond) ++ waitForAvailable(t, p) ++ ++ if available := p.IsLocationAvailable(); available != true { ++ t.Fatalf("IsLocationAvailable() = %v, want true", available) ++ } ++ if zero := p.GetLastFetchTime().IsZero(); zero != false { ++ t.Fatalf("GetLastFetchTime().IsZero() = %v, want false", zero) ++ } ++ loc, err := p.GetLocation() ++ if err != nil { ++ t.Fatalf("GetLocation() error = %v, want nil", err) ++ } ++ assertSampleLocation(t, loc) ++ ++ loc.Latitude = 99 ++ loc.Longitude = 88 ++ loc.Provider = "mutated" ++ loc2, err := p.GetLocation() ++ if err != nil { ++ t.Fatalf("second GetLocation() error = %v, want nil", err) ++ } ++ assertSampleLocation(t, loc2) ++} ++ ++func TestMissingTimestampUsesGPSFileModificationTime(t *testing.T) { ++ ++ ++ resetGPSPath(t) ++ writeGPSFile(t, `{"latitude":12.25,"longitude":34.5,"speed":1.75,"accuracy":8.5}`, time.Unix(1770000123, 0)) ++ ++ p := location.NewTermuxLocationProvider(testLogger()) ++ defer p.Stop() ++ p.SetCacheTTL(400 * 24 * time.Hour) ++ waitForAvailable(t, p) ++ ++ loc, err := p.GetLocation() ++ if err != nil { ++ t.Fatalf("GetLocation() error = %v, want nil", err) ++ } ++ if loc.Latitude != 12.25 { ++ t.Fatalf("latitude = %.2f, want 12.25", loc.Latitude) ++ } ++ if loc.Longitude != 34.5 { ++ t.Fatalf("longitude = %.1f, want 34.5", loc.Longitude) ++ } ++ if loc.Speed != 1.75 { ++ t.Fatalf("speed = %.2f, want 1.75", loc.Speed) ++ } ++ if loc.Accuracy != 8.5 { ++ t.Fatalf("accuracy = %.1f, want 8.5", loc.Accuracy) ++ } ++ if loc.Provider != "termux-file" { ++ t.Fatalf("provider = %q, want termux-file", loc.Provider) ++ } ++ if got := loc.Timestamp.UTC().Format(time.RFC3339); got != "2026-02-02T02:42:03Z" { ++ t.Fatalf("timestamp = %q, want 2026-02-02T02:42:03Z", got) ++ } ++} ++ ++func TestDefaultLocationIsCachedUntilRealGPSIsReadable(t *testing.T) { ++ ++ ++ resetGPSPath(t) ++ ++ p := location.NewTermuxLocationProvider(testLogger()) ++ defer p.Stop() ++ waitForAvailable(t, p) ++ ++ if available := p.IsLocationAvailable(); available != true { ++ t.Fatalf("IsLocationAvailable() = %v, want true", available) ++ } ++ loc, err := p.GetLocation() ++ if err != nil { ++ t.Fatalf("GetLocation() error = %v, want nil", err) ++ } ++ if loc.Latitude != 0 { ++ t.Fatalf("latitude = %.1f, want 0", loc.Latitude) ++ } ++ if loc.Longitude != 0 { ++ t.Fatalf("longitude = %.1f, want 0", loc.Longitude) ++ } ++ ++ if loc.Provider != "default" { ++ t.Fatalf("provider = %q, want default", loc.Provider) ++ } ++ if zero := loc.Timestamp.IsZero(); zero != false { ++ t.Fatalf("default timestamp IsZero() = %v, want false", zero) ++ } ++ if zero := p.GetLastFetchTime().IsZero(); zero != false { ++ t.Fatalf("GetLastFetchTime().IsZero() = %v, want false", zero) ++ } ++} ++ ++func TestUnchangedFileModTimeDoesNotReplaceCacheOrAdvanceLastFetch(t *testing.T) { ++ ++ ++ resetGPSPath(t) ++ firstMod := time.Unix(1770000200, 0) ++ writeGPSFile(t, `{"latitude":1.1,"longitude":2.2,"speed":3.3,"accuracy":4.4,"timestamp":1770000201}`, firstMod) ++ ++ p := location.NewTermuxLocationProvider(testLogger()) ++ defer p.Stop() ++ p.SetCacheTTL(400 * 24 * time.Hour) ++ waitForAvailable(t, p) ++ ++ first, err := p.GetLocation() ++ if err != nil { ++ t.Fatalf("first GetLocation() error = %v, want nil", err) ++ } ++ if first.Latitude != 1.1 { ++ t.Fatalf("first latitude = %.1f, want 1.1", first.Latitude) ++ } ++ if first.Longitude != 2.2 { ++ t.Fatalf("first longitude = %.1f, want 2.2", first.Longitude) ++ } ++ if first.Speed != 3.3 { ++ t.Fatalf("first speed = %.1f, want 3.3", first.Speed) ++ } ++ if first.Accuracy != 4.4 { ++ t.Fatalf("first accuracy = %.1f, want 4.4", first.Accuracy) ++ } ++ if first.Provider != "termux-file" { ++ t.Fatalf("first provider = %q, want termux-file", first.Provider) ++ } ++ if got := first.Timestamp.UTC().Format(time.RFC3339); got != "2026-02-02T02:43:21Z" { ++ t.Fatalf("first timestamp = %q, want 2026-02-02T02:43:21Z", got) ++ } ++ firstFetch := p.GetLastFetchTime() ++ if zero := firstFetch.IsZero(); zero != false { ++ t.Fatalf("first fetch IsZero() = %v, want false", zero) ++ } ++ ++ writeGPSFile(t, `{"latitude":9.9,"longitude":8.8,"speed":7.7,"accuracy":6.6,"timestamp":1770000301}`, firstMod) ++ time.Sleep(11 * time.Second) ++ unchanged, err := p.GetLocation() ++ if err != nil { ++ t.Fatalf("unchanged GetLocation() error = %v, want nil", err) ++ } ++ if unchanged.Latitude != 1.1 { ++ t.Fatalf("unchanged latitude = %.1f, want 1.1", unchanged.Latitude) ++ } ++ if unchanged.Longitude != 2.2 { ++ t.Fatalf("unchanged longitude = %.1f, want 2.2", unchanged.Longitude) ++ } ++ if unchanged.Speed != 3.3 { ++ t.Fatalf("unchanged speed = %.1f, want 3.3", unchanged.Speed) ++ } ++ if unchanged.Accuracy != 4.4 { ++ t.Fatalf("unchanged accuracy = %.1f, want 4.4", unchanged.Accuracy) ++ } ++ if sameFetch := p.GetLastFetchTime().Equal(firstFetch); sameFetch != true { ++ t.Fatalf("last fetch unchanged = %v, want true", sameFetch) ++ } ++ ++ writeGPSFile(t, `{"latitude":5.5,"longitude":6.6,"speed":7.7,"accuracy":8.8,"timestamp":1770000401}`, firstMod.Add(time.Second)) ++ updated := waitForLatitude(t, p, 5.5) ++ if updated.Longitude != 6.6 { ++ t.Fatalf("updated longitude = %.1f, want 6.6", updated.Longitude) ++ } ++ if updated.Speed != 7.7 { ++ t.Fatalf("updated speed = %.1f, want 7.7", updated.Speed) ++ } ++ if updated.Accuracy != 8.8 { ++ t.Fatalf("updated accuracy = %.1f, want 8.8", updated.Accuracy) ++ } ++ if updated.Provider != "termux-file" { ++ t.Fatalf("updated provider = %q, want termux-file", updated.Provider) ++ } ++ if got := updated.Timestamp.UTC().Format(time.RFC3339); got != "2026-02-02T02:46:41Z" { ++ t.Fatalf("updated timestamp = %q, want 2026-02-02T02:46:41Z", got) ++ } ++ if advancedFetch := p.GetLastFetchTime().After(firstFetch); advancedFetch != true { ++ t.Fatalf("last fetch advanced = %v, want true", advancedFetch) ++ } ++} ++ ++func TestDefaultTTLRejectsStaleCacheAndSetCacheTTLExtendsWindow(t *testing.T) { ++ ++ ++ resetGPSPath(t) ++ writeGPSFile(t, `{"latitude":57.7089,"longitude":11.9746,"speed":12.5,"accuracy":4.2,"timestamp":1760000000}`, time.Unix(1770000000, 0)) ++ ++ p := location.NewTermuxLocationProvider(testLogger()) ++ defer p.Stop() ++ waitForAvailable(t, p) ++ ++ loc, err := p.GetLocation() ++ if err == nil { ++ t.Fatal("stale GetLocation() error = , want stale location error") ++ } ++ ++ assertStaleError(t, err) ++ ++ p.SetCacheTTL(400 * 24 * time.Hour) ++ loc, err = p.GetLocation() ++ if err != nil { ++ t.Fatalf("extended TTL GetLocation() error = %v, want nil", err) ++ } ++ assertSampleLocation(t, loc) ++} ++ ++func TestGetLocationBeforeAnyCacheReportsSpecificNoDataError(t *testing.T) { ++ ++ ++ resetGPSPath(t) ++ makeGPSFIFO(t) ++ ++ p := location.NewTermuxLocationProvider(testLogger()) ++ loc, err := p.GetLocation() ++ if err == nil { ++ ++ if loc == nil { ++ t.Fatal("location = , want default location when no error is returned") ++ } ++ if loc.Latitude != 0 { ++ t.Fatalf("latitude = %.1f, want 0", loc.Latitude) ++ } ++ if loc.Longitude != 0 { ++ t.Fatalf("longitude = %.1f, want 0", loc.Longitude) ++ } ++ if loc.Provider != "default" { ++ t.Fatalf("provider = %q, want default", loc.Provider) ++ } ++ } else { ++ ++ msg := strings.ToLower(err.Error()) ++ if !strings.Contains(msg, "no") || !strings.Contains(msg, "location") || !strings.Contains(msg, "available") { ++ t.Fatalf("error message = %q, want explanation that no location data is available yet", err.Error()) ++ } ++ } ++ ++ done := make(chan struct{}) ++ go func() { ++ ++ if f, openErr := os.OpenFile(gpsPath, os.O_WRONLY|syscall.O_NONBLOCK, 0); openErr == nil { ++ _, _ = f.Write([]byte(`{`)) ++ _ = f.Close() ++ } ++ close(done) ++ }() ++ select { ++ case <-done: ++ case <-time.After(2 * time.Second): ++ t.Fatal("timed out unblocking gps fifo") ++ } ++ p.Stop() ++} ++ ++func TestSetCacheTTLIsIndependentAcrossInstances(t *testing.T) { ++ ++ ++ resetGPSPath(t) ++ writeGPSFile(t, `{"latitude":57.7089,"longitude":11.9746,"speed":12.5,"accuracy":4.2,"timestamp":1760000000}`, time.Unix(1770000000, 0)) ++ ++ a := location.NewTermuxLocationProvider(testLogger()) ++ defer a.Stop() ++ b := location.NewTermuxLocationProvider(testLogger()) ++ defer b.Stop() ++ a.SetCacheTTL(400 * 24 * time.Hour) ++ b.SetCacheTTL(1 * time.Nanosecond) ++ waitForAvailable(t, a) ++ waitForAvailable(t, b) ++ ++ locA, errA := a.GetLocation() ++ if errA != nil { ++ t.Fatalf("a.GetLocation() error = %v, want nil", errA) ++ } ++ assertSampleLocation(t, locA) ++ _, errB := b.GetLocation() ++ if errB == nil { ++ t.Fatal("b.GetLocation() error = , want stale location error") ++ } ++ ++ assertStaleError(t, errB) ++} ++ ++func TestStopTerminatesProvider(t *testing.T) { ++ ++ ++ resetGPSPath(t) ++ writeGPSFile(t, `{"latitude":57.7089,"longitude":11.9746,"speed":12.5,"accuracy":4.2,"timestamp":1760000000}`, time.Unix(1770000000, 0)) ++ ++ p := location.NewTermuxLocationProvider(testLogger()) ++ p.SetCacheTTL(400 * 24 * time.Hour) ++ waitForAvailable(t, p) ++ p.Stop() ++ ++} ++ ++func TestStopBoundsGoroutinesAndFileDescriptorsAcrossManyCycles(t *testing.T) { ++ ++ ++ resetGPSPath(t) ++ writeGPSFile(t, `{"latitude":0.25,"longitude":0.5,"speed":0.75,"accuracy":1.25}`, time.Now()) ++ ++ runtime.GC() ++ beforeGoroutines := runtime.NumGoroutine() ++ beforeFDs := countFDs(t) ++ ++ for i := 0; i < 120; i++ { ++ p := location.NewTermuxLocationProvider(testLogger()) ++ waitForAvailable(t, p) ++ p.Stop() ++ } ++ ++ deadline := time.Now().Add(2 * time.Second) ++ var afterGoroutines int ++ for time.Now().Before(deadline) { ++ runtime.GC() ++ afterGoroutines = runtime.NumGoroutine() ++ if afterGoroutines <= beforeGoroutines+10 { ++ break ++ } ++ time.Sleep(20 * time.Millisecond) ++ } ++ afterFDs := countFDs(t) ++ if afterGoroutines > beforeGoroutines+10 { ++ t.Fatalf("goroutines after cycles = %d, want <= %d", afterGoroutines, beforeGoroutines+10) ++ } ++ if afterFDs > beforeFDs+10 { ++ t.Fatalf("fds after cycles = %d, want <= %d", afterFDs, beforeFDs+10) ++ } ++} ++ ++func countFDs(t *testing.T) int { ++ t.Helper() ++ entries, err := os.ReadDir("/proc/self/fd") ++ if err != nil { ++ t.Fatalf("read /proc/self/fd: %v", err) ++ } ++ return len(entries) ++} +diff --git a/mimo_test_command.sh b/mimo_test_command.sh +new file mode 100755 +--- /dev/null ++++ b/mimo_test_command.sh +@@ -0,0 +1,19 @@ ++#!/usr/bin/env bash ++ ++ ++ ++ ++export NODE_OPTIONS="${NODE_OPTIONS:-} --max-old-space-size=4096" ++export MAVEN_OPTS="${MAVEN_OPTS:-} -Xmx3g -XX:+UseG1GC" ++export GRADLE_OPTS="${GRADLE_OPTS:-} -Xmx3g -XX:+UseG1GC" ++export TEST_JVM_OPTS="${TEST_JVM_OPTS:-} -Xmx3g" ++export GOPROXY=off ++export GOSUMDB=off ++export GOTOOLCHAIN=local ++export GOFLAGS="${GOFLAGS:-} -mod=readonly" ++set -e ++cd /workspace/repo ++set -euo pipefail ++ ++cd /workspace/repo ++exec go test -v -count=1 ./usercase-test-coderl/... diff --git a/tasks/format-code-task-001643/tests/test.sh b/tasks/format-code-task-001643/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..79a99e01bc474d9ed850738f209d9444044d2657 --- /dev/null +++ b/tasks/format-code-task-001643/tests/test.sh @@ -0,0 +1,38 @@ +#!/bin/bash +# Code grading, mimoagent opensource_code.py: reset the files the hidden test patch touches, apply it, run the +# task's test command; reward 1 when it exits 0. A testbed failure (reset or apply) writes no reward: not scored. +M=/var/lib/mimo +CWD=/workspace/repo +V=/logs/verifier +mkdir -p "$V" +BASE=$(cat "$M/base" 2>/dev/null) || { echo "setup never ran (no $M/base)" >&2; exit 1; } +cd "$CWD" || exit 1 +if [ -d "$M/git-hidden" ]; then rm -rf "$CWD/.git"; mv "$M/git-hidden" "$CWD/.git"; fi +# the agent's change against the base, so its own commits count too +git add -A >/dev/null 2>&1 && git -c core.fileMode=false diff --cached "$BASE" > "$V/agent.diff" +git reset -q +if ! ( +while IFS= read -r tf; do + [ -z "$tf" ] && continue + if git cat-file -e $BASE:"$tf" 2>/dev/null; then + git checkout $BASE -- "$tf" 2>/dev/null || true + else + git rm -f --cached "$tf" >/dev/null 2>&1 || true + rm -f "$tf" + fi +done <<'EOF_RESET_TEST_FILES' +usercase-test-coderl/termux_location_provider_test.go +mimo_test_command.sh +EOF_RESET_TEST_FILES + +); then echo "could not reset the test files (testbed problem, not scored)" >&2; exit 1; fi +if ! git apply --verbose /tests/test.patch > "$V/apply.log" 2>&1; then + cat "$V/apply.log" >&2 + echo "the hidden tests could not be applied (testbed problem, not scored)" >&2 + exit 1 +fi +timeout 1800 sh -c "$(cat /tests/test_command.sh)" > "$V/test_output.log" 2>&1 +RC=$? +tail -c 12000 "$V/test_output.log" +if [ $RC -eq 0 ]; then echo 1 > "$V/reward.txt"; else echo 0 > "$V/reward.txt"; fi +echo "test command exited $RC" diff --git a/tasks/format-code-task-001643/tests/test_command.sh b/tasks/format-code-task-001643/tests/test_command.sh new file mode 100644 index 0000000000000000000000000000000000000000..88cb7810b836396c4869db31aeac7d4d4b189685 --- /dev/null +++ b/tasks/format-code-task-001643/tests/test_command.sh @@ -0,0 +1 @@ +bash /workspace/repo/mimo_test_command.sh \ No newline at end of file diff --git a/tasks/format-code-task-001644/environment/Dockerfile b/tasks/format-code-task-001644/environment/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..df7d2da16d30fdae7db163267822792744885668 --- /dev/null +++ b/tasks/format-code-task-001644/environment/Dockerfile @@ -0,0 +1,3 @@ +# The task's image, pinned by digest (the same as [environment].docker_image). +# Setup runs at start from [environment.healthcheck]; environment/setup/ is its readable copy. +FROM docker.io/xiaomimimo/mimo-v2.6-rl-oss@sha256:7fc71640ae981566df2f2c873bd759a92c8f75ba87ff0455c786f602ca435830 diff --git a/tasks/format-code-task-001644/environment/setup/files/blocklist b/tasks/format-code-task-001644/environment/setup/files/blocklist new file mode 100644 index 0000000000000000000000000000000000000000..a8e4bdc4c7d9b739c047a3cb58ea72a1bb05bcbc --- /dev/null +++ b/tasks/format-code-task-001644/environment/setup/files/blocklist @@ -0,0 +1,33 @@ +# mimo answer-leak blocklist (mimoagent) +0.0.0.0 github.com +0.0.0.0 www.github.com +0.0.0.0 api.github.com +0.0.0.0 raw.githubusercontent.com +0.0.0.0 codeload.github.com +0.0.0.0 objects.githubusercontent.com +0.0.0.0 gist.github.com +0.0.0.0 gist.githubusercontent.com +0.0.0.0 gitlab.com +0.0.0.0 bitbucket.org +0.0.0.0 sourceforge.net +0.0.0.0 git.kernel.org +0.0.0.0 chromium.googlesource.com +0.0.0.0 android.googlesource.com +0.0.0.0 sourcegraph.com +0.0.0.0 bugs.chromium.org +0.0.0.0 issues.oss-fuzz.com +0.0.0.0 oss-fuzz.com +0.0.0.0 osv.dev +0.0.0.0 api.osv.dev +0.0.0.0 bugzilla.mozilla.org +0.0.0.0 proxy.golang.org +0.0.0.0 sum.golang.org +0.0.0.0 pkg.go.dev +0.0.0.0 google.com +0.0.0.0 www.google.com +0.0.0.0 bing.com +0.0.0.0 www.bing.com +0.0.0.0 duckduckgo.com +0.0.0.0 html.duckduckgo.com +0.0.0.0 search.brave.com +0.0.0.0 stackoverflow.com diff --git a/tasks/format-code-task-001644/environment/setup/setup.sh b/tasks/format-code-task-001644/environment/setup/setup.sh new file mode 100644 index 0000000000000000000000000000000000000000..e9eb7daf39f9542bd095367feee457f3da77e492 --- /dev/null +++ b/tasks/format-code-task-001644/environment/setup/setup.sh @@ -0,0 +1,34 @@ +#!/bin/bash +# Runs once, as root, before the agent starts: Harbor's [environment.healthcheck] unpacks this folder into +# /var/lib/mimo and runs it. Generated by mimo_harbor; see its README for how each step maps to Xiaomi's harness. +M=/var/lib/mimo +[ -f "$M/ready" ] && exit 0 +chmod 700 "$M" +fail() { echo "setup: $*" >&2; exit 1; } +# the answer-leak blocklist (mimoagent), applied to /etc/hosts by the agent right after it installs +write_blocklist() { cp "$M/files/blocklist" "$M/blocklist"; } + +# Code: mimoagent environments/datasets/opensource_code.py + base.py, as the explorer runs it (app/runner/domains.py Code). +CWD=/workspace/repo +git config --global --add safe.directory "$CWD" +cd "$CWD" || fail "no working directory $CWD" +if ! git rev-parse --git-dir >/dev/null 2>&1; then # a bare source tree: give it a baseline commit + git init -q && git add -A && git -c user.name=mimo -c user.email=mimo@localhost commit -q -m baseline --allow-empty +fi +BASE=$(git rev-parse HEAD 2>/dev/null) +[ ${#BASE} -eq 40 ] || fail "could not resolve the base commit in $CWD" +echo "$BASE" > "$M/base" +# Images are built with history truncated at the base. If one is not, the fix could be read out of git log, +# so .git is hidden while the agent works and put back for grading. +LATER=$(git rev-list --all --not "$BASE" 2>/dev/null | head -n 5 | grep -c . || true) +rm -f /tmp/fail.log /tmp/pass.log /tmp/patch.diff /tmp/test_patch.diff /tmp/*.log 2>/dev/null; rm -rf /tmp/claude-0 /tmp/claude-* /tmp/testem-* /tmp/puppeteer_dev_chrome_profile-* 2>/dev/null; rm -f /tmp/test_files.json 2>/dev/null; rm -rf /tmp/jest_* /tmp/jest-* /tmp/build /tmp/build_env 2>/dev/null; rm -rf /tmp/pytest-of-root /tmp/pytest-* /tmp/.pytest_cache /tmp/__pycache__ 2>/dev/null; rm -rf /tmp/go-build* /tmp/standards /tmp/wordpress /tmp/zig-* /tmp/testbase /tmp/testbed 2>/dev/null; rm -f /tmp/tmp*.tmp /tmp/*.bak /tmp/expect* /tmp/butwas* 2>/dev/null; rm -rf /root/.cache/go-build 2>/dev/null; rm -rf /tests 2>/dev/null; find /logs -mindepth 1 -delete 2>/dev/null; mkdir -p /logs/agent /logs/verifier /logs/artifacts; chmod 777 /logs/agent /logs/verifier /logs/artifacts; find /var/log -type f -delete 2>/dev/null || true; rm -rf /var/lib/postgresql/*/*/log /var/lib/postgresql/*/*/pg_log 2>/dev/null || true; find /var/lib/mysql /var/lib/mongodb -type f -name '*.log' -delete 2>/dev/null || true; rm -rf /root/.npm/_logs /root/.babel.json /root/.pytest_cache 2>/dev/null || true; find / -maxdepth 4 -xdev -name task_description.md -path '*/.build_env/*' -delete 2>/dev/null || true; true +git clean -fdx --exclude=node_modules --exclude=bower_components --exclude=.husky --exclude=vendor --exclude=third_party --exclude=_deps --exclude=vcpkg_installed --exclude=.venv --exclude=venv --exclude=.gradle --exclude=target --exclude=.build --exclude=lib --exclude=.bundle --exclude=Manifest.toml --exclude=_build --exclude=.stack-work --exclude=dist-newstyle >/dev/null 2>&1 +find /root/.m2 -type f \( -name '*-SNAPSHOT.jar' -o -name '*-SNAPSHOT-sources.jar' -o -name '*-SNAPSHOT-tests.jar' -o -name '*-SNAPSHOT-test-sources.jar' \) -delete 2>/dev/null; rm -rf /root/.julia/compiled 2>/dev/null; rm -rf /root/.gradle/caches/build-cache-* /root/.gradle/daemon 2>/dev/null; rm -rf /root/.gradle/caches/*/scripts /root/.gradle/caches/jars-* 2>/dev/null; rm -rf /root/.cache/bazel 2>/dev/null; true +if [ "$LATER" -gt 0 ]; then + mv "$CWD/.git" "$M/git-hidden" + echo "history not truncated at ${BASE:0:12}: .git hidden while the agent works" +fi +write_blocklist + +touch "$M/ready" +echo "setup done" diff --git a/tasks/format-code-task-001644/tests/test.patch b/tasks/format-code-task-001644/tests/test.patch new file mode 100644 index 0000000000000000000000000000000000000000..80e20911d1906bb11e78d5499cf3cb988d7c93b7 --- /dev/null +++ b/tasks/format-code-task-001644/tests/test.patch @@ -0,0 +1,348 @@ +diff --git a/usercase-test-coderl/report.test.js b/usercase-test-coderl/report.test.js +new file mode 100644 +--- /dev/null ++++ b/usercase-test-coderl/report.test.js +@@ -0,0 +1,322 @@ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++'use strict'; ++ ++const assert = require('node:assert/strict'); ++const fs = require('node:fs'); ++const path = require('node:path'); ++const test = require('node:test'); ++const vm = require('node:vm'); ++ ++const REPO = '/workspace/repo'; ++ ++const sourceFiles = [ ++ 'source/namespace.js', ++ 'source/api/Auth.js', ++ 'source/api/Connection.js', ++ 'source/api/connections.js', ++ 'source/api/Sequence.js', ++ 'source/mail/Message.js', ++ 'source/mail/Thread.js', ++ 'source/mail/Mailbox.js', ++ 'source/mail/MessageList.js', ++ 'source/mail/MessageSubmission.js', ++ 'source/mail/mail-model.js', ++]; ++ ++const loadPublicJmap = (loadedRecords = {}) => { ++ const context = { ++ clearTimeout, ++ console, ++ setTimeout, ++ }; ++ context.global = context; ++ context.O = {}; ++ context.O.UndoManager = function (mixin) { ++ Object.assign(this, mixin || {}); ++ }; ++ context.O.UndoManager.prototype = { ++ constructor: context.O.UndoManager, ++ get(key) { ++ return this[key]; ++ }, ++ set(key, value) { ++ this[key] = value; ++ return this; ++ }, ++ dataDidChange() { ++ this.didChangeCount = (this.didChangeCount || 0) + 1; ++ return this; ++ }, ++ }; ++ ++ vm.createContext(context); ++ sourceFiles.forEach((file) => { ++ vm.runInContext( ++ fs.readFileSync(path.join(REPO, file), 'utf8'), ++ context, ++ { filename: file }, ++ ); ++ }); ++ context.JMAP.store.getRecordFromStoreKey = (storeKey) => loadedRecords[storeKey] || null; ++ context.JMAP.store.getStatus = (storeKey) => loadedRecords[storeKey] ? ++ context.O.Status.READY : 0; ++ context.JMAP.__TypeError = vm.runInContext('TypeError', context); ++ return context.JMAP; ++}; ++ ++const loadedMessage = (accountId, id, storeKey) => { ++ const calls = []; ++ const data = { accountId, id, storeKey }; ++ return { ++ calls, ++ get(key) { ++ calls.push(key); ++ return data[key]; ++ }, ++ is(status) { ++ return status === 2; ++ }, ++ }; ++}; ++ ++const asHostValue = (value) => JSON.parse(JSON.stringify(value)); ++ ++const drainQueuedCalls = (mail) => asHostValue(mail.makeRequest()[0]); ++ ++const drainUndoData = (mail) => { ++ const data = mail.undoManager.getUndoData(); ++ return data === null ? null : asHostValue(data); ++}; ++ ++const reportCallsByAccount = (calls) => { ++ const result = {}; ++ calls.forEach((call) => { ++ assert.equal(call[0], 'Email/report'); ++ assert.equal(call.length >= 2, true); ++ assert.equal(Object.hasOwn(result, call[1].accountId), false); ++ result[call[1].accountId] = { ++ ids: call[1].ids, ++ type: call[1].type, ++ }; ++ }); ++ return result; ++}; ++ ++const assertReportCalls = (calls, expected) => { ++ ++ assert.deepStrictEqual(reportCallsByAccount(calls), expected); ++}; ++ ++const assertUndoReportsInverse = (JMAP, undoData, expected) => { ++ ++ assert.ok(Array.isArray(undoData)); ++ assert.equal(undoData.length > 0, true); ++ JMAP.mail.undoManager.applyChange(undoData); ++ assertReportCalls(drainQueuedCalls(JMAP.mail), expected); ++}; ++ ++test('same-account spam report queues one Email/report call and no undo', () => { ++ ++ ++ const JMAP = loadPublicJmap(); ++ const mail = JMAP.mail; ++ const m1 = loadedMessage('accA', 'e1', 'sk1'); ++ const m2 = loadedMessage('accA', 'e2', 'sk2'); ++ ++ const result = mail.report([m1, m2], true, false); ++ ++ assert.strictEqual(result === mail, true); ++ assertReportCalls(drainQueuedCalls(mail), { ++ accA: { ++ ids: ['e1', 'e2'], ++ type: 'spam', ++ }, ++ }); ++ assert.deepStrictEqual(drainUndoData(mail), null); ++}); ++ ++test('cross-account not-spam report queues per-account calls and inverse undo data', () => { ++ ++ ++ const m1 = loadedMessage('accA', 'e1', 'sk1'); ++ const m3 = loadedMessage('accB', 'e3', 'sk3'); ++ const JMAP = loadPublicJmap({ sk1: m1, sk3: m3 }); ++ const mail = JMAP.mail; ++ ++ const result = mail.report([m1, m3], false, true); ++ ++ assert.strictEqual(result === mail, true); ++ assertReportCalls(drainQueuedCalls(mail), { ++ accA: { ++ ids: ['e1'], ++ type: 'notspam', ++ }, ++ accB: { ++ ids: ['e3'], ++ type: 'notspam', ++ }, ++ }); ++ assertUndoReportsInverse(JMAP, mail.undoManager.getUndoData(), { ++ accA: { ++ ids: ['e1'], ++ type: 'spam', ++ }, ++ accB: { ++ ids: ['e3'], ++ type: 'spam', ++ }, ++ }); ++}); ++ ++test('mixed-account spam report groups ids per account', () => { ++ ++ ++ const m1 = loadedMessage('accA', 'e1', 'sk1'); ++ const m2 = loadedMessage('accA', 'e2', 'sk2'); ++ const m3 = loadedMessage('accB', 'e3', 'sk3'); ++ const JMAP = loadPublicJmap({ sk1: m1, sk2: m2, sk3: m3 }); ++ const mail = JMAP.mail; ++ ++ mail.report([m3, m1, m2], true, true); ++ ++ assertReportCalls(drainQueuedCalls(mail), { ++ accA: { ++ ids: ['e1', 'e2'], ++ type: 'spam', ++ }, ++ accB: { ++ ids: ['e3'], ++ type: 'spam', ++ }, ++ }); ++ assertUndoReportsInverse(JMAP, mail.undoManager.getUndoData(), { ++ accA: { ++ ids: ['e1', 'e2'], ++ type: 'notspam', ++ }, ++ accB: { ++ ids: ['e3'], ++ type: 'notspam', ++ }, ++ }); ++}); ++ ++test('report reads account id, message id, and store key from loaded messages', () => { ++ ++ ++ const m1 = loadedMessage('accA', 'e1', 'sk1'); ++ const JMAP = loadPublicJmap({ sk1: m1 }); ++ ++ JMAP.mail.report([m1], true, true); ++ ++ ++ assert.deepStrictEqual(new Set(m1.calls), new Set(['accountId', 'id', 'storeKey'])); ++ assertReportCalls(drainQueuedCalls(JMAP.mail), { ++ accA: { ++ ids: ['e1'], ++ type: 'spam', ++ }, ++ }); ++ assertUndoReportsInverse(JMAP, JMAP.mail.undoManager.getUndoData(), { ++ accA: { ++ ids: ['e1'], ++ type: 'notspam', ++ }, ++ }); ++}); ++ ++test('request and undo drains are idempotent after reporting', () => { ++ ++ ++ const m1 = loadedMessage('accA', 'e1', 'sk1'); ++ const JMAP = loadPublicJmap({ sk1: m1 }); ++ const mail = JMAP.mail; ++ ++ mail.report([m1], true, true); ++ ++ assertReportCalls(drainQueuedCalls(mail), { ++ accA: { ++ ids: ['e1'], ++ type: 'spam', ++ }, ++ }); ++ ++ assert.deepStrictEqual(drainQueuedCalls(mail), []); ++ assertUndoReportsInverse(JMAP, mail.undoManager.getUndoData(), { ++ accA: { ++ ids: ['e1'], ++ type: 'notspam', ++ }, ++ }); ++ ++ assert.deepStrictEqual(drainUndoData(mail), null); ++}); ++ ++test('fresh public mail sessions do not share queued report state', () => { ++ ++ ++ const m1 = loadedMessage('accA', 'e1', 'sk1'); ++ const sessionA = loadPublicJmap({ sk1: m1 }); ++ const sessionB = loadPublicJmap(); ++ ++ sessionA.mail.report([m1], false, true); ++ ++ assertReportCalls(drainQueuedCalls(sessionA.mail), { ++ accA: { ++ ids: ['e1'], ++ type: 'notspam', ++ }, ++ }); ++ ++ assert.deepStrictEqual(drainQueuedCalls(sessionB.mail), []); ++ assertUndoReportsInverse(sessionA, sessionA.mail.undoManager.getUndoData(), { ++ accA: { ++ ids: ['e1'], ++ type: 'spam', ++ }, ++ }); ++ ++ assert.deepStrictEqual(drainUndoData(sessionB.mail), null); ++}); ++ ++test('queued report work and pending undo stay bounded across repeated use and drain cycles', () => { ++ ++ ++ const m1 = loadedMessage('accA', 'e1', 'sk1'); ++ const m3 = loadedMessage('accB', 'e3', 'sk3'); ++ const JMAP = loadPublicJmap({ sk1: m1, sk3: m3 }); ++ const mail = JMAP.mail; ++ ++ for (let i = 0; i < 100; i += 1) { ++ mail.report([m1, m3], false, true); ++ const calls = drainQueuedCalls(mail); ++ ++ assert.deepStrictEqual(Object.keys(reportCallsByAccount(calls)).sort(), ['accA', 'accB']); ++ const undoData = mail.undoManager.getUndoData(); ++ assertUndoReportsInverse(JMAP, undoData, { ++ accA: { ++ ids: ['e1'], ++ type: 'spam', ++ }, ++ accB: { ++ ids: ['e3'], ++ type: 'spam', ++ }, ++ }); ++ drainQueuedCalls(mail); ++ } ++ ++ ++ assert.deepStrictEqual(drainQueuedCalls(mail), []); ++ assert.deepStrictEqual(drainUndoData(mail), null); ++}); +diff --git a/mimo_test_command.sh b/mimo_test_command.sh +new file mode 100755 +--- /dev/null ++++ b/mimo_test_command.sh +@@ -0,0 +1,16 @@ ++#!/usr/bin/env bash ++ ++ ++ ++ ++export NODE_OPTIONS="${NODE_OPTIONS:-} --max-old-space-size=4096" ++export MAVEN_OPTS="${MAVEN_OPTS:-} -Xmx3g -XX:+UseG1GC" ++export GRADLE_OPTS="${GRADLE_OPTS:-} -Xmx3g -XX:+UseG1GC" ++export TEST_JVM_OPTS="${TEST_JVM_OPTS:-} -Xmx3g" ++set -e ++cd /workspace/repo ++set -euo pipefail ++ ++cd /workspace/repo ++ ++exec node --test /workspace/repo/usercase-test-coderl/report.test.js diff --git a/tasks/format-code-task-001644/tests/test.sh b/tasks/format-code-task-001644/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..03b8f0c464bec0d819813f63ce5b19f2e62a5c6b --- /dev/null +++ b/tasks/format-code-task-001644/tests/test.sh @@ -0,0 +1,38 @@ +#!/bin/bash +# Code grading, mimoagent opensource_code.py: reset the files the hidden test patch touches, apply it, run the +# task's test command; reward 1 when it exits 0. A testbed failure (reset or apply) writes no reward: not scored. +M=/var/lib/mimo +CWD=/workspace/repo +V=/logs/verifier +mkdir -p "$V" +BASE=$(cat "$M/base" 2>/dev/null) || { echo "setup never ran (no $M/base)" >&2; exit 1; } +cd "$CWD" || exit 1 +if [ -d "$M/git-hidden" ]; then rm -rf "$CWD/.git"; mv "$M/git-hidden" "$CWD/.git"; fi +# the agent's change against the base, so its own commits count too +git add -A >/dev/null 2>&1 && git -c core.fileMode=false diff --cached "$BASE" > "$V/agent.diff" +git reset -q +if ! ( +while IFS= read -r tf; do + [ -z "$tf" ] && continue + if git cat-file -e $BASE:"$tf" 2>/dev/null; then + git checkout $BASE -- "$tf" 2>/dev/null || true + else + git rm -f --cached "$tf" >/dev/null 2>&1 || true + rm -f "$tf" + fi +done <<'EOF_RESET_TEST_FILES' +usercase-test-coderl/report.test.js +mimo_test_command.sh +EOF_RESET_TEST_FILES + +); then echo "could not reset the test files (testbed problem, not scored)" >&2; exit 1; fi +if ! git apply --verbose /tests/test.patch > "$V/apply.log" 2>&1; then + cat "$V/apply.log" >&2 + echo "the hidden tests could not be applied (testbed problem, not scored)" >&2 + exit 1 +fi +timeout 1800 sh -c "$(cat /tests/test_command.sh)" > "$V/test_output.log" 2>&1 +RC=$? +tail -c 12000 "$V/test_output.log" +if [ $RC -eq 0 ]; then echo 1 > "$V/reward.txt"; else echo 0 > "$V/reward.txt"; fi +echo "test command exited $RC" diff --git a/tasks/format-code-task-001644/tests/test_command.sh b/tasks/format-code-task-001644/tests/test_command.sh new file mode 100644 index 0000000000000000000000000000000000000000..88cb7810b836396c4869db31aeac7d4d4b189685 --- /dev/null +++ b/tasks/format-code-task-001644/tests/test_command.sh @@ -0,0 +1 @@ +bash /workspace/repo/mimo_test_command.sh \ No newline at end of file diff --git a/tasks/format-code-task-001650/environment/Dockerfile b/tasks/format-code-task-001650/environment/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..6f7aa0b66c387ead657e63aee73e0770e0c97c92 --- /dev/null +++ b/tasks/format-code-task-001650/environment/Dockerfile @@ -0,0 +1,3 @@ +# The task's image, pinned by digest (the same as [environment].docker_image). +# Setup runs at start from [environment.healthcheck]; environment/setup/ is its readable copy. +FROM docker.io/xiaomimimo/mimo-v2.6-rl-oss@sha256:a4bf21f37892a715571248d7326d1123110016855684e5eae8c32efddad49d01 diff --git a/tasks/format-code-task-001650/environment/setup/files/blocklist b/tasks/format-code-task-001650/environment/setup/files/blocklist new file mode 100644 index 0000000000000000000000000000000000000000..a8e4bdc4c7d9b739c047a3cb58ea72a1bb05bcbc --- /dev/null +++ b/tasks/format-code-task-001650/environment/setup/files/blocklist @@ -0,0 +1,33 @@ +# mimo answer-leak blocklist (mimoagent) +0.0.0.0 github.com +0.0.0.0 www.github.com +0.0.0.0 api.github.com +0.0.0.0 raw.githubusercontent.com +0.0.0.0 codeload.github.com +0.0.0.0 objects.githubusercontent.com +0.0.0.0 gist.github.com +0.0.0.0 gist.githubusercontent.com +0.0.0.0 gitlab.com +0.0.0.0 bitbucket.org +0.0.0.0 sourceforge.net +0.0.0.0 git.kernel.org +0.0.0.0 chromium.googlesource.com +0.0.0.0 android.googlesource.com +0.0.0.0 sourcegraph.com +0.0.0.0 bugs.chromium.org +0.0.0.0 issues.oss-fuzz.com +0.0.0.0 oss-fuzz.com +0.0.0.0 osv.dev +0.0.0.0 api.osv.dev +0.0.0.0 bugzilla.mozilla.org +0.0.0.0 proxy.golang.org +0.0.0.0 sum.golang.org +0.0.0.0 pkg.go.dev +0.0.0.0 google.com +0.0.0.0 www.google.com +0.0.0.0 bing.com +0.0.0.0 www.bing.com +0.0.0.0 duckduckgo.com +0.0.0.0 html.duckduckgo.com +0.0.0.0 search.brave.com +0.0.0.0 stackoverflow.com diff --git a/tasks/format-code-task-001650/environment/setup/setup.sh b/tasks/format-code-task-001650/environment/setup/setup.sh new file mode 100644 index 0000000000000000000000000000000000000000..d883db90cfcfb48f7a139861bbe9f6b5d95cad6f --- /dev/null +++ b/tasks/format-code-task-001650/environment/setup/setup.sh @@ -0,0 +1,34 @@ +#!/bin/bash +# Runs once, as root, before the agent starts: Harbor's [environment.healthcheck] unpacks this folder into +# /var/lib/mimo and runs it. Generated by mimo_harbor; see its README for how each step maps to Xiaomi's harness. +M=/var/lib/mimo +[ -f "$M/ready" ] && exit 0 +chmod 700 "$M" +fail() { echo "setup: $*" >&2; exit 1; } +# the answer-leak blocklist (mimoagent), applied to /etc/hosts by the agent right after it installs +write_blocklist() { cp "$M/files/blocklist" "$M/blocklist"; } + +# Code: mimoagent environments/datasets/opensource_code.py + base.py, as the explorer runs it (app/runner/domains.py Code). +CWD=/testbed +git config --global --add safe.directory "$CWD" +cd "$CWD" || fail "no working directory $CWD" +if ! git rev-parse --git-dir >/dev/null 2>&1; then # a bare source tree: give it a baseline commit + git init -q && git add -A && git -c user.name=mimo -c user.email=mimo@localhost commit -q -m baseline --allow-empty +fi +BASE=$(git rev-parse HEAD 2>/dev/null) +[ ${#BASE} -eq 40 ] || fail "could not resolve the base commit in $CWD" +echo "$BASE" > "$M/base" +# Images are built with history truncated at the base. If one is not, the fix could be read out of git log, +# so .git is hidden while the agent works and put back for grading. +LATER=$(git rev-list --all --not "$BASE" 2>/dev/null | head -n 5 | grep -c . || true) +rm -f /tmp/fail.log /tmp/pass.log /tmp/patch.diff /tmp/test_patch.diff /tmp/*.log 2>/dev/null; rm -rf /tmp/claude-0 /tmp/claude-* /tmp/testem-* /tmp/puppeteer_dev_chrome_profile-* 2>/dev/null; rm -f /tmp/test_files.json 2>/dev/null; rm -rf /tmp/jest_* /tmp/jest-* /tmp/build /tmp/build_env 2>/dev/null; rm -rf /tmp/pytest-of-root /tmp/pytest-* /tmp/.pytest_cache /tmp/__pycache__ 2>/dev/null; rm -rf /tmp/go-build* /tmp/standards /tmp/wordpress /tmp/zig-* /tmp/testbase /tmp/testbed 2>/dev/null; rm -f /tmp/tmp*.tmp /tmp/*.bak /tmp/expect* /tmp/butwas* 2>/dev/null; rm -rf /root/.cache/go-build 2>/dev/null; rm -rf /tests 2>/dev/null; find /logs -mindepth 1 -delete 2>/dev/null; mkdir -p /logs/agent /logs/verifier /logs/artifacts; chmod 777 /logs/agent /logs/verifier /logs/artifacts; find /var/log -type f -delete 2>/dev/null || true; rm -rf /var/lib/postgresql/*/*/log /var/lib/postgresql/*/*/pg_log 2>/dev/null || true; find /var/lib/mysql /var/lib/mongodb -type f -name '*.log' -delete 2>/dev/null || true; rm -rf /root/.npm/_logs /root/.babel.json /root/.pytest_cache 2>/dev/null || true; find / -maxdepth 4 -xdev -name task_description.md -path '*/.build_env/*' -delete 2>/dev/null || true; true +git clean -fdx --exclude=node_modules --exclude=bower_components --exclude=.husky --exclude=vendor --exclude=third_party --exclude=_deps --exclude=vcpkg_installed --exclude=.venv --exclude=venv --exclude=.gradle --exclude=target --exclude=.build --exclude=lib --exclude=.bundle --exclude=Manifest.toml --exclude=_build --exclude=.stack-work --exclude=dist-newstyle >/dev/null 2>&1 +find /root/.m2 -type f \( -name '*-SNAPSHOT.jar' -o -name '*-SNAPSHOT-sources.jar' -o -name '*-SNAPSHOT-tests.jar' -o -name '*-SNAPSHOT-test-sources.jar' \) -delete 2>/dev/null; rm -rf /root/.julia/compiled 2>/dev/null; rm -rf /root/.gradle/caches/build-cache-* /root/.gradle/daemon 2>/dev/null; rm -rf /root/.gradle/caches/*/scripts /root/.gradle/caches/jars-* 2>/dev/null; rm -rf /root/.cache/bazel 2>/dev/null; true +if [ "$LATER" -gt 0 ]; then + mv "$CWD/.git" "$M/git-hidden" + echo "history not truncated at ${BASE:0:12}: .git hidden while the agent works" +fi +write_blocklist + +touch "$M/ready" +echo "setup done" diff --git a/tasks/format-code-task-001650/tests/test.patch b/tasks/format-code-task-001650/tests/test.patch new file mode 100644 index 0000000000000000000000000000000000000000..94530a556dd427685428bfe4d01d6e85e25ad3f8 --- /dev/null +++ b/tasks/format-code-task-001650/tests/test.patch @@ -0,0 +1,194 @@ +diff --git a/test/unit/4_dispatch/permissions_issue.spec.js b/test/unit/4_dispatch/permissions_issue.spec.js +new file mode 100644 +index 00000000..5cf13a77 +--- /dev/null ++++ b/test/unit/4_dispatch/permissions_issue.spec.js +@@ -0,0 +1,166 @@ ++ ++ ++ ++ ++ ++ ++ ++var assert = require('assert'); ++var path = require('path'); ++ ++describe('permissions name discrepancy issue', function () { ++ this.timeout(30000); ++ ++ var engine; ++ var ctx; ++ ++ before(function (done) { ++ process.env.JOOLA_NO_DOMAIN = '1'; ++ process.env.NODE_TLS_REJECT_UNAUTHORIZED = '0'; ++ process.env.JOOLA_CONFIG_INTERFACES_WEBSERVER_SECUREONLY = 'false'; ++ process.env.JOOLA_CONFIG_AUTHENTICATION_BASICAUTH_ENABLED = 'true'; ++ process.env.JOOLA_CONFIG_STORE_LOGGER_CONSOLE_LEVEL = 'error'; ++ ++ require('../../../joola.js').init({}, function (err, eng) { ++ if (err) return done(err); ++ eng.state.once('state:change', function (state) { ++ if (state !== 'online') return done(new Error('engine state: ' + state)); ++ engine = eng; ++ ctx = { user: { permissions: ['superuser'] } }; ++ done(); ++ }); ++ }); ++ }); ++ ++ after(function (done) { ++ if (engine && engine.shutdown) { ++ engine.shutdown(0, function () { done(); }); ++ } else { ++ done(); ++ } ++ }); ++ ++ it('list includes query:fetch (the actual permission used by query.fetch)', function (done) { ++ engine.permissions.list(ctx, function (err, list) { ++ if (err) return done(err); ++ assert(Array.isArray(list), 'expected an array'); ++ assert(list.indexOf('query:fetch') !== -1, ++ 'expected list to contain "query:fetch", got: ' + JSON.stringify(list)); ++ done(); ++ }); ++ }); ++ ++ it('list includes query:stop', function (done) { ++ engine.permissions.list(ctx, function (err, list) { ++ if (err) return done(err); ++ assert(list.indexOf('query:stop') !== -1, ++ 'expected list to contain "query:stop", got: ' + JSON.stringify(list)); ++ done(); ++ }); ++ }); ++ ++ it('list includes beacon:insert (actual beacon insert permission)', function (done) { ++ engine.permissions.list(ctx, function (err, list) { ++ if (err) return done(err); ++ assert(list.indexOf('beacon:insert') !== -1, ++ 'expected list to contain "beacon:insert", got: ' + JSON.stringify(list)); ++ done(); ++ }); ++ }); ++ ++ it('list reconciles legacy "query" name with the actual query permission', function (done) { ++ ++ ++ ++ engine.permissions.list(ctx, function (err, list) { ++ if (err) return done(err); ++ assert(list.indexOf('query:fetch') !== -1, ++ 'list must contain the actual permission "query:fetch"; full list: ' + JSON.stringify(list)); ++ done(); ++ }); ++ }); ++ ++ it('list reconciles legacy "beacon_insert" name with the actual beacon permission', function (done) { ++ engine.permissions.list(ctx, function (err, list) { ++ if (err) return done(err); ++ assert(list.indexOf('beacon:insert') !== -1, ++ 'list must contain the actual permission "beacon:insert"; full list: ' + JSON.stringify(list)); ++ done(); ++ }); ++ }); ++ ++ it('list includes namespaced permissions from multiple modules', function (done) { ++ engine.permissions.list(ctx, function (err, list) { ++ if (err) return done(err); ++ var expected = [ ++ 'roles:add', ++ 'users:list', ++ 'collections:list', ++ 'workspaces:list', ++ 'system:version' ++ ]; ++ expected.forEach(function (p) { ++ assert(list.indexOf(p) !== -1, ++ 'expected list to contain "' + p + '"; full list: ' + JSON.stringify(list)); ++ }); ++ done(); ++ }); ++ }); ++ ++ it('get("query:fetch") succeeds and returns the permission', function (done) { ++ engine.permissions.get(ctx, 'query:fetch', function (err, result) { ++ if (err) return done(err); ++ assert(Array.isArray(result), 'expected array result'); ++ assert.strictEqual(result[0], 'query:fetch'); ++ done(); ++ }); ++ }); ++ ++ it('get("beacon:insert") succeeds', function (done) { ++ engine.permissions.get(ctx, 'beacon:insert', function (err, result) { ++ if (err) return done(err); ++ assert.strictEqual(result[0], 'beacon:insert'); ++ done(); ++ }); ++ }); ++ ++ it('get("query") behaves consistently with list (legacy name reconciliation)', function (done) { ++ ++ ++ ++ engine.permissions.list(ctx, function (err, list) { ++ if (err) return done(err); ++ var inList = list.indexOf('query') !== -1; ++ engine.permissions.get(ctx, 'query', function (gerr, result) { ++ if (inList) { ++ assert(!gerr, 'list contains "query" but get() errored: ' + gerr); ++ } else { ++ assert(gerr, 'list omits "query"; expected get() to error too'); ++ } ++ done(); ++ }); ++ }); ++ }); ++ ++ it('get("beacon_insert") behaves consistently with list (legacy name reconciliation)', function (done) { ++ engine.permissions.list(ctx, function (err, list) { ++ if (err) return done(err); ++ var inList = list.indexOf('beacon_insert') !== -1; ++ engine.permissions.get(ctx, 'beacon_insert', function (gerr, result) { ++ if (inList) { ++ assert(!gerr, 'list contains "beacon_insert" but get() errored: ' + gerr); ++ } else { ++ assert(gerr, 'list omits "beacon_insert"; expected get() to error too'); ++ } ++ done(); ++ }); ++ }); ++ }); ++ ++ it('get("nonexistent_permission_xyz") still returns an error (preservation)', function (done) { ++ engine.permissions.get(ctx, 'nonexistent_permission_xyz', function (err, result) { ++ assert(err, 'expected error for unknown permission'); ++ done(); ++ }); ++ }); ++}); +diff --git a/test_commands.json b/test_commands.json +new file mode 100644 +index 00000000..63f2fb60 +--- /dev/null ++++ b/test_commands.json +@@ -0,0 +1,3 @@ ++{ ++ "test_commands": ["./node_modules/.bin/mocha test/unit/4_dispatch/permissions_issue.spec.js --reporter spec --no-config --timeout 60000 --exit"] ++} +diff --git a/mimo_test_command.sh b/mimo_test_command.sh +new file mode 100755 +--- /dev/null ++++ b/mimo_test_command.sh +@@ -0,0 +1,8 @@ ++#!/usr/bin/env bash ++ ++set -uo pipefail ++cd /testbed ++rc=0 ++./node_modules/.bin/mocha test/unit/4_dispatch/permissions_issue.spec.js --reporter spec --no-config --timeout 60000 --exit ++rc=$(( rc | $? )) ++exit $rc diff --git a/tasks/format-code-task-001650/tests/test.sh b/tasks/format-code-task-001650/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..ccbfe518928abeaa21ac59535f0a2902341e99d5 --- /dev/null +++ b/tasks/format-code-task-001650/tests/test.sh @@ -0,0 +1,39 @@ +#!/bin/bash +# Code grading, mimoagent opensource_code.py: reset the files the hidden test patch touches, apply it, run the +# task's test command; reward 1 when it exits 0. A testbed failure (reset or apply) writes no reward: not scored. +M=/var/lib/mimo +CWD=/testbed +V=/logs/verifier +mkdir -p "$V" +BASE=$(cat "$M/base" 2>/dev/null) || { echo "setup never ran (no $M/base)" >&2; exit 1; } +cd "$CWD" || exit 1 +if [ -d "$M/git-hidden" ]; then rm -rf "$CWD/.git"; mv "$M/git-hidden" "$CWD/.git"; fi +# the agent's change against the base, so its own commits count too +git add -A >/dev/null 2>&1 && git -c core.fileMode=false diff --cached "$BASE" > "$V/agent.diff" +git reset -q +if ! ( +while IFS= read -r tf; do + [ -z "$tf" ] && continue + if git cat-file -e $BASE:"$tf" 2>/dev/null; then + git checkout $BASE -- "$tf" 2>/dev/null || true + else + git rm -f --cached "$tf" >/dev/null 2>&1 || true + rm -f "$tf" + fi +done <<'EOF_RESET_TEST_FILES' +test/unit/4_dispatch/permissions_issue.spec.js +test_commands.json +mimo_test_command.sh +EOF_RESET_TEST_FILES + +); then echo "could not reset the test files (testbed problem, not scored)" >&2; exit 1; fi +if ! git apply --verbose /tests/test.patch > "$V/apply.log" 2>&1; then + cat "$V/apply.log" >&2 + echo "the hidden tests could not be applied (testbed problem, not scored)" >&2 + exit 1 +fi +timeout 1800 sh -c "$(cat /tests/test_command.sh)" > "$V/test_output.log" 2>&1 +RC=$? +tail -c 12000 "$V/test_output.log" +if [ $RC -eq 0 ]; then echo 1 > "$V/reward.txt"; else echo 0 > "$V/reward.txt"; fi +echo "test command exited $RC" diff --git a/tasks/format-code-task-001650/tests/test_command.sh b/tasks/format-code-task-001650/tests/test_command.sh new file mode 100644 index 0000000000000000000000000000000000000000..7cb23076694ad17d72e8296d62b2b240083e36db --- /dev/null +++ b/tasks/format-code-task-001650/tests/test_command.sh @@ -0,0 +1 @@ +bash /testbed/mimo_test_command.sh \ No newline at end of file diff --git a/tasks/format-code-task-001657/environment/Dockerfile b/tasks/format-code-task-001657/environment/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..502017b2191137f2f25e91ff2c8a2e86dfa82f0e --- /dev/null +++ b/tasks/format-code-task-001657/environment/Dockerfile @@ -0,0 +1,3 @@ +# The task's image, pinned by digest (the same as [environment].docker_image). +# Setup runs at start from [environment.healthcheck]; environment/setup/ is its readable copy. +FROM docker.io/xiaomimimo/mimo-v2.6-rl-oss@sha256:341a60e1a5ac5c4aa7fee2a1368e11c8b5359bbd2ae0b6493cd9c0abffa4656e diff --git a/tasks/format-code-task-001657/environment/setup/files/blocklist b/tasks/format-code-task-001657/environment/setup/files/blocklist new file mode 100644 index 0000000000000000000000000000000000000000..a8e4bdc4c7d9b739c047a3cb58ea72a1bb05bcbc --- /dev/null +++ b/tasks/format-code-task-001657/environment/setup/files/blocklist @@ -0,0 +1,33 @@ +# mimo answer-leak blocklist (mimoagent) +0.0.0.0 github.com +0.0.0.0 www.github.com +0.0.0.0 api.github.com +0.0.0.0 raw.githubusercontent.com +0.0.0.0 codeload.github.com +0.0.0.0 objects.githubusercontent.com +0.0.0.0 gist.github.com +0.0.0.0 gist.githubusercontent.com +0.0.0.0 gitlab.com +0.0.0.0 bitbucket.org +0.0.0.0 sourceforge.net +0.0.0.0 git.kernel.org +0.0.0.0 chromium.googlesource.com +0.0.0.0 android.googlesource.com +0.0.0.0 sourcegraph.com +0.0.0.0 bugs.chromium.org +0.0.0.0 issues.oss-fuzz.com +0.0.0.0 oss-fuzz.com +0.0.0.0 osv.dev +0.0.0.0 api.osv.dev +0.0.0.0 bugzilla.mozilla.org +0.0.0.0 proxy.golang.org +0.0.0.0 sum.golang.org +0.0.0.0 pkg.go.dev +0.0.0.0 google.com +0.0.0.0 www.google.com +0.0.0.0 bing.com +0.0.0.0 www.bing.com +0.0.0.0 duckduckgo.com +0.0.0.0 html.duckduckgo.com +0.0.0.0 search.brave.com +0.0.0.0 stackoverflow.com diff --git a/tasks/format-code-task-001657/environment/setup/setup.sh b/tasks/format-code-task-001657/environment/setup/setup.sh new file mode 100644 index 0000000000000000000000000000000000000000..d883db90cfcfb48f7a139861bbe9f6b5d95cad6f --- /dev/null +++ b/tasks/format-code-task-001657/environment/setup/setup.sh @@ -0,0 +1,34 @@ +#!/bin/bash +# Runs once, as root, before the agent starts: Harbor's [environment.healthcheck] unpacks this folder into +# /var/lib/mimo and runs it. Generated by mimo_harbor; see its README for how each step maps to Xiaomi's harness. +M=/var/lib/mimo +[ -f "$M/ready" ] && exit 0 +chmod 700 "$M" +fail() { echo "setup: $*" >&2; exit 1; } +# the answer-leak blocklist (mimoagent), applied to /etc/hosts by the agent right after it installs +write_blocklist() { cp "$M/files/blocklist" "$M/blocklist"; } + +# Code: mimoagent environments/datasets/opensource_code.py + base.py, as the explorer runs it (app/runner/domains.py Code). +CWD=/testbed +git config --global --add safe.directory "$CWD" +cd "$CWD" || fail "no working directory $CWD" +if ! git rev-parse --git-dir >/dev/null 2>&1; then # a bare source tree: give it a baseline commit + git init -q && git add -A && git -c user.name=mimo -c user.email=mimo@localhost commit -q -m baseline --allow-empty +fi +BASE=$(git rev-parse HEAD 2>/dev/null) +[ ${#BASE} -eq 40 ] || fail "could not resolve the base commit in $CWD" +echo "$BASE" > "$M/base" +# Images are built with history truncated at the base. If one is not, the fix could be read out of git log, +# so .git is hidden while the agent works and put back for grading. +LATER=$(git rev-list --all --not "$BASE" 2>/dev/null | head -n 5 | grep -c . || true) +rm -f /tmp/fail.log /tmp/pass.log /tmp/patch.diff /tmp/test_patch.diff /tmp/*.log 2>/dev/null; rm -rf /tmp/claude-0 /tmp/claude-* /tmp/testem-* /tmp/puppeteer_dev_chrome_profile-* 2>/dev/null; rm -f /tmp/test_files.json 2>/dev/null; rm -rf /tmp/jest_* /tmp/jest-* /tmp/build /tmp/build_env 2>/dev/null; rm -rf /tmp/pytest-of-root /tmp/pytest-* /tmp/.pytest_cache /tmp/__pycache__ 2>/dev/null; rm -rf /tmp/go-build* /tmp/standards /tmp/wordpress /tmp/zig-* /tmp/testbase /tmp/testbed 2>/dev/null; rm -f /tmp/tmp*.tmp /tmp/*.bak /tmp/expect* /tmp/butwas* 2>/dev/null; rm -rf /root/.cache/go-build 2>/dev/null; rm -rf /tests 2>/dev/null; find /logs -mindepth 1 -delete 2>/dev/null; mkdir -p /logs/agent /logs/verifier /logs/artifacts; chmod 777 /logs/agent /logs/verifier /logs/artifacts; find /var/log -type f -delete 2>/dev/null || true; rm -rf /var/lib/postgresql/*/*/log /var/lib/postgresql/*/*/pg_log 2>/dev/null || true; find /var/lib/mysql /var/lib/mongodb -type f -name '*.log' -delete 2>/dev/null || true; rm -rf /root/.npm/_logs /root/.babel.json /root/.pytest_cache 2>/dev/null || true; find / -maxdepth 4 -xdev -name task_description.md -path '*/.build_env/*' -delete 2>/dev/null || true; true +git clean -fdx --exclude=node_modules --exclude=bower_components --exclude=.husky --exclude=vendor --exclude=third_party --exclude=_deps --exclude=vcpkg_installed --exclude=.venv --exclude=venv --exclude=.gradle --exclude=target --exclude=.build --exclude=lib --exclude=.bundle --exclude=Manifest.toml --exclude=_build --exclude=.stack-work --exclude=dist-newstyle >/dev/null 2>&1 +find /root/.m2 -type f \( -name '*-SNAPSHOT.jar' -o -name '*-SNAPSHOT-sources.jar' -o -name '*-SNAPSHOT-tests.jar' -o -name '*-SNAPSHOT-test-sources.jar' \) -delete 2>/dev/null; rm -rf /root/.julia/compiled 2>/dev/null; rm -rf /root/.gradle/caches/build-cache-* /root/.gradle/daemon 2>/dev/null; rm -rf /root/.gradle/caches/*/scripts /root/.gradle/caches/jars-* 2>/dev/null; rm -rf /root/.cache/bazel 2>/dev/null; true +if [ "$LATER" -gt 0 ]; then + mv "$CWD/.git" "$M/git-hidden" + echo "history not truncated at ${BASE:0:12}: .git hidden while the agent works" +fi +write_blocklist + +touch "$M/ready" +echo "setup done" diff --git a/tasks/format-code-task-001657/tests/test.patch b/tasks/format-code-task-001657/tests/test.patch new file mode 100644 index 0000000000000000000000000000000000000000..987186ace564314df9f7228f35d7b3f7713630c6 --- /dev/null +++ b/tasks/format-code-task-001657/tests/test.patch @@ -0,0 +1,61 @@ +diff --git a/value_tests/map_test.go b/value_tests/map_test.go +index f8ffa5a3..02a1895a 100644 +--- a/value_tests/map_test.go ++++ b/value_tests/map_test.go +@@ -31,6 +31,7 @@ func init() { + map[string]*json.RawMessage{"hello": pRawMessage(json.RawMessage("[]"))}, + map[Date]bool{{}: true}, + map[Date2]bool{{}: true}, ++ map[customKey]string{customKey(1): "bar"}, + ) + unmarshalCases = append(unmarshalCases, unmarshalCase{ + ptr: (*map[string]string)(nil), +@@ -55,6 +56,9 @@ func init() { + "2018-12-13": true, + "2018-12-14": true + }`, ++ }, unmarshalCase{ ++ ptr: (*map[customKey]string)(nil), ++ input: `{"foo": "bar"}`, + }) + } + +@@ -115,3 +119,14 @@ func (d Date2) UnmarshalJSON(b []byte) error { + func (d Date2) MarshalJSON() ([]byte, error) { + return []byte(d.Time.Format("2006-01-02")), nil + } ++ ++type customKey int32 ++ ++func (c customKey) MarshalText() ([]byte, error) { ++ return []byte("foo"), nil ++} ++ ++func (c *customKey) UnmarshalText(value []byte) error { ++ *c = 1 ++ return nil ++} +diff --git a/mimo_build_env.tar.gz.b64 b/mimo_build_env.tar.gz.b64 +new file mode 100644 +--- /dev/null ++++ b/mimo_build_env.tar.gz.b64 +@@ -0,0 +1,8 @@ ++H4sIAAAAAAAAA+3Tz2vbMBQHcJ/9VzzYDt0hkuXEKQwCKzu0gzGPkp2DbCuOwJaMJIf2v5/srks3 ++WHtpKWXfD8aW9eM92c9m1ai7ZqfMkScvJYvOi2K+Rn9f57YociHOV0U8kkyItVglVLzYjh4YfZCO ++KHHWhsfmPTX+RrFT/YPyYVfbvpemYf7wfDmeqv86W/6u/3q5jPVfrfNlQtnzbeHf/vP61w3Nha9U ++k6qbwbpAl+V1WW433A6Bt3YhWC7uh75fbK/+GOCVNh/fT92n1XeTpvcVZ526t2X59fPVxZdvm87W ++skvTd/RjaJ1sFDm171QdcgqWjoJlLKe9dXRpacpB8ZscZNCV7nS4pbNeDqSDcrHLGtrrmw9pa6lV ++gVodDmPF4nze20Y5s2gtvw/+6S7ylPd6NBQOimLlp2XT88c4naKzo+xGtZs6PI955haL0Z1qtY85 ++PdXSq3i2xo+9aqi6pe303/TS+YPs+Hwzml+3887m8IsjLWo7mrARxPjDNOlrfwIAAAAAAAAAAAAA ++AAAAAAAA8Ib9BJG470IAKAAA +diff --git a/mimo_test_command.sh b/mimo_test_command.sh +new file mode 100755 +--- /dev/null ++++ b/mimo_test_command.sh +@@ -0,0 +1,6 @@ ++#!/usr/bin/env bash ++ ++set -uo pipefail ++cd /testbed || exit 1 ++base64 -d mimo_build_env.tar.gz.b64 | tar -xzf - -C /testbed || exit 1 ++exec bash -lc 'cd /testbed && bash -eo pipefail /testbed/.build_env/test_command.sh' diff --git a/tasks/format-code-task-001657/tests/test.sh b/tasks/format-code-task-001657/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..f94c16616f4ed1ba6d82612b36347464c859d196 --- /dev/null +++ b/tasks/format-code-task-001657/tests/test.sh @@ -0,0 +1,39 @@ +#!/bin/bash +# Code grading, mimoagent opensource_code.py: reset the files the hidden test patch touches, apply it, run the +# task's test command; reward 1 when it exits 0. A testbed failure (reset or apply) writes no reward: not scored. +M=/var/lib/mimo +CWD=/testbed +V=/logs/verifier +mkdir -p "$V" +BASE=$(cat "$M/base" 2>/dev/null) || { echo "setup never ran (no $M/base)" >&2; exit 1; } +cd "$CWD" || exit 1 +if [ -d "$M/git-hidden" ]; then rm -rf "$CWD/.git"; mv "$M/git-hidden" "$CWD/.git"; fi +# the agent's change against the base, so its own commits count too +git add -A >/dev/null 2>&1 && git -c core.fileMode=false diff --cached "$BASE" > "$V/agent.diff" +git reset -q +if ! ( +while IFS= read -r tf; do + [ -z "$tf" ] && continue + if git cat-file -e $BASE:"$tf" 2>/dev/null; then + git checkout $BASE -- "$tf" 2>/dev/null || true + else + git rm -f --cached "$tf" >/dev/null 2>&1 || true + rm -f "$tf" + fi +done <<'EOF_RESET_TEST_FILES' +value_tests/map_test.go +mimo_build_env.tar.gz.b64 +mimo_test_command.sh +EOF_RESET_TEST_FILES + +); then echo "could not reset the test files (testbed problem, not scored)" >&2; exit 1; fi +if ! git apply --verbose /tests/test.patch > "$V/apply.log" 2>&1; then + cat "$V/apply.log" >&2 + echo "the hidden tests could not be applied (testbed problem, not scored)" >&2 + exit 1 +fi +timeout 1800 sh -c "$(cat /tests/test_command.sh)" > "$V/test_output.log" 2>&1 +RC=$? +tail -c 12000 "$V/test_output.log" +if [ $RC -eq 0 ]; then echo 1 > "$V/reward.txt"; else echo 0 > "$V/reward.txt"; fi +echo "test command exited $RC" diff --git a/tasks/format-code-task-001657/tests/test_command.sh b/tasks/format-code-task-001657/tests/test_command.sh new file mode 100644 index 0000000000000000000000000000000000000000..7cb23076694ad17d72e8296d62b2b240083e36db --- /dev/null +++ b/tasks/format-code-task-001657/tests/test_command.sh @@ -0,0 +1 @@ +bash /testbed/mimo_test_command.sh \ No newline at end of file diff --git a/tasks/format-code-task-001659/environment/Dockerfile b/tasks/format-code-task-001659/environment/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..bcc96c5b93f47881a46e70205e60052b96ecae99 --- /dev/null +++ b/tasks/format-code-task-001659/environment/Dockerfile @@ -0,0 +1,3 @@ +# The task's image, pinned by digest (the same as [environment].docker_image). +# Setup runs at start from [environment.healthcheck]; environment/setup/ is its readable copy. +FROM docker.io/xiaomimimo/mimo-v2.6-rl-oss@sha256:23603cd8a1056664b2b5d54677f2699e8ba411c958478a324270bab8097222b3 diff --git a/tasks/format-code-task-001659/environment/setup/files/blocklist b/tasks/format-code-task-001659/environment/setup/files/blocklist new file mode 100644 index 0000000000000000000000000000000000000000..a8e4bdc4c7d9b739c047a3cb58ea72a1bb05bcbc --- /dev/null +++ b/tasks/format-code-task-001659/environment/setup/files/blocklist @@ -0,0 +1,33 @@ +# mimo answer-leak blocklist (mimoagent) +0.0.0.0 github.com +0.0.0.0 www.github.com +0.0.0.0 api.github.com +0.0.0.0 raw.githubusercontent.com +0.0.0.0 codeload.github.com +0.0.0.0 objects.githubusercontent.com +0.0.0.0 gist.github.com +0.0.0.0 gist.githubusercontent.com +0.0.0.0 gitlab.com +0.0.0.0 bitbucket.org +0.0.0.0 sourceforge.net +0.0.0.0 git.kernel.org +0.0.0.0 chromium.googlesource.com +0.0.0.0 android.googlesource.com +0.0.0.0 sourcegraph.com +0.0.0.0 bugs.chromium.org +0.0.0.0 issues.oss-fuzz.com +0.0.0.0 oss-fuzz.com +0.0.0.0 osv.dev +0.0.0.0 api.osv.dev +0.0.0.0 bugzilla.mozilla.org +0.0.0.0 proxy.golang.org +0.0.0.0 sum.golang.org +0.0.0.0 pkg.go.dev +0.0.0.0 google.com +0.0.0.0 www.google.com +0.0.0.0 bing.com +0.0.0.0 www.bing.com +0.0.0.0 duckduckgo.com +0.0.0.0 html.duckduckgo.com +0.0.0.0 search.brave.com +0.0.0.0 stackoverflow.com diff --git a/tasks/format-code-task-001659/environment/setup/setup.sh b/tasks/format-code-task-001659/environment/setup/setup.sh new file mode 100644 index 0000000000000000000000000000000000000000..e9eb7daf39f9542bd095367feee457f3da77e492 --- /dev/null +++ b/tasks/format-code-task-001659/environment/setup/setup.sh @@ -0,0 +1,34 @@ +#!/bin/bash +# Runs once, as root, before the agent starts: Harbor's [environment.healthcheck] unpacks this folder into +# /var/lib/mimo and runs it. Generated by mimo_harbor; see its README for how each step maps to Xiaomi's harness. +M=/var/lib/mimo +[ -f "$M/ready" ] && exit 0 +chmod 700 "$M" +fail() { echo "setup: $*" >&2; exit 1; } +# the answer-leak blocklist (mimoagent), applied to /etc/hosts by the agent right after it installs +write_blocklist() { cp "$M/files/blocklist" "$M/blocklist"; } + +# Code: mimoagent environments/datasets/opensource_code.py + base.py, as the explorer runs it (app/runner/domains.py Code). +CWD=/workspace/repo +git config --global --add safe.directory "$CWD" +cd "$CWD" || fail "no working directory $CWD" +if ! git rev-parse --git-dir >/dev/null 2>&1; then # a bare source tree: give it a baseline commit + git init -q && git add -A && git -c user.name=mimo -c user.email=mimo@localhost commit -q -m baseline --allow-empty +fi +BASE=$(git rev-parse HEAD 2>/dev/null) +[ ${#BASE} -eq 40 ] || fail "could not resolve the base commit in $CWD" +echo "$BASE" > "$M/base" +# Images are built with history truncated at the base. If one is not, the fix could be read out of git log, +# so .git is hidden while the agent works and put back for grading. +LATER=$(git rev-list --all --not "$BASE" 2>/dev/null | head -n 5 | grep -c . || true) +rm -f /tmp/fail.log /tmp/pass.log /tmp/patch.diff /tmp/test_patch.diff /tmp/*.log 2>/dev/null; rm -rf /tmp/claude-0 /tmp/claude-* /tmp/testem-* /tmp/puppeteer_dev_chrome_profile-* 2>/dev/null; rm -f /tmp/test_files.json 2>/dev/null; rm -rf /tmp/jest_* /tmp/jest-* /tmp/build /tmp/build_env 2>/dev/null; rm -rf /tmp/pytest-of-root /tmp/pytest-* /tmp/.pytest_cache /tmp/__pycache__ 2>/dev/null; rm -rf /tmp/go-build* /tmp/standards /tmp/wordpress /tmp/zig-* /tmp/testbase /tmp/testbed 2>/dev/null; rm -f /tmp/tmp*.tmp /tmp/*.bak /tmp/expect* /tmp/butwas* 2>/dev/null; rm -rf /root/.cache/go-build 2>/dev/null; rm -rf /tests 2>/dev/null; find /logs -mindepth 1 -delete 2>/dev/null; mkdir -p /logs/agent /logs/verifier /logs/artifacts; chmod 777 /logs/agent /logs/verifier /logs/artifacts; find /var/log -type f -delete 2>/dev/null || true; rm -rf /var/lib/postgresql/*/*/log /var/lib/postgresql/*/*/pg_log 2>/dev/null || true; find /var/lib/mysql /var/lib/mongodb -type f -name '*.log' -delete 2>/dev/null || true; rm -rf /root/.npm/_logs /root/.babel.json /root/.pytest_cache 2>/dev/null || true; find / -maxdepth 4 -xdev -name task_description.md -path '*/.build_env/*' -delete 2>/dev/null || true; true +git clean -fdx --exclude=node_modules --exclude=bower_components --exclude=.husky --exclude=vendor --exclude=third_party --exclude=_deps --exclude=vcpkg_installed --exclude=.venv --exclude=venv --exclude=.gradle --exclude=target --exclude=.build --exclude=lib --exclude=.bundle --exclude=Manifest.toml --exclude=_build --exclude=.stack-work --exclude=dist-newstyle >/dev/null 2>&1 +find /root/.m2 -type f \( -name '*-SNAPSHOT.jar' -o -name '*-SNAPSHOT-sources.jar' -o -name '*-SNAPSHOT-tests.jar' -o -name '*-SNAPSHOT-test-sources.jar' \) -delete 2>/dev/null; rm -rf /root/.julia/compiled 2>/dev/null; rm -rf /root/.gradle/caches/build-cache-* /root/.gradle/daemon 2>/dev/null; rm -rf /root/.gradle/caches/*/scripts /root/.gradle/caches/jars-* 2>/dev/null; rm -rf /root/.cache/bazel 2>/dev/null; true +if [ "$LATER" -gt 0 ]; then + mv "$CWD/.git" "$M/git-hidden" + echo "history not truncated at ${BASE:0:12}: .git hidden while the agent works" +fi +write_blocklist + +touch "$M/ready" +echo "setup done" diff --git a/tasks/format-code-task-001659/tests/test.patch b/tasks/format-code-task-001659/tests/test.patch new file mode 100644 index 0000000000000000000000000000000000000000..76924884f9256a8a889d9ed36806dbf1dd07eff2 --- /dev/null +++ b/tasks/format-code-task-001659/tests/test.patch @@ -0,0 +1,521 @@ +diff --git a/usercase-test-coderl/test_dedupe_chars.py b/usercase-test-coderl/test_dedupe_chars.py +new file mode 100644 +--- /dev/null ++++ b/usercase-test-coderl/test_dedupe_chars.py +@@ -0,0 +1,496 @@ ++import copy ++import json ++import subprocess ++import sys ++ ++import pytest ++ ++from pdfplumber.utils import dedupe_chars ++ ++ ++def test_default_extra_attrs_collapse_near_duplicates_and_keep_other_text(): ++ ++ ++ ++ ++ chars = [ ++ { ++ "id": "lead", ++ "text": "A", ++ "upright": True, ++ "fontname": "F1", ++ "size": 12, ++ "doctop": 10.0, ++ "x0": 20.0, ++ }, ++ { ++ "id": "dup", ++ "text": "A", ++ "upright": True, ++ "fontname": "F1", ++ "size": 12, ++ "doctop": 10.4, ++ "x0": 20.5, ++ }, ++ { ++ "id": "other", ++ "text": "B", ++ "upright": True, ++ "fontname": "F1", ++ "size": 12, ++ "doctop": 12.0, ++ "x0": 25.0, ++ }, ++ ] ++ ++ actual = dedupe_chars(chars) ++ ++ assert actual == [ ++ { ++ "id": "lead", ++ "text": "A", ++ "upright": True, ++ "fontname": "F1", ++ "size": 12, ++ "doctop": 10.0, ++ "x0": 20.0, ++ }, ++ { ++ "id": "other", ++ "text": "B", ++ "upright": True, ++ "fontname": "F1", ++ "size": 12, ++ "doctop": 12.0, ++ "x0": 25.0, ++ }, ++ ] ++ assert (actual is chars) is False ++ ++ ++def test_default_extra_attrs_keep_different_fontname(): ++ ++ ++ ++ ++ chars = [ ++ { ++ "id": "f1", ++ "text": "A", ++ "upright": True, ++ "fontname": "F1", ++ "size": 12, ++ "doctop": 10.0, ++ "x0": 20.0, ++ }, ++ { ++ "id": "f2", ++ "text": "A", ++ "upright": True, ++ "fontname": "F2", ++ "size": 12, ++ "doctop": 10.4, ++ "x0": 20.5, ++ }, ++ ] ++ ++ assert dedupe_chars(chars) == [ ++ { ++ "id": "f1", ++ "text": "A", ++ "upright": True, ++ "fontname": "F1", ++ "size": 12, ++ "doctop": 10.0, ++ "x0": 20.0, ++ }, ++ { ++ "id": "f2", ++ "text": "A", ++ "upright": True, ++ "fontname": "F2", ++ "size": 12, ++ "doctop": 10.4, ++ "x0": 20.5, ++ }, ++ ] ++ ++ ++def test_empty_extra_attrs_ignores_fontname_difference(): ++ ++ ++ ++ ++ chars = [ ++ { ++ "id": "f1", ++ "text": "A", ++ "upright": True, ++ "fontname": "F1", ++ "size": 12, ++ "doctop": 10.0, ++ "x0": 20.0, ++ }, ++ { ++ "id": "f2", ++ "text": "A", ++ "upright": True, ++ "fontname": "F2", ++ "size": 12, ++ "doctop": 10.4, ++ "x0": 20.5, ++ }, ++ ] ++ ++ assert dedupe_chars(chars, extra_attrs=()) == [ ++ { ++ "id": "f1", ++ "text": "A", ++ "upright": True, ++ "fontname": "F1", ++ "size": 12, ++ "doctop": 10.0, ++ "x0": 20.0, ++ } ++ ] ++ ++ ++def test_lower_tolerance_keeps_positions_outside_tolerance(): ++ ++ ++ ++ ++ chars = [ ++ { ++ "id": "base", ++ "text": "A", ++ "upright": True, ++ "fontname": "F1", ++ "size": 12, ++ "doctop": 10.0, ++ "x0": 20.0, ++ }, ++ { ++ "id": "near_but_outside", ++ "text": "A", ++ "upright": True, ++ "fontname": "F1", ++ "size": 12, ++ "doctop": 10.2, ++ "x0": 20.0, ++ }, ++ ] ++ ++ assert dedupe_chars(chars, tolerance=0.1) == [ ++ { ++ "id": "base", ++ "text": "A", ++ "upright": True, ++ "fontname": "F1", ++ "size": 12, ++ "doctop": 10.0, ++ "x0": 20.0, ++ }, ++ { ++ "id": "near_but_outside", ++ "text": "A", ++ "upright": True, ++ "fontname": "F1", ++ "size": 12, ++ "doctop": 10.2, ++ "x0": 20.0, ++ }, ++ ] ++ ++ ++def test_cluster_keeps_smallest_position_then_returns_original_input_order(): ++ ++ ++ ++ ++ chars = [ ++ { ++ "id": "first_kept_later_position", ++ "text": "Q", ++ "upright": True, ++ "fontname": "F1", ++ "size": 11, ++ "doctop": 50.5, ++ "x0": 8.0, ++ }, ++ { ++ "id": "different_text_between", ++ "text": "Z", ++ "upright": True, ++ "fontname": "F1", ++ "size": 11, ++ "doctop": 40.0, ++ "x0": 1.0, ++ }, ++ { ++ "id": "cluster_smallest_position", ++ "text": "Q", ++ "upright": True, ++ "fontname": "F1", ++ "size": 11, ++ "doctop": 50.0, ++ "x0": 7.5, ++ }, ++ ] ++ ++ assert dedupe_chars(chars) == [ ++ { ++ "id": "different_text_between", ++ "text": "Z", ++ "upright": True, ++ "fontname": "F1", ++ "size": 11, ++ "doctop": 40.0, ++ "x0": 1.0, ++ }, ++ { ++ "id": "cluster_smallest_position", ++ "text": "Q", ++ "upright": True, ++ "fontname": "F1", ++ "size": 11, ++ "doctop": 50.0, ++ "x0": 7.5, ++ }, ++ ] ++ ++ ++def test_different_upright_values_do_not_collapse(): ++ ++ ++ ++ ++ chars = [ ++ { ++ "id": "upright", ++ "text": "A", ++ "upright": True, ++ "fontname": "F1", ++ "size": 12, ++ "doctop": 10.0, ++ "x0": 20.0, ++ }, ++ { ++ "id": "rotated", ++ "text": "A", ++ "upright": False, ++ "fontname": "F1", ++ "size": 12, ++ "doctop": 10.2, ++ "x0": 20.2, ++ }, ++ ] ++ ++ assert dedupe_chars(chars) == [ ++ { ++ "id": "upright", ++ "text": "A", ++ "upright": True, ++ "fontname": "F1", ++ "size": 12, ++ "doctop": 10.0, ++ "x0": 20.0, ++ }, ++ { ++ "id": "rotated", ++ "text": "A", ++ "upright": False, ++ "fontname": "F1", ++ "size": 12, ++ "doctop": 10.2, ++ "x0": 20.2, ++ }, ++ ] ++ ++ ++def test_empty_input_returns_empty_new_list(): ++ ++ ++ ++ ++ chars = [] ++ ++ actual = dedupe_chars(chars) ++ ++ assert actual == [] ++ assert (actual is chars) is False ++ ++ ++@pytest.mark.parametrize( ++ "chars,kwargs", ++ [ ++ ([{"upright": True, "fontname": "F1", "size": 12, "doctop": 10.0, "x0": 20.0}], {}), ++ ([{"text": "A", "fontname": "F1", "size": 12, "doctop": 10.0, "x0": 20.0}], {}), ++ ([{"text": "A", "upright": True, "fontname": "F1", "size": 12, "x0": 20.0}], {}), ++ ([{"text": "A", "upright": True, "fontname": "F1", "size": 12, "doctop": 10.0}], {}), ++ ([{"text": "A", "upright": True, "size": 12, "doctop": 10.0, "x0": 20.0}], {}), ++ ( ++ [ ++ { ++ "text": "A", ++ "upright": True, ++ "fontname": "F1", ++ "size": 12, ++ "doctop": 10.0, ++ "x0": 20.0, ++ } ++ ], ++ {"extra_attrs": ("color",)}, ++ ), ++ ], ++) ++def test_missing_required_or_requested_fields_raise_keyerror(chars, kwargs): ++ ++ ++ ++ ++ with pytest.raises(KeyError): ++ dedupe_chars(chars, **kwargs) ++ ++ ++def test_referential_transparency_for_equal_calls(): ++ chars = [ ++ { ++ "id": "base", ++ "text": "A", ++ "upright": True, ++ "fontname": "F1", ++ "size": 12, ++ "doctop": 10.0, ++ "x0": 20.0, ++ }, ++ { ++ "id": "dup", ++ "text": "A", ++ "upright": True, ++ "fontname": "F1", ++ "size": 12, ++ "doctop": 10.5, ++ "x0": 20.4, ++ }, ++ ] ++ ++ assert dedupe_chars(chars) == dedupe_chars(chars) ++ ++ ++def test_does_not_mutate_input_list_or_character_dicts(): ++ chars = [ ++ { ++ "id": "base", ++ "text": "A", ++ "upright": True, ++ "fontname": "F1", ++ "size": 12, ++ "doctop": 10.0, ++ "x0": 20.0, ++ }, ++ { ++ "id": "dup", ++ "text": "A", ++ "upright": True, ++ "fontname": "F1", ++ "size": 12, ++ "doctop": 10.5, ++ "x0": 20.4, ++ }, ++ ] ++ original = copy.deepcopy(chars) ++ ++ dedupe_chars(chars) ++ ++ assert chars == original ++ ++ ++def test_no_global_state_matches_fresh_process_result(): ++ chars = [ ++ { ++ "id": "base", ++ "text": "A", ++ "upright": True, ++ "fontname": "F1", ++ "size": 12, ++ "doctop": 10.0, ++ "x0": 20.0, ++ }, ++ { ++ "id": "dup", ++ "text": "A", ++ "upright": True, ++ "fontname": "F1", ++ "size": 12, ++ "doctop": 10.5, ++ "x0": 20.4, ++ }, ++ { ++ "id": "other", ++ "text": "B", ++ "upright": True, ++ "fontname": "F2", ++ "size": 10, ++ "doctop": 5.0, ++ "x0": 2.0, ++ }, ++ ] ++ in_process = dedupe_chars(chars) ++ chars_json = json.dumps(chars) ++ script = f""" ++import json ++import sys ++sys.path.insert(0, "/workspace/repo") ++from pdfplumber.utils import dedupe_chars ++chars = json.loads({chars_json!r}) ++sys.stdout.write(json.dumps(dedupe_chars(chars), sort_keys=True)) ++""" ++ ++ completed = subprocess.run( ++ [sys.executable, "-c", script], ++ check=True, ++ stdout=subprocess.PIPE, ++ stderr=subprocess.PIPE, ++ text=True, ++ ) ++ ++ assert json.loads(completed.stdout) == in_process ++ ++ ++def test_default_call_dedupes_without_requiring_side_effect_instrumentation(): ++ chars = [ ++ { ++ "id": "base", ++ "text": "A", ++ "upright": True, ++ "fontname": "F1", ++ "size": 12, ++ "doctop": 10.0, ++ "x0": 20.0, ++ }, ++ { ++ "id": "dup", ++ "text": "A", ++ "upright": True, ++ "fontname": "F1", ++ "size": 12, ++ "doctop": 10.5, ++ "x0": 20.4, ++ }, ++ ] ++ ++ actual = dedupe_chars(chars) ++ ++ ++ assert actual == [ ++ { ++ "id": "base", ++ "text": "A", ++ "upright": True, ++ "fontname": "F1", ++ "size": 12, ++ "doctop": 10.0, ++ "x0": 20.0, ++ } ++ ] +diff --git a/mimo_test_command.sh b/mimo_test_command.sh +new file mode 100755 +--- /dev/null ++++ b/mimo_test_command.sh +@@ -0,0 +1,15 @@ ++#!/usr/bin/env bash ++ ++ ++ ++ ++export NODE_OPTIONS="${NODE_OPTIONS:-} --max-old-space-size=4096" ++export MAVEN_OPTS="${MAVEN_OPTS:-} -Xmx3g -XX:+UseG1GC" ++export GRADLE_OPTS="${GRADLE_OPTS:-} -Xmx3g -XX:+UseG1GC" ++export TEST_JVM_OPTS="${TEST_JVM_OPTS:-} -Xmx3g" ++set -e ++cd /workspace/repo ++set -euo pipefail ++export PYTHONPATH="/workspace/repo${PYTHONPATH:+:${PYTHONPATH}}" ++export PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 ++exec python -m pytest -o addopts='' -p no:cacheprovider /workspace/repo/usercase-test-coderl/test_dedupe_chars.py -v diff --git a/tasks/format-code-task-001659/tests/test.sh b/tasks/format-code-task-001659/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..56a12ace748a6012dafdb95f0bb7f687010c6c88 --- /dev/null +++ b/tasks/format-code-task-001659/tests/test.sh @@ -0,0 +1,38 @@ +#!/bin/bash +# Code grading, mimoagent opensource_code.py: reset the files the hidden test patch touches, apply it, run the +# task's test command; reward 1 when it exits 0. A testbed failure (reset or apply) writes no reward: not scored. +M=/var/lib/mimo +CWD=/workspace/repo +V=/logs/verifier +mkdir -p "$V" +BASE=$(cat "$M/base" 2>/dev/null) || { echo "setup never ran (no $M/base)" >&2; exit 1; } +cd "$CWD" || exit 1 +if [ -d "$M/git-hidden" ]; then rm -rf "$CWD/.git"; mv "$M/git-hidden" "$CWD/.git"; fi +# the agent's change against the base, so its own commits count too +git add -A >/dev/null 2>&1 && git -c core.fileMode=false diff --cached "$BASE" > "$V/agent.diff" +git reset -q +if ! ( +while IFS= read -r tf; do + [ -z "$tf" ] && continue + if git cat-file -e $BASE:"$tf" 2>/dev/null; then + git checkout $BASE -- "$tf" 2>/dev/null || true + else + git rm -f --cached "$tf" >/dev/null 2>&1 || true + rm -f "$tf" + fi +done <<'EOF_RESET_TEST_FILES' +usercase-test-coderl/test_dedupe_chars.py +mimo_test_command.sh +EOF_RESET_TEST_FILES + +); then echo "could not reset the test files (testbed problem, not scored)" >&2; exit 1; fi +if ! git apply --verbose /tests/test.patch > "$V/apply.log" 2>&1; then + cat "$V/apply.log" >&2 + echo "the hidden tests could not be applied (testbed problem, not scored)" >&2 + exit 1 +fi +timeout 1800 sh -c "$(cat /tests/test_command.sh)" > "$V/test_output.log" 2>&1 +RC=$? +tail -c 12000 "$V/test_output.log" +if [ $RC -eq 0 ]; then echo 1 > "$V/reward.txt"; else echo 0 > "$V/reward.txt"; fi +echo "test command exited $RC" diff --git a/tasks/format-code-task-001659/tests/test_command.sh b/tasks/format-code-task-001659/tests/test_command.sh new file mode 100644 index 0000000000000000000000000000000000000000..88cb7810b836396c4869db31aeac7d4d4b189685 --- /dev/null +++ b/tasks/format-code-task-001659/tests/test_command.sh @@ -0,0 +1 @@ +bash /workspace/repo/mimo_test_command.sh \ No newline at end of file diff --git a/tasks/format-code-task-001661/environment/Dockerfile b/tasks/format-code-task-001661/environment/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..fdef54dc018882bf05cc9c8e3737ebee4579d965 --- /dev/null +++ b/tasks/format-code-task-001661/environment/Dockerfile @@ -0,0 +1,3 @@ +# The task's image, pinned by digest (the same as [environment].docker_image). +# Setup runs at start from [environment.healthcheck]; environment/setup/ is its readable copy. +FROM docker.io/xiaomimimo/mimo-v2.6-rl-oss@sha256:38280116603fd55e56437bcd7c089f3915a6df8a7ed335bb6935503ffb77f475 diff --git a/tasks/format-code-task-001661/environment/setup/files/blocklist b/tasks/format-code-task-001661/environment/setup/files/blocklist new file mode 100644 index 0000000000000000000000000000000000000000..a8e4bdc4c7d9b739c047a3cb58ea72a1bb05bcbc --- /dev/null +++ b/tasks/format-code-task-001661/environment/setup/files/blocklist @@ -0,0 +1,33 @@ +# mimo answer-leak blocklist (mimoagent) +0.0.0.0 github.com +0.0.0.0 www.github.com +0.0.0.0 api.github.com +0.0.0.0 raw.githubusercontent.com +0.0.0.0 codeload.github.com +0.0.0.0 objects.githubusercontent.com +0.0.0.0 gist.github.com +0.0.0.0 gist.githubusercontent.com +0.0.0.0 gitlab.com +0.0.0.0 bitbucket.org +0.0.0.0 sourceforge.net +0.0.0.0 git.kernel.org +0.0.0.0 chromium.googlesource.com +0.0.0.0 android.googlesource.com +0.0.0.0 sourcegraph.com +0.0.0.0 bugs.chromium.org +0.0.0.0 issues.oss-fuzz.com +0.0.0.0 oss-fuzz.com +0.0.0.0 osv.dev +0.0.0.0 api.osv.dev +0.0.0.0 bugzilla.mozilla.org +0.0.0.0 proxy.golang.org +0.0.0.0 sum.golang.org +0.0.0.0 pkg.go.dev +0.0.0.0 google.com +0.0.0.0 www.google.com +0.0.0.0 bing.com +0.0.0.0 www.bing.com +0.0.0.0 duckduckgo.com +0.0.0.0 html.duckduckgo.com +0.0.0.0 search.brave.com +0.0.0.0 stackoverflow.com diff --git a/tasks/format-code-task-001661/environment/setup/setup.sh b/tasks/format-code-task-001661/environment/setup/setup.sh new file mode 100644 index 0000000000000000000000000000000000000000..e9eb7daf39f9542bd095367feee457f3da77e492 --- /dev/null +++ b/tasks/format-code-task-001661/environment/setup/setup.sh @@ -0,0 +1,34 @@ +#!/bin/bash +# Runs once, as root, before the agent starts: Harbor's [environment.healthcheck] unpacks this folder into +# /var/lib/mimo and runs it. Generated by mimo_harbor; see its README for how each step maps to Xiaomi's harness. +M=/var/lib/mimo +[ -f "$M/ready" ] && exit 0 +chmod 700 "$M" +fail() { echo "setup: $*" >&2; exit 1; } +# the answer-leak blocklist (mimoagent), applied to /etc/hosts by the agent right after it installs +write_blocklist() { cp "$M/files/blocklist" "$M/blocklist"; } + +# Code: mimoagent environments/datasets/opensource_code.py + base.py, as the explorer runs it (app/runner/domains.py Code). +CWD=/workspace/repo +git config --global --add safe.directory "$CWD" +cd "$CWD" || fail "no working directory $CWD" +if ! git rev-parse --git-dir >/dev/null 2>&1; then # a bare source tree: give it a baseline commit + git init -q && git add -A && git -c user.name=mimo -c user.email=mimo@localhost commit -q -m baseline --allow-empty +fi +BASE=$(git rev-parse HEAD 2>/dev/null) +[ ${#BASE} -eq 40 ] || fail "could not resolve the base commit in $CWD" +echo "$BASE" > "$M/base" +# Images are built with history truncated at the base. If one is not, the fix could be read out of git log, +# so .git is hidden while the agent works and put back for grading. +LATER=$(git rev-list --all --not "$BASE" 2>/dev/null | head -n 5 | grep -c . || true) +rm -f /tmp/fail.log /tmp/pass.log /tmp/patch.diff /tmp/test_patch.diff /tmp/*.log 2>/dev/null; rm -rf /tmp/claude-0 /tmp/claude-* /tmp/testem-* /tmp/puppeteer_dev_chrome_profile-* 2>/dev/null; rm -f /tmp/test_files.json 2>/dev/null; rm -rf /tmp/jest_* /tmp/jest-* /tmp/build /tmp/build_env 2>/dev/null; rm -rf /tmp/pytest-of-root /tmp/pytest-* /tmp/.pytest_cache /tmp/__pycache__ 2>/dev/null; rm -rf /tmp/go-build* /tmp/standards /tmp/wordpress /tmp/zig-* /tmp/testbase /tmp/testbed 2>/dev/null; rm -f /tmp/tmp*.tmp /tmp/*.bak /tmp/expect* /tmp/butwas* 2>/dev/null; rm -rf /root/.cache/go-build 2>/dev/null; rm -rf /tests 2>/dev/null; find /logs -mindepth 1 -delete 2>/dev/null; mkdir -p /logs/agent /logs/verifier /logs/artifacts; chmod 777 /logs/agent /logs/verifier /logs/artifacts; find /var/log -type f -delete 2>/dev/null || true; rm -rf /var/lib/postgresql/*/*/log /var/lib/postgresql/*/*/pg_log 2>/dev/null || true; find /var/lib/mysql /var/lib/mongodb -type f -name '*.log' -delete 2>/dev/null || true; rm -rf /root/.npm/_logs /root/.babel.json /root/.pytest_cache 2>/dev/null || true; find / -maxdepth 4 -xdev -name task_description.md -path '*/.build_env/*' -delete 2>/dev/null || true; true +git clean -fdx --exclude=node_modules --exclude=bower_components --exclude=.husky --exclude=vendor --exclude=third_party --exclude=_deps --exclude=vcpkg_installed --exclude=.venv --exclude=venv --exclude=.gradle --exclude=target --exclude=.build --exclude=lib --exclude=.bundle --exclude=Manifest.toml --exclude=_build --exclude=.stack-work --exclude=dist-newstyle >/dev/null 2>&1 +find /root/.m2 -type f \( -name '*-SNAPSHOT.jar' -o -name '*-SNAPSHOT-sources.jar' -o -name '*-SNAPSHOT-tests.jar' -o -name '*-SNAPSHOT-test-sources.jar' \) -delete 2>/dev/null; rm -rf /root/.julia/compiled 2>/dev/null; rm -rf /root/.gradle/caches/build-cache-* /root/.gradle/daemon 2>/dev/null; rm -rf /root/.gradle/caches/*/scripts /root/.gradle/caches/jars-* 2>/dev/null; rm -rf /root/.cache/bazel 2>/dev/null; true +if [ "$LATER" -gt 0 ]; then + mv "$CWD/.git" "$M/git-hidden" + echo "history not truncated at ${BASE:0:12}: .git hidden while the agent works" +fi +write_blocklist + +touch "$M/ready" +echo "setup done" diff --git a/tasks/format-code-task-001661/tests/test.patch b/tasks/format-code-task-001661/tests/test.patch new file mode 100644 index 0000000000000000000000000000000000000000..2cc9e74c5861af980bd56b477939433f38cc2436 --- /dev/null +++ b/tasks/format-code-task-001661/tests/test.patch @@ -0,0 +1,286 @@ +diff --git a/usercase-test-coderl/test_bidirectional_friendship.py b/usercase-test-coderl/test_bidirectional_friendship.py +new file mode 100644 +--- /dev/null ++++ b/usercase-test-coderl/test_bidirectional_friendship.py +@@ -0,0 +1,257 @@ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++import pytest ++ ++from django.conf import settings ++ ++ ++if not settings.configured: ++ settings.configure( ++ SECRET_KEY="fixture-friendship", ++ INSTALLED_APPS=[ ++ "django.contrib.auth", ++ "django.contrib.contenttypes", ++ "django.contrib.sites", ++ "friends", ++ ], ++ DATABASES={"default": {"ENGINE": "django.db.backends.sqlite3", "NAME": ":memory:"}}, ++ USE_TZ=True, ++ DEFAULT_AUTO_FIELD="django.db.models.AutoField", ++ SITE_ID=1, ++ SITE_NAME="Example", ++ CONTACT_EMAIL="contact@example.test", ++ DEFAULT_FROM_EMAIL="noreply@example.test", ++ ) ++ ++import django ++ ++django.setup() ++ ++from django.apps import apps ++from django.contrib.auth.models import User ++from django.db import connection ++from django.db.models.query import QuerySet ++ ++from friends.models import Friendship, FriendshipInvitation, FriendshipInvitationHistory, friend_set_for ++ ++ ++_original_select_related = QuerySet.select_related ++ ++ ++def _select_related_compat(self, *fields, **kwargs): ++ kwargs.pop("depth", None) ++ return _original_select_related(self, *fields, **kwargs) ++ ++ ++QuerySet.select_related = _select_related_compat ++ ++ ++with connection.schema_editor() as schema_editor: ++ for model in apps.get_models(): ++ schema_editor.create_model(model) ++ ++ ++@pytest.fixture(autouse=True) ++def clean_database(): ++ Friendship.objects.all().delete() ++ FriendshipInvitation.objects.all().delete() ++ FriendshipInvitationHistory.objects.all().delete() ++ User.objects.all().delete() ++ yield ++ Friendship.objects.all().delete() ++ FriendshipInvitation.objects.all().delete() ++ FriendshipInvitationHistory.objects.all().delete() ++ User.objects.all().delete() ++ ++ ++def make_user(pk, username): ++ return User.objects.create(id=pk, username=username) ++ ++ ++def friend_rows_for(user): ++ return [ ++ ( ++ item["friend"].id, ++ item["friend"].username, ++ item["friendship"].id, ++ item["friendship"].from_user.username, ++ item["friendship"].to_user.username, ++ ) ++ for item in Friendship.objects.friends_for_user(user) ++ ] ++ ++ ++def test_friends_for_user_returns_the_other_user_from_either_storage_direction(): ++ ++ ++ ++ ++ alice = make_user(101, "alice") ++ bob = make_user(102, "bob") ++ carol = make_user(103, "carol") ++ Friendship.objects.create(id=201, from_user=alice, to_user=bob) ++ ++ assert friend_rows_for(alice) == [(102, "bob", 201, "alice", "bob")] ++ assert friend_rows_for(bob) == [(101, "alice", 201, "alice", "bob")] ++ assert friend_rows_for(carol) == [] ++ ++ ++def test_are_friends_answers_true_both_ways_and_false_for_absent_pairs(): ++ ++ ++ ++ ++ alice = make_user(111, "alice") ++ bob = make_user(112, "bob") ++ carol = make_user(113, "carol") ++ Friendship.objects.create(id=211, from_user=alice, to_user=bob) ++ ++ assert Friendship.objects.are_friends(alice, bob) is True ++ assert Friendship.objects.are_friends(bob, alice) is True ++ assert Friendship.objects.are_friends(alice, carol) is False ++ assert Friendship.objects.are_friends(carol, alice) is False ++ ++ ++def test_remove_forward_order_deletes_the_matching_friendship_row(): ++ ++ ++ ++ ++ alice = make_user(121, "alice") ++ bob = make_user(122, "bob") ++ Friendship.objects.create(id=221, from_user=alice, to_user=bob) ++ ++ assert Friendship.objects.count() == 1 ++ Friendship.objects.remove(alice, bob) ++ ++ assert Friendship.objects.count() == 0 ++ assert Friendship.objects.are_friends(alice, bob) is False ++ assert Friendship.objects.are_friends(bob, alice) is False ++ ++ ++def test_remove_reverse_order_deletes_row_and_marks_same_direction_invitation_deleted(): ++ ++ ++ ++ ++ alice = make_user(131, "alice") ++ bob = make_user(132, "bob") ++ Friendship.objects.create(id=231, from_user=alice, to_user=bob) ++ same_invitation = FriendshipInvitation.objects.create(id=331, from_user=alice, to_user=bob, message="same direction", status="2") ++ reverse_invitation = FriendshipInvitation.objects.create(id=332, from_user=bob, to_user=alice, message="reverse direction", status="2") ++ ++ ++ assert (same_invitation.status, reverse_invitation.status) == ("2", "2") ++ Friendship.objects.remove(bob, alice) ++ ++ assert Friendship.objects.count() == 0 ++ same_invitation.refresh_from_db() ++ reverse_invitation.refresh_from_db() ++ ++ assert (same_invitation.status, reverse_invitation.status) == ("8", "2") ++ ++ ++def test_friend_set_for_returns_the_bidirectional_user_set(): ++ ++ ++ ++ ++ alice = make_user(141, "alice") ++ bob = make_user(142, "bob") ++ carol = make_user(143, "carol") ++ Friendship.objects.create(id=241, from_user=alice, to_user=bob) ++ ++ assert sorted((user.id, user.username) for user in friend_set_for(alice)) == [(142, "bob")] ++ assert sorted((user.id, user.username) for user in friend_set_for(bob)) == [(141, "alice")] ++ assert sorted((user.id, user.username) for user in friend_set_for(carol)) == [] ++ ++ ++def test_remove_without_a_matching_row_does_not_create_or_delete_friendships(): ++ ++ ++ ++ ++ alice = make_user(151, "alice") ++ bob = make_user(152, "bob") ++ ++ try: ++ Friendship.objects.remove(alice, bob) ++ except Exception: ++ pass ++ ++ assert Friendship.objects.count() == 0 ++ ++ ++def test_cleanup_leaves_already_deleted_invitation_status_at_8_on_repeated_cleanup_paths(): ++ ++ ++ ++ ++ alice = make_user(161, "alice") ++ bob = make_user(162, "bob") ++ invitation = FriendshipInvitation.objects.create(id=361, from_user=alice, to_user=bob, message="already deleted", status="8") ++ ++ first = Friendship.objects.create(id=261, from_user=alice, to_user=bob) ++ first.delete() ++ assert Friendship.objects.count() == 0 ++ invitation.refresh_from_db() ++ ++ assert invitation.status == "8" ++ ++ second = Friendship.objects.create(id=262, from_user=alice, to_user=bob) ++ second.delete() ++ assert Friendship.objects.count() == 0 ++ invitation.refresh_from_db() ++ ++ assert invitation.status == "8" ++ ++ ++def test_two_friendship_pairs_keep_independent_state_after_one_pair_is_removed(): ++ ++ ++ ++ ++ alice = make_user(171, "alice") ++ bob = make_user(172, "bob") ++ carol = make_user(173, "carol") ++ dana = make_user(174, "dana") ++ Friendship.objects.create(id=271, from_user=alice, to_user=bob) ++ Friendship.objects.create(id=272, from_user=carol, to_user=dana) ++ ++ assert friend_rows_for(alice) == [(172, "bob", 271, "alice", "bob")] ++ assert friend_rows_for(carol) == [(174, "dana", 272, "carol", "dana")] ++ ++ Friendship.objects.remove(alice, bob) ++ ++ assert friend_rows_for(alice) == [] ++ assert friend_rows_for(bob) == [] ++ assert friend_rows_for(carol) == [(174, "dana", 272, "carol", "dana")] ++ assert friend_rows_for(dana) == [(173, "carol", 272, "carol", "dana")] ++ assert Friendship.objects.count() == 1 ++ ++ ++def test_friendship_row_count_stays_bounded_across_many_remove_cycles(): ++ ++ ++ ++ ++ for offset in range(120): ++ left = make_user(1000 + offset * 2, "left-%03d" % offset) ++ right = make_user(1001 + offset * 2, "right-%03d" % offset) ++ Friendship.objects.create(from_user=left, to_user=right) ++ assert Friendship.objects.are_friends(right, left) is True ++ Friendship.objects.remove(right, left) ++ ++ assert Friendship.objects.count() == 0 +diff --git a/mimo_test_command.sh b/mimo_test_command.sh +new file mode 100755 +--- /dev/null ++++ b/mimo_test_command.sh +@@ -0,0 +1,19 @@ ++#!/usr/bin/env bash ++ ++ ++ ++ ++export NODE_OPTIONS="${NODE_OPTIONS:-} --max-old-space-size=4096" ++export MAVEN_OPTS="${MAVEN_OPTS:-} -Xmx3g -XX:+UseG1GC" ++export GRADLE_OPTS="${GRADLE_OPTS:-} -Xmx3g -XX:+UseG1GC" ++export TEST_JVM_OPTS="${TEST_JVM_OPTS:-} -Xmx3g" ++set -e ++cd /workspace/repo ++set -euo pipefail ++ ++cd /workspace/repo ++ ++export PYTHONPATH="/workspace/repo${PYTHONPATH:+:${PYTHONPATH}}" ++export PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 ++ ++exec /usr/local/bin/python -m pytest /workspace/repo/usercase-test-coderl/test_bidirectional_friendship.py -v diff --git a/tasks/format-code-task-001661/tests/test.sh b/tasks/format-code-task-001661/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..db03b48de13b3a9c14b5afe2056a31cba17bc353 --- /dev/null +++ b/tasks/format-code-task-001661/tests/test.sh @@ -0,0 +1,38 @@ +#!/bin/bash +# Code grading, mimoagent opensource_code.py: reset the files the hidden test patch touches, apply it, run the +# task's test command; reward 1 when it exits 0. A testbed failure (reset or apply) writes no reward: not scored. +M=/var/lib/mimo +CWD=/workspace/repo +V=/logs/verifier +mkdir -p "$V" +BASE=$(cat "$M/base" 2>/dev/null) || { echo "setup never ran (no $M/base)" >&2; exit 1; } +cd "$CWD" || exit 1 +if [ -d "$M/git-hidden" ]; then rm -rf "$CWD/.git"; mv "$M/git-hidden" "$CWD/.git"; fi +# the agent's change against the base, so its own commits count too +git add -A >/dev/null 2>&1 && git -c core.fileMode=false diff --cached "$BASE" > "$V/agent.diff" +git reset -q +if ! ( +while IFS= read -r tf; do + [ -z "$tf" ] && continue + if git cat-file -e $BASE:"$tf" 2>/dev/null; then + git checkout $BASE -- "$tf" 2>/dev/null || true + else + git rm -f --cached "$tf" >/dev/null 2>&1 || true + rm -f "$tf" + fi +done <<'EOF_RESET_TEST_FILES' +usercase-test-coderl/test_bidirectional_friendship.py +mimo_test_command.sh +EOF_RESET_TEST_FILES + +); then echo "could not reset the test files (testbed problem, not scored)" >&2; exit 1; fi +if ! git apply --verbose /tests/test.patch > "$V/apply.log" 2>&1; then + cat "$V/apply.log" >&2 + echo "the hidden tests could not be applied (testbed problem, not scored)" >&2 + exit 1 +fi +timeout 1800 sh -c "$(cat /tests/test_command.sh)" > "$V/test_output.log" 2>&1 +RC=$? +tail -c 12000 "$V/test_output.log" +if [ $RC -eq 0 ]; then echo 1 > "$V/reward.txt"; else echo 0 > "$V/reward.txt"; fi +echo "test command exited $RC" diff --git a/tasks/format-code-task-001661/tests/test_command.sh b/tasks/format-code-task-001661/tests/test_command.sh new file mode 100644 index 0000000000000000000000000000000000000000..88cb7810b836396c4869db31aeac7d4d4b189685 --- /dev/null +++ b/tasks/format-code-task-001661/tests/test_command.sh @@ -0,0 +1 @@ +bash /workspace/repo/mimo_test_command.sh \ No newline at end of file diff --git a/tasks/format-code-task-001666/environment/Dockerfile b/tasks/format-code-task-001666/environment/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..850864bac65882bb3fcc66963e8c97418f24fff3 --- /dev/null +++ b/tasks/format-code-task-001666/environment/Dockerfile @@ -0,0 +1,3 @@ +# The task's image, pinned by digest (the same as [environment].docker_image). +# Setup runs at start from [environment.healthcheck]; environment/setup/ is its readable copy. +FROM docker.io/xiaomimimo/mimo-v2.6-rl-oss@sha256:2844d12740848781b8638332ed7b506dadb235d73c772c5a7c1302de839ab87b diff --git a/tasks/format-code-task-001666/environment/setup/files/blocklist b/tasks/format-code-task-001666/environment/setup/files/blocklist new file mode 100644 index 0000000000000000000000000000000000000000..a8e4bdc4c7d9b739c047a3cb58ea72a1bb05bcbc --- /dev/null +++ b/tasks/format-code-task-001666/environment/setup/files/blocklist @@ -0,0 +1,33 @@ +# mimo answer-leak blocklist (mimoagent) +0.0.0.0 github.com +0.0.0.0 www.github.com +0.0.0.0 api.github.com +0.0.0.0 raw.githubusercontent.com +0.0.0.0 codeload.github.com +0.0.0.0 objects.githubusercontent.com +0.0.0.0 gist.github.com +0.0.0.0 gist.githubusercontent.com +0.0.0.0 gitlab.com +0.0.0.0 bitbucket.org +0.0.0.0 sourceforge.net +0.0.0.0 git.kernel.org +0.0.0.0 chromium.googlesource.com +0.0.0.0 android.googlesource.com +0.0.0.0 sourcegraph.com +0.0.0.0 bugs.chromium.org +0.0.0.0 issues.oss-fuzz.com +0.0.0.0 oss-fuzz.com +0.0.0.0 osv.dev +0.0.0.0 api.osv.dev +0.0.0.0 bugzilla.mozilla.org +0.0.0.0 proxy.golang.org +0.0.0.0 sum.golang.org +0.0.0.0 pkg.go.dev +0.0.0.0 google.com +0.0.0.0 www.google.com +0.0.0.0 bing.com +0.0.0.0 www.bing.com +0.0.0.0 duckduckgo.com +0.0.0.0 html.duckduckgo.com +0.0.0.0 search.brave.com +0.0.0.0 stackoverflow.com diff --git a/tasks/format-code-task-001666/environment/setup/setup.sh b/tasks/format-code-task-001666/environment/setup/setup.sh new file mode 100644 index 0000000000000000000000000000000000000000..d883db90cfcfb48f7a139861bbe9f6b5d95cad6f --- /dev/null +++ b/tasks/format-code-task-001666/environment/setup/setup.sh @@ -0,0 +1,34 @@ +#!/bin/bash +# Runs once, as root, before the agent starts: Harbor's [environment.healthcheck] unpacks this folder into +# /var/lib/mimo and runs it. Generated by mimo_harbor; see its README for how each step maps to Xiaomi's harness. +M=/var/lib/mimo +[ -f "$M/ready" ] && exit 0 +chmod 700 "$M" +fail() { echo "setup: $*" >&2; exit 1; } +# the answer-leak blocklist (mimoagent), applied to /etc/hosts by the agent right after it installs +write_blocklist() { cp "$M/files/blocklist" "$M/blocklist"; } + +# Code: mimoagent environments/datasets/opensource_code.py + base.py, as the explorer runs it (app/runner/domains.py Code). +CWD=/testbed +git config --global --add safe.directory "$CWD" +cd "$CWD" || fail "no working directory $CWD" +if ! git rev-parse --git-dir >/dev/null 2>&1; then # a bare source tree: give it a baseline commit + git init -q && git add -A && git -c user.name=mimo -c user.email=mimo@localhost commit -q -m baseline --allow-empty +fi +BASE=$(git rev-parse HEAD 2>/dev/null) +[ ${#BASE} -eq 40 ] || fail "could not resolve the base commit in $CWD" +echo "$BASE" > "$M/base" +# Images are built with history truncated at the base. If one is not, the fix could be read out of git log, +# so .git is hidden while the agent works and put back for grading. +LATER=$(git rev-list --all --not "$BASE" 2>/dev/null | head -n 5 | grep -c . || true) +rm -f /tmp/fail.log /tmp/pass.log /tmp/patch.diff /tmp/test_patch.diff /tmp/*.log 2>/dev/null; rm -rf /tmp/claude-0 /tmp/claude-* /tmp/testem-* /tmp/puppeteer_dev_chrome_profile-* 2>/dev/null; rm -f /tmp/test_files.json 2>/dev/null; rm -rf /tmp/jest_* /tmp/jest-* /tmp/build /tmp/build_env 2>/dev/null; rm -rf /tmp/pytest-of-root /tmp/pytest-* /tmp/.pytest_cache /tmp/__pycache__ 2>/dev/null; rm -rf /tmp/go-build* /tmp/standards /tmp/wordpress /tmp/zig-* /tmp/testbase /tmp/testbed 2>/dev/null; rm -f /tmp/tmp*.tmp /tmp/*.bak /tmp/expect* /tmp/butwas* 2>/dev/null; rm -rf /root/.cache/go-build 2>/dev/null; rm -rf /tests 2>/dev/null; find /logs -mindepth 1 -delete 2>/dev/null; mkdir -p /logs/agent /logs/verifier /logs/artifacts; chmod 777 /logs/agent /logs/verifier /logs/artifacts; find /var/log -type f -delete 2>/dev/null || true; rm -rf /var/lib/postgresql/*/*/log /var/lib/postgresql/*/*/pg_log 2>/dev/null || true; find /var/lib/mysql /var/lib/mongodb -type f -name '*.log' -delete 2>/dev/null || true; rm -rf /root/.npm/_logs /root/.babel.json /root/.pytest_cache 2>/dev/null || true; find / -maxdepth 4 -xdev -name task_description.md -path '*/.build_env/*' -delete 2>/dev/null || true; true +git clean -fdx --exclude=node_modules --exclude=bower_components --exclude=.husky --exclude=vendor --exclude=third_party --exclude=_deps --exclude=vcpkg_installed --exclude=.venv --exclude=venv --exclude=.gradle --exclude=target --exclude=.build --exclude=lib --exclude=.bundle --exclude=Manifest.toml --exclude=_build --exclude=.stack-work --exclude=dist-newstyle >/dev/null 2>&1 +find /root/.m2 -type f \( -name '*-SNAPSHOT.jar' -o -name '*-SNAPSHOT-sources.jar' -o -name '*-SNAPSHOT-tests.jar' -o -name '*-SNAPSHOT-test-sources.jar' \) -delete 2>/dev/null; rm -rf /root/.julia/compiled 2>/dev/null; rm -rf /root/.gradle/caches/build-cache-* /root/.gradle/daemon 2>/dev/null; rm -rf /root/.gradle/caches/*/scripts /root/.gradle/caches/jars-* 2>/dev/null; rm -rf /root/.cache/bazel 2>/dev/null; true +if [ "$LATER" -gt 0 ]; then + mv "$CWD/.git" "$M/git-hidden" + echo "history not truncated at ${BASE:0:12}: .git hidden while the agent works" +fi +write_blocklist + +touch "$M/ready" +echo "setup done" diff --git a/tasks/format-code-task-001666/tests/test.patch b/tasks/format-code-task-001666/tests/test.patch new file mode 100644 index 0000000000000000000000000000000000000000..3fa72523a89dfec81bab9c35e77c04bdc908e1c5 --- /dev/null +++ b/tasks/format-code-task-001666/tests/test.patch @@ -0,0 +1,50 @@ +diff --git a/tests/SigSeg.js b/tests/SigSeg.js +new file mode 100644 +index 00000000..57fcb3de +--- /dev/null ++++ b/tests/SigSeg.js +@@ -0,0 +1,12 @@ ++var muhammara = require("../muhammara"); ++const { expect } = require("chai"); ++ ++describe("SigSegv test", function () { ++ it("should read fields correctly", function () { ++ expect(() => ++ muhammara.createReader( ++ __dirname + "/TestMaterials/BrokenPdfBadHeader.txt" ++ ) ++ ).to.throw(); ++ }); ++}); +diff --git a/tests/TestMaterials/BrokenPdfBadHeader.txt b/tests/TestMaterials/BrokenPdfBadHeader.txt +new file mode 100644 +index 00000000..fd0b6cec +--- /dev/null ++++ b/tests/TestMaterials/BrokenPdfBadHeader.txt +@@ -0,0 +1,2 @@ ++%PDF-1.4 ++%%EOF +\ No newline at end of file +diff --git a/mimo_build_env.tar.gz.b64 b/mimo_build_env.tar.gz.b64 +new file mode 100644 +--- /dev/null ++++ b/mimo_build_env.tar.gz.b64 +@@ -0,0 +1,7 @@ ++H4sIAAAAAAAAA+3SzU6DQBAHcM48xZgm3vhYWujNu9f2ARpgR1gDu4Rd0Md3S402JtqY1Bjj/3dZ ++2K8ZmImrSXXywHpOgp+Sets8X0bv47g8izwTIt+ui40IUiGKtAgo/7GMzkzWlSNRMBrjvtp3af2P ++it/r79i6Q236vtQytu31Ylyq/yYTb/XPlvpvCrEOKL1eCp/75/Vf3SSV0klV2jasJS1NULEMwxXt ++n5SrW3KGfFMMpVNVx/7NdHVbKk0zj1YZbUPJc2RPe7WRTFl2PtXUNYn18b577X9115HkgbVkXSu2 ++5HuNlhYk7SPMTL2Rk4/zMJqerJnGmkM99KReD0fRsjs6rkendcrubsUxwG7S5FqfYzk27Oj4Kf7s ++s7/SZ0zRzi8My6xN9qrZcxM/Wn+hUz2byZHIfS+Gv10QAAAAAAAAAAAAAAAAAAAAAIBveAG4hUze ++ACgAAA== +diff --git a/mimo_test_command.sh b/mimo_test_command.sh +new file mode 100755 +--- /dev/null ++++ b/mimo_test_command.sh +@@ -0,0 +1,6 @@ ++#!/usr/bin/env bash ++ ++set -uo pipefail ++cd /testbed || exit 1 ++base64 -d mimo_build_env.tar.gz.b64 | tar -xzf - -C /testbed || exit 1 ++exec bash -lc 'cd /testbed && bash -eo pipefail /testbed/.build_env/test_command.sh' diff --git a/tasks/format-code-task-001666/tests/test.sh b/tasks/format-code-task-001666/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..5d82f47e42455e6b6a42826f059684082d4d691e --- /dev/null +++ b/tasks/format-code-task-001666/tests/test.sh @@ -0,0 +1,40 @@ +#!/bin/bash +# Code grading, mimoagent opensource_code.py: reset the files the hidden test patch touches, apply it, run the +# task's test command; reward 1 when it exits 0. A testbed failure (reset or apply) writes no reward: not scored. +M=/var/lib/mimo +CWD=/testbed +V=/logs/verifier +mkdir -p "$V" +BASE=$(cat "$M/base" 2>/dev/null) || { echo "setup never ran (no $M/base)" >&2; exit 1; } +cd "$CWD" || exit 1 +if [ -d "$M/git-hidden" ]; then rm -rf "$CWD/.git"; mv "$M/git-hidden" "$CWD/.git"; fi +# the agent's change against the base, so its own commits count too +git add -A >/dev/null 2>&1 && git -c core.fileMode=false diff --cached "$BASE" > "$V/agent.diff" +git reset -q +if ! ( +while IFS= read -r tf; do + [ -z "$tf" ] && continue + if git cat-file -e $BASE:"$tf" 2>/dev/null; then + git checkout $BASE -- "$tf" 2>/dev/null || true + else + git rm -f --cached "$tf" >/dev/null 2>&1 || true + rm -f "$tf" + fi +done <<'EOF_RESET_TEST_FILES' +tests/SigSeg.js +tests/TestMaterials/BrokenPdfBadHeader.txt +mimo_build_env.tar.gz.b64 +mimo_test_command.sh +EOF_RESET_TEST_FILES + +); then echo "could not reset the test files (testbed problem, not scored)" >&2; exit 1; fi +if ! git apply --verbose /tests/test.patch > "$V/apply.log" 2>&1; then + cat "$V/apply.log" >&2 + echo "the hidden tests could not be applied (testbed problem, not scored)" >&2 + exit 1 +fi +timeout 1800 sh -c "$(cat /tests/test_command.sh)" > "$V/test_output.log" 2>&1 +RC=$? +tail -c 12000 "$V/test_output.log" +if [ $RC -eq 0 ]; then echo 1 > "$V/reward.txt"; else echo 0 > "$V/reward.txt"; fi +echo "test command exited $RC" diff --git a/tasks/format-code-task-001666/tests/test_command.sh b/tasks/format-code-task-001666/tests/test_command.sh new file mode 100644 index 0000000000000000000000000000000000000000..7cb23076694ad17d72e8296d62b2b240083e36db --- /dev/null +++ b/tasks/format-code-task-001666/tests/test_command.sh @@ -0,0 +1 @@ +bash /testbed/mimo_test_command.sh \ No newline at end of file diff --git a/tasks/format-code-task-001675/tests/test.patch b/tasks/format-code-task-001675/tests/test.patch new file mode 100644 index 0000000000000000000000000000000000000000..0c91d1b465563484c5a1a33424eb4d56c839503f --- /dev/null +++ b/tasks/format-code-task-001675/tests/test.patch @@ -0,0 +1,585 @@ +diff --git a/usercase-test-coderl/gist_browsing.test.js b/usercase-test-coderl/gist_browsing.test.js +new file mode 100644 +--- /dev/null ++++ b/usercase-test-coderl/gist_browsing.test.js +@@ -0,0 +1,495 @@ ++ ++ ++ ++ ++ ++ ++ ++ ++const test = require("node:test"); ++const assert = require("node:assert/strict"); ++ ++const GH3_PATH = "/workspace/repo/gh3.js"; ++ ++ ++ ++function endpointFrom(params) { ++ if (typeof params.url === "string" && params.url.length > 0) { ++ try { ++ return new URL(params.url, "https://api.github.com").pathname.replace(/^\/+/, ""); ++ } catch (_) { ++ return params.url.split("?")[0].replace(/^\/+/, ""); ++ } ++ } ++ if (typeof params.service === "string") { ++ return params.service.replace(/^\/+/, ""); ++ } ++ return undefined; ++} ++ ++function queryFrom(params) { ++ const query = {}; ++ if (typeof params.url === "string") { ++ try { ++ const url = new URL(params.url, "https://api.github.com"); ++ for (const [key, value] of url.searchParams) { ++ query[key] = value; ++ } ++ } catch (_) {} ++ } ++ if (params.data && typeof params.data === "object") { ++ Object.assign(query, params.data); ++ } ++ return query; ++} ++ ++function assertRequest(request, endpoint, expectedQuery) { ++ assert.equal(request.endpoint, endpoint); ++ if (expectedQuery) { ++ for (const [key, value] of Object.entries(expectedQuery)) { ++ assert.equal(String(request.query[key]), String(value)); ++ } ++ } ++} ++ ++function installGh3(handler) { ++ const requests = []; ++ ++ global.window = { XDomainRequest: null }; ++ global.$ = { ++ support: { cors: true }, ++ ajaxSetup: {}, ++ isFunction(fn) { ++ return typeof fn === "function"; ++ }, ++ ajax(params) { ++ const request = { ++ endpoint: endpointFrom(params), ++ query: queryFrom(params), ++ service: params.service, ++ url: params.url ++ }; ++ if (Object.prototype.hasOwnProperty.call(params, "data")) { ++ request.data = params.data; ++ } ++ requests.push(request); ++ ++ const response = handler(request, requests.length); ++ if (response && response.error) { ++ params.error(response.error); ++ } else { ++ params.success(response ? response.body : undefined); ++ } ++ } ++ }; ++ ++ global._ = { ++ each(value, callback) { ++ if (value == null) return; ++ if (Array.isArray(value)) { ++ value.forEach(callback); ++ return; ++ } ++ Object.keys(value).forEach((key) => callback(value[key], key)); ++ }, ++ find(value, comparator) { ++ if (value == null) return undefined; ++ for (const item of value) { ++ if (comparator(item)) return item; ++ } ++ return undefined; ++ }, ++ filter(value, comparator) { ++ const matches = []; ++ if (value == null) return matches; ++ for (const item of value) { ++ if (comparator(item)) matches.push(item); ++ } ++ return matches; ++ } ++ }; ++ ++ delete require.cache[require.resolve(GH3_PATH)]; ++ return { Gh3: require(GH3_PATH), requests }; ++} ++ ++test("Gh3.Gists fetch appends pages and exposes the accumulated list", () => { ++ ++ ++ let fetchCall = 0; ++ const { Gh3, requests } = installGh3((request) => { ++ ++ assert.equal(request.endpoint, "users/octo/gists"); ++ fetchCall += 1; ++ return { ++ body: fetchCall === 1 ++ ? [{ id: "g-1", description: "first page", comments: 1 }] ++ : [ ++ { id: "g-2", description: "second page", comments: 0 }, ++ { id: "g-3", description: "second more", comments: 2 } ++ ] ++ }; ++ }); ++ ++ const gists = new Gh3.Gists(new Gh3.User("octo")); ++ assert.deepStrictEqual(gists.getGists().map((gist) => gist.id), []); ++ ++ let firstCallback = { err: "not-called", sameInstance: false }; ++ gists.fetch({ page: 1, per_page: 1 }, null, (err, result) => { ++ firstCallback = { err, sameInstance: result === gists }; ++ }); ++ ++ assertRequest(requests[0], "users/octo/gists", { page: 1, per_page: 1 }); ++ assert.equal(firstCallback.err, null); ++ assert.equal(firstCallback.sameInstance, true); ++ assert.deepStrictEqual(gists.getGists().map((gist) => gist.id), ["g-1"]); ++ assert.deepStrictEqual(gists.getGists().map((gist) => gist.description), ["first page"]); ++ assert.deepStrictEqual(gists.getGists().map((gist) => gist.constructor === Gh3.Gist), [true]); ++ ++ let secondCallback = { err: "not-called", sameInstance: false }; ++ gists.fetch({ page: 2, per_page: 2 }, "next", (err, result) => { ++ secondCallback = { err, sameInstance: result === gists }; ++ }); ++ ++ assertRequest(requests[1], "users/octo/gists", { page: 2, per_page: 2 }); ++ assert.equal(secondCallback.err, null); ++ assert.equal(secondCallback.sameInstance, true); ++ assert.deepStrictEqual(gists.getGists().map((gist) => gist.id), ["g-1", "g-2", "g-3"]); ++ ++ const eachDescriptions = []; ++ gists.eachGist((gist) => eachDescriptions.push(gist.description)); ++ assert.deepStrictEqual(eachDescriptions, ["first page", "second page", "second more"]); ++ assert.deepStrictEqual(gists.filter((gist) => gist.comments > 0).map((gist) => gist.id), ["g-1", "g-3"]); ++}); ++ ++test("Gh3.Gists fetch reports GitHub API errors as Error(message) with raw response", () => { ++ ++ ++ const { Gh3, requests } = installGh3(() => ({ ++ error: { responseJSON: { message: "No gists for ghost" }, status: 404 } ++ })); ++ ++ const gists = new Gh3.Gists(new Gh3.User("ghost")); ++ let callback = { errName: "not-called", message: "", status: 0, sameResponse: false }; ++ gists.fetch({ page: 9 }, "next", (err, response) => { ++ callback = { ++ errName: err.constructor.name, ++ message: err.message, ++ status: response.status, ++ sameResponse: response.responseJSON.message === "No gists for ghost" ++ }; ++ }); ++ ++ ++ assertRequest(requests[0], "users/ghost/gists", { page: 9 }); ++ assert.deepStrictEqual(callback, { ++ errName: "Error", ++ message: "No gists for ghost", ++ status: 404, ++ sameResponse: true ++ }); ++ assert.deepStrictEqual(gists.getGists().map((gist) => gist.id), []); ++}); ++ ++test("Gh3.Gist fetchContents resets files, copies metadata, and exposes file helpers", () => { ++ ++ ++ let contentCall = 0; ++ const { Gh3, requests } = installGh3((request) => { ++ ++ assert.equal(request.endpoint, "gists/detail-1"); ++ contentCall += 1; ++ return { ++ body: contentCall === 1 ++ ? { ++ id: "detail-1", ++ revision: "first", ++ description: "first content", ++ files: { ++ "old.js": { filename: "old.js", language: "JavaScript", type: "application/javascript", size: 3, content: "old" } ++ } ++ } ++ : { ++ id: "detail-1", ++ revision: "second", ++ description: "second content", ++ public: true, ++ owner: { login: "octo" }, ++ files: { ++ "new.js": { filename: "new.js", language: "JavaScript", type: "application/javascript", size: 4, content: "new" }, ++ "note.txt": { filename: "note.txt", language: "Text", type: "text/plain", size: 5, content: "note" } ++ } ++ } ++ }; ++ }); ++ ++ const gist = new Gh3.Gist({ ++ id: "detail-1", ++ description: "seed", ++ files: [{ filename: "stale.txt" }], ++ comments: [{ id: 99 }] ++ }); ++ assert.deepStrictEqual({ ++ id: gist.id, ++ description: gist.description, ++ files: gist.files.map((file) => file.filename), ++ comments: gist.comments.map((comment) => comment.id) ++ }, { ++ id: "detail-1", ++ description: "seed", ++ files: ["stale.txt"], ++ comments: [99] ++ }); ++ ++ let firstCallback = { err: "not-called", sameInstance: false }; ++ gist.fetchContents((err, result) => { ++ firstCallback = { err, sameInstance: result === gist }; ++ }); ++ ++ assertRequest(requests[0], "gists/detail-1"); ++ assert.equal(firstCallback.err, null); ++ assert.equal(firstCallback.sameInstance, true); ++ assert.deepStrictEqual({ ++ revision: gist.revision, ++ description: gist.description, ++ files: gist.getFiles().map((file) => file.filename) ++ }, { ++ revision: "first", ++ description: "first content", ++ files: ["old.js"] ++ }); ++ ++ let secondCallback = { err: "not-called", sameInstance: false }; ++ gist.fetchContents((err, result) => { ++ secondCallback = { err, sameInstance: result === gist }; ++ }); ++ assert.equal(secondCallback.err, null); ++ assert.equal(secondCallback.sameInstance, true); ++ const secondFileNames = gist.getFiles().map((file) => file.filename); ++ assert.deepStrictEqual({ ++ revision: gist.revision, ++ description: gist.description, ++ public: gist.public, ++ owner: gist.owner ++ }, { ++ revision: "second", ++ description: "second content", ++ public: true, ++ owner: { login: "octo" } ++ }); ++ ++ assert.deepStrictEqual(new Set(secondFileNames), new Set(["new.js", "note.txt"])); ++ assert.deepStrictEqual(gist.getFileByName("new.js"), { ++ filename: "new.js", ++ language: "JavaScript", ++ type: "application/javascript", ++ size: 4, ++ content: "new" ++ }); ++ ++ const eachFiles = []; ++ gist.eachFile((file) => eachFiles.push(`${file.filename}:${file.size}`)); ++ ++ assert.deepStrictEqual(new Set(eachFiles), new Set(["new.js:4", "note.txt:5"])); ++}); ++ ++test("Gh3.Gist fetchContents reports content API errors as Error(message)", () => { ++ ++ ++ const { Gh3, requests } = installGh3(() => ({ ++ error: { responseJSON: { message: "Gist content missing" }, status: 410 } ++ })); ++ ++ const gist = new Gh3.Gist({ id: "missing-content" }); ++ let callback = { errName: "not-called", message: "", status: 0, rawMessage: "" }; ++ gist.fetchContents((err, response) => { ++ callback = { ++ errName: err.constructor.name, ++ message: err.message, ++ status: response.status, ++ rawMessage: response.responseJSON.message ++ }; ++ }); ++ ++ ++ assertRequest(requests[0], "gists/missing-content"); ++ assert.deepStrictEqual(callback, { ++ errName: "Error", ++ message: "Gist content missing", ++ status: 410, ++ rawMessage: "Gist content missing" ++ }); ++}); ++ ++test("Gh3.Gist fetchComments resets comments and exposes comment helpers", () => { ++ ++ ++ let commentCall = 0; ++ const { Gh3, requests } = installGh3((request) => { ++ ++ assert.equal(request.endpoint, "gists/detail-1/comments"); ++ commentCall += 1; ++ return { ++ body: commentCall === 1 ++ ? [ ++ { id: 1, body: "old", user: { login: "olduser" } }, ++ { id: 2, body: "extra", user: { login: "olduser" } } ++ ] ++ : [ ++ { id: 3, body: "new", user: { login: "newuser" } } ++ ] ++ }; ++ }); ++ ++ const gist = new Gh3.Gist({ ++ id: "detail-1", ++ comments: [{ id: 99, body: "stale", user: { login: "seed" } }] ++ }); ++ assert.deepStrictEqual(gist.getComments().map((comment) => `${comment.id}:${comment.body}`), ["99:stale"]); ++ ++ let firstCallback = { err: "not-called", sameInstance: false }; ++ gist.fetchComments((err, result) => { ++ firstCallback = { err, sameInstance: result === gist }; ++ }); ++ ++ assertRequest(requests[0], "gists/detail-1/comments"); ++ assert.equal(firstCallback.err, null); ++ assert.equal(firstCallback.sameInstance, true); ++ assert.deepStrictEqual(gist.getComments().map((comment) => `${comment.id}:${comment.body}`), ["1:old", "2:extra"]); ++ assert.deepStrictEqual(gist.getComments().map((comment) => comment.constructor === Gh3.GistComment), [true, true]); ++ ++ let secondCallback = { err: "not-called", sameInstance: false }; ++ gist.fetchComments((err, result) => { ++ secondCallback = { err, sameInstance: result === gist }; ++ }); ++ assert.equal(secondCallback.err, null); ++ assert.equal(secondCallback.sameInstance, true); ++ assert.deepStrictEqual(gist.getComments().map((comment) => `${comment.id}:${comment.body}`), ["3:new"]); ++ assert.deepStrictEqual(gist.getComments().map((comment) => comment.constructor === Gh3.GistComment), [true]); ++ ++ const eachComments = []; ++ gist.eachComment((comment) => eachComments.push(`${comment.id}:${comment.user.login}`)); ++ assert.deepStrictEqual(eachComments, ["3:newuser"]); ++ assert.deepStrictEqual(gist.filterComments((comment) => comment.user.login === "newuser").map((comment) => comment.body), ["new"]); ++}); ++ ++test("Gh3.Gist fetchComments reports comment API errors as Error(message)", () => { ++ ++ ++ const { Gh3, requests } = installGh3(() => ({ ++ error: { responseJSON: { message: "Comments disabled" }, status: 451 } ++ })); ++ ++ const gist = new Gh3.Gist({ id: "missing-comments" }); ++ let callback = { errName: "not-called", message: "", status: 0, rawMessage: "" }; ++ gist.fetchComments((err, response) => { ++ callback = { ++ errName: err.constructor.name, ++ message: err.message, ++ status: response.status, ++ rawMessage: response.responseJSON.message ++ }; ++ }); ++ ++ ++ assertRequest(requests[0], "gists/missing-comments/comments"); ++ assert.deepStrictEqual(callback, { ++ errName: "Error", ++ message: "Comments disabled", ++ status: 451, ++ rawMessage: "Comments disabled" ++ }); ++}); ++ ++test("separate Gists and Gist instances keep independent arrays", () => { ++ ++ ++ const { Gh3 } = installGh3((request) => { ++ const bodies = { ++ "users/alpha/gists": [{ id: "alpha-1", description: "alpha only", comments: 0 }], ++ "users/beta/gists": [ ++ { id: "beta-1", description: "beta first", comments: 0 }, ++ { id: "beta-2", description: "beta second", comments: 0 } ++ ], ++ "gists/one": { ++ id: "one", ++ files: { "one.js": { filename: "one.js", size: 1 } } ++ }, ++ "gists/one/comments": [ ++ { id: 101, body: "one comment", user: { login: "one-user" } } ++ ] ++ }; ++ ++ return { body: bodies[request.endpoint] }; ++ }); ++ ++ const alpha = new Gh3.Gists(new Gh3.User("alpha")); ++ const beta = new Gh3.Gists(new Gh3.User("beta")); ++ alpha.fetch({ page: 1 }, null, () => {}); ++ assert.deepStrictEqual(alpha.getGists().map((gist) => gist.id), ["alpha-1"]); ++ assert.deepStrictEqual(beta.getGists().map((gist) => gist.id), []); ++ ++ beta.fetch({ page: 1 }, null, () => {}); ++ assert.deepStrictEqual(alpha.getGists().map((gist) => gist.id), ["alpha-1"]); ++ assert.deepStrictEqual(beta.getGists().map((gist) => gist.id), ["beta-1", "beta-2"]); ++ ++ const one = new Gh3.Gist({ ++ id: "one", ++ files: [{ filename: "one-seed" }], ++ comments: [{ id: 11, body: "one seed" }] ++ }); ++ const two = new Gh3.Gist({ ++ id: "two", ++ files: [{ filename: "two-seed" }], ++ comments: [{ id: 22, body: "two seed" }] ++ }); ++ one.fetchContents(() => {}); ++ one.fetchComments(() => {}); ++ ++ assert.deepStrictEqual(one.getFiles().map((file) => file.filename), ["one.js"]); ++ assert.deepStrictEqual(two.getFiles().map((file) => file.filename), ["two-seed"]); ++ assert.deepStrictEqual(one.getComments().map((comment) => `${comment.id}:${comment.body}`), ["101:one comment"]); ++ assert.deepStrictEqual(two.getComments().map((comment) => `${comment.id}:${comment.body}`), ["22:two seed"]); ++}); ++ ++test("repeated public gist sessions keep independent arrays", () => { ++ ++ ++ const observedLists = []; ++ const observedGists = []; ++ ++ const { Gh3 } = installGh3((request) => { ++ if (request.endpoint.indexOf("/comments") !== -1) { ++ return { body: [{ id: 1, body: "cycle comment", user: { login: "cycle" } }] }; ++ } ++ if (request.endpoint.indexOf("gists/cycle-") === 0) { ++ return { body: { id: request.endpoint.slice("gists/".length), files: { "cycle.js": { filename: "cycle.js", size: 1 } } } }; ++ } ++ return { body: [{ id: "cycle-list", description: "cycle", comments: 1 }] }; ++ }); ++ ++ for (let index = 0; index < 120; index += 1) { ++ const list = new Gh3.Gists(new Gh3.User(`cycle-user-${index}`)); ++ list.fetch({ page: 1, per_page: 1 }, null, () => {}); ++ assert.deepStrictEqual(list.getGists().map((gist) => gist.id), ["cycle-list"]); ++ ++ const gist = new Gh3.Gist({ id: `cycle-${index}` }); ++ gist.fetchContents(() => {}); ++ gist.fetchComments(() => {}); ++ assert.deepStrictEqual(gist.getFiles().map((file) => file.filename), ["cycle.js"]); ++ assert.deepStrictEqual(gist.getComments().map((comment) => comment.body), ["cycle comment"]); ++ if (index < 2) { ++ observedLists.push(list); ++ observedGists.push(gist); ++ } ++ } ++ ++ ++ ++ observedLists[0].getGists().push(new Gh3.Gist({ id: "manual-list-mutation" })); ++ assert.deepStrictEqual(observedLists[1].getGists().map((gist) => gist.id), ["cycle-list"]); ++ observedGists[0].getFiles().push({ filename: "manual-file-mutation" }); ++ observedGists[0].getComments().push(new Gh3.GistComment({ id: 999, body: "manual-comment-mutation" })); ++ assert.deepStrictEqual(observedGists[1].getFiles().map((file) => file.filename), ["cycle.js"]); ++ assert.deepStrictEqual(observedGists[1].getComments().map((comment) => comment.body), ["cycle comment"]); ++}); +diff --git a/usercase-test-coderl/offline_network_guard.cjs b/usercase-test-coderl/offline_network_guard.cjs +new file mode 100644 +--- /dev/null ++++ b/usercase-test-coderl/offline_network_guard.cjs +@@ -0,0 +1,60 @@ ++ ++"use strict"; ++ ++const blocked = (api) => function blockedNetworkCall() { ++ throw new Error(`local offline network guard blocked ${api}`); ++}; ++ ++const patchFunction = (object, name, api) => { ++ if (object && typeof object[name] === "function") { ++ object[name] = blocked(api); ++ } ++}; ++ ++for (const moduleName of ["node:http", "node:https", "node:http2"]) { ++ try { ++ const mod = require(moduleName); ++ patchFunction(mod, "request", `${moduleName}.request`); ++ patchFunction(mod, "get", `${moduleName}.get`); ++ patchFunction(mod, "connect", `${moduleName}.connect`); ++ } catch (_) { ++ ++ } ++} ++ ++try { ++ const net = require("node:net"); ++ patchFunction(net, "connect", "node:net.connect"); ++ patchFunction(net, "createConnection", "node:net.createConnection"); ++ patchFunction(net.Socket && net.Socket.prototype, "connect", "node:net.Socket.connect"); ++} catch (_) {} ++ ++try { ++ const tls = require("node:tls"); ++ patchFunction(tls, "connect", "node:tls.connect"); ++} catch (_) {} ++ ++try { ++ const dgram = require("node:dgram"); ++ patchFunction(dgram, "createSocket", "node:dgram.createSocket"); ++} catch (_) {} ++ ++try { ++ const dns = require("node:dns"); ++ for (const name of ["lookup", "resolve", "resolve4", "resolve6", "resolveCname", "resolveMx", "resolveTxt", "resolveSrv", "resolveNs", "resolveSoa", "reverse"]) { ++ patchFunction(dns, name, `node:dns.${name}`); ++ } ++ if (dns.promises) { ++ for (const name of ["lookup", "resolve", "resolve4", "resolve6", "resolveCname", "resolveMx", "resolveTxt", "resolveSrv", "resolveNs", "resolveSoa", "reverse"]) { ++ patchFunction(dns.promises, name, `node:dns.promises.${name}`); ++ } ++ } ++} catch (_) {} ++ ++if (typeof globalThis.fetch === "function") { ++ globalThis.fetch = blocked("globalThis.fetch"); ++} ++ ++if (typeof globalThis.WebSocket === "function") { ++ globalThis.WebSocket = blocked("globalThis.WebSocket"); ++} +diff --git a/mimo_test_command.sh b/mimo_test_command.sh +new file mode 100755 +--- /dev/null ++++ b/mimo_test_command.sh +@@ -0,0 +1,15 @@ ++#!/usr/bin/env bash ++ ++ ++ ++ ++export NODE_OPTIONS="${NODE_OPTIONS:-} --max-old-space-size=4096" ++export MAVEN_OPTS="${MAVEN_OPTS:-} -Xmx3g -XX:+UseG1GC" ++export GRADLE_OPTS="${GRADLE_OPTS:-} -Xmx3g -XX:+UseG1GC" ++export TEST_JVM_OPTS="${TEST_JVM_OPTS:-} -Xmx3g" ++set -e ++cd /workspace/repo ++set -euo pipefail ++cd /workspace/repo ++ ++exec node --require /workspace/repo/usercase-test-coderl/offline_network_guard.cjs --test /workspace/repo/usercase-test-coderl/gist_browsing.test.js diff --git a/tasks/format-code-task-001686/environment/Dockerfile b/tasks/format-code-task-001686/environment/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..7c52e443f1a46e8fb11a62f36ac754439f2864dc --- /dev/null +++ b/tasks/format-code-task-001686/environment/Dockerfile @@ -0,0 +1,3 @@ +# The task's image, pinned by digest (the same as [environment].docker_image). +# Setup runs at start from [environment.healthcheck]; environment/setup/ is its readable copy. +FROM docker.io/xiaomimimo/mimo-v2.6-rl-oss@sha256:c339a2849bee3a6f1e46c86981528999a88c24f095d46539ee9944ce66257285 diff --git a/tasks/format-code-task-001686/environment/setup/files/blocklist b/tasks/format-code-task-001686/environment/setup/files/blocklist new file mode 100644 index 0000000000000000000000000000000000000000..a8e4bdc4c7d9b739c047a3cb58ea72a1bb05bcbc --- /dev/null +++ b/tasks/format-code-task-001686/environment/setup/files/blocklist @@ -0,0 +1,33 @@ +# mimo answer-leak blocklist (mimoagent) +0.0.0.0 github.com +0.0.0.0 www.github.com +0.0.0.0 api.github.com +0.0.0.0 raw.githubusercontent.com +0.0.0.0 codeload.github.com +0.0.0.0 objects.githubusercontent.com +0.0.0.0 gist.github.com +0.0.0.0 gist.githubusercontent.com +0.0.0.0 gitlab.com +0.0.0.0 bitbucket.org +0.0.0.0 sourceforge.net +0.0.0.0 git.kernel.org +0.0.0.0 chromium.googlesource.com +0.0.0.0 android.googlesource.com +0.0.0.0 sourcegraph.com +0.0.0.0 bugs.chromium.org +0.0.0.0 issues.oss-fuzz.com +0.0.0.0 oss-fuzz.com +0.0.0.0 osv.dev +0.0.0.0 api.osv.dev +0.0.0.0 bugzilla.mozilla.org +0.0.0.0 proxy.golang.org +0.0.0.0 sum.golang.org +0.0.0.0 pkg.go.dev +0.0.0.0 google.com +0.0.0.0 www.google.com +0.0.0.0 bing.com +0.0.0.0 www.bing.com +0.0.0.0 duckduckgo.com +0.0.0.0 html.duckduckgo.com +0.0.0.0 search.brave.com +0.0.0.0 stackoverflow.com diff --git a/tasks/format-code-task-001686/environment/setup/setup.sh b/tasks/format-code-task-001686/environment/setup/setup.sh new file mode 100644 index 0000000000000000000000000000000000000000..d883db90cfcfb48f7a139861bbe9f6b5d95cad6f --- /dev/null +++ b/tasks/format-code-task-001686/environment/setup/setup.sh @@ -0,0 +1,34 @@ +#!/bin/bash +# Runs once, as root, before the agent starts: Harbor's [environment.healthcheck] unpacks this folder into +# /var/lib/mimo and runs it. Generated by mimo_harbor; see its README for how each step maps to Xiaomi's harness. +M=/var/lib/mimo +[ -f "$M/ready" ] && exit 0 +chmod 700 "$M" +fail() { echo "setup: $*" >&2; exit 1; } +# the answer-leak blocklist (mimoagent), applied to /etc/hosts by the agent right after it installs +write_blocklist() { cp "$M/files/blocklist" "$M/blocklist"; } + +# Code: mimoagent environments/datasets/opensource_code.py + base.py, as the explorer runs it (app/runner/domains.py Code). +CWD=/testbed +git config --global --add safe.directory "$CWD" +cd "$CWD" || fail "no working directory $CWD" +if ! git rev-parse --git-dir >/dev/null 2>&1; then # a bare source tree: give it a baseline commit + git init -q && git add -A && git -c user.name=mimo -c user.email=mimo@localhost commit -q -m baseline --allow-empty +fi +BASE=$(git rev-parse HEAD 2>/dev/null) +[ ${#BASE} -eq 40 ] || fail "could not resolve the base commit in $CWD" +echo "$BASE" > "$M/base" +# Images are built with history truncated at the base. If one is not, the fix could be read out of git log, +# so .git is hidden while the agent works and put back for grading. +LATER=$(git rev-list --all --not "$BASE" 2>/dev/null | head -n 5 | grep -c . || true) +rm -f /tmp/fail.log /tmp/pass.log /tmp/patch.diff /tmp/test_patch.diff /tmp/*.log 2>/dev/null; rm -rf /tmp/claude-0 /tmp/claude-* /tmp/testem-* /tmp/puppeteer_dev_chrome_profile-* 2>/dev/null; rm -f /tmp/test_files.json 2>/dev/null; rm -rf /tmp/jest_* /tmp/jest-* /tmp/build /tmp/build_env 2>/dev/null; rm -rf /tmp/pytest-of-root /tmp/pytest-* /tmp/.pytest_cache /tmp/__pycache__ 2>/dev/null; rm -rf /tmp/go-build* /tmp/standards /tmp/wordpress /tmp/zig-* /tmp/testbase /tmp/testbed 2>/dev/null; rm -f /tmp/tmp*.tmp /tmp/*.bak /tmp/expect* /tmp/butwas* 2>/dev/null; rm -rf /root/.cache/go-build 2>/dev/null; rm -rf /tests 2>/dev/null; find /logs -mindepth 1 -delete 2>/dev/null; mkdir -p /logs/agent /logs/verifier /logs/artifacts; chmod 777 /logs/agent /logs/verifier /logs/artifacts; find /var/log -type f -delete 2>/dev/null || true; rm -rf /var/lib/postgresql/*/*/log /var/lib/postgresql/*/*/pg_log 2>/dev/null || true; find /var/lib/mysql /var/lib/mongodb -type f -name '*.log' -delete 2>/dev/null || true; rm -rf /root/.npm/_logs /root/.babel.json /root/.pytest_cache 2>/dev/null || true; find / -maxdepth 4 -xdev -name task_description.md -path '*/.build_env/*' -delete 2>/dev/null || true; true +git clean -fdx --exclude=node_modules --exclude=bower_components --exclude=.husky --exclude=vendor --exclude=third_party --exclude=_deps --exclude=vcpkg_installed --exclude=.venv --exclude=venv --exclude=.gradle --exclude=target --exclude=.build --exclude=lib --exclude=.bundle --exclude=Manifest.toml --exclude=_build --exclude=.stack-work --exclude=dist-newstyle >/dev/null 2>&1 +find /root/.m2 -type f \( -name '*-SNAPSHOT.jar' -o -name '*-SNAPSHOT-sources.jar' -o -name '*-SNAPSHOT-tests.jar' -o -name '*-SNAPSHOT-test-sources.jar' \) -delete 2>/dev/null; rm -rf /root/.julia/compiled 2>/dev/null; rm -rf /root/.gradle/caches/build-cache-* /root/.gradle/daemon 2>/dev/null; rm -rf /root/.gradle/caches/*/scripts /root/.gradle/caches/jars-* 2>/dev/null; rm -rf /root/.cache/bazel 2>/dev/null; true +if [ "$LATER" -gt 0 ]; then + mv "$CWD/.git" "$M/git-hidden" + echo "history not truncated at ${BASE:0:12}: .git hidden while the agent works" +fi +write_blocklist + +touch "$M/ready" +echo "setup done" diff --git a/tasks/format-code-task-001686/tests/test.patch b/tasks/format-code-task-001686/tests/test.patch new file mode 100644 index 0000000000000000000000000000000000000000..c7c0da63f4fcedc8a263f5c3ccba8e525c6a1b9e --- /dev/null +++ b/tasks/format-code-task-001686/tests/test.patch @@ -0,0 +1,69 @@ +diff --git a/keras/src/ops/numpy_test.py b/keras/src/ops/numpy_test.py +index ab730608f..6d7ffd0cc 100644 +--- a/keras/src/ops/numpy_test.py ++++ b/keras/src/ops/numpy_test.py +@@ -1449,6 +1449,13 @@ class NumpyOneInputOpsDynamicShapeTest(testing.TestCase): + self.assertEqual(knp.tile(x, [1, 2]).shape, (None, 6)) + self.assertEqual(knp.tile(x, [2, 1, 2]).shape, (2, None, 6)) + ++ def test_tile_with_scalar_int_repeats_dynamic(self): ++ ++ ++ x = KerasTensor((None, 3)) ++ self.assertEqual(knp.tile(x, 2).shape, (None, 6)) ++ self.assertEqual(knp.Tile(2)(x).shape, (None, 6)) ++ + def test_trace(self): + x = KerasTensor((None, 3, None, 5)) + self.assertEqual(knp.trace(x).shape, (None, 5)) +@@ -1973,6 +1980,13 @@ class NumpyOneInputOpsStaticShapeTest(testing.TestCase): + self.assertEqual(knp.tile(x, [1, 2]).shape, (2, 6)) + self.assertEqual(knp.tile(x, [2, 1, 2]).shape, (2, 2, 6)) + ++ def test_tile_with_scalar_int_repeats_static(self): ++ ++ ++ x = KerasTensor((2, 3)) ++ self.assertEqual(knp.tile(x, 2).shape, (2, 6)) ++ self.assertEqual(knp.Tile(2)(x).shape, (2, 6)) ++ + def test_trace(self): + x = KerasTensor((2, 3, 4, 5)) + self.assertEqual(knp.trace(x).shape, (4, 5)) +@@ -4130,6 +4144,14 @@ class NumpyOneInputOpsCorrectnessTest(testing.TestCase, parameterized.TestCase): + self.assertAllClose(knp.tile(x, [2]), np.tile(x, [2])) + self.assertAllClose(knp.Tile([2])(x), np.tile(x, [2])) + ++ def test_tile_with_scalar_int_repeats(self): ++ ++ ++ ++ x = np.array([[1, 2, 3], [3, 2, 1]]) ++ self.assertAllClose(knp.tile(x, 2), np.tile(x, 2)) ++ self.assertAllClose(knp.Tile(2)(x), np.tile(x, 2)) ++ + def test_trace(self): + x = np.arange(24).reshape([1, 2, 3, 4]) + self.assertAllClose(knp.trace(x), np.trace(x)) +diff --git a/test_commands.json b/test_commands.json +new file mode 100644 +index 000000000..9f2f9c97d +--- /dev/null ++++ b/test_commands.json +@@ -0,0 +1,3 @@ ++{ ++ "test_commands": ["python -m pytest keras/src/ops/numpy_test.py -k test_tile_with_scalar_int_repeats -v"] ++} +diff --git a/mimo_test_command.sh b/mimo_test_command.sh +new file mode 100755 +--- /dev/null ++++ b/mimo_test_command.sh +@@ -0,0 +1,8 @@ ++#!/usr/bin/env bash ++ ++set -uo pipefail ++cd /testbed ++rc=0 ++python -m pytest keras/src/ops/numpy_test.py -k test_tile_with_scalar_int_repeats -v ++rc=$(( rc | $? )) ++exit $rc diff --git a/tasks/format-code-task-001686/tests/test.sh b/tasks/format-code-task-001686/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..09756b76e197f3f30fe5e2c28138e2a79df575b4 --- /dev/null +++ b/tasks/format-code-task-001686/tests/test.sh @@ -0,0 +1,39 @@ +#!/bin/bash +# Code grading, mimoagent opensource_code.py: reset the files the hidden test patch touches, apply it, run the +# task's test command; reward 1 when it exits 0. A testbed failure (reset or apply) writes no reward: not scored. +M=/var/lib/mimo +CWD=/testbed +V=/logs/verifier +mkdir -p "$V" +BASE=$(cat "$M/base" 2>/dev/null) || { echo "setup never ran (no $M/base)" >&2; exit 1; } +cd "$CWD" || exit 1 +if [ -d "$M/git-hidden" ]; then rm -rf "$CWD/.git"; mv "$M/git-hidden" "$CWD/.git"; fi +# the agent's change against the base, so its own commits count too +git add -A >/dev/null 2>&1 && git -c core.fileMode=false diff --cached "$BASE" > "$V/agent.diff" +git reset -q +if ! ( +while IFS= read -r tf; do + [ -z "$tf" ] && continue + if git cat-file -e $BASE:"$tf" 2>/dev/null; then + git checkout $BASE -- "$tf" 2>/dev/null || true + else + git rm -f --cached "$tf" >/dev/null 2>&1 || true + rm -f "$tf" + fi +done <<'EOF_RESET_TEST_FILES' +keras/src/ops/numpy_test.py +test_commands.json +mimo_test_command.sh +EOF_RESET_TEST_FILES + +); then echo "could not reset the test files (testbed problem, not scored)" >&2; exit 1; fi +if ! git apply --verbose /tests/test.patch > "$V/apply.log" 2>&1; then + cat "$V/apply.log" >&2 + echo "the hidden tests could not be applied (testbed problem, not scored)" >&2 + exit 1 +fi +timeout 1800 sh -c "$(cat /tests/test_command.sh)" > "$V/test_output.log" 2>&1 +RC=$? +tail -c 12000 "$V/test_output.log" +if [ $RC -eq 0 ]; then echo 1 > "$V/reward.txt"; else echo 0 > "$V/reward.txt"; fi +echo "test command exited $RC" diff --git a/tasks/format-code-task-001686/tests/test_command.sh b/tasks/format-code-task-001686/tests/test_command.sh new file mode 100644 index 0000000000000000000000000000000000000000..7cb23076694ad17d72e8296d62b2b240083e36db --- /dev/null +++ b/tasks/format-code-task-001686/tests/test_command.sh @@ -0,0 +1 @@ +bash /testbed/mimo_test_command.sh \ No newline at end of file diff --git a/tasks/format-code-task-001688/environment/Dockerfile b/tasks/format-code-task-001688/environment/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..22dd839c7f499959e27e1dae2ec021e15edfbb23 --- /dev/null +++ b/tasks/format-code-task-001688/environment/Dockerfile @@ -0,0 +1,3 @@ +# The task's image, pinned by digest (the same as [environment].docker_image). +# Setup runs at start from [environment.healthcheck]; environment/setup/ is its readable copy. +FROM docker.io/xiaomimimo/mimo-v2.6-rl-oss@sha256:06d4541e6ef86bdc8498b110d94fea4206a82a855665391f2d4b7c2a90298350 diff --git a/tasks/format-code-task-001688/environment/setup/files/blocklist b/tasks/format-code-task-001688/environment/setup/files/blocklist new file mode 100644 index 0000000000000000000000000000000000000000..a8e4bdc4c7d9b739c047a3cb58ea72a1bb05bcbc --- /dev/null +++ b/tasks/format-code-task-001688/environment/setup/files/blocklist @@ -0,0 +1,33 @@ +# mimo answer-leak blocklist (mimoagent) +0.0.0.0 github.com +0.0.0.0 www.github.com +0.0.0.0 api.github.com +0.0.0.0 raw.githubusercontent.com +0.0.0.0 codeload.github.com +0.0.0.0 objects.githubusercontent.com +0.0.0.0 gist.github.com +0.0.0.0 gist.githubusercontent.com +0.0.0.0 gitlab.com +0.0.0.0 bitbucket.org +0.0.0.0 sourceforge.net +0.0.0.0 git.kernel.org +0.0.0.0 chromium.googlesource.com +0.0.0.0 android.googlesource.com +0.0.0.0 sourcegraph.com +0.0.0.0 bugs.chromium.org +0.0.0.0 issues.oss-fuzz.com +0.0.0.0 oss-fuzz.com +0.0.0.0 osv.dev +0.0.0.0 api.osv.dev +0.0.0.0 bugzilla.mozilla.org +0.0.0.0 proxy.golang.org +0.0.0.0 sum.golang.org +0.0.0.0 pkg.go.dev +0.0.0.0 google.com +0.0.0.0 www.google.com +0.0.0.0 bing.com +0.0.0.0 www.bing.com +0.0.0.0 duckduckgo.com +0.0.0.0 html.duckduckgo.com +0.0.0.0 search.brave.com +0.0.0.0 stackoverflow.com diff --git a/tasks/format-code-task-001688/tests/test.patch b/tasks/format-code-task-001688/tests/test.patch new file mode 100644 index 0000000000000000000000000000000000000000..ca5231ae3b135dc3c42511b7bcdf523f20df6e22 --- /dev/null +++ b/tasks/format-code-task-001688/tests/test.patch @@ -0,0 +1,176 @@ +diff --git a/keras/rms_normalization_public_api_test.py b/keras/rms_normalization_public_api_test.py +new file mode 100644 +index 000000000..c38b480c8 +--- /dev/null ++++ b/keras/rms_normalization_public_api_test.py +@@ -0,0 +1,141 @@ ++import numpy as np ++import pytest ++ ++import keras ++ ++ ++def expected_rms_normalization(x, scale=1.0, axis=-1, epsilon=0.0): ++ mean_square = np.mean(np.square(x), axis=axis, keepdims=True) ++ return x * np.reciprocal(np.sqrt(mean_square + epsilon)) * scale ++ ++ ++class TestRMSNormalizationPublicAPI: ++ def test_ops_eager_values_with_scale_axis_and_epsilon(self): ++ x = np.array( ++ [[1.0, -2.0, 4.0], [3.0, 0.0, -6.0]], ++ dtype="float32", ++ ) ++ scale = np.array([0.5, 2.0, -1.0], dtype="float32") ++ epsilon = 0.25 ++ expected = expected_rms_normalization( ++ x, scale=scale, axis=-1, epsilon=epsilon ++ ) ++ for rms_normalization in ( ++ keras.ops.rms_normalization, ++ keras.ops.nn.rms_normalization, ++ ): ++ result = rms_normalization( ++ x, scale=scale, axis=-1, epsilon=epsilon ++ ) ++ np.testing.assert_allclose( ++ keras.ops.convert_to_numpy(result), expected, rtol=1e-5 ++ ) ++ assert tuple(result.shape) == x.shape ++ ++ def test_ops_honors_non_last_axis_and_default_arguments(self): ++ x = np.array( ++ [[[1.0, -2.0], [3.0, 4.0]], [[-5.0, 6.0], [7.0, -8.0]]], ++ dtype="float32", ++ ) ++ axis_result = keras.ops.rms_normalization(x, axis=0, epsilon=0.125) ++ axis_expected = expected_rms_normalization(x, axis=0, epsilon=0.125) ++ np.testing.assert_allclose( ++ keras.ops.convert_to_numpy(axis_result), axis_expected, rtol=1e-5 ++ ) ++ ++ default_x = np.array([[1.0, 2.0], [3.0, -4.0]], dtype="float32") ++ default_result = keras.ops.nn.rms_normalization(default_x) ++ default_expected = expected_rms_normalization( ++ default_x, epsilon=keras.backend.epsilon() ++ ) ++ np.testing.assert_allclose( ++ keras.ops.convert_to_numpy(default_result), ++ default_expected, ++ rtol=1e-5, ++ ) ++ ++ def test_ops_symbolic_shape_is_preserved(self): ++ symbolic = keras.Input(shape=(2, 3)) ++ result = keras.ops.rms_normalization(symbolic, axis=-1) ++ assert result.shape == (None, 2, 3) ++ ++ def test_layer_applies_trainable_scaling_to_rms_result(self): ++ layer = keras.layers.RMSNormalization(axis=-1, epsilon=0.5) ++ x = np.array( ++ [[[1.0, 2.0, -1.0], [4.0, -2.0, 0.5]]], ++ dtype="float32", ++ ) ++ _ = layer(x) ++ assert tuple(layer.compute_output_shape(x.shape)) == x.shape ++ assert len(layer.trainable_weights) == 1 ++ layer.trainable_weights[0].assign( ++ np.array([1.0, 0.5, 2.0], dtype="float32") ++ ) ++ result = layer(x) ++ expected = expected_rms_normalization( ++ x, scale=np.array([1.0, 0.5, 2.0]), axis=-1, epsilon=0.5 ++ ) ++ np.testing.assert_allclose( ++ keras.ops.convert_to_numpy(result), expected, rtol=1e-5 ++ ) ++ assert tuple(result.shape) == x.shape ++ ++ def test_layer_handles_rank_two_and_multi_axis_inputs(self): ++ rank_two_layer = keras.layers.RMSNormalization(axis=-1, epsilon=0.25) ++ rank_two_x = np.array([[1.0, -2.0, 3.0], [4.0, 0.5, -1.5]], dtype="float32") ++ rank_two_result = rank_two_layer(rank_two_x) ++ rank_two_expected = expected_rms_normalization( ++ rank_two_x, axis=-1, epsilon=0.25 ++ ) ++ np.testing.assert_allclose( ++ keras.ops.convert_to_numpy(rank_two_result), ++ rank_two_expected, ++ rtol=1e-5, ++ ) ++ ++ multi_axis_layer = keras.layers.RMSNormalization(axis=[1, 2], epsilon=0.25) ++ multi_axis_x = np.array( ++ [[[1.0, -2.0, 3.0], [4.0, -5.0, 6.0]]], dtype="float32" ++ ) ++ multi_axis_result = multi_axis_layer(multi_axis_x) ++ multi_axis_expected = expected_rms_normalization( ++ multi_axis_x, axis=(1, 2), epsilon=0.25 ++ ) ++ np.testing.assert_allclose( ++ keras.ops.convert_to_numpy(multi_axis_result), ++ multi_axis_expected, ++ rtol=1e-5, ++ ) ++ assert tuple(multi_axis_result.shape) == multi_axis_x.shape ++ ++ def test_layer_compute_output_shape_axis_validation(self): ++ layer = keras.layers.RMSNormalization(axis=-1) ++ assert layer.compute_output_shape((2, 3, 4)) == (2, 3, 4) ++ for bad_axis in (3, -4, 4, -5): ++ with pytest.raises(ValueError): ++ keras.layers.RMSNormalization( ++ axis=bad_axis ++ ).compute_output_shape((2, 3, 4)) ++ with pytest.raises(ValueError): ++ keras.layers.RMSNormalization(axis=[-1, 3]).compute_output_shape( ++ (2, 3, 4) ++ ) ++ ++ def test_layer_normalization_rms_scaling_is_not_rmsnorm_behavior(self): ++ x = np.array([[1.0, 2.0, 4.0]], dtype="float32") ++ layer_norm = keras.layers.LayerNormalization( ++ rms_scaling=True, ++ gamma_initializer="ones", ++ dtype="float32", ++ ) ++ rms_norm = keras.layers.RMSNormalization(axis=-1, epsilon=0.0) ++ ++ layer_norm_result = keras.ops.convert_to_numpy(layer_norm(x)) ++ rms_norm_result = keras.ops.convert_to_numpy(rms_norm(x)) ++ ++ np.testing.assert_allclose( ++ rms_norm_result, ++ expected_rms_normalization(x, axis=-1, epsilon=0.0), ++ rtol=1e-5, ++ ) ++ assert not np.allclose(layer_norm_result, rms_norm_result) +diff --git a/mimo_test_command.sh b/mimo_test_command.sh +new file mode 100755 +--- /dev/null ++++ b/mimo_test_command.sh +@@ -0,0 +1,24 @@ ++#!/bin/bash ++set -uo pipefail ++cd /testbed ++ ++ ++pip install --break-system-packages -e . --no-deps 2>&1 | tail -3 ++ ++ ++case "${1:-}" in ++ base) ++ KERAS_BACKEND=numpy python3 -m pytest \ ++ keras/src/layers/normalization/layer_normalization_test.py::LayerNormalizationTest::test_output_with_rms_scaling \ ++ -q ++ ;; ++ new) ++ KERAS_BACKEND=numpy python3 -m pytest \ ++ keras/rms_normalization_public_api_test.py \ ++ -q ++ ;; ++ *) ++ echo "usage: $0 base|new" ++ exit 2 ++ ;; ++esac diff --git a/tasks/format-code-task-001688/tests/test.sh b/tasks/format-code-task-001688/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..ad8b6ae992b52a3d36eb14d4da38368b563d6699 --- /dev/null +++ b/tasks/format-code-task-001688/tests/test.sh @@ -0,0 +1,38 @@ +#!/bin/bash +# Code grading, mimoagent opensource_code.py: reset the files the hidden test patch touches, apply it, run the +# task's test command; reward 1 when it exits 0. A testbed failure (reset or apply) writes no reward: not scored. +M=/var/lib/mimo +CWD=/testbed +V=/logs/verifier +mkdir -p "$V" +BASE=$(cat "$M/base" 2>/dev/null) || { echo "setup never ran (no $M/base)" >&2; exit 1; } +cd "$CWD" || exit 1 +if [ -d "$M/git-hidden" ]; then rm -rf "$CWD/.git"; mv "$M/git-hidden" "$CWD/.git"; fi +# the agent's change against the base, so its own commits count too +git add -A >/dev/null 2>&1 && git -c core.fileMode=false diff --cached "$BASE" > "$V/agent.diff" +git reset -q +if ! ( +while IFS= read -r tf; do + [ -z "$tf" ] && continue + if git cat-file -e $BASE:"$tf" 2>/dev/null; then + git checkout $BASE -- "$tf" 2>/dev/null || true + else + git rm -f --cached "$tf" >/dev/null 2>&1 || true + rm -f "$tf" + fi +done <<'EOF_RESET_TEST_FILES' +keras/rms_normalization_public_api_test.py +mimo_test_command.sh +EOF_RESET_TEST_FILES + +); then echo "could not reset the test files (testbed problem, not scored)" >&2; exit 1; fi +if ! git apply --verbose /tests/test.patch > "$V/apply.log" 2>&1; then + cat "$V/apply.log" >&2 + echo "the hidden tests could not be applied (testbed problem, not scored)" >&2 + exit 1 +fi +timeout 1800 sh -c "$(cat /tests/test_command.sh)" > "$V/test_output.log" 2>&1 +RC=$? +tail -c 12000 "$V/test_output.log" +if [ $RC -eq 0 ]; then echo 1 > "$V/reward.txt"; else echo 0 > "$V/reward.txt"; fi +echo "test command exited $RC" diff --git a/tasks/format-code-task-001688/tests/test_command.sh b/tasks/format-code-task-001688/tests/test_command.sh new file mode 100644 index 0000000000000000000000000000000000000000..e8d2f32b64045b5a5a56e0ad5667da87d8e0bc2a --- /dev/null +++ b/tasks/format-code-task-001688/tests/test_command.sh @@ -0,0 +1 @@ +bash /testbed/mimo_test_command.sh base && bash /testbed/mimo_test_command.sh new \ No newline at end of file diff --git a/tasks/format-code-task-001692/environment/Dockerfile b/tasks/format-code-task-001692/environment/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..5dab23456422e87dde68252e183e861c94ce7338 --- /dev/null +++ b/tasks/format-code-task-001692/environment/Dockerfile @@ -0,0 +1,3 @@ +# The task's image, pinned by digest (the same as [environment].docker_image). +# Setup runs at start from [environment.healthcheck]; environment/setup/ is its readable copy. +FROM docker.io/xiaomimimo/mimo-v2.6-rl-oss@sha256:3239895d36695313b47df36faf4b0f5546f8fe1002459500cd5626ba646e4251 diff --git a/tasks/format-code-task-001692/environment/setup/files/blocklist b/tasks/format-code-task-001692/environment/setup/files/blocklist new file mode 100644 index 0000000000000000000000000000000000000000..a8e4bdc4c7d9b739c047a3cb58ea72a1bb05bcbc --- /dev/null +++ b/tasks/format-code-task-001692/environment/setup/files/blocklist @@ -0,0 +1,33 @@ +# mimo answer-leak blocklist (mimoagent) +0.0.0.0 github.com +0.0.0.0 www.github.com +0.0.0.0 api.github.com +0.0.0.0 raw.githubusercontent.com +0.0.0.0 codeload.github.com +0.0.0.0 objects.githubusercontent.com +0.0.0.0 gist.github.com +0.0.0.0 gist.githubusercontent.com +0.0.0.0 gitlab.com +0.0.0.0 bitbucket.org +0.0.0.0 sourceforge.net +0.0.0.0 git.kernel.org +0.0.0.0 chromium.googlesource.com +0.0.0.0 android.googlesource.com +0.0.0.0 sourcegraph.com +0.0.0.0 bugs.chromium.org +0.0.0.0 issues.oss-fuzz.com +0.0.0.0 oss-fuzz.com +0.0.0.0 osv.dev +0.0.0.0 api.osv.dev +0.0.0.0 bugzilla.mozilla.org +0.0.0.0 proxy.golang.org +0.0.0.0 sum.golang.org +0.0.0.0 pkg.go.dev +0.0.0.0 google.com +0.0.0.0 www.google.com +0.0.0.0 bing.com +0.0.0.0 www.bing.com +0.0.0.0 duckduckgo.com +0.0.0.0 html.duckduckgo.com +0.0.0.0 search.brave.com +0.0.0.0 stackoverflow.com diff --git a/tasks/format-code-task-001692/environment/setup/setup.sh b/tasks/format-code-task-001692/environment/setup/setup.sh new file mode 100644 index 0000000000000000000000000000000000000000..d883db90cfcfb48f7a139861bbe9f6b5d95cad6f --- /dev/null +++ b/tasks/format-code-task-001692/environment/setup/setup.sh @@ -0,0 +1,34 @@ +#!/bin/bash +# Runs once, as root, before the agent starts: Harbor's [environment.healthcheck] unpacks this folder into +# /var/lib/mimo and runs it. Generated by mimo_harbor; see its README for how each step maps to Xiaomi's harness. +M=/var/lib/mimo +[ -f "$M/ready" ] && exit 0 +chmod 700 "$M" +fail() { echo "setup: $*" >&2; exit 1; } +# the answer-leak blocklist (mimoagent), applied to /etc/hosts by the agent right after it installs +write_blocklist() { cp "$M/files/blocklist" "$M/blocklist"; } + +# Code: mimoagent environments/datasets/opensource_code.py + base.py, as the explorer runs it (app/runner/domains.py Code). +CWD=/testbed +git config --global --add safe.directory "$CWD" +cd "$CWD" || fail "no working directory $CWD" +if ! git rev-parse --git-dir >/dev/null 2>&1; then # a bare source tree: give it a baseline commit + git init -q && git add -A && git -c user.name=mimo -c user.email=mimo@localhost commit -q -m baseline --allow-empty +fi +BASE=$(git rev-parse HEAD 2>/dev/null) +[ ${#BASE} -eq 40 ] || fail "could not resolve the base commit in $CWD" +echo "$BASE" > "$M/base" +# Images are built with history truncated at the base. If one is not, the fix could be read out of git log, +# so .git is hidden while the agent works and put back for grading. +LATER=$(git rev-list --all --not "$BASE" 2>/dev/null | head -n 5 | grep -c . || true) +rm -f /tmp/fail.log /tmp/pass.log /tmp/patch.diff /tmp/test_patch.diff /tmp/*.log 2>/dev/null; rm -rf /tmp/claude-0 /tmp/claude-* /tmp/testem-* /tmp/puppeteer_dev_chrome_profile-* 2>/dev/null; rm -f /tmp/test_files.json 2>/dev/null; rm -rf /tmp/jest_* /tmp/jest-* /tmp/build /tmp/build_env 2>/dev/null; rm -rf /tmp/pytest-of-root /tmp/pytest-* /tmp/.pytest_cache /tmp/__pycache__ 2>/dev/null; rm -rf /tmp/go-build* /tmp/standards /tmp/wordpress /tmp/zig-* /tmp/testbase /tmp/testbed 2>/dev/null; rm -f /tmp/tmp*.tmp /tmp/*.bak /tmp/expect* /tmp/butwas* 2>/dev/null; rm -rf /root/.cache/go-build 2>/dev/null; rm -rf /tests 2>/dev/null; find /logs -mindepth 1 -delete 2>/dev/null; mkdir -p /logs/agent /logs/verifier /logs/artifacts; chmod 777 /logs/agent /logs/verifier /logs/artifacts; find /var/log -type f -delete 2>/dev/null || true; rm -rf /var/lib/postgresql/*/*/log /var/lib/postgresql/*/*/pg_log 2>/dev/null || true; find /var/lib/mysql /var/lib/mongodb -type f -name '*.log' -delete 2>/dev/null || true; rm -rf /root/.npm/_logs /root/.babel.json /root/.pytest_cache 2>/dev/null || true; find / -maxdepth 4 -xdev -name task_description.md -path '*/.build_env/*' -delete 2>/dev/null || true; true +git clean -fdx --exclude=node_modules --exclude=bower_components --exclude=.husky --exclude=vendor --exclude=third_party --exclude=_deps --exclude=vcpkg_installed --exclude=.venv --exclude=venv --exclude=.gradle --exclude=target --exclude=.build --exclude=lib --exclude=.bundle --exclude=Manifest.toml --exclude=_build --exclude=.stack-work --exclude=dist-newstyle >/dev/null 2>&1 +find /root/.m2 -type f \( -name '*-SNAPSHOT.jar' -o -name '*-SNAPSHOT-sources.jar' -o -name '*-SNAPSHOT-tests.jar' -o -name '*-SNAPSHOT-test-sources.jar' \) -delete 2>/dev/null; rm -rf /root/.julia/compiled 2>/dev/null; rm -rf /root/.gradle/caches/build-cache-* /root/.gradle/daemon 2>/dev/null; rm -rf /root/.gradle/caches/*/scripts /root/.gradle/caches/jars-* 2>/dev/null; rm -rf /root/.cache/bazel 2>/dev/null; true +if [ "$LATER" -gt 0 ]; then + mv "$CWD/.git" "$M/git-hidden" + echo "history not truncated at ${BASE:0:12}: .git hidden while the agent works" +fi +write_blocklist + +touch "$M/ready" +echo "setup done" diff --git a/tasks/format-code-task-001692/tests/test.patch b/tasks/format-code-task-001692/tests/test.patch new file mode 100644 index 0000000000000000000000000000000000000000..e3e878d3deb26672fb151c3bd7a7758eeb7662df --- /dev/null +++ b/tasks/format-code-task-001692/tests/test.patch @@ -0,0 +1,93 @@ +diff --git a/test_commands.json b/test_commands.json +new file mode 100644 +index 0000000..942025e +--- /dev/null ++++ b/test_commands.json +@@ -0,0 +1,3 @@ ++{ ++ "test_commands": ["python -m pytest tests/kerastuner/engine/hyperparameters_test.py -k \"test_hp_get_missing_on_empty_raises_key_error or test_hp_getitem_missing_on_empty_raises_key_error or test_hp_get_missing_is_not_value_error_on_empty or test_hp_get_missing_on_nonempty_raises_key_error or test_hp_contains_missing_returns_false or test_hp_get_inactive_still_raises_value_error\" -v"] ++} +diff --git a/tests/kerastuner/engine/hyperparameters_test.py b/tests/kerastuner/engine/hyperparameters_test.py +index 6409576..9b150d5 100644 +--- a/tests/kerastuner/engine/hyperparameters_test.py ++++ b/tests/kerastuner/engine/hyperparameters_test.py +@@ -552,3 +552,66 @@ def test_return_default_value_if_not_populated(): + 'hp_name', + ['hp_value', 'hp_value_default'], + default='hp_value_default') == 'hp_value_default' ++ ++ ++def test_hp_get_missing_on_empty_raises_key_error(): ++ ++ hp = hp_module.HyperParameters() ++ with pytest.raises(KeyError, match='does not exist'): ++ hp.get('anything') ++ ++ ++def test_hp_getitem_missing_on_empty_raises_key_error(): ++ ++ hp = hp_module.HyperParameters() ++ with pytest.raises(KeyError, match='does not exist'): ++ hp['anything'] ++ ++ ++def test_hp_get_missing_is_not_value_error_on_empty(): ++ ++ hp = hp_module.HyperParameters() ++ try: ++ hp.get('anything') ++ except KeyError: ++ pass ++ except ValueError: ++ pytest.fail("HyperParameters.get(missing) raised ValueError; " ++ "expected KeyError") ++ else: ++ pytest.fail("HyperParameters.get(missing) did not raise") ++ ++ ++def test_hp_get_missing_on_nonempty_raises_key_error(): ++ ++ hp = hp_module.HyperParameters() ++ hp.Int('a', 0, 10, default=3) ++ hp.Choice('b', [1, 2], default=2) ++ with pytest.raises(KeyError, match='does not exist'): ++ hp.get('missing_name') ++ with pytest.raises(KeyError, match='does not exist'): ++ hp['missing_name'] ++ ++ ++def test_hp_contains_missing_returns_false(): ++ ++ ++ hp = hp_module.HyperParameters() ++ assert ('anything' in hp) is False ++ ++ hp.Int('a', 0, 10, default=3) ++ assert ('a' in hp) is True ++ assert ('missing' in hp) is False ++ ++ ++def test_hp_get_inactive_still_raises_value_error(): ++ ++ ++ hp = hp_module.HyperParameters() ++ hp.Choice('b', [1, 2], default=2) ++ with hp.conditional_scope('b', 1): ++ hp.Float('c', -10, 10, default=3) ++ with pytest.raises(ValueError, match='is currently inactive'): ++ hp.get('c') ++ with pytest.raises(ValueError, match='is currently inactive'): ++ hp['c'] +diff --git a/mimo_test_command.sh b/mimo_test_command.sh +new file mode 100755 +--- /dev/null ++++ b/mimo_test_command.sh +@@ -0,0 +1,8 @@ ++#!/usr/bin/env bash ++ ++set -uo pipefail ++cd /testbed ++rc=0 ++python -m pytest tests/kerastuner/engine/hyperparameters_test.py -k "test_hp_get_missing_on_empty_raises_key_error or test_hp_getitem_missing_on_empty_raises_key_error or test_hp_get_missing_is_not_value_error_on_empty or test_hp_get_missing_on_nonempty_raises_key_error or test_hp_contains_missing_returns_false or test_hp_get_inactive_still_raises_value_error" -v ++rc=$(( rc | $? )) ++exit $rc diff --git a/tasks/format-code-task-001692/tests/test.sh b/tasks/format-code-task-001692/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..9d98717fe98c3a7ced550a8b806b2deba4b2dc73 --- /dev/null +++ b/tasks/format-code-task-001692/tests/test.sh @@ -0,0 +1,39 @@ +#!/bin/bash +# Code grading, mimoagent opensource_code.py: reset the files the hidden test patch touches, apply it, run the +# task's test command; reward 1 when it exits 0. A testbed failure (reset or apply) writes no reward: not scored. +M=/var/lib/mimo +CWD=/testbed +V=/logs/verifier +mkdir -p "$V" +BASE=$(cat "$M/base" 2>/dev/null) || { echo "setup never ran (no $M/base)" >&2; exit 1; } +cd "$CWD" || exit 1 +if [ -d "$M/git-hidden" ]; then rm -rf "$CWD/.git"; mv "$M/git-hidden" "$CWD/.git"; fi +# the agent's change against the base, so its own commits count too +git add -A >/dev/null 2>&1 && git -c core.fileMode=false diff --cached "$BASE" > "$V/agent.diff" +git reset -q +if ! ( +while IFS= read -r tf; do + [ -z "$tf" ] && continue + if git cat-file -e $BASE:"$tf" 2>/dev/null; then + git checkout $BASE -- "$tf" 2>/dev/null || true + else + git rm -f --cached "$tf" >/dev/null 2>&1 || true + rm -f "$tf" + fi +done <<'EOF_RESET_TEST_FILES' +test_commands.json +tests/kerastuner/engine/hyperparameters_test.py +mimo_test_command.sh +EOF_RESET_TEST_FILES + +); then echo "could not reset the test files (testbed problem, not scored)" >&2; exit 1; fi +if ! git apply --verbose /tests/test.patch > "$V/apply.log" 2>&1; then + cat "$V/apply.log" >&2 + echo "the hidden tests could not be applied (testbed problem, not scored)" >&2 + exit 1 +fi +timeout 1800 sh -c "$(cat /tests/test_command.sh)" > "$V/test_output.log" 2>&1 +RC=$? +tail -c 12000 "$V/test_output.log" +if [ $RC -eq 0 ]; then echo 1 > "$V/reward.txt"; else echo 0 > "$V/reward.txt"; fi +echo "test command exited $RC" diff --git a/tasks/format-code-task-001692/tests/test_command.sh b/tasks/format-code-task-001692/tests/test_command.sh new file mode 100644 index 0000000000000000000000000000000000000000..7cb23076694ad17d72e8296d62b2b240083e36db --- /dev/null +++ b/tasks/format-code-task-001692/tests/test_command.sh @@ -0,0 +1 @@ +bash /testbed/mimo_test_command.sh \ No newline at end of file diff --git a/tasks/format-code-task-001695/environment/Dockerfile b/tasks/format-code-task-001695/environment/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..d6293ea4f657fa58ce255950c677c30778b6842e --- /dev/null +++ b/tasks/format-code-task-001695/environment/Dockerfile @@ -0,0 +1,3 @@ +# The task's image, pinned by digest (the same as [environment].docker_image). +# Setup runs at start from [environment.healthcheck]; environment/setup/ is its readable copy. +FROM docker.io/xiaomimimo/mimo-v2.6-rl-oss@sha256:0bf9cc5dd0647373647da8c3e0af419ed155d1f1c4465af238a56fefc6b4c847 diff --git a/tasks/format-code-task-001695/environment/setup/files/blocklist b/tasks/format-code-task-001695/environment/setup/files/blocklist new file mode 100644 index 0000000000000000000000000000000000000000..a8e4bdc4c7d9b739c047a3cb58ea72a1bb05bcbc --- /dev/null +++ b/tasks/format-code-task-001695/environment/setup/files/blocklist @@ -0,0 +1,33 @@ +# mimo answer-leak blocklist (mimoagent) +0.0.0.0 github.com +0.0.0.0 www.github.com +0.0.0.0 api.github.com +0.0.0.0 raw.githubusercontent.com +0.0.0.0 codeload.github.com +0.0.0.0 objects.githubusercontent.com +0.0.0.0 gist.github.com +0.0.0.0 gist.githubusercontent.com +0.0.0.0 gitlab.com +0.0.0.0 bitbucket.org +0.0.0.0 sourceforge.net +0.0.0.0 git.kernel.org +0.0.0.0 chromium.googlesource.com +0.0.0.0 android.googlesource.com +0.0.0.0 sourcegraph.com +0.0.0.0 bugs.chromium.org +0.0.0.0 issues.oss-fuzz.com +0.0.0.0 oss-fuzz.com +0.0.0.0 osv.dev +0.0.0.0 api.osv.dev +0.0.0.0 bugzilla.mozilla.org +0.0.0.0 proxy.golang.org +0.0.0.0 sum.golang.org +0.0.0.0 pkg.go.dev +0.0.0.0 google.com +0.0.0.0 www.google.com +0.0.0.0 bing.com +0.0.0.0 www.bing.com +0.0.0.0 duckduckgo.com +0.0.0.0 html.duckduckgo.com +0.0.0.0 search.brave.com +0.0.0.0 stackoverflow.com diff --git a/tasks/format-code-task-001695/environment/setup/setup.sh b/tasks/format-code-task-001695/environment/setup/setup.sh new file mode 100644 index 0000000000000000000000000000000000000000..d883db90cfcfb48f7a139861bbe9f6b5d95cad6f --- /dev/null +++ b/tasks/format-code-task-001695/environment/setup/setup.sh @@ -0,0 +1,34 @@ +#!/bin/bash +# Runs once, as root, before the agent starts: Harbor's [environment.healthcheck] unpacks this folder into +# /var/lib/mimo and runs it. Generated by mimo_harbor; see its README for how each step maps to Xiaomi's harness. +M=/var/lib/mimo +[ -f "$M/ready" ] && exit 0 +chmod 700 "$M" +fail() { echo "setup: $*" >&2; exit 1; } +# the answer-leak blocklist (mimoagent), applied to /etc/hosts by the agent right after it installs +write_blocklist() { cp "$M/files/blocklist" "$M/blocklist"; } + +# Code: mimoagent environments/datasets/opensource_code.py + base.py, as the explorer runs it (app/runner/domains.py Code). +CWD=/testbed +git config --global --add safe.directory "$CWD" +cd "$CWD" || fail "no working directory $CWD" +if ! git rev-parse --git-dir >/dev/null 2>&1; then # a bare source tree: give it a baseline commit + git init -q && git add -A && git -c user.name=mimo -c user.email=mimo@localhost commit -q -m baseline --allow-empty +fi +BASE=$(git rev-parse HEAD 2>/dev/null) +[ ${#BASE} -eq 40 ] || fail "could not resolve the base commit in $CWD" +echo "$BASE" > "$M/base" +# Images are built with history truncated at the base. If one is not, the fix could be read out of git log, +# so .git is hidden while the agent works and put back for grading. +LATER=$(git rev-list --all --not "$BASE" 2>/dev/null | head -n 5 | grep -c . || true) +rm -f /tmp/fail.log /tmp/pass.log /tmp/patch.diff /tmp/test_patch.diff /tmp/*.log 2>/dev/null; rm -rf /tmp/claude-0 /tmp/claude-* /tmp/testem-* /tmp/puppeteer_dev_chrome_profile-* 2>/dev/null; rm -f /tmp/test_files.json 2>/dev/null; rm -rf /tmp/jest_* /tmp/jest-* /tmp/build /tmp/build_env 2>/dev/null; rm -rf /tmp/pytest-of-root /tmp/pytest-* /tmp/.pytest_cache /tmp/__pycache__ 2>/dev/null; rm -rf /tmp/go-build* /tmp/standards /tmp/wordpress /tmp/zig-* /tmp/testbase /tmp/testbed 2>/dev/null; rm -f /tmp/tmp*.tmp /tmp/*.bak /tmp/expect* /tmp/butwas* 2>/dev/null; rm -rf /root/.cache/go-build 2>/dev/null; rm -rf /tests 2>/dev/null; find /logs -mindepth 1 -delete 2>/dev/null; mkdir -p /logs/agent /logs/verifier /logs/artifacts; chmod 777 /logs/agent /logs/verifier /logs/artifacts; find /var/log -type f -delete 2>/dev/null || true; rm -rf /var/lib/postgresql/*/*/log /var/lib/postgresql/*/*/pg_log 2>/dev/null || true; find /var/lib/mysql /var/lib/mongodb -type f -name '*.log' -delete 2>/dev/null || true; rm -rf /root/.npm/_logs /root/.babel.json /root/.pytest_cache 2>/dev/null || true; find / -maxdepth 4 -xdev -name task_description.md -path '*/.build_env/*' -delete 2>/dev/null || true; true +git clean -fdx --exclude=node_modules --exclude=bower_components --exclude=.husky --exclude=vendor --exclude=third_party --exclude=_deps --exclude=vcpkg_installed --exclude=.venv --exclude=venv --exclude=.gradle --exclude=target --exclude=.build --exclude=lib --exclude=.bundle --exclude=Manifest.toml --exclude=_build --exclude=.stack-work --exclude=dist-newstyle >/dev/null 2>&1 +find /root/.m2 -type f \( -name '*-SNAPSHOT.jar' -o -name '*-SNAPSHOT-sources.jar' -o -name '*-SNAPSHOT-tests.jar' -o -name '*-SNAPSHOT-test-sources.jar' \) -delete 2>/dev/null; rm -rf /root/.julia/compiled 2>/dev/null; rm -rf /root/.gradle/caches/build-cache-* /root/.gradle/daemon 2>/dev/null; rm -rf /root/.gradle/caches/*/scripts /root/.gradle/caches/jars-* 2>/dev/null; rm -rf /root/.cache/bazel 2>/dev/null; true +if [ "$LATER" -gt 0 ]; then + mv "$CWD/.git" "$M/git-hidden" + echo "history not truncated at ${BASE:0:12}: .git hidden while the agent works" +fi +write_blocklist + +touch "$M/ready" +echo "setup done" diff --git a/tasks/format-code-task-001695/tests/test.patch b/tasks/format-code-task-001695/tests/test.patch new file mode 100644 index 0000000000000000000000000000000000000000..417aea2efb34598e327a84eb00f162b802d069de --- /dev/null +++ b/tasks/format-code-task-001695/tests/test.patch @@ -0,0 +1,122 @@ +diff --git a/test_commands.json b/test_commands.json +new file mode 100644 +index 00000000..3a919cbb +--- /dev/null ++++ b/test_commands.json +@@ -0,0 +1,3 @@ ++{ ++ "test_commands": ["python -m pytest tests/test_mapping.py -k Pickle -v"] ++} +diff --git a/tests/test_mapping.py b/tests/test_mapping.py +index 4079191d..6a97338d 100644 +--- a/tests/test_mapping.py ++++ b/tests/test_mapping.py +@@ -1,9 +1,11 @@ ++import pickle + import unittest + import numpy as np + + from skfem.mesh import MeshHex, MeshQuad, MeshTri + from skfem.element import ElementHex1, ElementQuad1, ElementHex2 +-from skfem.assembly import FacetBasis ++from skfem.assembly import CellBasis, FacetBasis ++from skfem.mapping.mapping_isoparametric import MappingIsoparametric + from skfem.mapping.mapping_mortar import MappingMortar + + +@@ -141,5 +143,82 @@ class TestMortarPairNoMatch2(TestMortarPair): + translate_y = -np.pi / 10. + + ++class TestPickleMappingIsoparametricQuad(unittest.TestCase): ++ """Regression: MappingIsoparametric for Quad mesh must be pickleable ++ (broken by use of functools.lru_cache / closures).""" ++ ++ def runTest(self): ++ m = MeshQuad().refined(2) ++ mp = MappingIsoparametric(m, ElementQuad1(), ElementQuad1()) ++ data = pickle.dumps(mp) ++ mp2 = pickle.loads(data) ++ self.assertIsInstance(mp2, MappingIsoparametric) ++ ++ ++class TestPickleMappingIsoparametricHex(unittest.TestCase): ++ """Regression: MappingIsoparametric for Hex mesh must be pickleable.""" ++ ++ def runTest(self): ++ m = MeshHex().refined(1) ++ mp = MappingIsoparametric(m, ElementHex1()) ++ data = pickle.dumps(mp) ++ mp2 = pickle.loads(data) ++ self.assertIsInstance(mp2, MappingIsoparametric) ++ ++ ++class TestPickleMappingPreservesDetDF(unittest.TestCase): ++ """After pickle/unpickle, detDF should return identical values.""" ++ ++ def runTest(self): ++ m = MeshQuad().refined(2) ++ mp = MappingIsoparametric(m, ElementQuad1(), ElementQuad1()) ++ X = np.array([[0.3, 0.7], [0.2, 0.8]]) ++ d_before = mp.detDF(X) ++ mp2 = pickle.loads(pickle.dumps(mp)) ++ d_after = mp2.detDF(X) ++ self.assertTrue(np.allclose(d_before, d_after)) ++ ++ self.assertEqual(d_after.shape, (m.t.shape[1], X.shape[1])) ++ ++ ++class TestPickleMappingPreservesInvDF(unittest.TestCase): ++ """After pickle/unpickle, invDF should return identical values.""" ++ ++ def runTest(self): ++ m = MeshQuad().refined(2) ++ mp = MappingIsoparametric(m, ElementQuad1(), ElementQuad1()) ++ X = np.array([[0.3, 0.7], [0.2, 0.8]]) ++ inv_before = mp.invDF(X) ++ mp2 = pickle.loads(pickle.dumps(mp)) ++ inv_after = mp2.invDF(X) ++ self.assertTrue(np.allclose(inv_before, inv_after)) ++ ++ ++class TestPickleCellBasisQuad(unittest.TestCase): ++ """Regression: CellBasis (which holds a MappingIsoparametric) must ++ be pickleable.""" ++ ++ def runTest(self): ++ m = MeshQuad().refined(2) ++ b = CellBasis(m, ElementQuad1()) ++ data = pickle.dumps(b) ++ b2 = pickle.loads(data) ++ ++ self.assertEqual(b2.dofs.element_dofs.shape, ++ b.dofs.element_dofs.shape) ++ ++ ++class TestPickleFacetBasisQuad(unittest.TestCase): ++ """Regression: FacetBasis on a quad mesh must be pickleable.""" ++ ++ def runTest(self): ++ m = MeshQuad().refined(2) ++ fb = FacetBasis(m, ElementQuad1()) ++ data = pickle.dumps(fb) ++ fb2 = pickle.loads(data) ++ self.assertEqual(fb2.dofs.element_dofs.shape, ++ fb.dofs.element_dofs.shape) ++ ++ + if __name__ == '__main__': + unittest.main() +diff --git a/mimo_test_command.sh b/mimo_test_command.sh +new file mode 100755 +--- /dev/null ++++ b/mimo_test_command.sh +@@ -0,0 +1,8 @@ ++#!/usr/bin/env bash ++ ++set -uo pipefail ++cd /testbed ++rc=0 ++python -m pytest tests/test_mapping.py -k Pickle -v ++rc=$(( rc | $? )) ++exit $rc diff --git a/tasks/format-code-task-001695/tests/test.sh b/tasks/format-code-task-001695/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..39eb64024c67edcf6f64f24b458b6641fc270bcc --- /dev/null +++ b/tasks/format-code-task-001695/tests/test.sh @@ -0,0 +1,39 @@ +#!/bin/bash +# Code grading, mimoagent opensource_code.py: reset the files the hidden test patch touches, apply it, run the +# task's test command; reward 1 when it exits 0. A testbed failure (reset or apply) writes no reward: not scored. +M=/var/lib/mimo +CWD=/testbed +V=/logs/verifier +mkdir -p "$V" +BASE=$(cat "$M/base" 2>/dev/null) || { echo "setup never ran (no $M/base)" >&2; exit 1; } +cd "$CWD" || exit 1 +if [ -d "$M/git-hidden" ]; then rm -rf "$CWD/.git"; mv "$M/git-hidden" "$CWD/.git"; fi +# the agent's change against the base, so its own commits count too +git add -A >/dev/null 2>&1 && git -c core.fileMode=false diff --cached "$BASE" > "$V/agent.diff" +git reset -q +if ! ( +while IFS= read -r tf; do + [ -z "$tf" ] && continue + if git cat-file -e $BASE:"$tf" 2>/dev/null; then + git checkout $BASE -- "$tf" 2>/dev/null || true + else + git rm -f --cached "$tf" >/dev/null 2>&1 || true + rm -f "$tf" + fi +done <<'EOF_RESET_TEST_FILES' +test_commands.json +tests/test_mapping.py +mimo_test_command.sh +EOF_RESET_TEST_FILES + +); then echo "could not reset the test files (testbed problem, not scored)" >&2; exit 1; fi +if ! git apply --verbose /tests/test.patch > "$V/apply.log" 2>&1; then + cat "$V/apply.log" >&2 + echo "the hidden tests could not be applied (testbed problem, not scored)" >&2 + exit 1 +fi +timeout 1800 sh -c "$(cat /tests/test_command.sh)" > "$V/test_output.log" 2>&1 +RC=$? +tail -c 12000 "$V/test_output.log" +if [ $RC -eq 0 ]; then echo 1 > "$V/reward.txt"; else echo 0 > "$V/reward.txt"; fi +echo "test command exited $RC" diff --git a/tasks/format-code-task-001695/tests/test_command.sh b/tasks/format-code-task-001695/tests/test_command.sh new file mode 100644 index 0000000000000000000000000000000000000000..7cb23076694ad17d72e8296d62b2b240083e36db --- /dev/null +++ b/tasks/format-code-task-001695/tests/test_command.sh @@ -0,0 +1 @@ +bash /testbed/mimo_test_command.sh \ No newline at end of file diff --git a/tasks/format-code-task-001802/environment/Dockerfile b/tasks/format-code-task-001802/environment/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..00373ebb7fdcc8f42852824e436eb158876dc830 --- /dev/null +++ b/tasks/format-code-task-001802/environment/Dockerfile @@ -0,0 +1,3 @@ +# The task's image, pinned by digest (the same as [environment].docker_image). +# Setup runs at start from [environment.healthcheck]; environment/setup/ is its readable copy. +FROM docker.io/xiaomimimo/mimo-v2.6-rl-oss@sha256:8b6aa94b0d4b235cda85dea12945506106fb65f0e5351c1da6fc944c02b4d683 diff --git a/tasks/format-code-task-001802/environment/setup/files/blocklist b/tasks/format-code-task-001802/environment/setup/files/blocklist new file mode 100644 index 0000000000000000000000000000000000000000..a8e4bdc4c7d9b739c047a3cb58ea72a1bb05bcbc --- /dev/null +++ b/tasks/format-code-task-001802/environment/setup/files/blocklist @@ -0,0 +1,33 @@ +# mimo answer-leak blocklist (mimoagent) +0.0.0.0 github.com +0.0.0.0 www.github.com +0.0.0.0 api.github.com +0.0.0.0 raw.githubusercontent.com +0.0.0.0 codeload.github.com +0.0.0.0 objects.githubusercontent.com +0.0.0.0 gist.github.com +0.0.0.0 gist.githubusercontent.com +0.0.0.0 gitlab.com +0.0.0.0 bitbucket.org +0.0.0.0 sourceforge.net +0.0.0.0 git.kernel.org +0.0.0.0 chromium.googlesource.com +0.0.0.0 android.googlesource.com +0.0.0.0 sourcegraph.com +0.0.0.0 bugs.chromium.org +0.0.0.0 issues.oss-fuzz.com +0.0.0.0 oss-fuzz.com +0.0.0.0 osv.dev +0.0.0.0 api.osv.dev +0.0.0.0 bugzilla.mozilla.org +0.0.0.0 proxy.golang.org +0.0.0.0 sum.golang.org +0.0.0.0 pkg.go.dev +0.0.0.0 google.com +0.0.0.0 www.google.com +0.0.0.0 bing.com +0.0.0.0 www.bing.com +0.0.0.0 duckduckgo.com +0.0.0.0 html.duckduckgo.com +0.0.0.0 search.brave.com +0.0.0.0 stackoverflow.com diff --git a/tasks/format-code-task-001802/environment/setup/setup.sh b/tasks/format-code-task-001802/environment/setup/setup.sh new file mode 100644 index 0000000000000000000000000000000000000000..d883db90cfcfb48f7a139861bbe9f6b5d95cad6f --- /dev/null +++ b/tasks/format-code-task-001802/environment/setup/setup.sh @@ -0,0 +1,34 @@ +#!/bin/bash +# Runs once, as root, before the agent starts: Harbor's [environment.healthcheck] unpacks this folder into +# /var/lib/mimo and runs it. Generated by mimo_harbor; see its README for how each step maps to Xiaomi's harness. +M=/var/lib/mimo +[ -f "$M/ready" ] && exit 0 +chmod 700 "$M" +fail() { echo "setup: $*" >&2; exit 1; } +# the answer-leak blocklist (mimoagent), applied to /etc/hosts by the agent right after it installs +write_blocklist() { cp "$M/files/blocklist" "$M/blocklist"; } + +# Code: mimoagent environments/datasets/opensource_code.py + base.py, as the explorer runs it (app/runner/domains.py Code). +CWD=/testbed +git config --global --add safe.directory "$CWD" +cd "$CWD" || fail "no working directory $CWD" +if ! git rev-parse --git-dir >/dev/null 2>&1; then # a bare source tree: give it a baseline commit + git init -q && git add -A && git -c user.name=mimo -c user.email=mimo@localhost commit -q -m baseline --allow-empty +fi +BASE=$(git rev-parse HEAD 2>/dev/null) +[ ${#BASE} -eq 40 ] || fail "could not resolve the base commit in $CWD" +echo "$BASE" > "$M/base" +# Images are built with history truncated at the base. If one is not, the fix could be read out of git log, +# so .git is hidden while the agent works and put back for grading. +LATER=$(git rev-list --all --not "$BASE" 2>/dev/null | head -n 5 | grep -c . || true) +rm -f /tmp/fail.log /tmp/pass.log /tmp/patch.diff /tmp/test_patch.diff /tmp/*.log 2>/dev/null; rm -rf /tmp/claude-0 /tmp/claude-* /tmp/testem-* /tmp/puppeteer_dev_chrome_profile-* 2>/dev/null; rm -f /tmp/test_files.json 2>/dev/null; rm -rf /tmp/jest_* /tmp/jest-* /tmp/build /tmp/build_env 2>/dev/null; rm -rf /tmp/pytest-of-root /tmp/pytest-* /tmp/.pytest_cache /tmp/__pycache__ 2>/dev/null; rm -rf /tmp/go-build* /tmp/standards /tmp/wordpress /tmp/zig-* /tmp/testbase /tmp/testbed 2>/dev/null; rm -f /tmp/tmp*.tmp /tmp/*.bak /tmp/expect* /tmp/butwas* 2>/dev/null; rm -rf /root/.cache/go-build 2>/dev/null; rm -rf /tests 2>/dev/null; find /logs -mindepth 1 -delete 2>/dev/null; mkdir -p /logs/agent /logs/verifier /logs/artifacts; chmod 777 /logs/agent /logs/verifier /logs/artifacts; find /var/log -type f -delete 2>/dev/null || true; rm -rf /var/lib/postgresql/*/*/log /var/lib/postgresql/*/*/pg_log 2>/dev/null || true; find /var/lib/mysql /var/lib/mongodb -type f -name '*.log' -delete 2>/dev/null || true; rm -rf /root/.npm/_logs /root/.babel.json /root/.pytest_cache 2>/dev/null || true; find / -maxdepth 4 -xdev -name task_description.md -path '*/.build_env/*' -delete 2>/dev/null || true; true +git clean -fdx --exclude=node_modules --exclude=bower_components --exclude=.husky --exclude=vendor --exclude=third_party --exclude=_deps --exclude=vcpkg_installed --exclude=.venv --exclude=venv --exclude=.gradle --exclude=target --exclude=.build --exclude=lib --exclude=.bundle --exclude=Manifest.toml --exclude=_build --exclude=.stack-work --exclude=dist-newstyle >/dev/null 2>&1 +find /root/.m2 -type f \( -name '*-SNAPSHOT.jar' -o -name '*-SNAPSHOT-sources.jar' -o -name '*-SNAPSHOT-tests.jar' -o -name '*-SNAPSHOT-test-sources.jar' \) -delete 2>/dev/null; rm -rf /root/.julia/compiled 2>/dev/null; rm -rf /root/.gradle/caches/build-cache-* /root/.gradle/daemon 2>/dev/null; rm -rf /root/.gradle/caches/*/scripts /root/.gradle/caches/jars-* 2>/dev/null; rm -rf /root/.cache/bazel 2>/dev/null; true +if [ "$LATER" -gt 0 ]; then + mv "$CWD/.git" "$M/git-hidden" + echo "history not truncated at ${BASE:0:12}: .git hidden while the agent works" +fi +write_blocklist + +touch "$M/ready" +echo "setup done" diff --git a/tasks/format-code-task-001802/tests/test.patch b/tasks/format-code-task-001802/tests/test.patch new file mode 100644 index 0000000000000000000000000000000000000000..7cfd107a9541622f6b5425d7a8d48dc8a160992f --- /dev/null +++ b/tasks/format-code-task-001802/tests/test.patch @@ -0,0 +1,136 @@ +diff --git a/tests/lcb/stdlib/modulo.lcb b/tests/lcb/stdlib/modulo.lcb +new file mode 100644 +index 000000000..62ea90804 +--- /dev/null ++++ b/tests/lcb/stdlib/modulo.lcb +@@ -0,0 +1,52 @@ ++/* ++Copyright (C) 2015 Runtime Revolution Ltd. ++ ++This file is part of LiveCode. ++ ++LiveCode is free software; you can redistribute it and/or modify it under ++the terms of the GNU General Public License v3 as published by the Free ++Software Foundation. ++ ++LiveCode is distributed in the hope that it will be useful, but WITHOUT ANY ++WARRANTY; without even the implied warranty of MERCHANTABILITY or ++FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License ++for more details. ++ ++You should have received a copy of the GNU General Public License ++along with LiveCode. If not see . */ ++ ++module com.livecode.modulo.tests ++ ++public handler TestModIntegerPositiveDivisor() ++ test "pos pos" when 10 mod 3 = 1 ++ test "neg pos" when -10 mod 3 = 2 ++ test "exact" when 9 mod 3 = 0 ++ test "zero dividend" when 0 mod 5 = 0 ++ test "smaller pos" when 2 mod 5 = 2 ++ test "smaller neg" when -2 mod 5 = 3 ++end handler ++ ++public handler TestModIntegerNegativeDivisor() ++ test "pos neg" when 10 mod -3 = -2 ++ test "neg neg" when -10 mod -3 = -1 ++ test "smaller pos" when 2 mod -5 = -3 ++ test "smaller neg" when -2 mod -5 = -2 ++end handler ++ ++public handler TestModIntegerEqualMagnitude() ++ test "equal" when 7 mod 7 = 0 ++ test "neg equal" when -7 mod 7 = 0 ++ test "opposite" when 7 mod -7 = 0 ++end handler ++ ++public handler TestModRealPositiveDivisor() ++ test "pos pos" when 5.5 mod 2 = 1.5 ++ test "neg pos" when -5.5 mod 2 = 0.5 ++end handler ++ ++public handler TestModRealNegativeDivisor() ++ test "pos neg" when 5.5 mod -2 = -0.5 ++ test "neg neg" when -5.5 mod -2 = -1.5 ++end handler ++ ++end module +diff --git a/mimo_test_command.sh b/mimo_test_command.sh +new file mode 100755 +--- /dev/null ++++ b/mimo_test_command.sh +@@ -0,0 +1,73 @@ ++#!/usr/bin/env bash ++ ++ ++ ++set -euo pipefail ++HERE="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" ++cd /testbed ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++mkdir -p .build_env/icu-compat ++: > .build_env/icu-compat/icu_compat_preinclude.h ++ ++ ++find /testbed -type f ! -path '*/.git/*' -exec touch -d '2001-01-01 00:00:00' {} + 2>/dev/null || true ++ ++ ++find /testbed/_cache /testbed/_build /testbed/libscript/src/_mlc \ ++ -type f -exec touch -d '2002-01-01 00:00:00' {} + 2>/dev/null || true ++touch -d '2001-01-01 00:00:00' .build_env/icu-compat/icu_compat_preinclude.h ++ ++ ++{ git diff --name-only -- \ ++ 'libfoundation/*.cpp' 'libfoundation/*.h' 'libfoundation/*.c' \ ++ 'libscript/*.cpp' 'libscript/*.h' 'libscript/*.mlc' 'libscript/*.c' \ ++ 'engine/*.cpp' 'engine/*.h' 2>/dev/null ++ git diff --cached --name-only -- \ ++ 'libfoundation/*.cpp' 'libfoundation/*.h' 'libfoundation/*.c' \ ++ 'libscript/*.cpp' 'libscript/*.h' 'libscript/*.mlc' 'libscript/*.c' \ ++ 'engine/*.cpp' 'engine/*.h' 2>/dev/null ++} | sort -u | while read -r f; do ++ [ -f "$f" ] && touch "$f" ++done ++ ++ ++make -C libfoundation libfoundation ++make -C libscript libstdscript ++make -C toolchain lc-run ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++make -C tests/lcb check ++ ++ ++LC_RUN=_build/linux/x86_64/debug/lc-run ++TESTRUNNER=_tests/lcb/_testrunner.lcm ++"$LC_RUN" --handler SummarizeTests "$TESTRUNNER" \ ++ --summary-log /tmp/modulo-summary.log \ ++ _tests/lcb/stdlib/modulo.log diff --git a/tasks/format-code-task-001802/tests/test.sh b/tasks/format-code-task-001802/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..b193adee8f8ed852cde634d0e12142b765787217 --- /dev/null +++ b/tasks/format-code-task-001802/tests/test.sh @@ -0,0 +1,38 @@ +#!/bin/bash +# Code grading, mimoagent opensource_code.py: reset the files the hidden test patch touches, apply it, run the +# task's test command; reward 1 when it exits 0. A testbed failure (reset or apply) writes no reward: not scored. +M=/var/lib/mimo +CWD=/testbed +V=/logs/verifier +mkdir -p "$V" +BASE=$(cat "$M/base" 2>/dev/null) || { echo "setup never ran (no $M/base)" >&2; exit 1; } +cd "$CWD" || exit 1 +if [ -d "$M/git-hidden" ]; then rm -rf "$CWD/.git"; mv "$M/git-hidden" "$CWD/.git"; fi +# the agent's change against the base, so its own commits count too +git add -A >/dev/null 2>&1 && git -c core.fileMode=false diff --cached "$BASE" > "$V/agent.diff" +git reset -q +if ! ( +while IFS= read -r tf; do + [ -z "$tf" ] && continue + if git cat-file -e $BASE:"$tf" 2>/dev/null; then + git checkout $BASE -- "$tf" 2>/dev/null || true + else + git rm -f --cached "$tf" >/dev/null 2>&1 || true + rm -f "$tf" + fi +done <<'EOF_RESET_TEST_FILES' +tests/lcb/stdlib/modulo.lcb +mimo_test_command.sh +EOF_RESET_TEST_FILES + +); then echo "could not reset the test files (testbed problem, not scored)" >&2; exit 1; fi +if ! git apply --verbose /tests/test.patch > "$V/apply.log" 2>&1; then + cat "$V/apply.log" >&2 + echo "the hidden tests could not be applied (testbed problem, not scored)" >&2 + exit 1 +fi +timeout 1800 sh -c "$(cat /tests/test_command.sh)" > "$V/test_output.log" 2>&1 +RC=$? +tail -c 12000 "$V/test_output.log" +if [ $RC -eq 0 ]; then echo 1 > "$V/reward.txt"; else echo 0 > "$V/reward.txt"; fi +echo "test command exited $RC" diff --git a/tasks/format-code-task-001802/tests/test_command.sh b/tasks/format-code-task-001802/tests/test_command.sh new file mode 100644 index 0000000000000000000000000000000000000000..7cb23076694ad17d72e8296d62b2b240083e36db --- /dev/null +++ b/tasks/format-code-task-001802/tests/test_command.sh @@ -0,0 +1 @@ +bash /testbed/mimo_test_command.sh \ No newline at end of file diff --git a/tasks/format-code-task-001811/environment/Dockerfile b/tasks/format-code-task-001811/environment/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..2eafd5b8e91e9edb146ddd3f1f7ce2d213233260 --- /dev/null +++ b/tasks/format-code-task-001811/environment/Dockerfile @@ -0,0 +1,3 @@ +# The task's image, pinned by digest (the same as [environment].docker_image). +# Setup runs at start from [environment.healthcheck]; environment/setup/ is its readable copy. +FROM docker.io/xiaomimimo/mimo-v2.6-rl-oss@sha256:799a07981738372251b71461764263678b9ff17504788c82de69eecf9344cd83 diff --git a/tasks/format-code-task-001811/environment/setup/files/blocklist b/tasks/format-code-task-001811/environment/setup/files/blocklist new file mode 100644 index 0000000000000000000000000000000000000000..a8e4bdc4c7d9b739c047a3cb58ea72a1bb05bcbc --- /dev/null +++ b/tasks/format-code-task-001811/environment/setup/files/blocklist @@ -0,0 +1,33 @@ +# mimo answer-leak blocklist (mimoagent) +0.0.0.0 github.com +0.0.0.0 www.github.com +0.0.0.0 api.github.com +0.0.0.0 raw.githubusercontent.com +0.0.0.0 codeload.github.com +0.0.0.0 objects.githubusercontent.com +0.0.0.0 gist.github.com +0.0.0.0 gist.githubusercontent.com +0.0.0.0 gitlab.com +0.0.0.0 bitbucket.org +0.0.0.0 sourceforge.net +0.0.0.0 git.kernel.org +0.0.0.0 chromium.googlesource.com +0.0.0.0 android.googlesource.com +0.0.0.0 sourcegraph.com +0.0.0.0 bugs.chromium.org +0.0.0.0 issues.oss-fuzz.com +0.0.0.0 oss-fuzz.com +0.0.0.0 osv.dev +0.0.0.0 api.osv.dev +0.0.0.0 bugzilla.mozilla.org +0.0.0.0 proxy.golang.org +0.0.0.0 sum.golang.org +0.0.0.0 pkg.go.dev +0.0.0.0 google.com +0.0.0.0 www.google.com +0.0.0.0 bing.com +0.0.0.0 www.bing.com +0.0.0.0 duckduckgo.com +0.0.0.0 html.duckduckgo.com +0.0.0.0 search.brave.com +0.0.0.0 stackoverflow.com diff --git a/tasks/format-code-task-001811/environment/setup/setup.sh b/tasks/format-code-task-001811/environment/setup/setup.sh new file mode 100644 index 0000000000000000000000000000000000000000..d883db90cfcfb48f7a139861bbe9f6b5d95cad6f --- /dev/null +++ b/tasks/format-code-task-001811/environment/setup/setup.sh @@ -0,0 +1,34 @@ +#!/bin/bash +# Runs once, as root, before the agent starts: Harbor's [environment.healthcheck] unpacks this folder into +# /var/lib/mimo and runs it. Generated by mimo_harbor; see its README for how each step maps to Xiaomi's harness. +M=/var/lib/mimo +[ -f "$M/ready" ] && exit 0 +chmod 700 "$M" +fail() { echo "setup: $*" >&2; exit 1; } +# the answer-leak blocklist (mimoagent), applied to /etc/hosts by the agent right after it installs +write_blocklist() { cp "$M/files/blocklist" "$M/blocklist"; } + +# Code: mimoagent environments/datasets/opensource_code.py + base.py, as the explorer runs it (app/runner/domains.py Code). +CWD=/testbed +git config --global --add safe.directory "$CWD" +cd "$CWD" || fail "no working directory $CWD" +if ! git rev-parse --git-dir >/dev/null 2>&1; then # a bare source tree: give it a baseline commit + git init -q && git add -A && git -c user.name=mimo -c user.email=mimo@localhost commit -q -m baseline --allow-empty +fi +BASE=$(git rev-parse HEAD 2>/dev/null) +[ ${#BASE} -eq 40 ] || fail "could not resolve the base commit in $CWD" +echo "$BASE" > "$M/base" +# Images are built with history truncated at the base. If one is not, the fix could be read out of git log, +# so .git is hidden while the agent works and put back for grading. +LATER=$(git rev-list --all --not "$BASE" 2>/dev/null | head -n 5 | grep -c . || true) +rm -f /tmp/fail.log /tmp/pass.log /tmp/patch.diff /tmp/test_patch.diff /tmp/*.log 2>/dev/null; rm -rf /tmp/claude-0 /tmp/claude-* /tmp/testem-* /tmp/puppeteer_dev_chrome_profile-* 2>/dev/null; rm -f /tmp/test_files.json 2>/dev/null; rm -rf /tmp/jest_* /tmp/jest-* /tmp/build /tmp/build_env 2>/dev/null; rm -rf /tmp/pytest-of-root /tmp/pytest-* /tmp/.pytest_cache /tmp/__pycache__ 2>/dev/null; rm -rf /tmp/go-build* /tmp/standards /tmp/wordpress /tmp/zig-* /tmp/testbase /tmp/testbed 2>/dev/null; rm -f /tmp/tmp*.tmp /tmp/*.bak /tmp/expect* /tmp/butwas* 2>/dev/null; rm -rf /root/.cache/go-build 2>/dev/null; rm -rf /tests 2>/dev/null; find /logs -mindepth 1 -delete 2>/dev/null; mkdir -p /logs/agent /logs/verifier /logs/artifacts; chmod 777 /logs/agent /logs/verifier /logs/artifacts; find /var/log -type f -delete 2>/dev/null || true; rm -rf /var/lib/postgresql/*/*/log /var/lib/postgresql/*/*/pg_log 2>/dev/null || true; find /var/lib/mysql /var/lib/mongodb -type f -name '*.log' -delete 2>/dev/null || true; rm -rf /root/.npm/_logs /root/.babel.json /root/.pytest_cache 2>/dev/null || true; find / -maxdepth 4 -xdev -name task_description.md -path '*/.build_env/*' -delete 2>/dev/null || true; true +git clean -fdx --exclude=node_modules --exclude=bower_components --exclude=.husky --exclude=vendor --exclude=third_party --exclude=_deps --exclude=vcpkg_installed --exclude=.venv --exclude=venv --exclude=.gradle --exclude=target --exclude=.build --exclude=lib --exclude=.bundle --exclude=Manifest.toml --exclude=_build --exclude=.stack-work --exclude=dist-newstyle >/dev/null 2>&1 +find /root/.m2 -type f \( -name '*-SNAPSHOT.jar' -o -name '*-SNAPSHOT-sources.jar' -o -name '*-SNAPSHOT-tests.jar' -o -name '*-SNAPSHOT-test-sources.jar' \) -delete 2>/dev/null; rm -rf /root/.julia/compiled 2>/dev/null; rm -rf /root/.gradle/caches/build-cache-* /root/.gradle/daemon 2>/dev/null; rm -rf /root/.gradle/caches/*/scripts /root/.gradle/caches/jars-* 2>/dev/null; rm -rf /root/.cache/bazel 2>/dev/null; true +if [ "$LATER" -gt 0 ]; then + mv "$CWD/.git" "$M/git-hidden" + echo "history not truncated at ${BASE:0:12}: .git hidden while the agent works" +fi +write_blocklist + +touch "$M/ready" +echo "setup done" diff --git a/tasks/format-code-task-001811/tests/test.patch b/tasks/format-code-task-001811/tests/test.patch new file mode 100644 index 0000000000000000000000000000000000000000..cc2a0f6686e951fdf2562ced2b41f4d31657cf8c --- /dev/null +++ b/tasks/format-code-task-001811/tests/test.patch @@ -0,0 +1,106 @@ +diff --git a/locust/test/test_runners.py b/locust/test/test_runners.py +index 0666f415..964610bf 100644 +--- a/locust/test/test_runners.py ++++ b/locust/test/test_runners.py +@@ -1069,6 +1069,79 @@ class TestMasterRunner(LocustTestCase): + self.assertEqual(1, len(master.clients)) + master.quit() + ++ def test_master_stop_resets_shape_last_state(self): ++ ++ ++ ++ class DummyShape(LoadTestShape): ++ def tick(self): ++ return None ++ ++ self.environment.shape_class = DummyShape() ++ ++ with mock.patch("locust.rpc.rpc.Server", mocked_rpc()) as server: ++ master = self.get_runner() ++ server.mocked_send(Message("client_ready", None, "fake_client1")) ++ ++ master.shape_last_state = (5, 5) ++ master.state = STATE_RUNNING ++ master.stop() ++ self.assertIsNone( ++ master.shape_last_state, ++ "MasterRunner.stop() must reset shape_last_state to None when a shape_class is set", ++ ) ++ ++ def test_master_restart_shape_after_stop_sends_spawn(self): ++ ++ ++ ++ ++ ++ class ConstantShape(LoadTestShape): ++ def tick(self): ++ return (1, 1) ++ ++ self.environment.shape_class = ConstantShape() ++ ++ with mock.patch("locust.rpc.rpc.Server", mocked_rpc()) as server: ++ master = self.get_runner() ++ for i in range(3): ++ server.mocked_send(Message("client_ready", None, "fake_client%i" % i)) ++ ++ ++ master.start_shape() ++ sleep(0.5) ++ spawn_count_first = sum(1 for _, m in server.outbox if m.type == "spawn") ++ self.assertGreater( ++ spawn_count_first, 0, ++ "Expected spawn messages from initial start_shape()", ++ ) ++ ++ for i in range(3): ++ server.mocked_send(Message("spawning_complete", {"count": 1}, "fake_client%i" % i)) ++ sleep(0.1) ++ ++ ++ master.stop() ++ ++ ++ sleep(1.5) ++ ++ ++ server.outbox.clear() ++ ++ ++ ++ master.start_shape() ++ sleep(0.5) ++ ++ spawn_count_second = sum(1 for _, m in server.outbox if m.type == "spawn") ++ self.assertGreater( ++ spawn_count_second, 0, ++ "Expected spawn messages after restart: shape_last_state was not reset " ++ "on stop, so shape_worker incorrectly treated the new tick value as unchanged", ++ ) ++ + class TestWorkerRunner(LocustTestCase): + def setUp(self): + super(TestWorkerRunner, self).setUp() +diff --git a/test_commands.json b/test_commands.json +new file mode 100644 +index 00000000..8bf7a396 +--- /dev/null ++++ b/test_commands.json +@@ -0,0 +1,3 @@ ++{ ++ "test_commands": ["python -m unittest locust.test.test_runners.TestMasterRunner.test_master_stop_resets_shape_last_state locust.test.test_runners.TestMasterRunner.test_master_restart_shape_after_stop_sends_spawn -v"] ++} +diff --git a/mimo_test_command.sh b/mimo_test_command.sh +new file mode 100755 +--- /dev/null ++++ b/mimo_test_command.sh +@@ -0,0 +1,8 @@ ++#!/usr/bin/env bash ++ ++set -uo pipefail ++cd /testbed ++rc=0 ++python -m unittest locust.test.test_runners.TestMasterRunner.test_master_stop_resets_shape_last_state locust.test.test_runners.TestMasterRunner.test_master_restart_shape_after_stop_sends_spawn -v ++rc=$(( rc | $? )) ++exit $rc diff --git a/tasks/format-code-task-001811/tests/test.sh b/tasks/format-code-task-001811/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..969a05307dffd05da5afd1671e65508272781bc9 --- /dev/null +++ b/tasks/format-code-task-001811/tests/test.sh @@ -0,0 +1,39 @@ +#!/bin/bash +# Code grading, mimoagent opensource_code.py: reset the files the hidden test patch touches, apply it, run the +# task's test command; reward 1 when it exits 0. A testbed failure (reset or apply) writes no reward: not scored. +M=/var/lib/mimo +CWD=/testbed +V=/logs/verifier +mkdir -p "$V" +BASE=$(cat "$M/base" 2>/dev/null) || { echo "setup never ran (no $M/base)" >&2; exit 1; } +cd "$CWD" || exit 1 +if [ -d "$M/git-hidden" ]; then rm -rf "$CWD/.git"; mv "$M/git-hidden" "$CWD/.git"; fi +# the agent's change against the base, so its own commits count too +git add -A >/dev/null 2>&1 && git -c core.fileMode=false diff --cached "$BASE" > "$V/agent.diff" +git reset -q +if ! ( +while IFS= read -r tf; do + [ -z "$tf" ] && continue + if git cat-file -e $BASE:"$tf" 2>/dev/null; then + git checkout $BASE -- "$tf" 2>/dev/null || true + else + git rm -f --cached "$tf" >/dev/null 2>&1 || true + rm -f "$tf" + fi +done <<'EOF_RESET_TEST_FILES' +locust/test/test_runners.py +test_commands.json +mimo_test_command.sh +EOF_RESET_TEST_FILES + +); then echo "could not reset the test files (testbed problem, not scored)" >&2; exit 1; fi +if ! git apply --verbose /tests/test.patch > "$V/apply.log" 2>&1; then + cat "$V/apply.log" >&2 + echo "the hidden tests could not be applied (testbed problem, not scored)" >&2 + exit 1 +fi +timeout 1800 sh -c "$(cat /tests/test_command.sh)" > "$V/test_output.log" 2>&1 +RC=$? +tail -c 12000 "$V/test_output.log" +if [ $RC -eq 0 ]; then echo 1 > "$V/reward.txt"; else echo 0 > "$V/reward.txt"; fi +echo "test command exited $RC" diff --git a/tasks/format-code-task-001811/tests/test_command.sh b/tasks/format-code-task-001811/tests/test_command.sh new file mode 100644 index 0000000000000000000000000000000000000000..7cb23076694ad17d72e8296d62b2b240083e36db --- /dev/null +++ b/tasks/format-code-task-001811/tests/test_command.sh @@ -0,0 +1 @@ +bash /testbed/mimo_test_command.sh \ No newline at end of file diff --git a/tasks/format-code-task-001816/environment/Dockerfile b/tasks/format-code-task-001816/environment/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..70fd4865956ad5fd6ffe0d676635b8e558318f85 --- /dev/null +++ b/tasks/format-code-task-001816/environment/Dockerfile @@ -0,0 +1,3 @@ +# The task's image, pinned by digest (the same as [environment].docker_image). +# Setup runs at start from [environment.healthcheck]; environment/setup/ is its readable copy. +FROM docker.io/xiaomimimo/mimo-v2.6-rl-oss@sha256:d6c44798fde3815e96b9018c11db65993ed67d6742c7e182850a7028bd230f46 diff --git a/tasks/format-code-task-001816/environment/setup/files/blocklist b/tasks/format-code-task-001816/environment/setup/files/blocklist new file mode 100644 index 0000000000000000000000000000000000000000..a8e4bdc4c7d9b739c047a3cb58ea72a1bb05bcbc --- /dev/null +++ b/tasks/format-code-task-001816/environment/setup/files/blocklist @@ -0,0 +1,33 @@ +# mimo answer-leak blocklist (mimoagent) +0.0.0.0 github.com +0.0.0.0 www.github.com +0.0.0.0 api.github.com +0.0.0.0 raw.githubusercontent.com +0.0.0.0 codeload.github.com +0.0.0.0 objects.githubusercontent.com +0.0.0.0 gist.github.com +0.0.0.0 gist.githubusercontent.com +0.0.0.0 gitlab.com +0.0.0.0 bitbucket.org +0.0.0.0 sourceforge.net +0.0.0.0 git.kernel.org +0.0.0.0 chromium.googlesource.com +0.0.0.0 android.googlesource.com +0.0.0.0 sourcegraph.com +0.0.0.0 bugs.chromium.org +0.0.0.0 issues.oss-fuzz.com +0.0.0.0 oss-fuzz.com +0.0.0.0 osv.dev +0.0.0.0 api.osv.dev +0.0.0.0 bugzilla.mozilla.org +0.0.0.0 proxy.golang.org +0.0.0.0 sum.golang.org +0.0.0.0 pkg.go.dev +0.0.0.0 google.com +0.0.0.0 www.google.com +0.0.0.0 bing.com +0.0.0.0 www.bing.com +0.0.0.0 duckduckgo.com +0.0.0.0 html.duckduckgo.com +0.0.0.0 search.brave.com +0.0.0.0 stackoverflow.com diff --git a/tasks/format-code-task-001816/environment/setup/setup.sh b/tasks/format-code-task-001816/environment/setup/setup.sh new file mode 100644 index 0000000000000000000000000000000000000000..e9eb7daf39f9542bd095367feee457f3da77e492 --- /dev/null +++ b/tasks/format-code-task-001816/environment/setup/setup.sh @@ -0,0 +1,34 @@ +#!/bin/bash +# Runs once, as root, before the agent starts: Harbor's [environment.healthcheck] unpacks this folder into +# /var/lib/mimo and runs it. Generated by mimo_harbor; see its README for how each step maps to Xiaomi's harness. +M=/var/lib/mimo +[ -f "$M/ready" ] && exit 0 +chmod 700 "$M" +fail() { echo "setup: $*" >&2; exit 1; } +# the answer-leak blocklist (mimoagent), applied to /etc/hosts by the agent right after it installs +write_blocklist() { cp "$M/files/blocklist" "$M/blocklist"; } + +# Code: mimoagent environments/datasets/opensource_code.py + base.py, as the explorer runs it (app/runner/domains.py Code). +CWD=/workspace/repo +git config --global --add safe.directory "$CWD" +cd "$CWD" || fail "no working directory $CWD" +if ! git rev-parse --git-dir >/dev/null 2>&1; then # a bare source tree: give it a baseline commit + git init -q && git add -A && git -c user.name=mimo -c user.email=mimo@localhost commit -q -m baseline --allow-empty +fi +BASE=$(git rev-parse HEAD 2>/dev/null) +[ ${#BASE} -eq 40 ] || fail "could not resolve the base commit in $CWD" +echo "$BASE" > "$M/base" +# Images are built with history truncated at the base. If one is not, the fix could be read out of git log, +# so .git is hidden while the agent works and put back for grading. +LATER=$(git rev-list --all --not "$BASE" 2>/dev/null | head -n 5 | grep -c . || true) +rm -f /tmp/fail.log /tmp/pass.log /tmp/patch.diff /tmp/test_patch.diff /tmp/*.log 2>/dev/null; rm -rf /tmp/claude-0 /tmp/claude-* /tmp/testem-* /tmp/puppeteer_dev_chrome_profile-* 2>/dev/null; rm -f /tmp/test_files.json 2>/dev/null; rm -rf /tmp/jest_* /tmp/jest-* /tmp/build /tmp/build_env 2>/dev/null; rm -rf /tmp/pytest-of-root /tmp/pytest-* /tmp/.pytest_cache /tmp/__pycache__ 2>/dev/null; rm -rf /tmp/go-build* /tmp/standards /tmp/wordpress /tmp/zig-* /tmp/testbase /tmp/testbed 2>/dev/null; rm -f /tmp/tmp*.tmp /tmp/*.bak /tmp/expect* /tmp/butwas* 2>/dev/null; rm -rf /root/.cache/go-build 2>/dev/null; rm -rf /tests 2>/dev/null; find /logs -mindepth 1 -delete 2>/dev/null; mkdir -p /logs/agent /logs/verifier /logs/artifacts; chmod 777 /logs/agent /logs/verifier /logs/artifacts; find /var/log -type f -delete 2>/dev/null || true; rm -rf /var/lib/postgresql/*/*/log /var/lib/postgresql/*/*/pg_log 2>/dev/null || true; find /var/lib/mysql /var/lib/mongodb -type f -name '*.log' -delete 2>/dev/null || true; rm -rf /root/.npm/_logs /root/.babel.json /root/.pytest_cache 2>/dev/null || true; find / -maxdepth 4 -xdev -name task_description.md -path '*/.build_env/*' -delete 2>/dev/null || true; true +git clean -fdx --exclude=node_modules --exclude=bower_components --exclude=.husky --exclude=vendor --exclude=third_party --exclude=_deps --exclude=vcpkg_installed --exclude=.venv --exclude=venv --exclude=.gradle --exclude=target --exclude=.build --exclude=lib --exclude=.bundle --exclude=Manifest.toml --exclude=_build --exclude=.stack-work --exclude=dist-newstyle >/dev/null 2>&1 +find /root/.m2 -type f \( -name '*-SNAPSHOT.jar' -o -name '*-SNAPSHOT-sources.jar' -o -name '*-SNAPSHOT-tests.jar' -o -name '*-SNAPSHOT-test-sources.jar' \) -delete 2>/dev/null; rm -rf /root/.julia/compiled 2>/dev/null; rm -rf /root/.gradle/caches/build-cache-* /root/.gradle/daemon 2>/dev/null; rm -rf /root/.gradle/caches/*/scripts /root/.gradle/caches/jars-* 2>/dev/null; rm -rf /root/.cache/bazel 2>/dev/null; true +if [ "$LATER" -gt 0 ]; then + mv "$CWD/.git" "$M/git-hidden" + echo "history not truncated at ${BASE:0:12}: .git hidden while the agent works" +fi +write_blocklist + +touch "$M/ready" +echo "setup done" diff --git a/tasks/format-code-task-001816/tests/test.patch b/tasks/format-code-task-001816/tests/test.patch new file mode 100644 index 0000000000000000000000000000000000000000..00f6e6b0a3985fc7e526864a1cca996feb8403df --- /dev/null +++ b/tasks/format-code-task-001816/tests/test.patch @@ -0,0 +1,439 @@ +diff --git a/usercase-test-coderl/ldap_message_read_test.go b/usercase-test-coderl/ldap_message_read_test.go +new file mode 100644 +--- /dev/null ++++ b/usercase-test-coderl/ldap_message_read_test.go +@@ -0,0 +1,399 @@ ++package usercase_test_coderl ++ ++import ( ++ "encoding/hex" ++ "errors" ++ "os" ++ "reflect" ++ "testing" ++ ++ msg "github.com/lor00x/goldap/message" ++) ++ ++ ++ ++ ++ ++ ++type expectedControl struct { ++ controlType string ++ critical bool ++ valueHex string ++} ++ ++type messageSummary struct { ++ id int ++ opName string ++ controls []expectedControl ++} ++ ++var bindRequestBytes = []byte{0x30, 0x0c, 0x02, 0x01, 0x01, 0x60, 0x07, 0x02, 0x01, 0x03, 0x04, 0x00, 0x80, 0x00} ++var bindResponseBytes = []byte{0x30, 0x0c, 0x02, 0x01, 0x02, 0x61, 0x07, 0x0a, 0x01, 0x00, 0x04, 0x00, 0x04, 0x00} ++var unbindRequestBytes = []byte{0x30, 0x05, 0x02, 0x01, 0x03, 0x42, 0x00} ++var searchRequestBytes = []byte{0x30, 0x28, 0x02, 0x01, 0x05, 0x63, 0x23, 0x04, 0x00, 0x0a, 0x01, 0x00, 0x0a, 0x01, 0x00, 0x02, 0x01, 0x00, 0x02, 0x01, 0x00, 0x01, 0x01, 0x00, 0x87, 0x0b, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x43, 0x6c, 0x61, 0x73, 0x73, 0x30, 0x03, 0x04, 0x01, 0x2a} ++var searchResultEntryBytes = []byte{0x30, 0x31, 0x02, 0x01, 0x05, 0x64, 0x2c, 0x04, 0x00, 0x30, 0x28, 0x30, 0x26, 0x04, 0x0b, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x43, 0x6c, 0x61, 0x73, 0x73, 0x31, 0x17, 0x04, 0x03, 0x74, 0x6f, 0x70, 0x04, 0x10, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x62, 0x6c, 0x65, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74} ++var searchDoneWithControlBytes = []byte{0x30, 0x34, 0x02, 0x01, 0x24, 0x65, 0x07, 0x0a, 0x01, 0x00, 0x04, 0x00, 0x04, 0x00, 0xa0, 0x26, 0x30, 0x24, 0x04, 0x16, 0x31, 0x2e, 0x32, 0x2e, 0x38, 0x34, 0x30, 0x2e, 0x31, 0x31, 0x33, 0x35, 0x35, 0x36, 0x2e, 0x31, 0x2e, 0x34, 0x2e, 0x33, 0x31, 0x39, 0x01, 0x01, 0xff, 0x04, 0x07, 0x30, 0x05, 0x02, 0x01, 0x00, 0x04, 0x00} ++var searchResultReferenceBytes = []byte{0x30, 0x11, 0x02, 0x01, 0x07, 0x73, 0x0c, 0x04, 0x0a, 0x6c, 0x64, 0x61, 0x70, 0x3a, 0x2f, 0x2f, 0x61, 0x2f, 0x62} ++var modifyRequestBytes = []byte{0x30, 0x79, 0x02, 0x01, 0x19, 0x66, 0x74, 0x04, 0x4a, 0x63, 0x6e, 0x3d, 0x72, 0x30, 0x30, 0x58, 0x2b, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x54, 0x68, 0x65, 0x20, 0x72, 0x30, 0x30, 0x58, 0x2b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x3d, 0x41, 0x20, 0x74, 0x65, 0x73, 0x74, 0x20, 0x75, 0x73, 0x65, 0x72, 0x2c, 0x6f, 0x75, 0x3d, 0x63, 0x6f, 0x6e, 0x73, 0x75, 0x6d, 0x65, 0x72, 0x73, 0x2c, 0x6f, 0x75, 0x3d, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x30, 0x26, 0x30, 0x24, 0x0a, 0x01, 0x00, 0x30, 0x1f, 0x04, 0x0f, 0x74, 0x65, 0x6c, 0x65, 0x70, 0x68, 0x6f, 0x6e, 0x65, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x31, 0x0c, 0x04, 0x0a, 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39} ++var modifyResponseBytes = []byte{0x30, 0x0c, 0x02, 0x01, 0x19, 0x67, 0x07, 0x0a, 0x01, 0x00, 0x04, 0x00, 0x04, 0x00} ++var addRequestBytes = []byte{0x30, 0x81, 0xb6, 0x02, 0x01, 0x15, 0x68, 0x81, 0xb0, 0x04, 0x4a, 0x63, 0x6e, 0x3d, 0x72, 0x30, 0x30, 0x58, 0x2b, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x4e, 0x61, 0x6d, 0x65, 0x3d, 0x54, 0x68, 0x65, 0x20, 0x72, 0x30, 0x30, 0x58, 0x2b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x3d, 0x41, 0x20, 0x74, 0x65, 0x73, 0x74, 0x20, 0x75, 0x73, 0x65, 0x72, 0x2c, 0x6f, 0x75, 0x3d, 0x63, 0x6f, 0x6e, 0x73, 0x75, 0x6d, 0x65, 0x72, 0x73, 0x2c, 0x6f, 0x75, 0x3d, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x30, 0x62, 0x30, 0x1c, 0x04, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x31, 0x0d, 0x04, 0x0b, 0x41, 0x20, 0x74, 0x65, 0x73, 0x74, 0x20, 0x75, 0x73, 0x65, 0x72, 0x30, 0x0c, 0x04, 0x02, 0x73, 0x6e, 0x31, 0x06, 0x04, 0x04, 0x72, 0x30, 0x30, 0x78, 0x30, 0x16, 0x04, 0x02, 0x63, 0x6e, 0x31, 0x10, 0x04, 0x04, 0x72, 0x30, 0x30, 0x58, 0x04, 0x08, 0x54, 0x68, 0x65, 0x20, 0x72, 0x30, 0x30, 0x58, 0x30, 0x1c, 0x04, 0x0b, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x43, 0x6c, 0x61, 0x73, 0x73, 0x31, 0x0d, 0x04, 0x06, 0x70, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x04, 0x03, 0x74, 0x6f, 0x70} ++var addResponseBytes = []byte{0x30, 0x0c, 0x02, 0x01, 0x15, 0x69, 0x07, 0x0a, 0x01, 0x00, 0x04, 0x00, 0x04, 0x00} ++var delRequestBytes = []byte{0x30, 0x40, 0x02, 0x01, 0x27, 0x4a, 0x3b, 0x63, 0x6e, 0x3d, 0x41, 0x20, 0x63, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x78, 0x20, 0x70, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x5c, 0x2c, 0x20, 0x76, 0x65, 0x72, 0x79, 0x20, 0x63, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x78, 0x20, 0x21, 0x2c, 0x6f, 0x75, 0x3d, 0x63, 0x6f, 0x6e, 0x73, 0x75, 0x6d, 0x65, 0x72, 0x73, 0x2c, 0x6f, 0x75, 0x3d, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d} ++var delResponseBytes = []byte{0x30, 0x0c, 0x02, 0x01, 0x27, 0x6b, 0x07, 0x0a, 0x01, 0x00, 0x04, 0x00, 0x04, 0x00} ++var modifyDNRequestBytes = []byte{0x30, 0x75, 0x02, 0x01, 0x1b, 0x6c, 0x70, 0x04, 0x4a, 0x63, 0x6e, 0x3d, 0x72, 0x30, 0x30, 0x58, 0x2b, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x54, 0x68, 0x65, 0x20, 0x72, 0x30, 0x30, 0x58, 0x2b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x3d, 0x41, 0x20, 0x74, 0x65, 0x73, 0x74, 0x20, 0x75, 0x73, 0x65, 0x72, 0x2c, 0x6f, 0x75, 0x3d, 0x63, 0x6f, 0x6e, 0x73, 0x75, 0x6d, 0x65, 0x72, 0x73, 0x2c, 0x6f, 0x75, 0x3d, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x04, 0x07, 0x63, 0x6e, 0x3d, 0x72, 0x30, 0x30, 0x58, 0x01, 0x01, 0xff, 0x80, 0x16, 0x6f, 0x75, 0x3d, 0x63, 0x6f, 0x6e, 0x73, 0x75, 0x6d, 0x65, 0x72, 0x73, 0x2c, 0x6f, 0x75, 0x3d, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d} ++var modifyDNResponseBytes = []byte{0x30, 0x0c, 0x02, 0x01, 0x1b, 0x6d, 0x07, 0x0a, 0x01, 0x00, 0x04, 0x00, 0x04, 0x00} ++var compareRequestBytes = []byte{0x30, 0x14, 0x02, 0x01, 0x28, 0x6e, 0x0f, 0x04, 0x04, 0x63, 0x6e, 0x3d, 0x61, 0x30, 0x07, 0x04, 0x02, 0x63, 0x6e, 0x04, 0x01, 0x61} ++var compareResponseBytes = []byte{0x30, 0x0c, 0x02, 0x01, 0x28, 0x6f, 0x07, 0x0a, 0x01, 0x00, 0x04, 0x00, 0x04, 0x00} ++var abandonRequestBytes = []byte{0x30, 0x06, 0x02, 0x01, 0x0a, 0x50, 0x01, 0x05} ++var extendedRequestBytes = []byte{0x30, 0x1d, 0x02, 0x01, 0x01, 0x77, 0x18, 0x80, 0x16, 0x31, 0x2e, 0x33, 0x2e, 0x36, 0x2e, 0x31, 0x2e, 0x34, 0x2e, 0x31, 0x2e, 0x31, 0x34, 0x36, 0x36, 0x2e, 0x32, 0x30, 0x30, 0x33, 0x37} ++var extendedResponseBytes = []byte{0x30, 0x26, 0x02, 0x01, 0x01, 0x78, 0x21, 0x0a, 0x01, 0x00, 0x04, 0x00, 0x04, 0x00, 0x8a, 0x16, 0x31, 0x2e, 0x33, 0x2e, 0x36, 0x2e, 0x31, 0x2e, 0x34, 0x2e, 0x31, 0x2e, 0x31, 0x34, 0x36, 0x36, 0x2e, 0x32, 0x30, 0x30, 0x33, 0x37, 0x8b, 0x00} ++var intermediateResponseBytes = []byte{0x30, 0x10, 0x02, 0x01, 0x09, 0x79, 0x0b, 0x80, 0x05, 0x31, 0x2e, 0x32, 0x2e, 0x33, 0x81, 0x02, 0x78, 0x79} ++ ++func TestDecodesBindRequestWithoutControls(t *testing.T) { ++ ++ ++ assertMessage(t, bindRequestBytes, 1, "BindRequest", nil) ++} ++ ++func TestDecodesBindResponseTag(t *testing.T) { ++ ++ ++ assertMessage(t, bindResponseBytes, 2, "BindResponse", nil) ++} ++ ++func TestDecodesUnbindRequestTag(t *testing.T) { ++ ++ ++ assertMessage(t, unbindRequestBytes, 3, "UnbindRequest", nil) ++} ++ ++func TestDecodesSearchRequestTag(t *testing.T) { ++ ++ ++ assertMessage(t, searchRequestBytes, 5, "SearchRequest", nil) ++} ++ ++func TestDecodesSearchResultEntryTag(t *testing.T) { ++ ++ ++ assertMessage(t, searchResultEntryBytes, 5, "SearchResultEntry", nil) ++} ++ ++func TestDecodesSearchResultDoneWithCriticalControl(t *testing.T) { ++ ++ ++ assertMessage(t, searchDoneWithControlBytes, 36, "SearchResultDone", []expectedControl{ ++ {controlType: "1.2.840.113556.1.4.319", critical: true, valueHex: "30050201000400"}, ++ }) ++} ++ ++func TestDecodesSearchResultReferenceTag(t *testing.T) { ++ ++ ++ assertMessage(t, searchResultReferenceBytes, 7, "SearchResultReference", nil) ++} ++ ++func TestDecodesModifyRequestTag(t *testing.T) { ++ ++ ++ assertMessage(t, modifyRequestBytes, 25, "ModifyRequest", nil) ++} ++ ++func TestDecodesModifyResponseTag(t *testing.T) { ++ ++ ++ assertMessage(t, modifyResponseBytes, 25, "ModifyResponse", nil) ++} ++ ++func TestDecodesAddRequestTag(t *testing.T) { ++ ++ ++ assertMessage(t, addRequestBytes, 21, "AddRequest", nil) ++} ++ ++func TestDecodesAddResponseTag(t *testing.T) { ++ ++ ++ assertMessage(t, addResponseBytes, 21, "AddResponse", nil) ++} ++ ++func TestDecodesDeleteRequestTag(t *testing.T) { ++ ++ ++ assertMessage(t, delRequestBytes, 39, "DelRequest", nil) ++} ++ ++func TestDecodesDeleteResponseTag(t *testing.T) { ++ ++ ++ assertMessage(t, delResponseBytes, 39, "DelResponse", nil) ++} ++ ++func TestDecodesModifyDNRequestTag(t *testing.T) { ++ ++ ++ assertMessage(t, modifyDNRequestBytes, 27, "ModifyDNRequest", nil) ++} ++ ++func TestDecodesModifyDNResponseTag(t *testing.T) { ++ ++ ++ assertMessage(t, modifyDNResponseBytes, 27, "ModifyDNResponse", nil) ++} ++ ++func TestDecodesCompareRequestTag(t *testing.T) { ++ ++ ++ assertMessage(t, compareRequestBytes, 40, "CompareRequest", nil) ++} ++ ++func TestDecodesCompareResponseTag(t *testing.T) { ++ ++ ++ assertMessage(t, compareResponseBytes, 40, "CompareResponse", nil) ++} ++ ++func TestDecodesAbandonRequestTag(t *testing.T) { ++ ++ ++ assertMessage(t, abandonRequestBytes, 10, "AbandonRequest", nil) ++} ++ ++func TestDecodesExtendedRequestTag(t *testing.T) { ++ ++ ++ assertMessage(t, extendedRequestBytes, 1, "ExtendedRequest", nil) ++} ++ ++func TestDecodesExtendedResponseTag(t *testing.T) { ++ ++ ++ assertMessage(t, extendedResponseBytes, 1, "ExtendedResponse", nil) ++} ++ ++func TestDecodesIntermediateResponseTag(t *testing.T) { ++ ++ ++ assertMessage(t, intermediateResponseBytes, 9, "IntermediateResponse", nil) ++} ++ ++func TestRejectsUnknownProtocolOpApplicationTag(t *testing.T) { ++ ++ ++ assertLdapError(t, ++ []byte{0x30, 0x05, 0x02, 0x01, 0x01, 0x7e, 0x00}) ++} ++ ++func TestRejectsExplicitFalseControlCriticality(t *testing.T) { ++ ++ ++ assertLdapError(t, ++ []byte{0x30, 0x34, 0x02, 0x01, 0x24, 0x65, 0x07, 0x0a, 0x01, 0x00, 0x04, 0x00, 0x04, 0x00, 0xa0, 0x26, 0x30, 0x24, 0x04, 0x16, 0x31, 0x2e, 0x32, 0x2e, 0x38, 0x34, 0x30, 0x2e, 0x31, 0x31, 0x33, 0x35, 0x35, 0x36, 0x2e, 0x31, 0x2e, 0x34, 0x2e, 0x33, 0x31, 0x39, 0x01, 0x01, 0x00, 0x04, 0x07, 0x30, 0x05, 0x02, 0x01, 0x00, 0x04, 0x00}) ++} ++ ++func TestReportsTruncatedEnvelopeAsReturnedError(t *testing.T) { ++ ++ ++ assertReturnedError(t, ++ []byte{0x30, 0x0c, 0x02, 0x01, 0x01, 0x60, 0x07, 0x02, 0x01, 0x03, 0x04, 0x00, 0x80}) ++} ++ ++func TestRejectsNonSequenceOuterEnvelope(t *testing.T) { ++ ++ ++ assertReturnedError(t, ++ []byte{0x31, 0x0c, 0x02, 0x01, 0x01, 0x60, 0x07, 0x02, 0x01, 0x03, 0x04, 0x00, 0x80, 0x00}) ++} ++ ++func TestReadLDAPMessageIsReferentiallyTransparentForEquivalentInput(t *testing.T) { ++ first := summarizeMessage(t, bindRequestBytes) ++ second := summarizeMessage(t, bindRequestBytes) ++ ++ expected := messageSummary{id: 1, opName: "BindRequest", controls: nil} ++ if !reflect.DeepEqual(first, expected) { ++ t.Fatalf("first summary = %#v, want %#v", first, expected) ++ } ++ if !reflect.DeepEqual(second, expected) { ++ t.Fatalf("second summary = %#v, want %#v", second, expected) ++ } ++ if !reflect.DeepEqual(first, second) { ++ t.Fatalf("first summary = %#v, second summary = %#v", first, second) ++ } ++} ++ ++func TestReadLDAPMessageDoesNotOverwriteCallerByteSlice(t *testing.T) { ++ input := append([]byte(nil), searchDoneWithControlBytes...) ++ message, err := msg.ReadLDAPMessage(msg.NewBytes(0, input)) ++ if err != nil { ++ t.Fatalf("ReadLDAPMessage returned %T: %v, want nil error", err, err) ++ } ++ ++ actual := summarizeDecodedMessage(t, message) ++ expected := messageSummary{id: 36, opName: "SearchResultDone", controls: []expectedControl{ ++ {controlType: "1.2.840.113556.1.4.319", critical: true, valueHex: "30050201000400"}, ++ }} ++ if !reflect.DeepEqual(actual, expected) { ++ t.Fatalf("message summary = %#v, want %#v", actual, expected) ++ } ++} ++ ++func TestReadLDAPMessageHasNoLastCallGlobalState(t *testing.T) { ++ ++ expected := messageSummary{id: 1, opName: "BindRequest", controls: nil} ++ first := summarizeMessage(t, bindRequestBytes) ++ _ = summarizeMessage(t, searchDoneWithControlBytes) ++ _ = summarizeMessage(t, compareRequestBytes) ++ second := summarizeMessage(t, bindRequestBytes) ++ if !reflect.DeepEqual(first, expected) { ++ t.Fatalf("first summary = %#v, want %#v", first, expected) ++ } ++ if !reflect.DeepEqual(second, expected) { ++ t.Fatalf("second summary = %#v, want %#v", second, expected) ++ } ++} ++ ++func TestReadLDAPMessageDoesNotWriteFilesInCWD(t *testing.T) { ++ oldwd, err := os.Getwd() ++ if err != nil { ++ t.Fatalf("Getwd returned %T: %v, want nil error", err, err) ++ } ++ tmp := t.TempDir() ++ if err := os.Chdir(tmp); err != nil { ++ t.Fatalf("Chdir returned %T: %v, want nil error", err, err) ++ } ++ defer func() { ++ if err := os.Chdir(oldwd); err != nil { ++ t.Fatalf("restore Chdir returned %T: %v, want nil error", err, err) ++ } ++ }() ++ ++ assertMessage(t, bindRequestBytes, 1, "BindRequest", nil) ++} ++ ++func assertMessage(t *testing.T, input []byte, wantID int, wantOp string, wantControls []expectedControl) { ++ t.Helper() ++ actual := summarizeMessage(t, input) ++ ++ expected := messageSummary{id: wantID, opName: wantOp, controls: wantControls} ++ if !reflect.DeepEqual(actual, expected) { ++ t.Fatalf("message summary = %#v, want %#v", actual, expected) ++ } ++} ++ ++func summarizeMessage(t *testing.T, input []byte) messageSummary { ++ t.Helper() ++ message, err := msg.ReadLDAPMessage(msg.NewBytes(0, append([]byte(nil), input...))) ++ if err != nil { ++ t.Fatalf("ReadLDAPMessage returned %T: %v, want nil error", err, err) ++ } ++ return summarizeDecodedMessage(t, message) ++} ++ ++func summarizeDecodedMessage(t *testing.T, message msg.LDAPMessage) messageSummary { ++ t.Helper() ++ opName := message.ProtocolOpName() ++ assertConcreteProtocolOp(t, message.ProtocolOp(), opName) ++ summary := messageSummary{ ++ id: message.MessageID().Int(), ++ opName: opName, ++ controls: nil, ++ } ++ if message.Controls() != nil { ++ for _, control := range *message.Controls() { ++ valueHex := "" ++ if control.ControlValue() != nil { ++ valueHex = hex.EncodeToString(control.ControlValue().Bytes()) ++ } ++ summary.controls = append(summary.controls, expectedControl{ ++ controlType: control.ControlType().String(), ++ critical: control.Criticality().Bool(), ++ valueHex: valueHex, ++ }) ++ } ++ } ++ return summary ++} ++ ++func assertConcreteProtocolOp(t *testing.T, op msg.ProtocolOp, wantName string) { ++ t.Helper() ++ ok := false ++ switch wantName { ++ case "BindRequest": ++ _, ok = op.(msg.BindRequest) ++ case "BindResponse": ++ _, ok = op.(msg.BindResponse) ++ case "UnbindRequest": ++ _, ok = op.(msg.UnbindRequest) ++ case "SearchRequest": ++ _, ok = op.(msg.SearchRequest) ++ case "SearchResultEntry": ++ _, ok = op.(msg.SearchResultEntry) ++ case "SearchResultDone": ++ _, ok = op.(msg.SearchResultDone) ++ case "SearchResultReference": ++ _, ok = op.(msg.SearchResultReference) ++ case "ModifyRequest": ++ _, ok = op.(msg.ModifyRequest) ++ case "ModifyResponse": ++ _, ok = op.(msg.ModifyResponse) ++ case "AddRequest": ++ _, ok = op.(msg.AddRequest) ++ case "AddResponse": ++ _, ok = op.(msg.AddResponse) ++ case "DelRequest": ++ _, ok = op.(msg.DelRequest) ++ case "DelResponse": ++ _, ok = op.(msg.DelResponse) ++ case "ModifyDNRequest": ++ _, ok = op.(msg.ModifyDNRequest) ++ case "ModifyDNResponse": ++ _, ok = op.(msg.ModifyDNResponse) ++ case "CompareRequest": ++ _, ok = op.(msg.CompareRequest) ++ case "CompareResponse": ++ _, ok = op.(msg.CompareResponse) ++ case "AbandonRequest": ++ _, ok = op.(msg.AbandonRequest) ++ case "ExtendedRequest": ++ _, ok = op.(msg.ExtendedRequest) ++ case "ExtendedResponse": ++ _, ok = op.(msg.ExtendedResponse) ++ case "IntermediateResponse": ++ _, ok = op.(msg.IntermediateResponse) ++ default: ++ t.Fatalf("protocol op expectation name = %q, want a known public ProtocolOp name", wantName) ++ } ++ if ok != true { ++ t.Fatalf("protocol op dynamic type match for %q = %v, want true", wantName, ok) ++ } ++} ++ ++func assertLdapError(t *testing.T, input []byte) { ++ t.Helper() ++ err := assertReturnedError(t, input) ++ ++ var ldapErr msg.LdapError ++ if errors.As(err, &ldapErr) != true { ++ t.Fatalf("errors.As(err, *message.LdapError) = false for %T %v, want true", err, err) ++ } ++} ++ ++func assertReturnedError(t *testing.T, input []byte) error { ++ t.Helper() ++ var err error ++ var recovered interface{} ++ func() { ++ defer func() { ++ recovered = recover() ++ }() ++ _, err = msg.ReadLDAPMessage(msg.NewBytes(0, append([]byte(nil), input...))) ++ }() ++ if recovered != nil { ++ t.Fatalf("panic = %#v, want nil", recovered) ++ } ++ if err == nil { ++ t.Fatalf("error = nil, want non-nil error") ++ } ++ ++ return err ++} +diff --git a/mimo_test_command.sh b/mimo_test_command.sh +new file mode 100755 +--- /dev/null ++++ b/mimo_test_command.sh +@@ -0,0 +1,30 @@ ++#!/usr/bin/env bash ++ ++ ++ ++ ++export NODE_OPTIONS="${NODE_OPTIONS:-} --max-old-space-size=4096" ++export MAVEN_OPTS="${MAVEN_OPTS:-} -Xmx3g -XX:+UseG1GC" ++export GRADLE_OPTS="${GRADLE_OPTS:-} -Xmx3g -XX:+UseG1GC" ++export TEST_JVM_OPTS="${TEST_JVM_OPTS:-} -Xmx3g" ++set -e ++cd /workspace/repo ++set -euo pipefail ++ ++repo=/workspace/repo ++gopath=/tmp/goldap-fixture-gopath ++ ++mkdir -p "$gopath/src/github.com/lor00x" ++ln -sfn "$repo" "$gopath/src/github.com/lor00x/goldap" ++ ++cd "$gopath/src/github.com/lor00x/goldap" ++exec env \ ++ GOPATH="$gopath" \ ++ GO111MODULE=off \ ++ GOPROXY=off \ ++ GOSUMDB=off \ ++ GOPRIVATE='*' \ ++ GONOPROXY='*' \ ++ GONOSUMDB='*' \ ++ GOVCS='*:off' \ ++ go test -v ./usercase-test-coderl diff --git a/tasks/format-code-task-001816/tests/test.sh b/tasks/format-code-task-001816/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..25d8c6ba6f87f243aca64107e5a094908347b366 --- /dev/null +++ b/tasks/format-code-task-001816/tests/test.sh @@ -0,0 +1,38 @@ +#!/bin/bash +# Code grading, mimoagent opensource_code.py: reset the files the hidden test patch touches, apply it, run the +# task's test command; reward 1 when it exits 0. A testbed failure (reset or apply) writes no reward: not scored. +M=/var/lib/mimo +CWD=/workspace/repo +V=/logs/verifier +mkdir -p "$V" +BASE=$(cat "$M/base" 2>/dev/null) || { echo "setup never ran (no $M/base)" >&2; exit 1; } +cd "$CWD" || exit 1 +if [ -d "$M/git-hidden" ]; then rm -rf "$CWD/.git"; mv "$M/git-hidden" "$CWD/.git"; fi +# the agent's change against the base, so its own commits count too +git add -A >/dev/null 2>&1 && git -c core.fileMode=false diff --cached "$BASE" > "$V/agent.diff" +git reset -q +if ! ( +while IFS= read -r tf; do + [ -z "$tf" ] && continue + if git cat-file -e $BASE:"$tf" 2>/dev/null; then + git checkout $BASE -- "$tf" 2>/dev/null || true + else + git rm -f --cached "$tf" >/dev/null 2>&1 || true + rm -f "$tf" + fi +done <<'EOF_RESET_TEST_FILES' +usercase-test-coderl/ldap_message_read_test.go +mimo_test_command.sh +EOF_RESET_TEST_FILES + +); then echo "could not reset the test files (testbed problem, not scored)" >&2; exit 1; fi +if ! git apply --verbose /tests/test.patch > "$V/apply.log" 2>&1; then + cat "$V/apply.log" >&2 + echo "the hidden tests could not be applied (testbed problem, not scored)" >&2 + exit 1 +fi +timeout 1800 sh -c "$(cat /tests/test_command.sh)" > "$V/test_output.log" 2>&1 +RC=$? +tail -c 12000 "$V/test_output.log" +if [ $RC -eq 0 ]; then echo 1 > "$V/reward.txt"; else echo 0 > "$V/reward.txt"; fi +echo "test command exited $RC" diff --git a/tasks/format-code-task-001816/tests/test_command.sh b/tasks/format-code-task-001816/tests/test_command.sh new file mode 100644 index 0000000000000000000000000000000000000000..88cb7810b836396c4869db31aeac7d4d4b189685 --- /dev/null +++ b/tasks/format-code-task-001816/tests/test_command.sh @@ -0,0 +1 @@ +bash /workspace/repo/mimo_test_command.sh \ No newline at end of file diff --git a/tasks/format-code-task-001820/environment/Dockerfile b/tasks/format-code-task-001820/environment/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..1bd0aae62359b45afab2aa1c1ca984b790a6d853 --- /dev/null +++ b/tasks/format-code-task-001820/environment/Dockerfile @@ -0,0 +1,3 @@ +# The task's image, pinned by digest (the same as [environment].docker_image). +# Setup runs at start from [environment.healthcheck]; environment/setup/ is its readable copy. +FROM docker.io/xiaomimimo/mimo-v2.6-rl-oss@sha256:8f373f3b5dc266ea2c384aa97805551b4ea4e18fcfa65e457194986f6ae2aa1e diff --git a/tasks/format-code-task-001820/environment/setup/files/blocklist b/tasks/format-code-task-001820/environment/setup/files/blocklist new file mode 100644 index 0000000000000000000000000000000000000000..a8e4bdc4c7d9b739c047a3cb58ea72a1bb05bcbc --- /dev/null +++ b/tasks/format-code-task-001820/environment/setup/files/blocklist @@ -0,0 +1,33 @@ +# mimo answer-leak blocklist (mimoagent) +0.0.0.0 github.com +0.0.0.0 www.github.com +0.0.0.0 api.github.com +0.0.0.0 raw.githubusercontent.com +0.0.0.0 codeload.github.com +0.0.0.0 objects.githubusercontent.com +0.0.0.0 gist.github.com +0.0.0.0 gist.githubusercontent.com +0.0.0.0 gitlab.com +0.0.0.0 bitbucket.org +0.0.0.0 sourceforge.net +0.0.0.0 git.kernel.org +0.0.0.0 chromium.googlesource.com +0.0.0.0 android.googlesource.com +0.0.0.0 sourcegraph.com +0.0.0.0 bugs.chromium.org +0.0.0.0 issues.oss-fuzz.com +0.0.0.0 oss-fuzz.com +0.0.0.0 osv.dev +0.0.0.0 api.osv.dev +0.0.0.0 bugzilla.mozilla.org +0.0.0.0 proxy.golang.org +0.0.0.0 sum.golang.org +0.0.0.0 pkg.go.dev +0.0.0.0 google.com +0.0.0.0 www.google.com +0.0.0.0 bing.com +0.0.0.0 www.bing.com +0.0.0.0 duckduckgo.com +0.0.0.0 html.duckduckgo.com +0.0.0.0 search.brave.com +0.0.0.0 stackoverflow.com diff --git a/tasks/format-code-task-001820/environment/setup/setup.sh b/tasks/format-code-task-001820/environment/setup/setup.sh new file mode 100644 index 0000000000000000000000000000000000000000..d883db90cfcfb48f7a139861bbe9f6b5d95cad6f --- /dev/null +++ b/tasks/format-code-task-001820/environment/setup/setup.sh @@ -0,0 +1,34 @@ +#!/bin/bash +# Runs once, as root, before the agent starts: Harbor's [environment.healthcheck] unpacks this folder into +# /var/lib/mimo and runs it. Generated by mimo_harbor; see its README for how each step maps to Xiaomi's harness. +M=/var/lib/mimo +[ -f "$M/ready" ] && exit 0 +chmod 700 "$M" +fail() { echo "setup: $*" >&2; exit 1; } +# the answer-leak blocklist (mimoagent), applied to /etc/hosts by the agent right after it installs +write_blocklist() { cp "$M/files/blocklist" "$M/blocklist"; } + +# Code: mimoagent environments/datasets/opensource_code.py + base.py, as the explorer runs it (app/runner/domains.py Code). +CWD=/testbed +git config --global --add safe.directory "$CWD" +cd "$CWD" || fail "no working directory $CWD" +if ! git rev-parse --git-dir >/dev/null 2>&1; then # a bare source tree: give it a baseline commit + git init -q && git add -A && git -c user.name=mimo -c user.email=mimo@localhost commit -q -m baseline --allow-empty +fi +BASE=$(git rev-parse HEAD 2>/dev/null) +[ ${#BASE} -eq 40 ] || fail "could not resolve the base commit in $CWD" +echo "$BASE" > "$M/base" +# Images are built with history truncated at the base. If one is not, the fix could be read out of git log, +# so .git is hidden while the agent works and put back for grading. +LATER=$(git rev-list --all --not "$BASE" 2>/dev/null | head -n 5 | grep -c . || true) +rm -f /tmp/fail.log /tmp/pass.log /tmp/patch.diff /tmp/test_patch.diff /tmp/*.log 2>/dev/null; rm -rf /tmp/claude-0 /tmp/claude-* /tmp/testem-* /tmp/puppeteer_dev_chrome_profile-* 2>/dev/null; rm -f /tmp/test_files.json 2>/dev/null; rm -rf /tmp/jest_* /tmp/jest-* /tmp/build /tmp/build_env 2>/dev/null; rm -rf /tmp/pytest-of-root /tmp/pytest-* /tmp/.pytest_cache /tmp/__pycache__ 2>/dev/null; rm -rf /tmp/go-build* /tmp/standards /tmp/wordpress /tmp/zig-* /tmp/testbase /tmp/testbed 2>/dev/null; rm -f /tmp/tmp*.tmp /tmp/*.bak /tmp/expect* /tmp/butwas* 2>/dev/null; rm -rf /root/.cache/go-build 2>/dev/null; rm -rf /tests 2>/dev/null; find /logs -mindepth 1 -delete 2>/dev/null; mkdir -p /logs/agent /logs/verifier /logs/artifacts; chmod 777 /logs/agent /logs/verifier /logs/artifacts; find /var/log -type f -delete 2>/dev/null || true; rm -rf /var/lib/postgresql/*/*/log /var/lib/postgresql/*/*/pg_log 2>/dev/null || true; find /var/lib/mysql /var/lib/mongodb -type f -name '*.log' -delete 2>/dev/null || true; rm -rf /root/.npm/_logs /root/.babel.json /root/.pytest_cache 2>/dev/null || true; find / -maxdepth 4 -xdev -name task_description.md -path '*/.build_env/*' -delete 2>/dev/null || true; true +git clean -fdx --exclude=node_modules --exclude=bower_components --exclude=.husky --exclude=vendor --exclude=third_party --exclude=_deps --exclude=vcpkg_installed --exclude=.venv --exclude=venv --exclude=.gradle --exclude=target --exclude=.build --exclude=lib --exclude=.bundle --exclude=Manifest.toml --exclude=_build --exclude=.stack-work --exclude=dist-newstyle >/dev/null 2>&1 +find /root/.m2 -type f \( -name '*-SNAPSHOT.jar' -o -name '*-SNAPSHOT-sources.jar' -o -name '*-SNAPSHOT-tests.jar' -o -name '*-SNAPSHOT-test-sources.jar' \) -delete 2>/dev/null; rm -rf /root/.julia/compiled 2>/dev/null; rm -rf /root/.gradle/caches/build-cache-* /root/.gradle/daemon 2>/dev/null; rm -rf /root/.gradle/caches/*/scripts /root/.gradle/caches/jars-* 2>/dev/null; rm -rf /root/.cache/bazel 2>/dev/null; true +if [ "$LATER" -gt 0 ]; then + mv "$CWD/.git" "$M/git-hidden" + echo "history not truncated at ${BASE:0:12}: .git hidden while the agent works" +fi +write_blocklist + +touch "$M/ready" +echo "setup done" diff --git a/tasks/format-code-task-001820/tests/test.patch b/tasks/format-code-task-001820/tests/test.patch new file mode 100644 index 0000000000000000000000000000000000000000..a8700535305ad7ea6724f3aecc51981628e9cf93 --- /dev/null +++ b/tasks/format-code-task-001820/tests/test.patch @@ -0,0 +1,155 @@ +diff --git a/test_commands.json b/test_commands.json +new file mode 100644 +index 0000000..852a3c2 +--- /dev/null ++++ b/test_commands.json +@@ -0,0 +1,3 @@ ++{ ++ "test_commands": ["python -m pytest tests/test_literal.py -v"] ++} +diff --git a/tests/test_literal.py b/tests/test_literal.py +new file mode 100644 +index 0000000..52bb466 +--- /dev/null ++++ b/tests/test_literal.py +@@ -0,0 +1,127 @@ ++import sys ++import unittest ++import dataclasses ++from typing import Union ++ ++from marshmallow import ValidationError ++ ++from marshmallow_dataclass import class_schema ++ ++if sys.version_info >= (3, 8): ++ from typing import Literal ++else: ++ from typing_extensions import Literal ++ ++ ++class TestLiteralField(unittest.TestCase): ++ def test_class_schema_with_literal_does_not_error(self): ++ @dataclasses.dataclass ++ class A: ++ choices: Literal["x", "y"] ++ ++ ++ schema_cls = class_schema(A) ++ self.assertIsNotNone(schema_cls) ++ ++ def test_literal_load_valid_value(self): ++ @dataclasses.dataclass ++ class A: ++ choices: Literal["x", "y"] ++ ++ schema = class_schema(A)() ++ result = schema.load({"choices": "x"}) ++ self.assertEqual(result, A(choices="x")) ++ ++ def test_literal_load_other_valid_value(self): ++ @dataclasses.dataclass ++ class A: ++ choices: Literal["x", "y"] ++ ++ schema = class_schema(A)() ++ result = schema.load({"choices": "y"}) ++ self.assertEqual(result, A(choices="y")) ++ ++ def test_literal_load_invalid_value_raises(self): ++ @dataclasses.dataclass ++ class A: ++ choices: Literal["x", "y"] ++ ++ schema = class_schema(A)() ++ with self.assertRaises(ValidationError): ++ schema.load({"choices": "z"}) ++ ++ def test_literal_dump_valid_value(self): ++ @dataclasses.dataclass ++ class A: ++ choices: Literal["x", "y"] ++ ++ schema = class_schema(A)() ++ result = schema.dump(A(choices="x")) ++ self.assertEqual(result, {"choices": "x"}) ++ ++ def test_literal_single_value_valid(self): ++ @dataclasses.dataclass ++ class A: ++ kind: Literal["only"] ++ ++ schema = class_schema(A)() ++ result = schema.load({"kind": "only"}) ++ self.assertEqual(result, A(kind="only")) ++ ++ def test_literal_single_value_invalid_raises(self): ++ @dataclasses.dataclass ++ class A: ++ kind: Literal["only"] ++ ++ schema = class_schema(A)() ++ with self.assertRaises(ValidationError): ++ schema.load({"kind": "other"}) ++ ++ def test_literal_int_does_not_coerce_string(self): ++ ++ ++ ++ @dataclasses.dataclass ++ class A: ++ n: Literal[1, 2, 3] ++ ++ schema = class_schema(A)() ++ ++ self.assertEqual(schema.load({"n": 1}), A(n=1)) ++ ++ ++ with self.assertRaises(ValidationError): ++ schema.load({"n": "1"}) ++ ++ def test_literal_int_invalid_value_raises(self): ++ @dataclasses.dataclass ++ class A: ++ n: Literal[1, 2, 3] ++ ++ schema = class_schema(A)() ++ with self.assertRaises(ValidationError): ++ schema.load({"n": 99}) ++ ++ def test_literal_tagged_union(self): ++ ++ @dataclasses.dataclass ++ class Cat: ++ kind: Literal["cat"] ++ meow: int ++ ++ @dataclasses.dataclass ++ class Dog: ++ kind: Literal["dog"] ++ bark: str ++ ++ @dataclasses.dataclass ++ class Pet: ++ animal: Union[Cat, Dog] ++ ++ schema = class_schema(Pet)() ++ cat = schema.load({"animal": {"kind": "cat", "meow": 5}}) ++ self.assertEqual(cat, Pet(animal=Cat(kind="cat", meow=5))) ++ ++ ++if __name__ == "__main__": ++ unittest.main() +diff --git a/mimo_test_command.sh b/mimo_test_command.sh +new file mode 100755 +--- /dev/null ++++ b/mimo_test_command.sh +@@ -0,0 +1,8 @@ ++#!/usr/bin/env bash ++ ++set -uo pipefail ++cd /testbed ++rc=0 ++python -m pytest -v -rA tests/test_literal.py::TestLiteralField::test_class_schema_with_literal_does_not_error tests/test_literal.py::TestLiteralField::test_literal_load_valid_value tests/test_literal.py::TestLiteralField::test_literal_load_other_valid_value tests/test_literal.py::TestLiteralField::test_literal_load_invalid_value_raises tests/test_literal.py::TestLiteralField::test_literal_dump_valid_value tests/test_literal.py::TestLiteralField::test_literal_single_value_valid tests/test_literal.py::TestLiteralField::test_literal_single_value_invalid_raises tests/test_literal.py::TestLiteralField::test_literal_int_does_not_coerce_string tests/test_literal.py::TestLiteralField::test_literal_int_invalid_value_raises tests/test_literal.py::TestLiteralField::test_literal_tagged_union ++rc=$(( rc | $? )) ++exit $rc diff --git a/tasks/format-code-task-001820/tests/test.sh b/tasks/format-code-task-001820/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..c8a7452a8e4c09f85a315618e8edeba999461411 --- /dev/null +++ b/tasks/format-code-task-001820/tests/test.sh @@ -0,0 +1,39 @@ +#!/bin/bash +# Code grading, mimoagent opensource_code.py: reset the files the hidden test patch touches, apply it, run the +# task's test command; reward 1 when it exits 0. A testbed failure (reset or apply) writes no reward: not scored. +M=/var/lib/mimo +CWD=/testbed +V=/logs/verifier +mkdir -p "$V" +BASE=$(cat "$M/base" 2>/dev/null) || { echo "setup never ran (no $M/base)" >&2; exit 1; } +cd "$CWD" || exit 1 +if [ -d "$M/git-hidden" ]; then rm -rf "$CWD/.git"; mv "$M/git-hidden" "$CWD/.git"; fi +# the agent's change against the base, so its own commits count too +git add -A >/dev/null 2>&1 && git -c core.fileMode=false diff --cached "$BASE" > "$V/agent.diff" +git reset -q +if ! ( +while IFS= read -r tf; do + [ -z "$tf" ] && continue + if git cat-file -e $BASE:"$tf" 2>/dev/null; then + git checkout $BASE -- "$tf" 2>/dev/null || true + else + git rm -f --cached "$tf" >/dev/null 2>&1 || true + rm -f "$tf" + fi +done <<'EOF_RESET_TEST_FILES' +test_commands.json +tests/test_literal.py +mimo_test_command.sh +EOF_RESET_TEST_FILES + +); then echo "could not reset the test files (testbed problem, not scored)" >&2; exit 1; fi +if ! git apply --verbose /tests/test.patch > "$V/apply.log" 2>&1; then + cat "$V/apply.log" >&2 + echo "the hidden tests could not be applied (testbed problem, not scored)" >&2 + exit 1 +fi +timeout 1800 sh -c "$(cat /tests/test_command.sh)" > "$V/test_output.log" 2>&1 +RC=$? +tail -c 12000 "$V/test_output.log" +if [ $RC -eq 0 ]; then echo 1 > "$V/reward.txt"; else echo 0 > "$V/reward.txt"; fi +echo "test command exited $RC" diff --git a/tasks/format-code-task-001820/tests/test_command.sh b/tasks/format-code-task-001820/tests/test_command.sh new file mode 100644 index 0000000000000000000000000000000000000000..7cb23076694ad17d72e8296d62b2b240083e36db --- /dev/null +++ b/tasks/format-code-task-001820/tests/test_command.sh @@ -0,0 +1 @@ +bash /testbed/mimo_test_command.sh \ No newline at end of file diff --git a/tasks/format-code-task-001829/environment/Dockerfile b/tasks/format-code-task-001829/environment/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..a785f63ca31154236a664d29d8417d47ee2b864a --- /dev/null +++ b/tasks/format-code-task-001829/environment/Dockerfile @@ -0,0 +1,3 @@ +# The task's image, pinned by digest (the same as [environment].docker_image). +# Setup runs at start from [environment.healthcheck]; environment/setup/ is its readable copy. +FROM docker.io/xiaomimimo/mimo-v2.6-rl-oss@sha256:1bd02cc4dedde3c43749ec0f0694a3ead65d45ea325580cc38771078d733c3ba diff --git a/tasks/format-code-task-001829/environment/setup/files/blocklist b/tasks/format-code-task-001829/environment/setup/files/blocklist new file mode 100644 index 0000000000000000000000000000000000000000..a8e4bdc4c7d9b739c047a3cb58ea72a1bb05bcbc --- /dev/null +++ b/tasks/format-code-task-001829/environment/setup/files/blocklist @@ -0,0 +1,33 @@ +# mimo answer-leak blocklist (mimoagent) +0.0.0.0 github.com +0.0.0.0 www.github.com +0.0.0.0 api.github.com +0.0.0.0 raw.githubusercontent.com +0.0.0.0 codeload.github.com +0.0.0.0 objects.githubusercontent.com +0.0.0.0 gist.github.com +0.0.0.0 gist.githubusercontent.com +0.0.0.0 gitlab.com +0.0.0.0 bitbucket.org +0.0.0.0 sourceforge.net +0.0.0.0 git.kernel.org +0.0.0.0 chromium.googlesource.com +0.0.0.0 android.googlesource.com +0.0.0.0 sourcegraph.com +0.0.0.0 bugs.chromium.org +0.0.0.0 issues.oss-fuzz.com +0.0.0.0 oss-fuzz.com +0.0.0.0 osv.dev +0.0.0.0 api.osv.dev +0.0.0.0 bugzilla.mozilla.org +0.0.0.0 proxy.golang.org +0.0.0.0 sum.golang.org +0.0.0.0 pkg.go.dev +0.0.0.0 google.com +0.0.0.0 www.google.com +0.0.0.0 bing.com +0.0.0.0 www.bing.com +0.0.0.0 duckduckgo.com +0.0.0.0 html.duckduckgo.com +0.0.0.0 search.brave.com +0.0.0.0 stackoverflow.com diff --git a/tasks/format-code-task-001829/environment/setup/setup.sh b/tasks/format-code-task-001829/environment/setup/setup.sh new file mode 100644 index 0000000000000000000000000000000000000000..e9eb7daf39f9542bd095367feee457f3da77e492 --- /dev/null +++ b/tasks/format-code-task-001829/environment/setup/setup.sh @@ -0,0 +1,34 @@ +#!/bin/bash +# Runs once, as root, before the agent starts: Harbor's [environment.healthcheck] unpacks this folder into +# /var/lib/mimo and runs it. Generated by mimo_harbor; see its README for how each step maps to Xiaomi's harness. +M=/var/lib/mimo +[ -f "$M/ready" ] && exit 0 +chmod 700 "$M" +fail() { echo "setup: $*" >&2; exit 1; } +# the answer-leak blocklist (mimoagent), applied to /etc/hosts by the agent right after it installs +write_blocklist() { cp "$M/files/blocklist" "$M/blocklist"; } + +# Code: mimoagent environments/datasets/opensource_code.py + base.py, as the explorer runs it (app/runner/domains.py Code). +CWD=/workspace/repo +git config --global --add safe.directory "$CWD" +cd "$CWD" || fail "no working directory $CWD" +if ! git rev-parse --git-dir >/dev/null 2>&1; then # a bare source tree: give it a baseline commit + git init -q && git add -A && git -c user.name=mimo -c user.email=mimo@localhost commit -q -m baseline --allow-empty +fi +BASE=$(git rev-parse HEAD 2>/dev/null) +[ ${#BASE} -eq 40 ] || fail "could not resolve the base commit in $CWD" +echo "$BASE" > "$M/base" +# Images are built with history truncated at the base. If one is not, the fix could be read out of git log, +# so .git is hidden while the agent works and put back for grading. +LATER=$(git rev-list --all --not "$BASE" 2>/dev/null | head -n 5 | grep -c . || true) +rm -f /tmp/fail.log /tmp/pass.log /tmp/patch.diff /tmp/test_patch.diff /tmp/*.log 2>/dev/null; rm -rf /tmp/claude-0 /tmp/claude-* /tmp/testem-* /tmp/puppeteer_dev_chrome_profile-* 2>/dev/null; rm -f /tmp/test_files.json 2>/dev/null; rm -rf /tmp/jest_* /tmp/jest-* /tmp/build /tmp/build_env 2>/dev/null; rm -rf /tmp/pytest-of-root /tmp/pytest-* /tmp/.pytest_cache /tmp/__pycache__ 2>/dev/null; rm -rf /tmp/go-build* /tmp/standards /tmp/wordpress /tmp/zig-* /tmp/testbase /tmp/testbed 2>/dev/null; rm -f /tmp/tmp*.tmp /tmp/*.bak /tmp/expect* /tmp/butwas* 2>/dev/null; rm -rf /root/.cache/go-build 2>/dev/null; rm -rf /tests 2>/dev/null; find /logs -mindepth 1 -delete 2>/dev/null; mkdir -p /logs/agent /logs/verifier /logs/artifacts; chmod 777 /logs/agent /logs/verifier /logs/artifacts; find /var/log -type f -delete 2>/dev/null || true; rm -rf /var/lib/postgresql/*/*/log /var/lib/postgresql/*/*/pg_log 2>/dev/null || true; find /var/lib/mysql /var/lib/mongodb -type f -name '*.log' -delete 2>/dev/null || true; rm -rf /root/.npm/_logs /root/.babel.json /root/.pytest_cache 2>/dev/null || true; find / -maxdepth 4 -xdev -name task_description.md -path '*/.build_env/*' -delete 2>/dev/null || true; true +git clean -fdx --exclude=node_modules --exclude=bower_components --exclude=.husky --exclude=vendor --exclude=third_party --exclude=_deps --exclude=vcpkg_installed --exclude=.venv --exclude=venv --exclude=.gradle --exclude=target --exclude=.build --exclude=lib --exclude=.bundle --exclude=Manifest.toml --exclude=_build --exclude=.stack-work --exclude=dist-newstyle >/dev/null 2>&1 +find /root/.m2 -type f \( -name '*-SNAPSHOT.jar' -o -name '*-SNAPSHOT-sources.jar' -o -name '*-SNAPSHOT-tests.jar' -o -name '*-SNAPSHOT-test-sources.jar' \) -delete 2>/dev/null; rm -rf /root/.julia/compiled 2>/dev/null; rm -rf /root/.gradle/caches/build-cache-* /root/.gradle/daemon 2>/dev/null; rm -rf /root/.gradle/caches/*/scripts /root/.gradle/caches/jars-* 2>/dev/null; rm -rf /root/.cache/bazel 2>/dev/null; true +if [ "$LATER" -gt 0 ]; then + mv "$CWD/.git" "$M/git-hidden" + echo "history not truncated at ${BASE:0:12}: .git hidden while the agent works" +fi +write_blocklist + +touch "$M/ready" +echo "setup done" diff --git a/tasks/format-code-task-001829/tests/test.patch b/tasks/format-code-task-001829/tests/test.patch new file mode 100644 index 0000000000000000000000000000000000000000..39724947e32c0fb9ea3dad2652b1ff1b38af2bfd --- /dev/null +++ b/tasks/format-code-task-001829/tests/test.patch @@ -0,0 +1,425 @@ +diff --git a/usercase-test-coderl/target_formatter_test.go b/usercase-test-coderl/target_formatter_test.go +new file mode 100644 +--- /dev/null ++++ b/usercase-test-coderl/target_formatter_test.go +@@ -0,0 +1,397 @@ ++package usercase_test_coderl ++ ++import ( ++ "errors" ++ "os" ++ "path/filepath" ++ "reflect" ++ "sort" ++ "testing" ++ ++ "github.com/luraproject/lura/v2/config" ++ "github.com/luraproject/lura/v2/proxy" ++) ++ ++ ++ ++ ++ ++ ++func TestTargetExtractsTopLevelObjectAndPreservesCompletion(t *testing.T) { ++ ++ ++ formatter := proxy.NewEntityFormatter(&config.Backend{Target: "profile"}) ++ out := formatter.Format(proxy.Response{ ++ Data: map[string]interface{}{ ++ "id": 1, ++ "profile": map[string]interface{}{"name": "Ada", "active": true}, ++ }, ++ IsComplete: true, ++ }) ++ ++ expected := proxy.Response{ ++ Data: map[string]interface{}{"name": "Ada", "active": true}, ++ IsComplete: true, ++ } ++ if !reflect.DeepEqual(expected, out) { ++ t.Fatalf("unexpected formatted response:\nexpected %#v\nactual %#v", expected, out) ++ } ++} ++ ++func TestTargetWalksDottedNestedObjects(t *testing.T) { ++ ++ ++ formatter := proxy.NewEntityFormatter(&config.Backend{Target: "payload.user"}) ++ out := formatter.Format(proxy.Response{ ++ Data: map[string]interface{}{ ++ "payload": map[string]interface{}{"user": map[string]interface{}{"name": "Ada"}, "debug": true}, ++ "status": "ok", ++ }, ++ IsComplete: true, ++ }) ++ ++ expected := proxy.Response{ ++ Data: map[string]interface{}{"name": "Ada"}, ++ IsComplete: true, ++ } ++ if !reflect.DeepEqual(expected, out) { ++ t.Fatalf("unexpected formatted response:\nexpected %#v\nactual %#v", expected, out) ++ } ++} ++ ++func TestMissingTargetSegmentReturnsEmptyMapAndPreservesMetadata(t *testing.T) { ++ ++ ++ formatter := proxy.NewEntityFormatter(&config.Backend{Target: "payload.user"}) ++ out := formatter.Format(proxy.Response{ ++ Data: map[string]interface{}{ ++ "payload": map[string]interface{}{"debug": true}, ++ "status": "ok", ++ }, ++ IsComplete: true, ++ Metadata: proxy.Metadata{StatusCode: 206, Headers: map[string][]string{"X-Trace": {"missing-target"}}}, ++ }) ++ ++ expected := proxy.Response{ ++ Data: map[string]interface{}{}, ++ IsComplete: true, ++ Metadata: proxy.Metadata{StatusCode: 206, Headers: map[string][]string{"X-Trace": {"missing-target"}}}, ++ } ++ if !reflect.DeepEqual(expected, out) { ++ t.Fatalf("unexpected formatted response:\nexpected %#v\nactual %#v", expected, out) ++ } ++} ++ ++func TestNonObjectTargetValueReturnsEmptyMapAndPreservesMetadata(t *testing.T) { ++ ++ ++ formatter := proxy.NewEntityFormatter(&config.Backend{Target: "payload.user"}) ++ out := formatter.Format(proxy.Response{ ++ Data: map[string]interface{}{ ++ "payload": map[string]interface{}{"user": "Ada"}, ++ }, ++ IsComplete: true, ++ Metadata: proxy.Metadata{StatusCode: 207, Headers: map[string][]string{"X-Trace": {"scalar-target"}}}, ++ }) ++ ++ expected := proxy.Response{ ++ Data: map[string]interface{}{}, ++ IsComplete: true, ++ Metadata: proxy.Metadata{StatusCode: 207, Headers: map[string][]string{"X-Trace": {"scalar-target"}}}, ++ } ++ if !reflect.DeepEqual(expected, out) { ++ t.Fatalf("unexpected formatted response:\nexpected %#v\nactual %#v", expected, out) ++ } ++} ++ ++func TestTargetRunsBeforeAllowMappingAndGrouping(t *testing.T) { ++ ++ ++ formatter := proxy.NewEntityFormatter(&config.Backend{ ++ Target: "payload", ++ AllowList: []string{"name"}, ++ Mapping: map[string]string{"name": "display_name"}, ++ Group: "user", ++ }) ++ out := formatter.Format(proxy.Response{ ++ Data: map[string]interface{}{ ++ "payload": map[string]interface{}{"name": "Ada", "secret": "x"}, ++ "ignored": true, ++ }, ++ IsComplete: true, ++ }) ++ ++ expected := proxy.Response{ ++ Data: map[string]interface{}{"user": map[string]interface{}{"display_name": "Ada"}}, ++ IsComplete: true, ++ } ++ if !reflect.DeepEqual(expected, out) { ++ t.Fatalf("unexpected formatted response:\nexpected %#v\nactual %#v", expected, out) ++ } ++} ++ ++func TestTargetRunsBeforeDenyFiltering(t *testing.T) { ++ ++ ++ formatter := proxy.NewEntityFormatter(&config.Backend{ ++ Target: "payload", ++ DenyList: []string{"secret"}, ++ }) ++ out := formatter.Format(proxy.Response{ ++ Data: map[string]interface{}{ ++ "payload": map[string]interface{}{"name": "Ada", "secret": "x"}, ++ "secret": "root-secret", ++ }, ++ IsComplete: true, ++ }) ++ ++ expected := proxy.Response{ ++ Data: map[string]interface{}{"name": "Ada"}, ++ IsComplete: true, ++ } ++ if !reflect.DeepEqual(expected, out) { ++ t.Fatalf("unexpected formatted response:\nexpected %#v\nactual %#v", expected, out) ++ } ++} ++ ++func TestTargetRunsBeforeBackendFlatmapAndGroupWrapsAfter(t *testing.T) { ++ ++ ++ formatter := proxy.NewEntityFormatter(&config.Backend{ ++ Target: "payload", ++ Group: "user", ++ ExtraConfig: config.ExtraConfig{ ++ proxy.Namespace: map[string]interface{}{ ++ "flatmap_filter": []interface{}{ ++ map[string]interface{}{"type": "move", "args": []interface{}{"profile.name", "display_name"}}, ++ map[string]interface{}{"type": "append", "args": []interface{}{"roles", "all_roles"}}, ++ map[string]interface{}{"type": "del", "args": []interface{}{"secret"}}, ++ }, ++ }, ++ }, ++ }) ++ out := formatter.Format(proxy.Response{ ++ Data: map[string]interface{}{ ++ "payload": map[string]interface{}{ ++ "profile": map[string]interface{}{"name": "Ada"}, ++ "roles": []interface{}{"admin"}, ++ "all_roles": []interface{}{"reader"}, ++ "secret": "x", ++ }, ++ "ignored": true, ++ }, ++ IsComplete: true, ++ }) ++ ++ ++ ++ user, ok := out.Data["user"].(map[string]interface{}) ++ if !ok || len(out.Data) != 1 || !out.IsComplete { ++ t.Fatalf("unexpected grouped response shape: %#v", out) ++ } ++ if user["display_name"] != "Ada" { ++ t.Fatalf("flatmap move did not run against targeted object: %#v", out) ++ } ++ if !reflect.DeepEqual([]interface{}{"reader", "admin"}, user["all_roles"]) { ++ t.Fatalf("flatmap append did not run against targeted object: %#v", out) ++ } ++ if _, ok := user["secret"]; ok { ++ t.Fatalf("flatmap delete did not run against targeted object: %#v", out) ++ } ++} ++ ++func TestJSONConfigKeyTargetPopulatesBackendTarget(t *testing.T) { ++ ++ ++ parser := config.NewParserWithFileReader(func(_ string) ([]byte, error) { ++ return []byte(`{ ++ "version": 3, ++ "name": "target-json", ++ "host": ["http://example.com"], ++ "endpoints": [{ ++ "endpoint": "/profile", ++ "backend": [{ ++ "host": ["http://example.com"], ++ "url_pattern": "/users", ++ "target": "payload.user" ++ }] ++ }] ++ }`), nil ++ }) ++ ++ cfg, err := parser.Parse("inline.json") ++ if err != nil { ++ t.Fatalf("unexpected parser error: %v", err) ++ } ++ expected := "payload.user" ++ actual := cfg.Endpoints[0].Backend[0].Target ++ if actual != expected { ++ t.Fatalf("unexpected parsed target: expected %q, got %q", expected, actual) ++ } ++} ++ ++func TestInvalidJSONTargetTypeReturnsParseError(t *testing.T) { ++ parser := config.NewParserWithFileReader(func(_ string) ([]byte, error) { ++ return []byte(`{"version":3,"name":"bad","host":["http://example.com"],"endpoints":[{"endpoint":"/profile","backend":[{"host":["http://example.com"],"url_pattern":"/users","target":42}]}]}`), nil ++ }) ++ ++ _, err := parser.Parse("inline.json") ++ var parseErr *config.ParseError ++ if !errors.As(err, &parseErr) { ++ t.Fatalf("expected *config.ParseError, got %T: %v", err, err) ++ } ++ ++ ++} ++ ++func TestFormatIsReferentiallyTransparentForEquivalentInputs(t *testing.T) { ++ backend := &config.Backend{Target: "profile"} ++ formatter := proxy.NewEntityFormatter(backend) ++ response := proxy.Response{ ++ Data: map[string]interface{}{"id": 1, "profile": map[string]interface{}{"name": "Ada", "active": true}}, ++ IsComplete: true, ++ } ++ ++ first := formatter.Format(deepCopyResponse(response)) ++ second := formatter.Format(deepCopyResponse(response)) ++ expected := proxy.Response{ ++ Data: map[string]interface{}{"name": "Ada", "active": true}, ++ IsComplete: true, ++ } ++ if !reflect.DeepEqual(expected, first) || !reflect.DeepEqual(expected, second) || !reflect.DeepEqual(first, second) { ++ t.Fatalf("format is not referentially transparent:\nexpected %#v\nfirst %#v\nsecond %#v", expected, first, second) ++ } ++} ++ ++func TestFormatDoesNotMutateCallerResponseData(t *testing.T) { ++ backend := &config.Backend{Target: "payload"} ++ response := proxy.Response{ ++ Data: map[string]interface{}{ ++ "payload": map[string]interface{}{"name": "Ada", "secret": "x"}, ++ "ignored": true, ++ }, ++ IsComplete: true, ++ Metadata: proxy.Metadata{StatusCode: 202, Headers: map[string][]string{"X-Trace": {"original"}}}, ++ } ++ before := deepCopyResponse(response) ++ ++ _ = proxy.NewEntityFormatter(backend).Format(response) ++ if !reflect.DeepEqual(before, response) { ++ t.Fatalf("Format mutated caller-owned input:\nbefore %#v\nafter %#v", before, response) ++ } ++} ++ ++func TestFormatHasNoObservableGlobalStateAcrossNoiseCalls(t *testing.T) { ++ backend := &config.Backend{Target: "profile"} ++ formatter := proxy.NewEntityFormatter(backend) ++ base := proxy.Response{Data: map[string]interface{}{"profile": map[string]interface{}{"name": "Ada", "active": true}}, IsComplete: true} ++ ++ first := formatter.Format(deepCopyResponse(base)) ++ _ = formatter.Format(proxy.Response{Data: map[string]interface{}{"payload": map[string]interface{}{"debug": true}}, IsComplete: false}) ++ _ = proxy.NewEntityFormatter(&config.Backend{Target: "payload.user"}).Format(proxy.Response{Data: map[string]interface{}{"payload": map[string]interface{}{"user": map[string]interface{}{"name": "Grace"}}}, IsComplete: true}) ++ again := formatter.Format(deepCopyResponse(base)) ++ ++ expected := proxy.Response{Data: map[string]interface{}{"name": "Ada", "active": true}, IsComplete: true} ++ if !reflect.DeepEqual(expected, first) || !reflect.DeepEqual(expected, again) { ++ t.Fatalf("format changed across noise calls:\nexpected %#v\nfirst %#v\nagain %#v", expected, first, again) ++ } ++} ++ ++func TestFormatDoesNotWriteFilesInWorkingDirectory(t *testing.T) { ++ root := t.TempDir() ++ original, err := os.Getwd() ++ if err != nil { ++ t.Fatal(err) ++ } ++ t.Cleanup(func() { ++ if err := os.Chdir(original); err != nil { ++ t.Fatalf("failed to restore working directory: %v", err) ++ } ++ }) ++ if err := os.Chdir(root); err != nil { ++ t.Fatal(err) ++ } ++ before := listRelativeEntries(t, root) ++ ++ out := proxy.NewEntityFormatter(&config.Backend{Target: "profile"}).Format(proxy.Response{ ++ Data: map[string]interface{}{"profile": map[string]interface{}{"name": "Ada"}}, ++ IsComplete: true, ++ }) ++ ++ after := listRelativeEntries(t, root) ++ expectedOut := proxy.Response{Data: map[string]interface{}{"name": "Ada"}, IsComplete: true} ++ if !reflect.DeepEqual(expectedOut, out) { ++ t.Fatalf("unexpected output during side-effect check:\nexpected %#v\nactual %#v", expectedOut, out) ++ } ++ if !reflect.DeepEqual(before, after) { ++ t.Fatalf("Format wrote to the working directory:\nbefore %#v\nafter %#v", before, after) ++ } ++} ++ ++func deepCopyResponse(in proxy.Response) proxy.Response { ++ out := in ++ out.Data = deepCopyMap(in.Data) ++ out.Metadata.Headers = deepCopyStringSlices(in.Metadata.Headers) ++ return out ++} ++ ++func deepCopyMap(in map[string]interface{}) map[string]interface{} { ++ if in == nil { ++ return nil ++ } ++ out := make(map[string]interface{}, len(in)) ++ for k, v := range in { ++ out[k] = deepCopyValue(v) ++ } ++ return out ++} ++ ++func deepCopyValue(v interface{}) interface{} { ++ switch typed := v.(type) { ++ case map[string]interface{}: ++ return deepCopyMap(typed) ++ case []interface{}: ++ out := make([]interface{}, len(typed)) ++ for i, item := range typed { ++ out[i] = deepCopyValue(item) ++ } ++ return out ++ default: ++ return typed ++ } ++} ++ ++func deepCopyStringSlices(in map[string][]string) map[string][]string { ++ if in == nil { ++ return nil ++ } ++ out := make(map[string][]string, len(in)) ++ for k, v := range in { ++ out[k] = append([]string(nil), v...) ++ } ++ return out ++} ++ ++func listRelativeEntries(t *testing.T, root string) []string { ++ t.Helper() ++ var entries []string ++ err := filepath.WalkDir(root, func(path string, d os.DirEntry, err error) error { ++ if err != nil { ++ return err ++ } ++ if path == root { ++ return nil ++ } ++ rel, err := filepath.Rel(root, path) ++ if err != nil { ++ return err ++ } ++ entries = append(entries, rel) ++ return nil ++ }) ++ if err != nil { ++ t.Fatal(err) ++ } ++ sort.Strings(entries) ++ return entries ++} +diff --git a/mimo_test_command.sh b/mimo_test_command.sh +new file mode 100755 +--- /dev/null ++++ b/mimo_test_command.sh +@@ -0,0 +1,18 @@ ++#!/usr/bin/env bash ++ ++ ++ ++ ++export NODE_OPTIONS="${NODE_OPTIONS:-} --max-old-space-size=4096" ++export MAVEN_OPTS="${MAVEN_OPTS:-} -Xmx3g -XX:+UseG1GC" ++export GRADLE_OPTS="${GRADLE_OPTS:-} -Xmx3g -XX:+UseG1GC" ++export TEST_JVM_OPTS="${TEST_JVM_OPTS:-} -Xmx3g" ++ ++export GOTOOLCHAIN=local ++export GOPROXY=off ++export GOSUMDB=off ++set -e ++cd /workspace/repo ++set -euo pipefail ++cd /workspace/repo ++exec go test -v ./usercase-test-coderl/... diff --git a/tasks/format-code-task-001829/tests/test.sh b/tasks/format-code-task-001829/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..95cc5949d30714c7501fc4f2766a73e7e02fa3d2 --- /dev/null +++ b/tasks/format-code-task-001829/tests/test.sh @@ -0,0 +1,38 @@ +#!/bin/bash +# Code grading, mimoagent opensource_code.py: reset the files the hidden test patch touches, apply it, run the +# task's test command; reward 1 when it exits 0. A testbed failure (reset or apply) writes no reward: not scored. +M=/var/lib/mimo +CWD=/workspace/repo +V=/logs/verifier +mkdir -p "$V" +BASE=$(cat "$M/base" 2>/dev/null) || { echo "setup never ran (no $M/base)" >&2; exit 1; } +cd "$CWD" || exit 1 +if [ -d "$M/git-hidden" ]; then rm -rf "$CWD/.git"; mv "$M/git-hidden" "$CWD/.git"; fi +# the agent's change against the base, so its own commits count too +git add -A >/dev/null 2>&1 && git -c core.fileMode=false diff --cached "$BASE" > "$V/agent.diff" +git reset -q +if ! ( +while IFS= read -r tf; do + [ -z "$tf" ] && continue + if git cat-file -e $BASE:"$tf" 2>/dev/null; then + git checkout $BASE -- "$tf" 2>/dev/null || true + else + git rm -f --cached "$tf" >/dev/null 2>&1 || true + rm -f "$tf" + fi +done <<'EOF_RESET_TEST_FILES' +usercase-test-coderl/target_formatter_test.go +mimo_test_command.sh +EOF_RESET_TEST_FILES + +); then echo "could not reset the test files (testbed problem, not scored)" >&2; exit 1; fi +if ! git apply --verbose /tests/test.patch > "$V/apply.log" 2>&1; then + cat "$V/apply.log" >&2 + echo "the hidden tests could not be applied (testbed problem, not scored)" >&2 + exit 1 +fi +timeout 1800 sh -c "$(cat /tests/test_command.sh)" > "$V/test_output.log" 2>&1 +RC=$? +tail -c 12000 "$V/test_output.log" +if [ $RC -eq 0 ]; then echo 1 > "$V/reward.txt"; else echo 0 > "$V/reward.txt"; fi +echo "test command exited $RC" diff --git a/tasks/format-code-task-001829/tests/test_command.sh b/tasks/format-code-task-001829/tests/test_command.sh new file mode 100644 index 0000000000000000000000000000000000000000..88cb7810b836396c4869db31aeac7d4d4b189685 --- /dev/null +++ b/tasks/format-code-task-001829/tests/test_command.sh @@ -0,0 +1 @@ +bash /workspace/repo/mimo_test_command.sh \ No newline at end of file diff --git a/tasks/format-code-task-001833/environment/Dockerfile b/tasks/format-code-task-001833/environment/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..cc4f917908989b28ce7f3a4217d16d315244cc3a --- /dev/null +++ b/tasks/format-code-task-001833/environment/Dockerfile @@ -0,0 +1,3 @@ +# The task's image, pinned by digest (the same as [environment].docker_image). +# Setup runs at start from [environment.healthcheck]; environment/setup/ is its readable copy. +FROM docker.io/xiaomimimo/mimo-v2.6-rl-oss@sha256:1dd0877044977d3c06a26bf5aa623575a37315a154f02281d473712f75e4da19 diff --git a/tasks/format-code-task-001833/environment/setup/files/blocklist b/tasks/format-code-task-001833/environment/setup/files/blocklist new file mode 100644 index 0000000000000000000000000000000000000000..a8e4bdc4c7d9b739c047a3cb58ea72a1bb05bcbc --- /dev/null +++ b/tasks/format-code-task-001833/environment/setup/files/blocklist @@ -0,0 +1,33 @@ +# mimo answer-leak blocklist (mimoagent) +0.0.0.0 github.com +0.0.0.0 www.github.com +0.0.0.0 api.github.com +0.0.0.0 raw.githubusercontent.com +0.0.0.0 codeload.github.com +0.0.0.0 objects.githubusercontent.com +0.0.0.0 gist.github.com +0.0.0.0 gist.githubusercontent.com +0.0.0.0 gitlab.com +0.0.0.0 bitbucket.org +0.0.0.0 sourceforge.net +0.0.0.0 git.kernel.org +0.0.0.0 chromium.googlesource.com +0.0.0.0 android.googlesource.com +0.0.0.0 sourcegraph.com +0.0.0.0 bugs.chromium.org +0.0.0.0 issues.oss-fuzz.com +0.0.0.0 oss-fuzz.com +0.0.0.0 osv.dev +0.0.0.0 api.osv.dev +0.0.0.0 bugzilla.mozilla.org +0.0.0.0 proxy.golang.org +0.0.0.0 sum.golang.org +0.0.0.0 pkg.go.dev +0.0.0.0 google.com +0.0.0.0 www.google.com +0.0.0.0 bing.com +0.0.0.0 www.bing.com +0.0.0.0 duckduckgo.com +0.0.0.0 html.duckduckgo.com +0.0.0.0 search.brave.com +0.0.0.0 stackoverflow.com diff --git a/tasks/format-code-task-001833/environment/setup/setup.sh b/tasks/format-code-task-001833/environment/setup/setup.sh new file mode 100644 index 0000000000000000000000000000000000000000..d883db90cfcfb48f7a139861bbe9f6b5d95cad6f --- /dev/null +++ b/tasks/format-code-task-001833/environment/setup/setup.sh @@ -0,0 +1,34 @@ +#!/bin/bash +# Runs once, as root, before the agent starts: Harbor's [environment.healthcheck] unpacks this folder into +# /var/lib/mimo and runs it. Generated by mimo_harbor; see its README for how each step maps to Xiaomi's harness. +M=/var/lib/mimo +[ -f "$M/ready" ] && exit 0 +chmod 700 "$M" +fail() { echo "setup: $*" >&2; exit 1; } +# the answer-leak blocklist (mimoagent), applied to /etc/hosts by the agent right after it installs +write_blocklist() { cp "$M/files/blocklist" "$M/blocklist"; } + +# Code: mimoagent environments/datasets/opensource_code.py + base.py, as the explorer runs it (app/runner/domains.py Code). +CWD=/testbed +git config --global --add safe.directory "$CWD" +cd "$CWD" || fail "no working directory $CWD" +if ! git rev-parse --git-dir >/dev/null 2>&1; then # a bare source tree: give it a baseline commit + git init -q && git add -A && git -c user.name=mimo -c user.email=mimo@localhost commit -q -m baseline --allow-empty +fi +BASE=$(git rev-parse HEAD 2>/dev/null) +[ ${#BASE} -eq 40 ] || fail "could not resolve the base commit in $CWD" +echo "$BASE" > "$M/base" +# Images are built with history truncated at the base. If one is not, the fix could be read out of git log, +# so .git is hidden while the agent works and put back for grading. +LATER=$(git rev-list --all --not "$BASE" 2>/dev/null | head -n 5 | grep -c . || true) +rm -f /tmp/fail.log /tmp/pass.log /tmp/patch.diff /tmp/test_patch.diff /tmp/*.log 2>/dev/null; rm -rf /tmp/claude-0 /tmp/claude-* /tmp/testem-* /tmp/puppeteer_dev_chrome_profile-* 2>/dev/null; rm -f /tmp/test_files.json 2>/dev/null; rm -rf /tmp/jest_* /tmp/jest-* /tmp/build /tmp/build_env 2>/dev/null; rm -rf /tmp/pytest-of-root /tmp/pytest-* /tmp/.pytest_cache /tmp/__pycache__ 2>/dev/null; rm -rf /tmp/go-build* /tmp/standards /tmp/wordpress /tmp/zig-* /tmp/testbase /tmp/testbed 2>/dev/null; rm -f /tmp/tmp*.tmp /tmp/*.bak /tmp/expect* /tmp/butwas* 2>/dev/null; rm -rf /root/.cache/go-build 2>/dev/null; rm -rf /tests 2>/dev/null; find /logs -mindepth 1 -delete 2>/dev/null; mkdir -p /logs/agent /logs/verifier /logs/artifacts; chmod 777 /logs/agent /logs/verifier /logs/artifacts; find /var/log -type f -delete 2>/dev/null || true; rm -rf /var/lib/postgresql/*/*/log /var/lib/postgresql/*/*/pg_log 2>/dev/null || true; find /var/lib/mysql /var/lib/mongodb -type f -name '*.log' -delete 2>/dev/null || true; rm -rf /root/.npm/_logs /root/.babel.json /root/.pytest_cache 2>/dev/null || true; find / -maxdepth 4 -xdev -name task_description.md -path '*/.build_env/*' -delete 2>/dev/null || true; true +git clean -fdx --exclude=node_modules --exclude=bower_components --exclude=.husky --exclude=vendor --exclude=third_party --exclude=_deps --exclude=vcpkg_installed --exclude=.venv --exclude=venv --exclude=.gradle --exclude=target --exclude=.build --exclude=lib --exclude=.bundle --exclude=Manifest.toml --exclude=_build --exclude=.stack-work --exclude=dist-newstyle >/dev/null 2>&1 +find /root/.m2 -type f \( -name '*-SNAPSHOT.jar' -o -name '*-SNAPSHOT-sources.jar' -o -name '*-SNAPSHOT-tests.jar' -o -name '*-SNAPSHOT-test-sources.jar' \) -delete 2>/dev/null; rm -rf /root/.julia/compiled 2>/dev/null; rm -rf /root/.gradle/caches/build-cache-* /root/.gradle/daemon 2>/dev/null; rm -rf /root/.gradle/caches/*/scripts /root/.gradle/caches/jars-* 2>/dev/null; rm -rf /root/.cache/bazel 2>/dev/null; true +if [ "$LATER" -gt 0 ]; then + mv "$CWD/.git" "$M/git-hidden" + echo "history not truncated at ${BASE:0:12}: .git hidden while the agent works" +fi +write_blocklist + +touch "$M/ready" +echo "setup done" diff --git a/tasks/format-code-task-001833/tests/test.patch b/tasks/format-code-task-001833/tests/test.patch new file mode 100644 index 0000000000000000000000000000000000000000..96ea24a868bb773130d3669f9a42992043a2bb3d --- /dev/null +++ b/tasks/format-code-task-001833/tests/test.patch @@ -0,0 +1,63 @@ +diff --git a/safedelete/tests/test_soft_delete_cascade.py b/safedelete/tests/test_soft_delete_cascade.py +index 887f494..09582ba 100644 +--- a/safedelete/tests/test_soft_delete_cascade.py ++++ b/safedelete/tests/test_soft_delete_cascade.py +@@ -1,10 +1,16 @@ + from django.db import models + from django.test import TestCase +-from safedelete import SOFT_DELETE_CASCADE ++from safedelete import SOFT_DELETE_CASCADE, SOFT_DELETE + from safedelete.models import SafeDeleteModel + from safedelete.tests.models import Article, Author, Category + + ++try: ++ from unittest.mock import patch ++except ImportError: ++ from mock import patch ++ ++ + class Press(SafeDeleteModel): + name = models.CharField(max_length=200) + article = models.ForeignKey(Article, on_delete=models.CASCADE) +@@ -90,6 +96,16 @@ def test_soft_delete_cascade_with_abstract_model(self): + self.assertEqual(ArticleView.objects.count(), 0) + self.assertEqual(ArticleView.all_objects.count(), 1) + ++ def test_soft_delete_cascade_deleted(self): ++ self.articles[0].delete(force_policy=SOFT_DELETE) ++ self.assertEqual(self.authors[1].article_set.count(), 1) ++ ++ with patch('safedelete.tests.models.Article.delete') as delete_article_mock: ++ self.authors[1].delete(force_policy=SOFT_DELETE_CASCADE) ++ ++ ++ self.assertEqual(delete_article_mock.call_count, 1) ++ + def test_undelete_with_soft_delete_cascade_policy(self): + self.authors[2].delete(force_policy=SOFT_DELETE_CASCADE) + self.authors[2].undelete(force_policy=SOFT_DELETE_CASCADE) +diff --git a/mimo_build_env.tar.gz.b64 b/mimo_build_env.tar.gz.b64 +new file mode 100644 +--- /dev/null ++++ b/mimo_build_env.tar.gz.b64 +@@ -0,0 +1,8 @@ ++H4sIAAAAAAAAA+3TT2/bIBQA8Jz5FMiX2urK6jR2Tj1ESlR1ytJqyU5NhbBNEiYbIh6ulm8/4sV1 ++O/XPJdU07f0uIHiGBw+zrFZlwaV++Nz7KOfeMEma1vuzbfpx0o/j9CKOh348jpNh2qPJh2X0RA1O ++WEp71hj3Vtx78/8o1tXfSXA8N1UldMFgc7w93qv/MB109R+kvv6DtD/o0fPjpfC6/7z+eUGbwmey ++IJmADT0rc3qy3bmN0fQspwFR1dZYRw18orADYoD5x6Ks0XfLYPxlNLu64fPJYnE9u5rzrzfj79PJ ++Mrinl3QZgFjJQpbSSbbfAhhI55Rew/Jx1eKH0GtDVtZUhz7LjV7Rw3T7AWk77Ho2X4ym08mYj25v ++534bV29LGZYKXPhKUERPqc+1W95ZlbFKAoi19LncR+Qw5xeot2H0LJ195qx2qoQ2qbV03NZaS0sW ++fvJb0/WZdOOPmUSk+alsG9LFhw/SZgaU2132/YZClbWVsD9P9wHzDW9uLrx74TabSDArx38P81xA ++LgrZnMiXismfyoWZMWXYrh9FJDghf/vNIYQQQgghhBBCCCGEEEIIIYQQQgih4/kFFVK1UQAoAAA= +diff --git a/mimo_test_command.sh b/mimo_test_command.sh +new file mode 100755 +--- /dev/null ++++ b/mimo_test_command.sh +@@ -0,0 +1,6 @@ ++#!/usr/bin/env bash ++ ++set -uo pipefail ++cd /testbed || exit 1 ++base64 -d mimo_build_env.tar.gz.b64 | tar -xzf - -C /testbed || exit 1 ++exec bash -lc 'cd /testbed && bash -eo pipefail /testbed/.build_env/test_command.sh' diff --git a/tasks/format-code-task-001833/tests/test.sh b/tasks/format-code-task-001833/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..928f900b46cc5db22fd1db5aa6df317e92cf5d25 --- /dev/null +++ b/tasks/format-code-task-001833/tests/test.sh @@ -0,0 +1,39 @@ +#!/bin/bash +# Code grading, mimoagent opensource_code.py: reset the files the hidden test patch touches, apply it, run the +# task's test command; reward 1 when it exits 0. A testbed failure (reset or apply) writes no reward: not scored. +M=/var/lib/mimo +CWD=/testbed +V=/logs/verifier +mkdir -p "$V" +BASE=$(cat "$M/base" 2>/dev/null) || { echo "setup never ran (no $M/base)" >&2; exit 1; } +cd "$CWD" || exit 1 +if [ -d "$M/git-hidden" ]; then rm -rf "$CWD/.git"; mv "$M/git-hidden" "$CWD/.git"; fi +# the agent's change against the base, so its own commits count too +git add -A >/dev/null 2>&1 && git -c core.fileMode=false diff --cached "$BASE" > "$V/agent.diff" +git reset -q +if ! ( +while IFS= read -r tf; do + [ -z "$tf" ] && continue + if git cat-file -e $BASE:"$tf" 2>/dev/null; then + git checkout $BASE -- "$tf" 2>/dev/null || true + else + git rm -f --cached "$tf" >/dev/null 2>&1 || true + rm -f "$tf" + fi +done <<'EOF_RESET_TEST_FILES' +safedelete/tests/test_soft_delete_cascade.py +mimo_build_env.tar.gz.b64 +mimo_test_command.sh +EOF_RESET_TEST_FILES + +); then echo "could not reset the test files (testbed problem, not scored)" >&2; exit 1; fi +if ! git apply --verbose /tests/test.patch > "$V/apply.log" 2>&1; then + cat "$V/apply.log" >&2 + echo "the hidden tests could not be applied (testbed problem, not scored)" >&2 + exit 1 +fi +timeout 1800 sh -c "$(cat /tests/test_command.sh)" > "$V/test_output.log" 2>&1 +RC=$? +tail -c 12000 "$V/test_output.log" +if [ $RC -eq 0 ]; then echo 1 > "$V/reward.txt"; else echo 0 > "$V/reward.txt"; fi +echo "test command exited $RC" diff --git a/tasks/format-code-task-001833/tests/test_command.sh b/tasks/format-code-task-001833/tests/test_command.sh new file mode 100644 index 0000000000000000000000000000000000000000..7cb23076694ad17d72e8296d62b2b240083e36db --- /dev/null +++ b/tasks/format-code-task-001833/tests/test_command.sh @@ -0,0 +1 @@ +bash /testbed/mimo_test_command.sh \ No newline at end of file diff --git a/tasks/format-code-task-001834/environment/Dockerfile b/tasks/format-code-task-001834/environment/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..8cbb20824a2cb1bc49ed8e7986d28d13bdff0744 --- /dev/null +++ b/tasks/format-code-task-001834/environment/Dockerfile @@ -0,0 +1,3 @@ +# The task's image, pinned by digest (the same as [environment].docker_image). +# Setup runs at start from [environment.healthcheck]; environment/setup/ is its readable copy. +FROM docker.io/xiaomimimo/mimo-v2.6-rl-oss@sha256:e9050ed305814caf9a284de5d769a54c1b8c1588d32a99d562f66315dd38f9de diff --git a/tasks/format-code-task-001834/environment/setup/files/blocklist b/tasks/format-code-task-001834/environment/setup/files/blocklist new file mode 100644 index 0000000000000000000000000000000000000000..a8e4bdc4c7d9b739c047a3cb58ea72a1bb05bcbc --- /dev/null +++ b/tasks/format-code-task-001834/environment/setup/files/blocklist @@ -0,0 +1,33 @@ +# mimo answer-leak blocklist (mimoagent) +0.0.0.0 github.com +0.0.0.0 www.github.com +0.0.0.0 api.github.com +0.0.0.0 raw.githubusercontent.com +0.0.0.0 codeload.github.com +0.0.0.0 objects.githubusercontent.com +0.0.0.0 gist.github.com +0.0.0.0 gist.githubusercontent.com +0.0.0.0 gitlab.com +0.0.0.0 bitbucket.org +0.0.0.0 sourceforge.net +0.0.0.0 git.kernel.org +0.0.0.0 chromium.googlesource.com +0.0.0.0 android.googlesource.com +0.0.0.0 sourcegraph.com +0.0.0.0 bugs.chromium.org +0.0.0.0 issues.oss-fuzz.com +0.0.0.0 oss-fuzz.com +0.0.0.0 osv.dev +0.0.0.0 api.osv.dev +0.0.0.0 bugzilla.mozilla.org +0.0.0.0 proxy.golang.org +0.0.0.0 sum.golang.org +0.0.0.0 pkg.go.dev +0.0.0.0 google.com +0.0.0.0 www.google.com +0.0.0.0 bing.com +0.0.0.0 www.bing.com +0.0.0.0 duckduckgo.com +0.0.0.0 html.duckduckgo.com +0.0.0.0 search.brave.com +0.0.0.0 stackoverflow.com diff --git a/tasks/format-code-task-001834/environment/setup/setup.sh b/tasks/format-code-task-001834/environment/setup/setup.sh new file mode 100644 index 0000000000000000000000000000000000000000..d883db90cfcfb48f7a139861bbe9f6b5d95cad6f --- /dev/null +++ b/tasks/format-code-task-001834/environment/setup/setup.sh @@ -0,0 +1,34 @@ +#!/bin/bash +# Runs once, as root, before the agent starts: Harbor's [environment.healthcheck] unpacks this folder into +# /var/lib/mimo and runs it. Generated by mimo_harbor; see its README for how each step maps to Xiaomi's harness. +M=/var/lib/mimo +[ -f "$M/ready" ] && exit 0 +chmod 700 "$M" +fail() { echo "setup: $*" >&2; exit 1; } +# the answer-leak blocklist (mimoagent), applied to /etc/hosts by the agent right after it installs +write_blocklist() { cp "$M/files/blocklist" "$M/blocklist"; } + +# Code: mimoagent environments/datasets/opensource_code.py + base.py, as the explorer runs it (app/runner/domains.py Code). +CWD=/testbed +git config --global --add safe.directory "$CWD" +cd "$CWD" || fail "no working directory $CWD" +if ! git rev-parse --git-dir >/dev/null 2>&1; then # a bare source tree: give it a baseline commit + git init -q && git add -A && git -c user.name=mimo -c user.email=mimo@localhost commit -q -m baseline --allow-empty +fi +BASE=$(git rev-parse HEAD 2>/dev/null) +[ ${#BASE} -eq 40 ] || fail "could not resolve the base commit in $CWD" +echo "$BASE" > "$M/base" +# Images are built with history truncated at the base. If one is not, the fix could be read out of git log, +# so .git is hidden while the agent works and put back for grading. +LATER=$(git rev-list --all --not "$BASE" 2>/dev/null | head -n 5 | grep -c . || true) +rm -f /tmp/fail.log /tmp/pass.log /tmp/patch.diff /tmp/test_patch.diff /tmp/*.log 2>/dev/null; rm -rf /tmp/claude-0 /tmp/claude-* /tmp/testem-* /tmp/puppeteer_dev_chrome_profile-* 2>/dev/null; rm -f /tmp/test_files.json 2>/dev/null; rm -rf /tmp/jest_* /tmp/jest-* /tmp/build /tmp/build_env 2>/dev/null; rm -rf /tmp/pytest-of-root /tmp/pytest-* /tmp/.pytest_cache /tmp/__pycache__ 2>/dev/null; rm -rf /tmp/go-build* /tmp/standards /tmp/wordpress /tmp/zig-* /tmp/testbase /tmp/testbed 2>/dev/null; rm -f /tmp/tmp*.tmp /tmp/*.bak /tmp/expect* /tmp/butwas* 2>/dev/null; rm -rf /root/.cache/go-build 2>/dev/null; rm -rf /tests 2>/dev/null; find /logs -mindepth 1 -delete 2>/dev/null; mkdir -p /logs/agent /logs/verifier /logs/artifacts; chmod 777 /logs/agent /logs/verifier /logs/artifacts; find /var/log -type f -delete 2>/dev/null || true; rm -rf /var/lib/postgresql/*/*/log /var/lib/postgresql/*/*/pg_log 2>/dev/null || true; find /var/lib/mysql /var/lib/mongodb -type f -name '*.log' -delete 2>/dev/null || true; rm -rf /root/.npm/_logs /root/.babel.json /root/.pytest_cache 2>/dev/null || true; find / -maxdepth 4 -xdev -name task_description.md -path '*/.build_env/*' -delete 2>/dev/null || true; true +git clean -fdx --exclude=node_modules --exclude=bower_components --exclude=.husky --exclude=vendor --exclude=third_party --exclude=_deps --exclude=vcpkg_installed --exclude=.venv --exclude=venv --exclude=.gradle --exclude=target --exclude=.build --exclude=lib --exclude=.bundle --exclude=Manifest.toml --exclude=_build --exclude=.stack-work --exclude=dist-newstyle >/dev/null 2>&1 +find /root/.m2 -type f \( -name '*-SNAPSHOT.jar' -o -name '*-SNAPSHOT-sources.jar' -o -name '*-SNAPSHOT-tests.jar' -o -name '*-SNAPSHOT-test-sources.jar' \) -delete 2>/dev/null; rm -rf /root/.julia/compiled 2>/dev/null; rm -rf /root/.gradle/caches/build-cache-* /root/.gradle/daemon 2>/dev/null; rm -rf /root/.gradle/caches/*/scripts /root/.gradle/caches/jars-* 2>/dev/null; rm -rf /root/.cache/bazel 2>/dev/null; true +if [ "$LATER" -gt 0 ]; then + mv "$CWD/.git" "$M/git-hidden" + echo "history not truncated at ${BASE:0:12}: .git hidden while the agent works" +fi +write_blocklist + +touch "$M/ready" +echo "setup done" diff --git a/tasks/format-code-task-001834/tests/test.patch b/tasks/format-code-task-001834/tests/test.patch new file mode 100644 index 0000000000000000000000000000000000000000..03de0c886a2c89c7d6d5ba91985d6234d85d73f0 --- /dev/null +++ b/tasks/format-code-task-001834/tests/test.patch @@ -0,0 +1,167 @@ +diff --git a/python/tests/nonreg/arcticdb/adapters/test_azure_library_adapter.py b/python/tests/nonreg/arcticdb/adapters/test_azure_library_adapter.py +new file mode 100644 +index 000000000..609eb4922 +--- /dev/null ++++ b/python/tests/nonreg/arcticdb/adapters/test_azure_library_adapter.py +@@ -0,0 +1,139 @@ ++ ++ ++ ++ ++ ++ ++ ++import re ++ ++import pytest ++ ++from arcticdb import Arctic ++from arcticdb.encoding_version import EncodingVersion ++ ++ ++ ++ ++ENDPOINT = ( ++ "DefaultEndpointsProtocol=http;AccountName=devstoreaccount1;" ++ "AccountKey=Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==;" ++ "BlobEndpoint=http://127.0.0.1:10000/devstoreaccount1" ++) ++ ++ ++def _make_adapter(uri): ++ ++ ++ ++ ++ ++ selected = [cls for cls in Arctic._LIBRARY_ADAPTERS if cls.supports_uri(uri)] ++ assert len(selected) == 1, f"Expected exactly one backend to handle {uri!r}, got {selected!r}" ++ cls = selected[0] ++ try: ++ return cls(uri, EncodingVersion.V1) ++ except TypeError: ++ return cls(uri) ++ ++ ++def _endpoint_from_repr(adapter): ++ match = re.fullmatch(r"azure\(endpoint=(?P.*), container=(?P.*)\)", repr(adapter)) ++ assert match is not None, f"Unexpected repr format: {repr(adapter)!r}" ++ return match ++ ++ ++ ++ ++ ++ ++ ++def test_azure_uri_is_recognised(): ++ selected = [cls for cls in Arctic._LIBRARY_ADAPTERS if cls.supports_uri(f"azure://{ENDPOINT};Container=foo")] ++ assert len(selected) == 1 ++ ++ ++@pytest.mark.parametrize("uri", ["s3://endpoint:bucket", "s3s://endpoint:bucket", "lmdb:///tmp/foo"]) ++def test_azure_backend_rejects_other_schemes(uri): ++ azure_backends = [cls for cls in Arctic._LIBRARY_ADAPTERS if cls.supports_uri(f"azure://{ENDPOINT};Container=foo")] ++ assert len(azure_backends) == 1 ++ azure_cls = azure_backends[0] ++ assert not azure_cls.supports_uri(uri) ++ ++ ++def test_other_backends_reject_azure(): ++ azure_uri = f"azure://{ENDPOINT};Container=foo" ++ azure_backends = [cls for cls in Arctic._LIBRARY_ADAPTERS if cls.supports_uri(azure_uri)] ++ azure_cls = azure_backends[0] ++ for cls in Arctic._LIBRARY_ADAPTERS: ++ if cls is azure_cls: ++ continue ++ assert not cls.supports_uri(azure_uri) ++ ++ ++ ++ ++ ++ ++ ++def test_connection_string_and_container_basic(): ++ adapter = _make_adapter(f"azure://{ENDPOINT};Container=mycontainer") ++ match = _endpoint_from_repr(adapter) ++ assert match["endpoint"] == ENDPOINT ++ assert match["container"] == "mycontainer" ++ ++ ++def test_arctic_options_are_stripped_from_connection_string(): ++ uri = f"azure://{ENDPOINT};Container=mycontainer;Path_prefix=some/prefix;CA_cert_path=/etc/ssl/cert.pem" ++ adapter = _make_adapter(uri) ++ endpoint = _endpoint_from_repr(adapter)["endpoint"] ++ assert endpoint == ENDPOINT ++ for stripped in ("Container=", "Path_prefix=", "CA_cert_path="): ++ assert stripped not in endpoint ++ ++ ++def test_connection_string_preserves_order(): ++ uri = "azure://Container=c;B=2;A=1;C=3" ++ adapter = _make_adapter(uri) ++ assert _endpoint_from_repr(adapter)["endpoint"] == "B=2;A=1;C=3" ++ ++ ++def test_value_with_equals_is_preserved(): ++ uri = f"azure://{ENDPOINT};Container=c" ++ adapter = _make_adapter(uri) ++ endpoint = _endpoint_from_repr(adapter)["endpoint"] ++ assert "AccountKey=Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==" in endpoint ++ ++ ++def test_key_matched_exactly_not_substring(): ++ ++ uri = "azure://AccountName=Containerxyz;Container=realcontainer" ++ adapter = _make_adapter(uri) ++ match = _endpoint_from_repr(adapter) ++ assert match["endpoint"] == "AccountName=Containerxyz" ++ assert match["container"] == "realcontainer" ++ ++ ++ ++ ++ ++ ++ ++def test_path_prefix_stripped(): ++ adapter = _make_adapter(f"azure://{ENDPOINT};Container=c;Path_prefix=/foo/bar/") ++ assert adapter.path_prefix == "foo/bar" ++ ++ ++def test_path_prefix_absent_is_none(): ++ adapter = _make_adapter(f"azure://{ENDPOINT};Container=c") ++ assert adapter.path_prefix is None ++ ++ ++ ++ ++ ++ ++ ++def test_empty_query_raises_value_error(): ++ with pytest.raises(ValueError): ++ _make_adapter("azure://") +diff --git a/mimo_test_command.sh b/mimo_test_command.sh +new file mode 100755 +--- /dev/null ++++ b/mimo_test_command.sh +@@ -0,0 +1,17 @@ ++#!/usr/bin/env bash ++ ++ ++ ++set -euo pipefail ++HERE="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" ++cd /testbed ++ ++ ++ ++cd /testbed/python ++ ++ ++python -m pytest tests/nonreg/arcticdb/adapters/test_lmdb_library_adapter.py -q ++ ++ ++python -m pytest tests/nonreg/arcticdb/adapters/test_azure_library_adapter.py -q diff --git a/tasks/format-code-task-001834/tests/test.sh b/tasks/format-code-task-001834/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..c431ade45fce670e8434a5fac751c10985208ff1 --- /dev/null +++ b/tasks/format-code-task-001834/tests/test.sh @@ -0,0 +1,38 @@ +#!/bin/bash +# Code grading, mimoagent opensource_code.py: reset the files the hidden test patch touches, apply it, run the +# task's test command; reward 1 when it exits 0. A testbed failure (reset or apply) writes no reward: not scored. +M=/var/lib/mimo +CWD=/testbed +V=/logs/verifier +mkdir -p "$V" +BASE=$(cat "$M/base" 2>/dev/null) || { echo "setup never ran (no $M/base)" >&2; exit 1; } +cd "$CWD" || exit 1 +if [ -d "$M/git-hidden" ]; then rm -rf "$CWD/.git"; mv "$M/git-hidden" "$CWD/.git"; fi +# the agent's change against the base, so its own commits count too +git add -A >/dev/null 2>&1 && git -c core.fileMode=false diff --cached "$BASE" > "$V/agent.diff" +git reset -q +if ! ( +while IFS= read -r tf; do + [ -z "$tf" ] && continue + if git cat-file -e $BASE:"$tf" 2>/dev/null; then + git checkout $BASE -- "$tf" 2>/dev/null || true + else + git rm -f --cached "$tf" >/dev/null 2>&1 || true + rm -f "$tf" + fi +done <<'EOF_RESET_TEST_FILES' +python/tests/nonreg/arcticdb/adapters/test_azure_library_adapter.py +mimo_test_command.sh +EOF_RESET_TEST_FILES + +); then echo "could not reset the test files (testbed problem, not scored)" >&2; exit 1; fi +if ! git apply --verbose /tests/test.patch > "$V/apply.log" 2>&1; then + cat "$V/apply.log" >&2 + echo "the hidden tests could not be applied (testbed problem, not scored)" >&2 + exit 1 +fi +timeout 1800 sh -c "$(cat /tests/test_command.sh)" > "$V/test_output.log" 2>&1 +RC=$? +tail -c 12000 "$V/test_output.log" +if [ $RC -eq 0 ]; then echo 1 > "$V/reward.txt"; else echo 0 > "$V/reward.txt"; fi +echo "test command exited $RC" diff --git a/tasks/format-code-task-001834/tests/test_command.sh b/tasks/format-code-task-001834/tests/test_command.sh new file mode 100644 index 0000000000000000000000000000000000000000..7cb23076694ad17d72e8296d62b2b240083e36db --- /dev/null +++ b/tasks/format-code-task-001834/tests/test_command.sh @@ -0,0 +1 @@ +bash /testbed/mimo_test_command.sh \ No newline at end of file diff --git a/tasks/format-code-task-001856/environment/Dockerfile b/tasks/format-code-task-001856/environment/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..776949beaef09cb1519c3cdc25cef1326f4f6d5e --- /dev/null +++ b/tasks/format-code-task-001856/environment/Dockerfile @@ -0,0 +1,3 @@ +# The task's image, pinned by digest (the same as [environment].docker_image). +# Setup runs at start from [environment.healthcheck]; environment/setup/ is its readable copy. +FROM docker.io/xiaomimimo/mimo-v2.6-rl-oss@sha256:0fda77fb3e8194e0af5235e82998e034377953450906ba119c67b439c79ec387 diff --git a/tasks/format-code-task-001856/environment/setup/files/blocklist b/tasks/format-code-task-001856/environment/setup/files/blocklist new file mode 100644 index 0000000000000000000000000000000000000000..a8e4bdc4c7d9b739c047a3cb58ea72a1bb05bcbc --- /dev/null +++ b/tasks/format-code-task-001856/environment/setup/files/blocklist @@ -0,0 +1,33 @@ +# mimo answer-leak blocklist (mimoagent) +0.0.0.0 github.com +0.0.0.0 www.github.com +0.0.0.0 api.github.com +0.0.0.0 raw.githubusercontent.com +0.0.0.0 codeload.github.com +0.0.0.0 objects.githubusercontent.com +0.0.0.0 gist.github.com +0.0.0.0 gist.githubusercontent.com +0.0.0.0 gitlab.com +0.0.0.0 bitbucket.org +0.0.0.0 sourceforge.net +0.0.0.0 git.kernel.org +0.0.0.0 chromium.googlesource.com +0.0.0.0 android.googlesource.com +0.0.0.0 sourcegraph.com +0.0.0.0 bugs.chromium.org +0.0.0.0 issues.oss-fuzz.com +0.0.0.0 oss-fuzz.com +0.0.0.0 osv.dev +0.0.0.0 api.osv.dev +0.0.0.0 bugzilla.mozilla.org +0.0.0.0 proxy.golang.org +0.0.0.0 sum.golang.org +0.0.0.0 pkg.go.dev +0.0.0.0 google.com +0.0.0.0 www.google.com +0.0.0.0 bing.com +0.0.0.0 www.bing.com +0.0.0.0 duckduckgo.com +0.0.0.0 html.duckduckgo.com +0.0.0.0 search.brave.com +0.0.0.0 stackoverflow.com diff --git a/tasks/format-code-task-001856/environment/setup/setup.sh b/tasks/format-code-task-001856/environment/setup/setup.sh new file mode 100644 index 0000000000000000000000000000000000000000..d883db90cfcfb48f7a139861bbe9f6b5d95cad6f --- /dev/null +++ b/tasks/format-code-task-001856/environment/setup/setup.sh @@ -0,0 +1,34 @@ +#!/bin/bash +# Runs once, as root, before the agent starts: Harbor's [environment.healthcheck] unpacks this folder into +# /var/lib/mimo and runs it. Generated by mimo_harbor; see its README for how each step maps to Xiaomi's harness. +M=/var/lib/mimo +[ -f "$M/ready" ] && exit 0 +chmod 700 "$M" +fail() { echo "setup: $*" >&2; exit 1; } +# the answer-leak blocklist (mimoagent), applied to /etc/hosts by the agent right after it installs +write_blocklist() { cp "$M/files/blocklist" "$M/blocklist"; } + +# Code: mimoagent environments/datasets/opensource_code.py + base.py, as the explorer runs it (app/runner/domains.py Code). +CWD=/testbed +git config --global --add safe.directory "$CWD" +cd "$CWD" || fail "no working directory $CWD" +if ! git rev-parse --git-dir >/dev/null 2>&1; then # a bare source tree: give it a baseline commit + git init -q && git add -A && git -c user.name=mimo -c user.email=mimo@localhost commit -q -m baseline --allow-empty +fi +BASE=$(git rev-parse HEAD 2>/dev/null) +[ ${#BASE} -eq 40 ] || fail "could not resolve the base commit in $CWD" +echo "$BASE" > "$M/base" +# Images are built with history truncated at the base. If one is not, the fix could be read out of git log, +# so .git is hidden while the agent works and put back for grading. +LATER=$(git rev-list --all --not "$BASE" 2>/dev/null | head -n 5 | grep -c . || true) +rm -f /tmp/fail.log /tmp/pass.log /tmp/patch.diff /tmp/test_patch.diff /tmp/*.log 2>/dev/null; rm -rf /tmp/claude-0 /tmp/claude-* /tmp/testem-* /tmp/puppeteer_dev_chrome_profile-* 2>/dev/null; rm -f /tmp/test_files.json 2>/dev/null; rm -rf /tmp/jest_* /tmp/jest-* /tmp/build /tmp/build_env 2>/dev/null; rm -rf /tmp/pytest-of-root /tmp/pytest-* /tmp/.pytest_cache /tmp/__pycache__ 2>/dev/null; rm -rf /tmp/go-build* /tmp/standards /tmp/wordpress /tmp/zig-* /tmp/testbase /tmp/testbed 2>/dev/null; rm -f /tmp/tmp*.tmp /tmp/*.bak /tmp/expect* /tmp/butwas* 2>/dev/null; rm -rf /root/.cache/go-build 2>/dev/null; rm -rf /tests 2>/dev/null; find /logs -mindepth 1 -delete 2>/dev/null; mkdir -p /logs/agent /logs/verifier /logs/artifacts; chmod 777 /logs/agent /logs/verifier /logs/artifacts; find /var/log -type f -delete 2>/dev/null || true; rm -rf /var/lib/postgresql/*/*/log /var/lib/postgresql/*/*/pg_log 2>/dev/null || true; find /var/lib/mysql /var/lib/mongodb -type f -name '*.log' -delete 2>/dev/null || true; rm -rf /root/.npm/_logs /root/.babel.json /root/.pytest_cache 2>/dev/null || true; find / -maxdepth 4 -xdev -name task_description.md -path '*/.build_env/*' -delete 2>/dev/null || true; true +git clean -fdx --exclude=node_modules --exclude=bower_components --exclude=.husky --exclude=vendor --exclude=third_party --exclude=_deps --exclude=vcpkg_installed --exclude=.venv --exclude=venv --exclude=.gradle --exclude=target --exclude=.build --exclude=lib --exclude=.bundle --exclude=Manifest.toml --exclude=_build --exclude=.stack-work --exclude=dist-newstyle >/dev/null 2>&1 +find /root/.m2 -type f \( -name '*-SNAPSHOT.jar' -o -name '*-SNAPSHOT-sources.jar' -o -name '*-SNAPSHOT-tests.jar' -o -name '*-SNAPSHOT-test-sources.jar' \) -delete 2>/dev/null; rm -rf /root/.julia/compiled 2>/dev/null; rm -rf /root/.gradle/caches/build-cache-* /root/.gradle/daemon 2>/dev/null; rm -rf /root/.gradle/caches/*/scripts /root/.gradle/caches/jars-* 2>/dev/null; rm -rf /root/.cache/bazel 2>/dev/null; true +if [ "$LATER" -gt 0 ]; then + mv "$CWD/.git" "$M/git-hidden" + echo "history not truncated at ${BASE:0:12}: .git hidden while the agent works" +fi +write_blocklist + +touch "$M/ready" +echo "setup done" diff --git a/tasks/format-code-task-001856/tests/test.patch b/tasks/format-code-task-001856/tests/test.patch new file mode 100644 index 0000000000000000000000000000000000000000..fccb621b0b308985ee385e8f9be7062cbdce58ac --- /dev/null +++ b/tasks/format-code-task-001856/tests/test.patch @@ -0,0 +1,372 @@ +diff --git a/packages/ra-core/src/form/useChoices.spec.tsx b/packages/ra-core/src/form/useChoices.spec.tsx +index 83a3b0f6e..adf746e31 100644 +--- a/packages/ra-core/src/form/useChoices.spec.tsx ++++ b/packages/ra-core/src/form/useChoices.spec.tsx +@@ -4,6 +4,7 @@ import { render, screen } from '@testing-library/react'; + + import { useChoices } from './useChoices'; + import { TestTranslationProvider } from '../i18n'; ++import { useRecordContext } from '../controller'; + + describe('useChoices hook', () => { + const defaultProps = { +@@ -56,9 +57,10 @@ describe('useChoices hook', () => { + }); + + it('should use optionText with an element value as text identifier', () => { +- const Foobar = ({ record }: { record?: any }) => ( +- {record.foobar} +- ); ++ const Foobar = () => { ++ const record = useRecordContext(); ++ return {record.foobar}; ++ }; + render( + { + expect(screen.queryAllByText('test')).toHaveLength(1); + }); + ++ it('should not inject the current choice as a record prop into an optionText element', () => { ++ const Probe = (props: { record?: any }) => { ++ const record = useRecordContext(); ++ return ( ++ ++ hook:{record.foobar} ++ {props.record ? prop-present : null} ++ ++ ); ++ }; ++ ++ render( ++ } ++ choice={{ id: 42, foobar: 'test' }} ++ /> ++ ); ++ ++ expect(screen.getByText('hook:test')).not.toBeNull(); ++ expect(screen.queryByText('prop-present')).toBeNull(); ++ }); ++ + it('should translate the choice by default', () => { + render( + `**${x}**`}> +diff --git a/packages/ra-ui-materialui/src/field/SelectField.spec.tsx b/packages/ra-ui-materialui/src/field/SelectField.spec.tsx +index 1fc9b070e..a14ae2729 100644 +--- a/packages/ra-ui-materialui/src/field/SelectField.spec.tsx ++++ b/packages/ra-ui-materialui/src/field/SelectField.spec.tsx +@@ -1,11 +1,10 @@ + import * as React from 'react'; +-import { FC } from 'react'; + import expect from 'expect'; + import { render, screen } from '@testing-library/react'; + import { +- RaRecord, +- TestTranslationProvider, + RecordContextProvider, ++ TestTranslationProvider, ++ useRecordContext, + } from 'ra-core'; + + import { SelectField } from './SelectField'; +@@ -123,9 +122,10 @@ describe('', () => { + }); + + it('should use optionText with an element value as text identifier', () => { +- const Foobar: FC<{ record?: RaRecord }> = ({ record }) => ( +- {record.foobar} +- ); ++ const Foobar = () => { ++ const record = useRecordContext(); ++ return {record.foobar}; ++ }; + render( + ', () => { + }); + + it('should allow customized rendering of suggesting item', () => { +- const SuggestionItem = ({ record }: { record?: any }) => ( +-
+- ); ++ const SuggestionItem = props => { ++ const record = useRecordContext(); ++ return
; ++ }; + + render( + +diff --git a/packages/ra-ui-materialui/src/input/AutocompleteInput.spec.tsx b/packages/ra-ui-materialui/src/input/AutocompleteInput.spec.tsx +index eeb5dbb59..c7ccbd240 100644 +--- a/packages/ra-ui-materialui/src/input/AutocompleteInput.spec.tsx ++++ b/packages/ra-ui-materialui/src/input/AutocompleteInput.spec.tsx +@@ -5,6 +5,7 @@ import { + FormDataConsumer, + testDataProvider, + TestTranslationProvider, ++ useRecordContext, + } from 'ra-core'; + import { AdminContext } from '../AdminContext'; + import { SimpleForm } from '../form'; +@@ -433,9 +434,10 @@ describe('', () => { + }); + + it('should allow customized rendering of suggesting item', () => { +- const SuggestionItem = ({ record, ...rest }: { record?: any }) => ( +-
+- ); ++ const SuggestionItem = props => { ++ const record = useRecordContext(); ++ return
; ++ }; + + render( + +@@ -459,6 +461,44 @@ describe('', () => { + expect(screen.queryByLabelText('bar')).not.toBeNull(); + }); + ++ it('should not pass the current suggestion as a record prop to an optionText element', async () => { ++ const SuggestionItem = (props: { record?: any }) => { ++ const record = useRecordContext(); ++ return ( ++
++ hook:{record && record.name} ++ {props.record ? prop-present : null} ++
++ ); ++ }; ++ ++ render( ++ ++ ++ } ++ inputText={choice => choice && choice.name} ++ matchSuggestion={(filter, choice) => ++ choice.name ++ .toLowerCase() ++ .includes(filter.toLowerCase()) ++ } ++ /> ++ ++ ++ ); ++ ++ fireEvent.click(screen.getByLabelText('resources.users.fields.role')); ++ ++ await waitFor(() => screen.getByText('hook:bar')); ++ expect(screen.queryByText('prop-present')).toBeNull(); ++ }); ++ + it('should display helperText if specified', () => { + render( + +diff --git a/packages/ra-ui-materialui/src/input/CheckboxGroupInput.spec.tsx b/packages/ra-ui-materialui/src/input/CheckboxGroupInput.spec.tsx +index d22227e32..f7f609827 100644 +--- a/packages/ra-ui-materialui/src/input/CheckboxGroupInput.spec.tsx ++++ b/packages/ra-ui-materialui/src/input/CheckboxGroupInput.spec.tsx +@@ -1,7 +1,11 @@ + import * as React from 'react'; + import expect from 'expect'; + import { fireEvent, render, screen, waitFor } from '@testing-library/react'; +-import { testDataProvider, TestTranslationProvider } from 'ra-core'; ++import { ++ testDataProvider, ++ TestTranslationProvider, ++ useRecordContext, ++} from 'ra-core'; + + import { AdminContext } from '../AdminContext'; + import { SimpleForm } from '../form'; +@@ -138,15 +142,16 @@ describe('', () => { + }); + + it('should use optionText with an element value as text identifier', () => { +- const Foobar = ({ record }) => ( +- {record.foobar} +- ); ++ const Foobar = () => { ++ const record = useRecordContext(); ++ return {record.foobar}; ++ }; + render( + + + } ++ optionText={} + choices={[{ id: 'foo', foobar: 'Bar' }]} + /> + +diff --git a/packages/ra-ui-materialui/src/input/RadioButtonGroupInput.spec.tsx b/packages/ra-ui-materialui/src/input/RadioButtonGroupInput.spec.tsx +index e97548a41..62c179be2 100644 +--- a/packages/ra-ui-materialui/src/input/RadioButtonGroupInput.spec.tsx ++++ b/packages/ra-ui-materialui/src/input/RadioButtonGroupInput.spec.tsx +@@ -1,7 +1,11 @@ + import * as React from 'react'; + import expect from 'expect'; + import { fireEvent, render, screen, waitFor } from '@testing-library/react'; +-import { testDataProvider, TestTranslationProvider } from 'ra-core'; ++import { ++ testDataProvider, ++ TestTranslationProvider, ++ useRecordContext, ++} from 'ra-core'; + + import { AdminContext } from '../AdminContext'; + import { SimpleForm } from '../form'; +@@ -238,9 +242,10 @@ describe('', () => { + }); + + it('should use optionText with an element value as text identifier', () => { +- const Foobar = ({ record }: { record?: any }) => ( +- {record.longname} +- ); ++ const Foobar = () => { ++ const record = useRecordContext(); ++ return {record.longname}; ++ }; + render( + + +diff --git a/packages/ra-ui-materialui/src/input/SelectArrayInput.spec.tsx b/packages/ra-ui-materialui/src/input/SelectArrayInput.spec.tsx +index fcc263ed0..12ed303e2 100644 +--- a/packages/ra-ui-materialui/src/input/SelectArrayInput.spec.tsx ++++ b/packages/ra-ui-materialui/src/input/SelectArrayInput.spec.tsx +@@ -1,7 +1,11 @@ + import * as React from 'react'; + import expect from 'expect'; + import { fireEvent, render, screen, waitFor } from '@testing-library/react'; +-import { testDataProvider, TestTranslationProvider } from 'ra-core'; ++import { ++ testDataProvider, ++ TestTranslationProvider, ++ useRecordContext, ++} from 'ra-core'; + + import { AdminContext } from '../AdminContext'; + import { SimpleForm } from '../form'; +@@ -170,7 +174,10 @@ describe('', () => { + }); + + it('should use optionText with an element value as text identifier', () => { +- const Foobar = ({ record = undefined }) => {record.foobar}; ++ const Foobar = () => { ++ const record = useRecordContext(); ++ return {record.foobar}; ++ }; + render( + + +diff --git a/packages/ra-ui-materialui/src/input/SelectInput.spec.tsx b/packages/ra-ui-materialui/src/input/SelectInput.spec.tsx +index 966f84c8a..1f705eda9 100644 +--- a/packages/ra-ui-materialui/src/input/SelectInput.spec.tsx ++++ b/packages/ra-ui-materialui/src/input/SelectInput.spec.tsx +@@ -1,6 +1,11 @@ + import * as React from 'react'; + import { fireEvent, render, screen, waitFor } from '@testing-library/react'; +-import { required, testDataProvider, TestTranslationProvider } from 'ra-core'; ++import { ++ required, ++ testDataProvider, ++ TestTranslationProvider, ++ useRecordContext, ++} from 'ra-core'; + + import { AdminContext } from '../AdminContext'; + import { SimpleForm } from '../form'; +@@ -249,9 +254,10 @@ describe('', () => { + }); + + it('should use optionText with an element value as text identifier', () => { +- const Foobar = ({ record }: { record?: any }) => ( +- +- ); ++ const Foobar = () => { ++ const record = useRecordContext(); ++ return ; ++ }; + + render( + +diff --git a/mimo_test_command.sh b/mimo_test_command.sh +new file mode 100755 +--- /dev/null ++++ b/mimo_test_command.sh +@@ -0,0 +1,48 @@ ++#!/bin/bash ++set -uo pipefail ++cd /testbed ++ ++ ++node .yarn/releases/yarn-3.1.1.cjs install ++ ++JEST_CMD=( ++ env ++ NODE_ENV=test ++ BABEL_ENV=cjs ++ NODE_ICU_DATA=./node_modules/full-icu ++ node ++ node_modules/.bin/jest ++) ++ ++TARGET_FILES=( ++ packages/ra-core/src/form/useChoices.spec.tsx ++ packages/ra-ui-materialui/src/field/SelectField.spec.tsx ++ packages/ra-ui-materialui/src/input/AutocompleteArrayInput.spec.tsx ++ packages/ra-ui-materialui/src/input/AutocompleteInput.spec.tsx ++ packages/ra-ui-materialui/src/input/CheckboxGroupInput.spec.tsx ++ packages/ra-ui-materialui/src/input/RadioButtonGroupInput.spec.tsx ++ packages/ra-ui-materialui/src/input/SelectArrayInput.spec.tsx ++ packages/ra-ui-materialui/src/input/SelectInput.spec.tsx ++) ++ ++case "${1:-}" in ++ base) ++ "${JEST_CMD[@]}" "${TARGET_FILES[@]}" ++ ;; ++ new) ++ "${JEST_CMD[@]}" \ ++ packages/ra-core/src/form/useChoices.spec.tsx \ ++ packages/ra-ui-materialui/src/field/SelectField.spec.tsx \ ++ packages/ra-ui-materialui/src/input/AutocompleteArrayInput.spec.tsx \ ++ packages/ra-ui-materialui/src/input/AutocompleteInput.spec.tsx \ ++ packages/ra-ui-materialui/src/input/CheckboxGroupInput.spec.tsx \ ++ packages/ra-ui-materialui/src/input/RadioButtonGroupInput.spec.tsx \ ++ packages/ra-ui-materialui/src/input/SelectArrayInput.spec.tsx \ ++ packages/ra-ui-materialui/src/input/SelectInput.spec.tsx \ ++ --testNamePattern='should use optionText with an element value as text identifier|should allow customized rendering of suggesting item|should not inject the current choice as a record prop into an optionText element|should not pass the current suggestion as a record prop to an optionText element' ++ ;; ++ *) ++ echo "usage: $0 base|new" ++ exit 2 ++ ;; ++esac diff --git a/tasks/format-code-task-001856/tests/test.sh b/tasks/format-code-task-001856/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..f899d13f2a6e137d3f6689a6a04ae622416b53e7 --- /dev/null +++ b/tasks/format-code-task-001856/tests/test.sh @@ -0,0 +1,45 @@ +#!/bin/bash +# Code grading, mimoagent opensource_code.py: reset the files the hidden test patch touches, apply it, run the +# task's test command; reward 1 when it exits 0. A testbed failure (reset or apply) writes no reward: not scored. +M=/var/lib/mimo +CWD=/testbed +V=/logs/verifier +mkdir -p "$V" +BASE=$(cat "$M/base" 2>/dev/null) || { echo "setup never ran (no $M/base)" >&2; exit 1; } +cd "$CWD" || exit 1 +if [ -d "$M/git-hidden" ]; then rm -rf "$CWD/.git"; mv "$M/git-hidden" "$CWD/.git"; fi +# the agent's change against the base, so its own commits count too +git add -A >/dev/null 2>&1 && git -c core.fileMode=false diff --cached "$BASE" > "$V/agent.diff" +git reset -q +if ! ( +while IFS= read -r tf; do + [ -z "$tf" ] && continue + if git cat-file -e $BASE:"$tf" 2>/dev/null; then + git checkout $BASE -- "$tf" 2>/dev/null || true + else + git rm -f --cached "$tf" >/dev/null 2>&1 || true + rm -f "$tf" + fi +done <<'EOF_RESET_TEST_FILES' +packages/ra-core/src/form/useChoices.spec.tsx +packages/ra-ui-materialui/src/field/SelectField.spec.tsx +packages/ra-ui-materialui/src/input/AutocompleteArrayInput.spec.tsx +packages/ra-ui-materialui/src/input/AutocompleteInput.spec.tsx +packages/ra-ui-materialui/src/input/CheckboxGroupInput.spec.tsx +packages/ra-ui-materialui/src/input/RadioButtonGroupInput.spec.tsx +packages/ra-ui-materialui/src/input/SelectArrayInput.spec.tsx +packages/ra-ui-materialui/src/input/SelectInput.spec.tsx +mimo_test_command.sh +EOF_RESET_TEST_FILES + +); then echo "could not reset the test files (testbed problem, not scored)" >&2; exit 1; fi +if ! git apply --verbose /tests/test.patch > "$V/apply.log" 2>&1; then + cat "$V/apply.log" >&2 + echo "the hidden tests could not be applied (testbed problem, not scored)" >&2 + exit 1 +fi +timeout 1800 sh -c "$(cat /tests/test_command.sh)" > "$V/test_output.log" 2>&1 +RC=$? +tail -c 12000 "$V/test_output.log" +if [ $RC -eq 0 ]; then echo 1 > "$V/reward.txt"; else echo 0 > "$V/reward.txt"; fi +echo "test command exited $RC" diff --git a/tasks/format-code-task-001856/tests/test_command.sh b/tasks/format-code-task-001856/tests/test_command.sh new file mode 100644 index 0000000000000000000000000000000000000000..e8d2f32b64045b5a5a56e0ad5667da87d8e0bc2a --- /dev/null +++ b/tasks/format-code-task-001856/tests/test_command.sh @@ -0,0 +1 @@ +bash /testbed/mimo_test_command.sh base && bash /testbed/mimo_test_command.sh new \ No newline at end of file diff --git a/tasks/format-code-task-002003/environment/Dockerfile b/tasks/format-code-task-002003/environment/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..4e12d12b0cdb4b1cc58db026e5d1cd9468b9872b --- /dev/null +++ b/tasks/format-code-task-002003/environment/Dockerfile @@ -0,0 +1,3 @@ +# The task's image, pinned by digest (the same as [environment].docker_image). +# Setup runs at start from [environment.healthcheck]; environment/setup/ is its readable copy. +FROM docker.io/xiaomimimo/mimo-v2.6-rl-oss@sha256:3f40c243c4c63567a66bb919c561e52570d3cf32ef25356a9add6a7a94117774 diff --git a/tasks/format-code-task-002003/environment/setup/files/blocklist b/tasks/format-code-task-002003/environment/setup/files/blocklist new file mode 100644 index 0000000000000000000000000000000000000000..a8e4bdc4c7d9b739c047a3cb58ea72a1bb05bcbc --- /dev/null +++ b/tasks/format-code-task-002003/environment/setup/files/blocklist @@ -0,0 +1,33 @@ +# mimo answer-leak blocklist (mimoagent) +0.0.0.0 github.com +0.0.0.0 www.github.com +0.0.0.0 api.github.com +0.0.0.0 raw.githubusercontent.com +0.0.0.0 codeload.github.com +0.0.0.0 objects.githubusercontent.com +0.0.0.0 gist.github.com +0.0.0.0 gist.githubusercontent.com +0.0.0.0 gitlab.com +0.0.0.0 bitbucket.org +0.0.0.0 sourceforge.net +0.0.0.0 git.kernel.org +0.0.0.0 chromium.googlesource.com +0.0.0.0 android.googlesource.com +0.0.0.0 sourcegraph.com +0.0.0.0 bugs.chromium.org +0.0.0.0 issues.oss-fuzz.com +0.0.0.0 oss-fuzz.com +0.0.0.0 osv.dev +0.0.0.0 api.osv.dev +0.0.0.0 bugzilla.mozilla.org +0.0.0.0 proxy.golang.org +0.0.0.0 sum.golang.org +0.0.0.0 pkg.go.dev +0.0.0.0 google.com +0.0.0.0 www.google.com +0.0.0.0 bing.com +0.0.0.0 www.bing.com +0.0.0.0 duckduckgo.com +0.0.0.0 html.duckduckgo.com +0.0.0.0 search.brave.com +0.0.0.0 stackoverflow.com diff --git a/tasks/format-code-task-002003/environment/setup/setup.sh b/tasks/format-code-task-002003/environment/setup/setup.sh new file mode 100644 index 0000000000000000000000000000000000000000..d883db90cfcfb48f7a139861bbe9f6b5d95cad6f --- /dev/null +++ b/tasks/format-code-task-002003/environment/setup/setup.sh @@ -0,0 +1,34 @@ +#!/bin/bash +# Runs once, as root, before the agent starts: Harbor's [environment.healthcheck] unpacks this folder into +# /var/lib/mimo and runs it. Generated by mimo_harbor; see its README for how each step maps to Xiaomi's harness. +M=/var/lib/mimo +[ -f "$M/ready" ] && exit 0 +chmod 700 "$M" +fail() { echo "setup: $*" >&2; exit 1; } +# the answer-leak blocklist (mimoagent), applied to /etc/hosts by the agent right after it installs +write_blocklist() { cp "$M/files/blocklist" "$M/blocklist"; } + +# Code: mimoagent environments/datasets/opensource_code.py + base.py, as the explorer runs it (app/runner/domains.py Code). +CWD=/testbed +git config --global --add safe.directory "$CWD" +cd "$CWD" || fail "no working directory $CWD" +if ! git rev-parse --git-dir >/dev/null 2>&1; then # a bare source tree: give it a baseline commit + git init -q && git add -A && git -c user.name=mimo -c user.email=mimo@localhost commit -q -m baseline --allow-empty +fi +BASE=$(git rev-parse HEAD 2>/dev/null) +[ ${#BASE} -eq 40 ] || fail "could not resolve the base commit in $CWD" +echo "$BASE" > "$M/base" +# Images are built with history truncated at the base. If one is not, the fix could be read out of git log, +# so .git is hidden while the agent works and put back for grading. +LATER=$(git rev-list --all --not "$BASE" 2>/dev/null | head -n 5 | grep -c . || true) +rm -f /tmp/fail.log /tmp/pass.log /tmp/patch.diff /tmp/test_patch.diff /tmp/*.log 2>/dev/null; rm -rf /tmp/claude-0 /tmp/claude-* /tmp/testem-* /tmp/puppeteer_dev_chrome_profile-* 2>/dev/null; rm -f /tmp/test_files.json 2>/dev/null; rm -rf /tmp/jest_* /tmp/jest-* /tmp/build /tmp/build_env 2>/dev/null; rm -rf /tmp/pytest-of-root /tmp/pytest-* /tmp/.pytest_cache /tmp/__pycache__ 2>/dev/null; rm -rf /tmp/go-build* /tmp/standards /tmp/wordpress /tmp/zig-* /tmp/testbase /tmp/testbed 2>/dev/null; rm -f /tmp/tmp*.tmp /tmp/*.bak /tmp/expect* /tmp/butwas* 2>/dev/null; rm -rf /root/.cache/go-build 2>/dev/null; rm -rf /tests 2>/dev/null; find /logs -mindepth 1 -delete 2>/dev/null; mkdir -p /logs/agent /logs/verifier /logs/artifacts; chmod 777 /logs/agent /logs/verifier /logs/artifacts; find /var/log -type f -delete 2>/dev/null || true; rm -rf /var/lib/postgresql/*/*/log /var/lib/postgresql/*/*/pg_log 2>/dev/null || true; find /var/lib/mysql /var/lib/mongodb -type f -name '*.log' -delete 2>/dev/null || true; rm -rf /root/.npm/_logs /root/.babel.json /root/.pytest_cache 2>/dev/null || true; find / -maxdepth 4 -xdev -name task_description.md -path '*/.build_env/*' -delete 2>/dev/null || true; true +git clean -fdx --exclude=node_modules --exclude=bower_components --exclude=.husky --exclude=vendor --exclude=third_party --exclude=_deps --exclude=vcpkg_installed --exclude=.venv --exclude=venv --exclude=.gradle --exclude=target --exclude=.build --exclude=lib --exclude=.bundle --exclude=Manifest.toml --exclude=_build --exclude=.stack-work --exclude=dist-newstyle >/dev/null 2>&1 +find /root/.m2 -type f \( -name '*-SNAPSHOT.jar' -o -name '*-SNAPSHOT-sources.jar' -o -name '*-SNAPSHOT-tests.jar' -o -name '*-SNAPSHOT-test-sources.jar' \) -delete 2>/dev/null; rm -rf /root/.julia/compiled 2>/dev/null; rm -rf /root/.gradle/caches/build-cache-* /root/.gradle/daemon 2>/dev/null; rm -rf /root/.gradle/caches/*/scripts /root/.gradle/caches/jars-* 2>/dev/null; rm -rf /root/.cache/bazel 2>/dev/null; true +if [ "$LATER" -gt 0 ]; then + mv "$CWD/.git" "$M/git-hidden" + echo "history not truncated at ${BASE:0:12}: .git hidden while the agent works" +fi +write_blocklist + +touch "$M/ready" +echo "setup done" diff --git a/tasks/format-code-task-002003/tests/test.patch b/tasks/format-code-task-002003/tests/test.patch new file mode 100644 index 0000000000000000000000000000000000000000..20fbe1e9ffc63a251c7a1058e8c2da118d2254a2 --- /dev/null +++ b/tasks/format-code-task-002003/tests/test.patch @@ -0,0 +1,55 @@ +diff --git a/test/test_rank.py b/test/test_rank.py +new file mode 100644 +index 00000000..d26ca078 +--- /dev/null ++++ b/test/test_rank.py +@@ -0,0 +1,27 @@ ++from mwmbl.tinysearchengine.indexer import Document ++from mwmbl.tinysearchengine.rank import order_results ++ ++ ++def test_order_result(): ++ doc1 = Document(title='title2', url='https://something.com', extract='extract2', score=2.0) ++ doc2 = Document(title='title3', url='https://something.com', extract='extract3', score=3.0) ++ doc3 = Document(title='Bananas and apples', url='https://something.com', extract='extract1', score=1.0) ++ ++ documents = [doc1, doc2, doc3] ++ ++ ++ ordered_results = order_results(["bananas"], documents, True) ++ ++ assert ordered_results[0].title == 'Bananas and apples' ++ ++ ++def test_order_results_where_document_has_properties_that_are_none(): ++ doc1 = Document(title=None, url='https://something.com', extract='extract2', score=2.0) ++ doc2 = Document(title='Bananas and apples', url='https://something.com', extract=None, score=1.0) ++ ++ documents = [doc1, doc2] ++ ++ ++ ordered_results = order_results(["bananas"], documents, True) ++ ++ assert ordered_results[0].title == 'Bananas and apples' +diff --git a/mimo_build_env.tar.gz.b64 b/mimo_build_env.tar.gz.b64 +new file mode 100644 +--- /dev/null ++++ b/mimo_build_env.tar.gz.b64 +@@ -0,0 +1,6 @@ ++H4sIAAAAAAAAA+3SvW6DMBQFYGae4r4APw4Fpg7ZMjUZsnSKDLaEVWwoGKTk6WtAbapIbZZEbdXz ++DdjYln3l47AYVC0O0oyRdy+xk6fp3DqX7dxn6YqxPM/iNPNixjKWeJTeraJPht7yjsjrmsZ+t+7a ++/B8VnvO3sreHstGaGxH21e3OuJb/Kmfn/Blz+T9kLPMovl0JX/vn+ZeC5uALKfz2aKvGJBRoGt2D +++JiIwunX75uhK+XFaFQoE/HSqpFb6beqJWXcjdY1BcHroKQlrauETm7MCN4Jaqe2J3eW28bfPe83 ++26fder95fN+XljKmKpZFNH2W19lx8xK2RwpG/6cvDgAAAAAAAAAAAAAAAAAAAADgF3gDuKJh/AAo ++AAA= +diff --git a/mimo_test_command.sh b/mimo_test_command.sh +new file mode 100755 +--- /dev/null ++++ b/mimo_test_command.sh +@@ -0,0 +1,6 @@ ++#!/usr/bin/env bash ++ ++set -uo pipefail ++cd /testbed || exit 1 ++base64 -d mimo_build_env.tar.gz.b64 | tar -xzf - -C /testbed || exit 1 ++exec bash -lc 'cd /testbed && bash -eo pipefail /testbed/.build_env/test_command.sh' diff --git a/tasks/format-code-task-002003/tests/test.sh b/tasks/format-code-task-002003/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..949dae3a3ede35ba882da54cf5ed21ed26a62465 --- /dev/null +++ b/tasks/format-code-task-002003/tests/test.sh @@ -0,0 +1,39 @@ +#!/bin/bash +# Code grading, mimoagent opensource_code.py: reset the files the hidden test patch touches, apply it, run the +# task's test command; reward 1 when it exits 0. A testbed failure (reset or apply) writes no reward: not scored. +M=/var/lib/mimo +CWD=/testbed +V=/logs/verifier +mkdir -p "$V" +BASE=$(cat "$M/base" 2>/dev/null) || { echo "setup never ran (no $M/base)" >&2; exit 1; } +cd "$CWD" || exit 1 +if [ -d "$M/git-hidden" ]; then rm -rf "$CWD/.git"; mv "$M/git-hidden" "$CWD/.git"; fi +# the agent's change against the base, so its own commits count too +git add -A >/dev/null 2>&1 && git -c core.fileMode=false diff --cached "$BASE" > "$V/agent.diff" +git reset -q +if ! ( +while IFS= read -r tf; do + [ -z "$tf" ] && continue + if git cat-file -e $BASE:"$tf" 2>/dev/null; then + git checkout $BASE -- "$tf" 2>/dev/null || true + else + git rm -f --cached "$tf" >/dev/null 2>&1 || true + rm -f "$tf" + fi +done <<'EOF_RESET_TEST_FILES' +test/test_rank.py +mimo_build_env.tar.gz.b64 +mimo_test_command.sh +EOF_RESET_TEST_FILES + +); then echo "could not reset the test files (testbed problem, not scored)" >&2; exit 1; fi +if ! git apply --verbose /tests/test.patch > "$V/apply.log" 2>&1; then + cat "$V/apply.log" >&2 + echo "the hidden tests could not be applied (testbed problem, not scored)" >&2 + exit 1 +fi +timeout 1800 sh -c "$(cat /tests/test_command.sh)" > "$V/test_output.log" 2>&1 +RC=$? +tail -c 12000 "$V/test_output.log" +if [ $RC -eq 0 ]; then echo 1 > "$V/reward.txt"; else echo 0 > "$V/reward.txt"; fi +echo "test command exited $RC" diff --git a/tasks/format-code-task-002003/tests/test_command.sh b/tasks/format-code-task-002003/tests/test_command.sh new file mode 100644 index 0000000000000000000000000000000000000000..7cb23076694ad17d72e8296d62b2b240083e36db --- /dev/null +++ b/tasks/format-code-task-002003/tests/test_command.sh @@ -0,0 +1 @@ +bash /testbed/mimo_test_command.sh \ No newline at end of file diff --git a/tasks/format-code-task-002017/environment/Dockerfile b/tasks/format-code-task-002017/environment/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..3dcb851b74767c29ccbff9c5323399c2dabdac2e --- /dev/null +++ b/tasks/format-code-task-002017/environment/Dockerfile @@ -0,0 +1,3 @@ +# The task's image, pinned by digest (the same as [environment].docker_image). +# Setup runs at start from [environment.healthcheck]; environment/setup/ is its readable copy. +FROM docker.io/xiaomimimo/mimo-v2.6-rl-oss@sha256:55d713853ae6c506e40f46ca982784d6d7e43b69f6f75adaf544275bd3f3670c diff --git a/tasks/format-code-task-002017/environment/setup/files/blocklist b/tasks/format-code-task-002017/environment/setup/files/blocklist new file mode 100644 index 0000000000000000000000000000000000000000..a8e4bdc4c7d9b739c047a3cb58ea72a1bb05bcbc --- /dev/null +++ b/tasks/format-code-task-002017/environment/setup/files/blocklist @@ -0,0 +1,33 @@ +# mimo answer-leak blocklist (mimoagent) +0.0.0.0 github.com +0.0.0.0 www.github.com +0.0.0.0 api.github.com +0.0.0.0 raw.githubusercontent.com +0.0.0.0 codeload.github.com +0.0.0.0 objects.githubusercontent.com +0.0.0.0 gist.github.com +0.0.0.0 gist.githubusercontent.com +0.0.0.0 gitlab.com +0.0.0.0 bitbucket.org +0.0.0.0 sourceforge.net +0.0.0.0 git.kernel.org +0.0.0.0 chromium.googlesource.com +0.0.0.0 android.googlesource.com +0.0.0.0 sourcegraph.com +0.0.0.0 bugs.chromium.org +0.0.0.0 issues.oss-fuzz.com +0.0.0.0 oss-fuzz.com +0.0.0.0 osv.dev +0.0.0.0 api.osv.dev +0.0.0.0 bugzilla.mozilla.org +0.0.0.0 proxy.golang.org +0.0.0.0 sum.golang.org +0.0.0.0 pkg.go.dev +0.0.0.0 google.com +0.0.0.0 www.google.com +0.0.0.0 bing.com +0.0.0.0 www.bing.com +0.0.0.0 duckduckgo.com +0.0.0.0 html.duckduckgo.com +0.0.0.0 search.brave.com +0.0.0.0 stackoverflow.com diff --git a/tasks/format-code-task-002017/environment/setup/setup.sh b/tasks/format-code-task-002017/environment/setup/setup.sh new file mode 100644 index 0000000000000000000000000000000000000000..d883db90cfcfb48f7a139861bbe9f6b5d95cad6f --- /dev/null +++ b/tasks/format-code-task-002017/environment/setup/setup.sh @@ -0,0 +1,34 @@ +#!/bin/bash +# Runs once, as root, before the agent starts: Harbor's [environment.healthcheck] unpacks this folder into +# /var/lib/mimo and runs it. Generated by mimo_harbor; see its README for how each step maps to Xiaomi's harness. +M=/var/lib/mimo +[ -f "$M/ready" ] && exit 0 +chmod 700 "$M" +fail() { echo "setup: $*" >&2; exit 1; } +# the answer-leak blocklist (mimoagent), applied to /etc/hosts by the agent right after it installs +write_blocklist() { cp "$M/files/blocklist" "$M/blocklist"; } + +# Code: mimoagent environments/datasets/opensource_code.py + base.py, as the explorer runs it (app/runner/domains.py Code). +CWD=/testbed +git config --global --add safe.directory "$CWD" +cd "$CWD" || fail "no working directory $CWD" +if ! git rev-parse --git-dir >/dev/null 2>&1; then # a bare source tree: give it a baseline commit + git init -q && git add -A && git -c user.name=mimo -c user.email=mimo@localhost commit -q -m baseline --allow-empty +fi +BASE=$(git rev-parse HEAD 2>/dev/null) +[ ${#BASE} -eq 40 ] || fail "could not resolve the base commit in $CWD" +echo "$BASE" > "$M/base" +# Images are built with history truncated at the base. If one is not, the fix could be read out of git log, +# so .git is hidden while the agent works and put back for grading. +LATER=$(git rev-list --all --not "$BASE" 2>/dev/null | head -n 5 | grep -c . || true) +rm -f /tmp/fail.log /tmp/pass.log /tmp/patch.diff /tmp/test_patch.diff /tmp/*.log 2>/dev/null; rm -rf /tmp/claude-0 /tmp/claude-* /tmp/testem-* /tmp/puppeteer_dev_chrome_profile-* 2>/dev/null; rm -f /tmp/test_files.json 2>/dev/null; rm -rf /tmp/jest_* /tmp/jest-* /tmp/build /tmp/build_env 2>/dev/null; rm -rf /tmp/pytest-of-root /tmp/pytest-* /tmp/.pytest_cache /tmp/__pycache__ 2>/dev/null; rm -rf /tmp/go-build* /tmp/standards /tmp/wordpress /tmp/zig-* /tmp/testbase /tmp/testbed 2>/dev/null; rm -f /tmp/tmp*.tmp /tmp/*.bak /tmp/expect* /tmp/butwas* 2>/dev/null; rm -rf /root/.cache/go-build 2>/dev/null; rm -rf /tests 2>/dev/null; find /logs -mindepth 1 -delete 2>/dev/null; mkdir -p /logs/agent /logs/verifier /logs/artifacts; chmod 777 /logs/agent /logs/verifier /logs/artifacts; find /var/log -type f -delete 2>/dev/null || true; rm -rf /var/lib/postgresql/*/*/log /var/lib/postgresql/*/*/pg_log 2>/dev/null || true; find /var/lib/mysql /var/lib/mongodb -type f -name '*.log' -delete 2>/dev/null || true; rm -rf /root/.npm/_logs /root/.babel.json /root/.pytest_cache 2>/dev/null || true; find / -maxdepth 4 -xdev -name task_description.md -path '*/.build_env/*' -delete 2>/dev/null || true; true +git clean -fdx --exclude=node_modules --exclude=bower_components --exclude=.husky --exclude=vendor --exclude=third_party --exclude=_deps --exclude=vcpkg_installed --exclude=.venv --exclude=venv --exclude=.gradle --exclude=target --exclude=.build --exclude=lib --exclude=.bundle --exclude=Manifest.toml --exclude=_build --exclude=.stack-work --exclude=dist-newstyle >/dev/null 2>&1 +find /root/.m2 -type f \( -name '*-SNAPSHOT.jar' -o -name '*-SNAPSHOT-sources.jar' -o -name '*-SNAPSHOT-tests.jar' -o -name '*-SNAPSHOT-test-sources.jar' \) -delete 2>/dev/null; rm -rf /root/.julia/compiled 2>/dev/null; rm -rf /root/.gradle/caches/build-cache-* /root/.gradle/daemon 2>/dev/null; rm -rf /root/.gradle/caches/*/scripts /root/.gradle/caches/jars-* 2>/dev/null; rm -rf /root/.cache/bazel 2>/dev/null; true +if [ "$LATER" -gt 0 ]; then + mv "$CWD/.git" "$M/git-hidden" + echo "history not truncated at ${BASE:0:12}: .git hidden while the agent works" +fi +write_blocklist + +touch "$M/ready" +echo "setup done" diff --git a/tasks/format-code-task-002017/tests/test.patch b/tasks/format-code-task-002017/tests/test.patch new file mode 100644 index 0000000000000000000000000000000000000000..484d02e187597dc4888eefa61c473e3d1c476a60 --- /dev/null +++ b/tasks/format-code-task-002017/tests/test.patch @@ -0,0 +1,204 @@ +diff --git a/napari/components/_tests/test_active_layer_highlight.py b/napari/components/_tests/test_active_layer_highlight.py +new file mode 100644 +index 00000000..2c3838bd +--- /dev/null ++++ b/napari/components/_tests/test_active_layer_highlight.py +@@ -0,0 +1,176 @@ ++ ++ ++ ++ ++ ++ ++import numpy as np ++ ++from napari.components import ViewerModel ++ ++ ++def _make_viewer_with_points(): ++ viewer = ViewerModel() ++ points = viewer.add_points([[10, 10], [20, 20], [30, 30]]) ++ points.selected_data = {0, 1} ++ return viewer, points ++ ++ ++def _make_viewer_with_shapes(mode='pan_zoom'): ++ viewer = ViewerModel() ++ shapes = viewer.add_shapes( ++ [[[10, 10], [10, 30], [30, 30], [30, 10]]], ++ shape_type='rectangle', ++ ) ++ shapes.mode = mode ++ shapes.selected_data = {0} ++ return viewer, shapes ++ ++ ++ ++ ++ ++def test_points_highlight_visible_when_active(): ++ ++ ++ viewer, points = _make_viewer_with_points() ++ assert viewer.layers.selection.active is points ++ assert list(points._highlight_index) == [0, 1] ++ ++ ++def test_points_highlight_hidden_when_other_layer_active(): ++ ++ ++ viewer, points = _make_viewer_with_points() ++ viewer.add_image(np.zeros((50, 50))) ++ ++ assert viewer.layers.selection.active is not points ++ assert list(points._highlight_index) == [] ++ ++ ++def test_points_highlight_restored_when_reactivated(): ++ ++ viewer, points = _make_viewer_with_points() ++ viewer.add_image(np.zeros((50, 50))) ++ ++ viewer.layers.selection.active = points ++ assert list(points._highlight_index) == [0, 1] ++ ++ ++def test_points_selected_data_preserved_across_layer_switch(): ++ ++ ++ viewer, points = _make_viewer_with_points() ++ viewer.add_image(np.zeros((50, 50))) ++ assert set(points.selected_data) == {0, 1} ++ viewer.layers.selection.active = points ++ assert set(points.selected_data) == {0, 1} ++ ++ ++def test_points_highlight_hidden_when_no_active_layer(): ++ ++ ++ viewer, points = _make_viewer_with_points() ++ viewer.add_image(np.zeros((50, 50))) ++ viewer.layers.selection.clear() ++ assert viewer.layers.selection.active is None ++ assert list(points._highlight_index) == [] ++ ++ ++ ++ ++ ++def test_shapes_outline_present_when_active(): ++ ++ ++ viewer, shapes = _make_viewer_with_shapes() ++ assert viewer.layers.selection.active is shapes ++ vertices, triangles = shapes._outline_shapes() ++ assert vertices is not None ++ assert triangles is not None ++ assert len(vertices) > 0 ++ ++ ++def test_shapes_outline_hidden_when_other_layer_active(): ++ ++ ++ viewer, shapes = _make_viewer_with_shapes() ++ viewer.add_image(np.zeros((50, 50))) ++ assert viewer.layers.selection.active is not shapes ++ vertices, triangles = shapes._outline_shapes() ++ assert vertices is None ++ assert triangles is None ++ ++ ++def test_shapes_outline_restored_when_reactivated(): ++ ++ ++ viewer, shapes = _make_viewer_with_shapes() ++ viewer.add_image(np.zeros((50, 50))) ++ viewer.layers.selection.active = shapes ++ vertices, triangles = shapes._outline_shapes() ++ assert vertices is not None ++ assert triangles is not None ++ assert len(vertices) > 0 ++ ++ ++ ++ ++ ++def test_shapes_box_present_in_select_mode_when_active(): ++ ++ ++ viewer, shapes = _make_viewer_with_shapes(mode='select') ++ vertices, face_color, edge_color, pos, width = ( ++ shapes._compute_vertices_and_box() ++ ) ++ assert pos is not None ++ assert vertices.shape[0] > 0 ++ assert width > 0 ++ ++ ++def test_shapes_box_hidden_when_other_layer_active(): ++ ++ ++ viewer, shapes = _make_viewer_with_shapes(mode='select') ++ viewer.add_image(np.zeros((50, 50))) ++ vertices, face_color, edge_color, pos, width = ( ++ shapes._compute_vertices_and_box() ++ ) ++ assert pos is None ++ assert vertices.shape == (0, 2) ++ assert width == 0 ++ ++ ++def test_shapes_box_restored_when_reactivated(): ++ ++ viewer, shapes = _make_viewer_with_shapes(mode='select') ++ viewer.add_image(np.zeros((50, 50))) ++ viewer.layers.selection.active = shapes ++ vertices, face_color, edge_color, pos, width = ( ++ shapes._compute_vertices_and_box() ++ ) ++ assert pos is not None ++ assert vertices.shape[0] > 0 ++ assert width > 0 ++ ++ ++def test_shapes_selected_data_preserved_across_layer_switch(): ++ ++ ++ viewer, shapes = _make_viewer_with_shapes(mode='select') ++ viewer.add_image(np.zeros((50, 50))) ++ assert set(shapes.selected_data) == {0} ++ viewer.layers.selection.active = shapes ++ assert set(shapes.selected_data) == {0} ++ ++ ++def test_shapes_outline_hidden_when_no_active_layer(): ++ ++ viewer, shapes = _make_viewer_with_shapes() ++ viewer.add_image(np.zeros((50, 50))) ++ viewer.layers.selection.clear() ++ assert viewer.layers.selection.active is None ++ vertices, triangles = shapes._outline_shapes() ++ assert vertices is None ++ assert triangles is None +diff --git a/test_commands.json b/test_commands.json +new file mode 100644 +index 00000000..4da7eee0 +--- /dev/null ++++ b/test_commands.json +@@ -0,0 +1,3 @@ ++{ ++ "test_commands": ["python -m pytest napari/components/_tests/test_active_layer_highlight.py -v"] ++} +diff --git a/mimo_test_command.sh b/mimo_test_command.sh +new file mode 100755 +--- /dev/null ++++ b/mimo_test_command.sh +@@ -0,0 +1,8 @@ ++#!/usr/bin/env bash ++ ++set -uo pipefail ++cd /testbed ++rc=0 ++python -m pytest napari/components/_tests/test_active_layer_highlight.py -v ++rc=$(( rc | $? )) ++exit $rc diff --git a/tasks/format-code-task-002017/tests/test.sh b/tasks/format-code-task-002017/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..cd6a78c2a3835ca7a5cdeb73ef9502bc78922a34 --- /dev/null +++ b/tasks/format-code-task-002017/tests/test.sh @@ -0,0 +1,39 @@ +#!/bin/bash +# Code grading, mimoagent opensource_code.py: reset the files the hidden test patch touches, apply it, run the +# task's test command; reward 1 when it exits 0. A testbed failure (reset or apply) writes no reward: not scored. +M=/var/lib/mimo +CWD=/testbed +V=/logs/verifier +mkdir -p "$V" +BASE=$(cat "$M/base" 2>/dev/null) || { echo "setup never ran (no $M/base)" >&2; exit 1; } +cd "$CWD" || exit 1 +if [ -d "$M/git-hidden" ]; then rm -rf "$CWD/.git"; mv "$M/git-hidden" "$CWD/.git"; fi +# the agent's change against the base, so its own commits count too +git add -A >/dev/null 2>&1 && git -c core.fileMode=false diff --cached "$BASE" > "$V/agent.diff" +git reset -q +if ! ( +while IFS= read -r tf; do + [ -z "$tf" ] && continue + if git cat-file -e $BASE:"$tf" 2>/dev/null; then + git checkout $BASE -- "$tf" 2>/dev/null || true + else + git rm -f --cached "$tf" >/dev/null 2>&1 || true + rm -f "$tf" + fi +done <<'EOF_RESET_TEST_FILES' +napari/components/_tests/test_active_layer_highlight.py +test_commands.json +mimo_test_command.sh +EOF_RESET_TEST_FILES + +); then echo "could not reset the test files (testbed problem, not scored)" >&2; exit 1; fi +if ! git apply --verbose /tests/test.patch > "$V/apply.log" 2>&1; then + cat "$V/apply.log" >&2 + echo "the hidden tests could not be applied (testbed problem, not scored)" >&2 + exit 1 +fi +timeout 1800 sh -c "$(cat /tests/test_command.sh)" > "$V/test_output.log" 2>&1 +RC=$? +tail -c 12000 "$V/test_output.log" +if [ $RC -eq 0 ]; then echo 1 > "$V/reward.txt"; else echo 0 > "$V/reward.txt"; fi +echo "test command exited $RC" diff --git a/tasks/format-code-task-002017/tests/test_command.sh b/tasks/format-code-task-002017/tests/test_command.sh new file mode 100644 index 0000000000000000000000000000000000000000..7cb23076694ad17d72e8296d62b2b240083e36db --- /dev/null +++ b/tasks/format-code-task-002017/tests/test_command.sh @@ -0,0 +1 @@ +bash /testbed/mimo_test_command.sh \ No newline at end of file diff --git a/tasks/format-code-task-002019/environment/Dockerfile b/tasks/format-code-task-002019/environment/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..8f2a5cdaf6592ecdca6a6463fca1ceae04ffff86 --- /dev/null +++ b/tasks/format-code-task-002019/environment/Dockerfile @@ -0,0 +1,3 @@ +# The task's image, pinned by digest (the same as [environment].docker_image). +# Setup runs at start from [environment.healthcheck]; environment/setup/ is its readable copy. +FROM docker.io/xiaomimimo/mimo-v2.6-rl-oss@sha256:bcd311ef018c4e0d5fbe306b841ded0289e84713625e4056397ae16235f0666d diff --git a/tasks/format-code-task-002019/environment/setup/files/blocklist b/tasks/format-code-task-002019/environment/setup/files/blocklist new file mode 100644 index 0000000000000000000000000000000000000000..a8e4bdc4c7d9b739c047a3cb58ea72a1bb05bcbc --- /dev/null +++ b/tasks/format-code-task-002019/environment/setup/files/blocklist @@ -0,0 +1,33 @@ +# mimo answer-leak blocklist (mimoagent) +0.0.0.0 github.com +0.0.0.0 www.github.com +0.0.0.0 api.github.com +0.0.0.0 raw.githubusercontent.com +0.0.0.0 codeload.github.com +0.0.0.0 objects.githubusercontent.com +0.0.0.0 gist.github.com +0.0.0.0 gist.githubusercontent.com +0.0.0.0 gitlab.com +0.0.0.0 bitbucket.org +0.0.0.0 sourceforge.net +0.0.0.0 git.kernel.org +0.0.0.0 chromium.googlesource.com +0.0.0.0 android.googlesource.com +0.0.0.0 sourcegraph.com +0.0.0.0 bugs.chromium.org +0.0.0.0 issues.oss-fuzz.com +0.0.0.0 oss-fuzz.com +0.0.0.0 osv.dev +0.0.0.0 api.osv.dev +0.0.0.0 bugzilla.mozilla.org +0.0.0.0 proxy.golang.org +0.0.0.0 sum.golang.org +0.0.0.0 pkg.go.dev +0.0.0.0 google.com +0.0.0.0 www.google.com +0.0.0.0 bing.com +0.0.0.0 www.bing.com +0.0.0.0 duckduckgo.com +0.0.0.0 html.duckduckgo.com +0.0.0.0 search.brave.com +0.0.0.0 stackoverflow.com diff --git a/tasks/format-code-task-002019/environment/setup/setup.sh b/tasks/format-code-task-002019/environment/setup/setup.sh new file mode 100644 index 0000000000000000000000000000000000000000..d883db90cfcfb48f7a139861bbe9f6b5d95cad6f --- /dev/null +++ b/tasks/format-code-task-002019/environment/setup/setup.sh @@ -0,0 +1,34 @@ +#!/bin/bash +# Runs once, as root, before the agent starts: Harbor's [environment.healthcheck] unpacks this folder into +# /var/lib/mimo and runs it. Generated by mimo_harbor; see its README for how each step maps to Xiaomi's harness. +M=/var/lib/mimo +[ -f "$M/ready" ] && exit 0 +chmod 700 "$M" +fail() { echo "setup: $*" >&2; exit 1; } +# the answer-leak blocklist (mimoagent), applied to /etc/hosts by the agent right after it installs +write_blocklist() { cp "$M/files/blocklist" "$M/blocklist"; } + +# Code: mimoagent environments/datasets/opensource_code.py + base.py, as the explorer runs it (app/runner/domains.py Code). +CWD=/testbed +git config --global --add safe.directory "$CWD" +cd "$CWD" || fail "no working directory $CWD" +if ! git rev-parse --git-dir >/dev/null 2>&1; then # a bare source tree: give it a baseline commit + git init -q && git add -A && git -c user.name=mimo -c user.email=mimo@localhost commit -q -m baseline --allow-empty +fi +BASE=$(git rev-parse HEAD 2>/dev/null) +[ ${#BASE} -eq 40 ] || fail "could not resolve the base commit in $CWD" +echo "$BASE" > "$M/base" +# Images are built with history truncated at the base. If one is not, the fix could be read out of git log, +# so .git is hidden while the agent works and put back for grading. +LATER=$(git rev-list --all --not "$BASE" 2>/dev/null | head -n 5 | grep -c . || true) +rm -f /tmp/fail.log /tmp/pass.log /tmp/patch.diff /tmp/test_patch.diff /tmp/*.log 2>/dev/null; rm -rf /tmp/claude-0 /tmp/claude-* /tmp/testem-* /tmp/puppeteer_dev_chrome_profile-* 2>/dev/null; rm -f /tmp/test_files.json 2>/dev/null; rm -rf /tmp/jest_* /tmp/jest-* /tmp/build /tmp/build_env 2>/dev/null; rm -rf /tmp/pytest-of-root /tmp/pytest-* /tmp/.pytest_cache /tmp/__pycache__ 2>/dev/null; rm -rf /tmp/go-build* /tmp/standards /tmp/wordpress /tmp/zig-* /tmp/testbase /tmp/testbed 2>/dev/null; rm -f /tmp/tmp*.tmp /tmp/*.bak /tmp/expect* /tmp/butwas* 2>/dev/null; rm -rf /root/.cache/go-build 2>/dev/null; rm -rf /tests 2>/dev/null; find /logs -mindepth 1 -delete 2>/dev/null; mkdir -p /logs/agent /logs/verifier /logs/artifacts; chmod 777 /logs/agent /logs/verifier /logs/artifacts; find /var/log -type f -delete 2>/dev/null || true; rm -rf /var/lib/postgresql/*/*/log /var/lib/postgresql/*/*/pg_log 2>/dev/null || true; find /var/lib/mysql /var/lib/mongodb -type f -name '*.log' -delete 2>/dev/null || true; rm -rf /root/.npm/_logs /root/.babel.json /root/.pytest_cache 2>/dev/null || true; find / -maxdepth 4 -xdev -name task_description.md -path '*/.build_env/*' -delete 2>/dev/null || true; true +git clean -fdx --exclude=node_modules --exclude=bower_components --exclude=.husky --exclude=vendor --exclude=third_party --exclude=_deps --exclude=vcpkg_installed --exclude=.venv --exclude=venv --exclude=.gradle --exclude=target --exclude=.build --exclude=lib --exclude=.bundle --exclude=Manifest.toml --exclude=_build --exclude=.stack-work --exclude=dist-newstyle >/dev/null 2>&1 +find /root/.m2 -type f \( -name '*-SNAPSHOT.jar' -o -name '*-SNAPSHOT-sources.jar' -o -name '*-SNAPSHOT-tests.jar' -o -name '*-SNAPSHOT-test-sources.jar' \) -delete 2>/dev/null; rm -rf /root/.julia/compiled 2>/dev/null; rm -rf /root/.gradle/caches/build-cache-* /root/.gradle/daemon 2>/dev/null; rm -rf /root/.gradle/caches/*/scripts /root/.gradle/caches/jars-* 2>/dev/null; rm -rf /root/.cache/bazel 2>/dev/null; true +if [ "$LATER" -gt 0 ]; then + mv "$CWD/.git" "$M/git-hidden" + echo "history not truncated at ${BASE:0:12}: .git hidden while the agent works" +fi +write_blocklist + +touch "$M/ready" +echo "setup done" diff --git a/tasks/format-code-task-002019/tests/test.patch b/tasks/format-code-task-002019/tests/test.patch new file mode 100644 index 0000000000000000000000000000000000000000..53fd50fa55b02d9d0ca3ab7d723f83684420e9e5 --- /dev/null +++ b/tasks/format-code-task-002019/tests/test.patch @@ -0,0 +1,337 @@ +diff --git a/serverless/src/deleteProject/__tests__/handler.test.js b/serverless/src/deleteProject/__tests__/handler.test.js +index 0870e4efa..42710b1f3 100644 +--- a/serverless/src/deleteProject/__tests__/handler.test.js ++++ b/serverless/src/deleteProject/__tests__/handler.test.js +@@ -13,7 +13,10 @@ beforeEach(() => { + jest.clearAllMocks() + + jest.spyOn(getJwtToken, 'getJwtToken').mockImplementation(() => 'mockJwt') +- jest.spyOn(getVerifiedJwtToken, 'getVerifiedJwtToken').mockImplementation(() => ({ id: 1 })) ++ jest.spyOn(getVerifiedJwtToken, 'getVerifiedJwtToken').mockImplementation(() => ({ ++ id: 1, ++ username: 'shared-visible-name' ++ })) + jest.spyOn(getDbConnection, 'getDbConnection').mockImplementationOnce(() => { + dbConnectionToMock = knex({ + client: 'pg', +@@ -100,4 +103,20 @@ describe('deleteProject', () => { + + expect(response.statusCode).toEqual(500) + }) ++ ++ test('deletes_visible_project_for_authenticated_account_with_shared_username', async () => { ++ dbTracker.on('query', (query) => { ++ ++ query.response(query.bindings.includes(1) ? 1 : 0) ++ }) ++ ++ const response = await deleteProject({ ++ pathParameters: { ++ id: '7023641925' ++ } ++ }, {}) ++ ++ expect(response.body).toBeNull() ++ expect(response.statusCode).toEqual(204) ++ }) + }) +diff --git a/serverless/src/getProjects/__tests__/handler.test.js b/serverless/src/getProjects/__tests__/handler.test.js +index 9aae8aff5..e78fe21fb 100644 +--- a/serverless/src/getProjects/__tests__/handler.test.js ++++ b/serverless/src/getProjects/__tests__/handler.test.js +@@ -13,7 +13,10 @@ beforeEach(() => { + jest.clearAllMocks() + + jest.spyOn(getJwtToken, 'getJwtToken').mockImplementation(() => 'mockJwt') +- jest.spyOn(getVerifiedJwtToken, 'getVerifiedJwtToken').mockImplementation(() => ({ username: 'testuser' })) ++ jest.spyOn(getVerifiedJwtToken, 'getVerifiedJwtToken').mockImplementation(() => ({ ++ id: 1, ++ username: 'shared-visible-name' ++ })) + + jest.spyOn(getDbConnection, 'getDbConnection').mockImplementationOnce(() => { + dbConnectionToMock = knex({ +@@ -90,4 +93,51 @@ describe('getProjects', () => { + + expect(response.statusCode).toEqual(500) + }) ++ ++ test('returns_only_projects_for_authenticated_account_when_visible_username_is_shared', async () => { ++ dbTracker.on('query', (query) => { ++ const currentAccountProjects = [ ++ { ++ id: 101, ++ name: 'current account first project', ++ path: '/search?p=current-1', ++ created_at: '2020-01-03T00:00:00.000Z' ++ }, ++ { ++ id: 102, ++ name: 'current account second project', ++ path: '/search?p=current-2', ++ created_at: '2020-01-02T00:00:00.000Z' ++ } ++ ] ++ ++ const sharedVisibleUsernameProjects = [ ++ ...currentAccountProjects, ++ { ++ id: 201, ++ name: 'other account project with same visible username', ++ path: '/search?p=other-account', ++ created_at: '2020-01-04T00:00:00.000Z' ++ } ++ ] ++ ++ ++ query.response( ++ query.bindings.includes(1) ++ ? currentAccountProjects ++ : sharedVisibleUsernameProjects ++ ) ++ }) ++ ++ const response = await getProjects({}, {}) ++ const body = JSON.parse(response.body) ++ const returnedNames = body.map((project) => project.name).sort() ++ ++ expect(response.statusCode).toEqual(200) ++ expect(returnedNames).toEqual([ ++ 'current account first project', ++ 'current account second project' ++ ]) ++ expect(returnedNames).not.toContain('other account project with same visible username') ++ }) + }) +diff --git a/static/src/js/components/ContactInfo/__tests__/ContactInfo.styles.test.js b/static/src/js/components/ContactInfo/__tests__/ContactInfo.styles.test.js +new file mode 100644 +index 000000000..b8a66077f +--- /dev/null ++++ b/static/src/js/components/ContactInfo/__tests__/ContactInfo.styles.test.js +@@ -0,0 +1,21 @@ ++import fs from 'fs' ++import path from 'path' ++ ++describe('ContactInfo styles', () => { ++ test('contact_info_form_does_not_add_inner_padding', () => { ++ const scss = fs.readFileSync( ++ path.join(__dirname, '../ContactInfo.scss'), ++ 'utf8' ++ ) ++ ++ ++ const contactInfoFormRule = scss.match(/\.contact-info-form\s*\{[^}]*\}/s) ++ const paddingDeclarations = Array.from( ++ contactInfoFormRule ? contactInfoFormRule[0].matchAll(/padding\s*:\s*([^;]+);/g) : [] ++ ).map((match) => match[1].trim()) ++ ++ expect(contactInfoFormRule).not.toBeNull() ++ expect(paddingDeclarations).not.toContain('30px') ++ expect(paddingDeclarations.every((value) => /^(0|0px|0rem)$/.test(value))).toEqual(true) ++ }) ++}) +diff --git a/static/src/js/components/ContactInfo/__tests__/ContactInfo.test.js b/static/src/js/components/ContactInfo/__tests__/ContactInfo.test.js +index 05a71e46c..8934a7014 100644 +--- a/static/src/js/components/ContactInfo/__tests__/ContactInfo.test.js ++++ b/static/src/js/components/ContactInfo/__tests__/ContactInfo.test.js +@@ -1,5 +1,5 @@ + import React from 'react' +-import Enzyme, { shallow } from 'enzyme' ++import Enzyme, { mount, shallow } from 'enzyme' + import Adapter from '@wojtekmaj/enzyme-adapter-react-17' + import Spinner from '../../Spinner/Spinner' + +@@ -126,4 +126,48 @@ describe('ContactInfo component', () => { + expect(props.onUpdateNotificationLevel).toBeCalledTimes(1) + expect(props.onUpdateNotificationLevel).toBeCalledWith('VERBOSE') + }) ++ ++ test('renders_contact_information_page_heading', () => { ++ const { enzymeWrapper } = setup() ++ ++ const heading = enzymeWrapper.find('h2').filterWhere( ++ (node) => node.text() === 'Contact Information' ++ ) ++ const oldHeading = enzymeWrapper.find('h3').filterWhere( ++ (node) => node.text() === 'View Contact Information' ++ ) ++ ++ expect(heading.exists()).toEqual(true) ++ expect(heading.hasClass('route-wrapper__page-heading')).toEqual(true) ++ expect(oldHeading.exists()).toEqual(false) ++ }) ++ ++ test('renders_edit_profile_as_external_link_button', () => { ++ const props = { ++ contactInfo: { ++ cmrPreferences: { mock: 'cmr' }, ++ ursProfile: { mock: 'urs' } ++ }, ++ earthdataEnvironment: 'prod', ++ onUpdateNotificationLevel: jest.fn() ++ } ++ const wrapper = mount() ++ ++ const editProfileControl = wrapper.find('a').filterWhere( ++ (node) => node.text().includes('Edit Profile in Earthdata Login') ++ ).first() ++ ++ expect(editProfileControl.exists()).toEqual(true) ++ ++ const controlHtml = editProfileControl.html() ++ const labelIndex = controlHtml.indexOf('Edit Profile in Earthdata Login') ++ const iconIndex = controlHtml.indexOf(' { + expect(props.onDeleteSavedProject).toBeCalledTimes(1) + expect(props.onDeleteSavedProject).toBeCalledWith('8069076') + }) ++ ++ test('closes_share_popover_when_clicking_outside', async () => { ++ const container = document.createElement('div') ++ const outsideButton = document.createElement('button') ++ ++ outsideButton.type = 'button' ++ outsideButton.textContent = 'Outside saved projects' ++ ++ document.body.appendChild(container) ++ document.body.appendChild(outsideButton) ++ ++ const hasAlphaShareInput = () => Array.from(document.body.querySelectorAll('input')) ++ .some((input) => input.value.includes('projectId=project-alpha-id')) ++ ++ const wrapper = mount( ++ ++ ++ ++ ++ , ++ { attachTo: container } ++ ) ++ ++ await act(async () => { ++ wrapper.find('button.saved-projects__button--share').at(0).simulate('click') ++ await new Promise((resolve) => setTimeout(resolve, 0)) ++ }) ++ wrapper.update() ++ ++ expect(hasAlphaShareInput()).toEqual(true) ++ ++ await act(async () => { ++ outsideButton.dispatchEvent(new MouseEvent('click', { bubbles: true })) ++ await new Promise((resolve) => setTimeout(resolve, 350)) ++ }) ++ wrapper.update() ++ ++ expect(hasAlphaShareInput()).toEqual(false) ++ ++ wrapper.unmount() ++ document.body.removeChild(container) ++ document.body.removeChild(outsideButton) ++ }) + }) + }) +diff --git a/mimo_test_command.sh b/mimo_test_command.sh +new file mode 100755 +--- /dev/null ++++ b/mimo_test_command.sh +@@ -0,0 +1,46 @@ ++#!/bin/bash ++set -euo pipefail ++ ++cd /testbed ++ ++setup_env() { ++ ++ set +u ++ dev-switch python3 3.12 ++ dev-switch node 20 ++ set -u ++ ++ cp secret.config.json.example secret.config.json ++ ++ if [ ! -d node_modules ]; then ++ CYPRESS_INSTALL_BINARY=0 npm install --legacy-peer-deps --ignore-scripts ++ fi ++ ++} ++ ++run_jest() { ++ NODE_OPTIONS=--max-old-space-size=6144 npx jest --runInBand --no-coverage "$@" ++} ++ ++NEW_TEST_NAMES="returns_only_projects_for_authenticated_account_when_visible_username_is_shared|deletes_visible_project_for_authenticated_account_with_shared_username|closes_share_popover_when_clicking_outside|renders_contact_information_page_heading|renders_edit_profile_as_external_link_button|contact_info_form_does_not_add_inner_padding" ++ORIGINAL_TEST_PATHS="serverless/src/getProjects/__tests__/handler.test.js|serverless/src/deleteProject/__tests__/handler.test.js|static/src/js/components/SavedProjects/__tests__/SavedProjects.test.js|static/src/js/components/ContactInfo/__tests__/ContactInfo.test.js" ++NEW_TEST_PATHS="${ORIGINAL_TEST_PATHS}|static/src/js/components/ContactInfo/__tests__/ContactInfo.styles.test.js" ++ ++case "${1:-}" in ++ base) ++ setup_env ++ run_jest \ ++ --testPathPattern="${ORIGINAL_TEST_PATHS}" \ ++ --testNamePattern="^(?!.*(${NEW_TEST_NAMES})).*$" ++ ;; ++ new) ++ setup_env ++ run_jest \ ++ --testPathPattern="${NEW_TEST_PATHS}" \ ++ --testNamePattern="(${NEW_TEST_NAMES})" ++ ;; ++ *) ++ echo "usage: $0 base|new" ++ exit 2 ++ ;; ++esac diff --git a/tasks/format-code-task-002019/tests/test.sh b/tasks/format-code-task-002019/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..9258b0e2d858aa95db952fc3225283134a69c053 --- /dev/null +++ b/tasks/format-code-task-002019/tests/test.sh @@ -0,0 +1,42 @@ +#!/bin/bash +# Code grading, mimoagent opensource_code.py: reset the files the hidden test patch touches, apply it, run the +# task's test command; reward 1 when it exits 0. A testbed failure (reset or apply) writes no reward: not scored. +M=/var/lib/mimo +CWD=/testbed +V=/logs/verifier +mkdir -p "$V" +BASE=$(cat "$M/base" 2>/dev/null) || { echo "setup never ran (no $M/base)" >&2; exit 1; } +cd "$CWD" || exit 1 +if [ -d "$M/git-hidden" ]; then rm -rf "$CWD/.git"; mv "$M/git-hidden" "$CWD/.git"; fi +# the agent's change against the base, so its own commits count too +git add -A >/dev/null 2>&1 && git -c core.fileMode=false diff --cached "$BASE" > "$V/agent.diff" +git reset -q +if ! ( +while IFS= read -r tf; do + [ -z "$tf" ] && continue + if git cat-file -e $BASE:"$tf" 2>/dev/null; then + git checkout $BASE -- "$tf" 2>/dev/null || true + else + git rm -f --cached "$tf" >/dev/null 2>&1 || true + rm -f "$tf" + fi +done <<'EOF_RESET_TEST_FILES' +serverless/src/deleteProject/__tests__/handler.test.js +serverless/src/getProjects/__tests__/handler.test.js +static/src/js/components/ContactInfo/__tests__/ContactInfo.styles.test.js +static/src/js/components/ContactInfo/__tests__/ContactInfo.test.js +static/src/js/components/SavedProjects/__tests__/SavedProjects.test.js +mimo_test_command.sh +EOF_RESET_TEST_FILES + +); then echo "could not reset the test files (testbed problem, not scored)" >&2; exit 1; fi +if ! git apply --verbose /tests/test.patch > "$V/apply.log" 2>&1; then + cat "$V/apply.log" >&2 + echo "the hidden tests could not be applied (testbed problem, not scored)" >&2 + exit 1 +fi +timeout 1800 sh -c "$(cat /tests/test_command.sh)" > "$V/test_output.log" 2>&1 +RC=$? +tail -c 12000 "$V/test_output.log" +if [ $RC -eq 0 ]; then echo 1 > "$V/reward.txt"; else echo 0 > "$V/reward.txt"; fi +echo "test command exited $RC" diff --git a/tasks/format-code-task-002019/tests/test_command.sh b/tasks/format-code-task-002019/tests/test_command.sh new file mode 100644 index 0000000000000000000000000000000000000000..e8d2f32b64045b5a5a56e0ad5667da87d8e0bc2a --- /dev/null +++ b/tasks/format-code-task-002019/tests/test_command.sh @@ -0,0 +1 @@ +bash /testbed/mimo_test_command.sh base && bash /testbed/mimo_test_command.sh new \ No newline at end of file diff --git a/tasks/format-code-task-002021/environment/Dockerfile b/tasks/format-code-task-002021/environment/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..d4cf41f050440e04f9f10bf9c5cea2b6bf59588c --- /dev/null +++ b/tasks/format-code-task-002021/environment/Dockerfile @@ -0,0 +1,3 @@ +# The task's image, pinned by digest (the same as [environment].docker_image). +# Setup runs at start from [environment.healthcheck]; environment/setup/ is its readable copy. +FROM docker.io/xiaomimimo/mimo-v2.6-rl-oss@sha256:ece31f45437c9d40bbe4693e97d2d2d6ec4df570f21b23f65275564e8d534659 diff --git a/tasks/format-code-task-002021/environment/setup/files/blocklist b/tasks/format-code-task-002021/environment/setup/files/blocklist new file mode 100644 index 0000000000000000000000000000000000000000..a8e4bdc4c7d9b739c047a3cb58ea72a1bb05bcbc --- /dev/null +++ b/tasks/format-code-task-002021/environment/setup/files/blocklist @@ -0,0 +1,33 @@ +# mimo answer-leak blocklist (mimoagent) +0.0.0.0 github.com +0.0.0.0 www.github.com +0.0.0.0 api.github.com +0.0.0.0 raw.githubusercontent.com +0.0.0.0 codeload.github.com +0.0.0.0 objects.githubusercontent.com +0.0.0.0 gist.github.com +0.0.0.0 gist.githubusercontent.com +0.0.0.0 gitlab.com +0.0.0.0 bitbucket.org +0.0.0.0 sourceforge.net +0.0.0.0 git.kernel.org +0.0.0.0 chromium.googlesource.com +0.0.0.0 android.googlesource.com +0.0.0.0 sourcegraph.com +0.0.0.0 bugs.chromium.org +0.0.0.0 issues.oss-fuzz.com +0.0.0.0 oss-fuzz.com +0.0.0.0 osv.dev +0.0.0.0 api.osv.dev +0.0.0.0 bugzilla.mozilla.org +0.0.0.0 proxy.golang.org +0.0.0.0 sum.golang.org +0.0.0.0 pkg.go.dev +0.0.0.0 google.com +0.0.0.0 www.google.com +0.0.0.0 bing.com +0.0.0.0 www.bing.com +0.0.0.0 duckduckgo.com +0.0.0.0 html.duckduckgo.com +0.0.0.0 search.brave.com +0.0.0.0 stackoverflow.com diff --git a/tasks/format-code-task-002021/environment/setup/setup.sh b/tasks/format-code-task-002021/environment/setup/setup.sh new file mode 100644 index 0000000000000000000000000000000000000000..e9eb7daf39f9542bd095367feee457f3da77e492 --- /dev/null +++ b/tasks/format-code-task-002021/environment/setup/setup.sh @@ -0,0 +1,34 @@ +#!/bin/bash +# Runs once, as root, before the agent starts: Harbor's [environment.healthcheck] unpacks this folder into +# /var/lib/mimo and runs it. Generated by mimo_harbor; see its README for how each step maps to Xiaomi's harness. +M=/var/lib/mimo +[ -f "$M/ready" ] && exit 0 +chmod 700 "$M" +fail() { echo "setup: $*" >&2; exit 1; } +# the answer-leak blocklist (mimoagent), applied to /etc/hosts by the agent right after it installs +write_blocklist() { cp "$M/files/blocklist" "$M/blocklist"; } + +# Code: mimoagent environments/datasets/opensource_code.py + base.py, as the explorer runs it (app/runner/domains.py Code). +CWD=/workspace/repo +git config --global --add safe.directory "$CWD" +cd "$CWD" || fail "no working directory $CWD" +if ! git rev-parse --git-dir >/dev/null 2>&1; then # a bare source tree: give it a baseline commit + git init -q && git add -A && git -c user.name=mimo -c user.email=mimo@localhost commit -q -m baseline --allow-empty +fi +BASE=$(git rev-parse HEAD 2>/dev/null) +[ ${#BASE} -eq 40 ] || fail "could not resolve the base commit in $CWD" +echo "$BASE" > "$M/base" +# Images are built with history truncated at the base. If one is not, the fix could be read out of git log, +# so .git is hidden while the agent works and put back for grading. +LATER=$(git rev-list --all --not "$BASE" 2>/dev/null | head -n 5 | grep -c . || true) +rm -f /tmp/fail.log /tmp/pass.log /tmp/patch.diff /tmp/test_patch.diff /tmp/*.log 2>/dev/null; rm -rf /tmp/claude-0 /tmp/claude-* /tmp/testem-* /tmp/puppeteer_dev_chrome_profile-* 2>/dev/null; rm -f /tmp/test_files.json 2>/dev/null; rm -rf /tmp/jest_* /tmp/jest-* /tmp/build /tmp/build_env 2>/dev/null; rm -rf /tmp/pytest-of-root /tmp/pytest-* /tmp/.pytest_cache /tmp/__pycache__ 2>/dev/null; rm -rf /tmp/go-build* /tmp/standards /tmp/wordpress /tmp/zig-* /tmp/testbase /tmp/testbed 2>/dev/null; rm -f /tmp/tmp*.tmp /tmp/*.bak /tmp/expect* /tmp/butwas* 2>/dev/null; rm -rf /root/.cache/go-build 2>/dev/null; rm -rf /tests 2>/dev/null; find /logs -mindepth 1 -delete 2>/dev/null; mkdir -p /logs/agent /logs/verifier /logs/artifacts; chmod 777 /logs/agent /logs/verifier /logs/artifacts; find /var/log -type f -delete 2>/dev/null || true; rm -rf /var/lib/postgresql/*/*/log /var/lib/postgresql/*/*/pg_log 2>/dev/null || true; find /var/lib/mysql /var/lib/mongodb -type f -name '*.log' -delete 2>/dev/null || true; rm -rf /root/.npm/_logs /root/.babel.json /root/.pytest_cache 2>/dev/null || true; find / -maxdepth 4 -xdev -name task_description.md -path '*/.build_env/*' -delete 2>/dev/null || true; true +git clean -fdx --exclude=node_modules --exclude=bower_components --exclude=.husky --exclude=vendor --exclude=third_party --exclude=_deps --exclude=vcpkg_installed --exclude=.venv --exclude=venv --exclude=.gradle --exclude=target --exclude=.build --exclude=lib --exclude=.bundle --exclude=Manifest.toml --exclude=_build --exclude=.stack-work --exclude=dist-newstyle >/dev/null 2>&1 +find /root/.m2 -type f \( -name '*-SNAPSHOT.jar' -o -name '*-SNAPSHOT-sources.jar' -o -name '*-SNAPSHOT-tests.jar' -o -name '*-SNAPSHOT-test-sources.jar' \) -delete 2>/dev/null; rm -rf /root/.julia/compiled 2>/dev/null; rm -rf /root/.gradle/caches/build-cache-* /root/.gradle/daemon 2>/dev/null; rm -rf /root/.gradle/caches/*/scripts /root/.gradle/caches/jars-* 2>/dev/null; rm -rf /root/.cache/bazel 2>/dev/null; true +if [ "$LATER" -gt 0 ]; then + mv "$CWD/.git" "$M/git-hidden" + echo "history not truncated at ${BASE:0:12}: .git hidden while the agent works" +fi +write_blocklist + +touch "$M/ready" +echo "setup done" diff --git a/tasks/format-code-task-002021/tests/test.patch b/tasks/format-code-task-002021/tests/test.patch new file mode 100644 index 0000000000000000000000000000000000000000..2f53d3e52de62bb35ddb43442a1efcd4cdba7253 --- /dev/null +++ b/tasks/format-code-task-002021/tests/test.patch @@ -0,0 +1,372 @@ +diff --git a/usercase-test-coderl/test_split_cell.py b/usercase-test-coderl/test_split_cell.py +new file mode 100644 +--- /dev/null ++++ b/usercase-test-coderl/test_split_cell.py +@@ -0,0 +1,342 @@ ++ ++ ++import asyncio ++ ++from textual.app import App ++ ++from src.cell import SplitTextArea ++from src.notebook import CodeCell, MarkdownCell, Notebook ++ ++ ++class _TermApp: ++ def change_tab_name(self, *args): ++ pass ++ ++ def remove_tab(self, *args): ++ pass ++ ++ ++class _NotebookHarness(App): ++ CSS = "" ++ ++ def __init__(self, notebook_count: int = 1): ++ super().__init__() ++ self.notebooks = [ ++ Notebook(f"erys_notebook{index + 1}", id=f"nb{index + 1}", term_app=_TermApp()) ++ for index in range(notebook_count) ++ ] ++ ++ def compose(self): ++ yield from self.notebooks ++ ++ ++def _cell_summary(notebook): ++ return [ ++ (type(cell).__name__, cell.input_text.text) ++ for cell in notebook.cell_container.children ++ ] ++ ++ ++def _binding_parts(binding): ++ if isinstance(binding, tuple): ++ return binding[:3] ++ return ( ++ getattr(binding, "key", None), ++ getattr(binding, "action", None), ++ getattr(binding, "description", None), ++ ) ++ ++ ++def test_split_text_area_exposes_action_and_binding(): ++ ++ ++ ++ ++ ++ assert ("ctrl+backslash", "split_cell", "Split Cell") in [ ++ _binding_parts(binding) for binding in SplitTextArea.BINDINGS ++ ] ++ assert callable(getattr(SplitTextArea, "action_split_cell", None)) ++ ++ ++def test_code_cell_split_before_middle_line_mounts_and_links_inserted_cell(): ++ ++ ++ ++ ++ ++ async def run(): ++ app = _NotebookHarness() ++ async with app.run_test() as pilot: ++ notebook = app.notebooks[0] ++ await pilot.pause() ++ first = await notebook.add_cell( ++ CodeCell, None, "after", source="alpha\nbeta\ngamma" ++ ) ++ following = await notebook.add_cell( ++ CodeCell, first, "after", source="omega" ++ ) ++ notebook.last_focused = first ++ await pilot.pause() ++ ++ assert _cell_summary(notebook) == [ ++ ("CodeCell", "alpha\nbeta\ngamma"), ++ ("CodeCell", "omega"), ++ ] ++ assert ( ++ first.prev is None, ++ first.next is following, ++ following.prev is first, ++ following.next is None, ++ ) == (True, True, True, True) ++ ++ first.input_text.cursor_location = (1, 0) ++ assert first.input_text.action_split_cell() is None ++ await pilot.pause() ++ ++ cells = list(notebook.cell_container.children) ++ inserted = cells[1] ++ assert _cell_summary(notebook) == [ ++ ("CodeCell", "alpha\n"), ++ ("CodeCell", "beta\ngamma"), ++ ("CodeCell", "omega"), ++ ] ++ assert [cell.notebook is notebook for cell in cells] == [True, True, True] ++ assert ( ++ first.prev is None, ++ first.next is inserted, ++ inserted.prev is first, ++ inserted.next is following, ++ following.prev is inserted, ++ following.next is None, ++ ) == (True, True, True, True, True, True) ++ ++ asyncio.run(run()) ++ ++ ++def test_code_cell_split_at_start_moves_all_text_to_new_code_cell(): ++ ++ ++ ++ ++ ++ async def run(): ++ app = _NotebookHarness() ++ async with app.run_test() as pilot: ++ notebook = app.notebooks[0] ++ await pilot.pause() ++ cell = await notebook.add_cell(CodeCell, None, "after", source="print(1)") ++ notebook.last_focused = cell ++ await pilot.pause() ++ ++ assert _cell_summary(notebook) == [("CodeCell", "print(1)")] ++ cell.input_text.cursor_location = (0, 0) ++ assert cell.input_text.action_split_cell() is None ++ await pilot.pause() ++ ++ assert _cell_summary(notebook) == [ ++ ("CodeCell", ""), ++ ("CodeCell", "print(1)"), ++ ] ++ assert [new_cell.notebook is notebook for new_cell in notebook.cell_container.children] == [ ++ True, ++ True, ++ ] ++ ++ asyncio.run(run()) ++ ++ ++def test_markdown_cell_split_at_end_keeps_text_and_inserts_empty_markdown_cell(): ++ ++ ++ ++ ++ ++ async def run(): ++ app = _NotebookHarness() ++ async with app.run_test() as pilot: ++ notebook = app.notebooks[0] ++ await pilot.pause() ++ cell = await notebook.add_cell(MarkdownCell, None, "after", source="# title") ++ notebook.last_focused = cell ++ await pilot.pause() ++ ++ assert _cell_summary(notebook) == [("MarkdownCell", "# title")] ++ cell.input_text.cursor_location = (0, 7) ++ assert cell.input_text.action_split_cell() is None ++ await pilot.pause() ++ ++ assert _cell_summary(notebook) == [ ++ ("MarkdownCell", "# title"), ++ ("MarkdownCell", ""), ++ ] ++ assert [new_cell.notebook is notebook for new_cell in notebook.cell_container.children] == [ ++ True, ++ True, ++ ] ++ ++ asyncio.run(run()) ++ ++ ++def test_ctrl_backslash_invokes_split_cell_in_live_notebook_session(): ++ ++ ++ ++ ++ ++ async def run(): ++ app = _NotebookHarness() ++ async with app.run_test() as pilot: ++ notebook = app.notebooks[0] ++ await pilot.pause() ++ cell = await notebook.add_cell(CodeCell, None, "after", source="alpha\nbeta") ++ notebook.last_focused = cell ++ cell.input_text.focus() ++ cell.input_text.cursor_location = (1, 0) ++ await pilot.pause() ++ ++ ++ await pilot.press("ctrl+backslash") ++ await pilot.pause() ++ ++ assert _cell_summary(notebook) == [ ++ ("CodeCell", "alpha\n"), ++ ("CodeCell", "beta"), ++ ] ++ ++ asyncio.run(run()) ++ ++ ++def test_deleting_inserted_cell_relinks_original_to_following_cell(): ++ ++ ++ ++ ++ ++ async def run(): ++ app = _NotebookHarness() ++ async with app.run_test() as pilot: ++ notebook = app.notebooks[0] ++ await pilot.pause() ++ first = await notebook.add_cell(CodeCell, None, "after", source="alpha\nbeta") ++ following = await notebook.add_cell(CodeCell, first, "after", source="omega") ++ notebook.last_focused = first ++ first.input_text.cursor_location = (1, 0) ++ assert first.input_text.action_split_cell() is None ++ await pilot.pause() ++ ++ inserted = list(notebook.cell_container.children)[1] ++ assert inserted.prev is first ++ assert inserted.next is following ++ ++ notebook.last_focused = inserted ++ notebook.delete_cell() ++ await pilot.pause() ++ ++ assert _cell_summary(notebook) == [ ++ ("CodeCell", "alpha\n"), ++ ("CodeCell", "omega"), ++ ] ++ assert first.next is following ++ assert following.prev is first ++ asyncio.run(run()) ++ ++ ++def test_splitting_one_notebook_does_not_mutate_another_notebook(): ++ ++ ++ ++ ++ ++ async def run(): ++ app = _NotebookHarness(notebook_count=2) ++ async with app.run_test() as pilot: ++ notebook_a, notebook_b = app.notebooks ++ await pilot.pause() ++ cell_a = await notebook_a.add_cell(CodeCell, None, "after", source="left\nright") ++ await notebook_b.add_cell(MarkdownCell, None, "after", source="solo") ++ notebook_a.last_focused = cell_a ++ await pilot.pause() ++ ++ assert _cell_summary(notebook_a) == [("CodeCell", "left\nright")] ++ assert _cell_summary(notebook_b) == [("MarkdownCell", "solo")] ++ cell_a.input_text.cursor_location = (1, 0) ++ assert cell_a.input_text.action_split_cell() is None ++ await pilot.pause() ++ ++ assert _cell_summary(notebook_a) == [ ++ ("CodeCell", "left\n"), ++ ("CodeCell", "right"), ++ ] ++ assert _cell_summary(notebook_b) == [("MarkdownCell", "solo")] ++ assert [cell.notebook is notebook_a for cell in notebook_a.cell_container.children] == [ ++ True, ++ True, ++ ] ++ assert [cell.notebook is notebook_b for cell in notebook_b.cell_container.children] == [ ++ True, ++ ] ++ ++ asyncio.run(run()) ++ ++ ++def test_repeated_splits_insert_each_new_cell_directly_after_source_cell(): ++ ++ ++ ++ ++ ++ async def run(): ++ app = _NotebookHarness(notebook_count=3) ++ async with app.run_test() as pilot: ++ await pilot.pause() ++ ++ for index, (cell_type, source, cursor, expected_original, expected_inserted) in enumerate([ ++ ++ (CodeCell, "one\ntwo\nthree", (1, 0), "one\n", "two\nthree"), ++ (MarkdownCell, "# heading\nbody", (1, 0), "# heading\n", "body"), ++ (CodeCell, "tail", (0, 0), "", "tail"), ++ ]): ++ notebook = app.notebooks[index] ++ cell = await notebook.add_cell(cell_type, None, "after", source=source) ++ following = await notebook.add_cell( ++ cell_type, cell, "after", source=f"after {index}" ++ ) ++ notebook.last_focused = cell ++ cell.input_text.cursor_location = cursor ++ await pilot.pause() ++ ++ assert _cell_summary(notebook)[-2:] == [ ++ (cell_type.__name__, source), ++ (cell_type.__name__, f"after {index}"), ++ ] ++ assert ( ++ cell.next is following, ++ following.prev is cell, ++ ) == (True, True) ++ ++ assert cell.input_text.action_split_cell() is None ++ await pilot.pause() ++ ++ cells = list(notebook.cell_container.children) ++ position = cells.index(cell) ++ inserted = cells[position + 1] ++ assert _cell_summary(notebook)[position : position + 3] == [ ++ (cell_type.__name__, expected_original), ++ (cell_type.__name__, expected_inserted), ++ (cell_type.__name__, f"after {index}"), ++ ] ++ assert inserted.notebook is notebook ++ assert ( ++ cell.next is inserted, ++ inserted.prev is cell, ++ inserted.next is following, ++ following.prev is inserted, ++ ) == ( ++ True, ++ True, ++ True, ++ True, ++ ) ++ ++ asyncio.run(run()) +diff --git a/mimo_test_command.sh b/mimo_test_command.sh +new file mode 100755 +--- /dev/null ++++ b/mimo_test_command.sh +@@ -0,0 +1,20 @@ ++#!/usr/bin/env bash ++ ++ ++ ++ ++export NODE_OPTIONS="${NODE_OPTIONS:-} --max-old-space-size=4096" ++export MAVEN_OPTS="${MAVEN_OPTS:-} -Xmx3g -XX:+UseG1GC" ++export GRADLE_OPTS="${GRADLE_OPTS:-} -Xmx3g -XX:+UseG1GC" ++export TEST_JVM_OPTS="${TEST_JVM_OPTS:-} -Xmx3g" ++set -e ++cd /workspace/repo ++set -euo pipefail ++ ++cd /workspace/repo ++ ++export PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 ++unset VIRTUAL_ENV ++unset CONDA_PREFIX ++ ++exec /usr/local/bin/python -m pytest /workspace/repo/usercase-test-coderl/test_split_cell.py -v diff --git a/tasks/format-code-task-002021/tests/test.sh b/tasks/format-code-task-002021/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..6cd337503373d5b22349125333e145bf3d04867a --- /dev/null +++ b/tasks/format-code-task-002021/tests/test.sh @@ -0,0 +1,38 @@ +#!/bin/bash +# Code grading, mimoagent opensource_code.py: reset the files the hidden test patch touches, apply it, run the +# task's test command; reward 1 when it exits 0. A testbed failure (reset or apply) writes no reward: not scored. +M=/var/lib/mimo +CWD=/workspace/repo +V=/logs/verifier +mkdir -p "$V" +BASE=$(cat "$M/base" 2>/dev/null) || { echo "setup never ran (no $M/base)" >&2; exit 1; } +cd "$CWD" || exit 1 +if [ -d "$M/git-hidden" ]; then rm -rf "$CWD/.git"; mv "$M/git-hidden" "$CWD/.git"; fi +# the agent's change against the base, so its own commits count too +git add -A >/dev/null 2>&1 && git -c core.fileMode=false diff --cached "$BASE" > "$V/agent.diff" +git reset -q +if ! ( +while IFS= read -r tf; do + [ -z "$tf" ] && continue + if git cat-file -e $BASE:"$tf" 2>/dev/null; then + git checkout $BASE -- "$tf" 2>/dev/null || true + else + git rm -f --cached "$tf" >/dev/null 2>&1 || true + rm -f "$tf" + fi +done <<'EOF_RESET_TEST_FILES' +usercase-test-coderl/test_split_cell.py +mimo_test_command.sh +EOF_RESET_TEST_FILES + +); then echo "could not reset the test files (testbed problem, not scored)" >&2; exit 1; fi +if ! git apply --verbose /tests/test.patch > "$V/apply.log" 2>&1; then + cat "$V/apply.log" >&2 + echo "the hidden tests could not be applied (testbed problem, not scored)" >&2 + exit 1 +fi +timeout 1800 sh -c "$(cat /tests/test_command.sh)" > "$V/test_output.log" 2>&1 +RC=$? +tail -c 12000 "$V/test_output.log" +if [ $RC -eq 0 ]; then echo 1 > "$V/reward.txt"; else echo 0 > "$V/reward.txt"; fi +echo "test command exited $RC" diff --git a/tasks/format-code-task-002021/tests/test_command.sh b/tasks/format-code-task-002021/tests/test_command.sh new file mode 100644 index 0000000000000000000000000000000000000000..88cb7810b836396c4869db31aeac7d4d4b189685 --- /dev/null +++ b/tasks/format-code-task-002021/tests/test_command.sh @@ -0,0 +1 @@ +bash /workspace/repo/mimo_test_command.sh \ No newline at end of file diff --git a/tasks/format-code-task-002026/environment/Dockerfile b/tasks/format-code-task-002026/environment/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..2b4e64cf170ee18c165a5912dd39d31311c5e00f --- /dev/null +++ b/tasks/format-code-task-002026/environment/Dockerfile @@ -0,0 +1,3 @@ +# The task's image, pinned by digest (the same as [environment].docker_image). +# Setup runs at start from [environment.healthcheck]; environment/setup/ is its readable copy. +FROM docker.io/xiaomimimo/mimo-v2.6-rl-oss@sha256:2e627f2395246598001352958d24720ec3147716b18c8e7c8a8845373f6e0e77 diff --git a/tasks/format-code-task-002026/environment/setup/files/blocklist b/tasks/format-code-task-002026/environment/setup/files/blocklist new file mode 100644 index 0000000000000000000000000000000000000000..a8e4bdc4c7d9b739c047a3cb58ea72a1bb05bcbc --- /dev/null +++ b/tasks/format-code-task-002026/environment/setup/files/blocklist @@ -0,0 +1,33 @@ +# mimo answer-leak blocklist (mimoagent) +0.0.0.0 github.com +0.0.0.0 www.github.com +0.0.0.0 api.github.com +0.0.0.0 raw.githubusercontent.com +0.0.0.0 codeload.github.com +0.0.0.0 objects.githubusercontent.com +0.0.0.0 gist.github.com +0.0.0.0 gist.githubusercontent.com +0.0.0.0 gitlab.com +0.0.0.0 bitbucket.org +0.0.0.0 sourceforge.net +0.0.0.0 git.kernel.org +0.0.0.0 chromium.googlesource.com +0.0.0.0 android.googlesource.com +0.0.0.0 sourcegraph.com +0.0.0.0 bugs.chromium.org +0.0.0.0 issues.oss-fuzz.com +0.0.0.0 oss-fuzz.com +0.0.0.0 osv.dev +0.0.0.0 api.osv.dev +0.0.0.0 bugzilla.mozilla.org +0.0.0.0 proxy.golang.org +0.0.0.0 sum.golang.org +0.0.0.0 pkg.go.dev +0.0.0.0 google.com +0.0.0.0 www.google.com +0.0.0.0 bing.com +0.0.0.0 www.bing.com +0.0.0.0 duckduckgo.com +0.0.0.0 html.duckduckgo.com +0.0.0.0 search.brave.com +0.0.0.0 stackoverflow.com diff --git a/tasks/format-code-task-002026/environment/setup/setup.sh b/tasks/format-code-task-002026/environment/setup/setup.sh new file mode 100644 index 0000000000000000000000000000000000000000..e9eb7daf39f9542bd095367feee457f3da77e492 --- /dev/null +++ b/tasks/format-code-task-002026/environment/setup/setup.sh @@ -0,0 +1,34 @@ +#!/bin/bash +# Runs once, as root, before the agent starts: Harbor's [environment.healthcheck] unpacks this folder into +# /var/lib/mimo and runs it. Generated by mimo_harbor; see its README for how each step maps to Xiaomi's harness. +M=/var/lib/mimo +[ -f "$M/ready" ] && exit 0 +chmod 700 "$M" +fail() { echo "setup: $*" >&2; exit 1; } +# the answer-leak blocklist (mimoagent), applied to /etc/hosts by the agent right after it installs +write_blocklist() { cp "$M/files/blocklist" "$M/blocklist"; } + +# Code: mimoagent environments/datasets/opensource_code.py + base.py, as the explorer runs it (app/runner/domains.py Code). +CWD=/workspace/repo +git config --global --add safe.directory "$CWD" +cd "$CWD" || fail "no working directory $CWD" +if ! git rev-parse --git-dir >/dev/null 2>&1; then # a bare source tree: give it a baseline commit + git init -q && git add -A && git -c user.name=mimo -c user.email=mimo@localhost commit -q -m baseline --allow-empty +fi +BASE=$(git rev-parse HEAD 2>/dev/null) +[ ${#BASE} -eq 40 ] || fail "could not resolve the base commit in $CWD" +echo "$BASE" > "$M/base" +# Images are built with history truncated at the base. If one is not, the fix could be read out of git log, +# so .git is hidden while the agent works and put back for grading. +LATER=$(git rev-list --all --not "$BASE" 2>/dev/null | head -n 5 | grep -c . || true) +rm -f /tmp/fail.log /tmp/pass.log /tmp/patch.diff /tmp/test_patch.diff /tmp/*.log 2>/dev/null; rm -rf /tmp/claude-0 /tmp/claude-* /tmp/testem-* /tmp/puppeteer_dev_chrome_profile-* 2>/dev/null; rm -f /tmp/test_files.json 2>/dev/null; rm -rf /tmp/jest_* /tmp/jest-* /tmp/build /tmp/build_env 2>/dev/null; rm -rf /tmp/pytest-of-root /tmp/pytest-* /tmp/.pytest_cache /tmp/__pycache__ 2>/dev/null; rm -rf /tmp/go-build* /tmp/standards /tmp/wordpress /tmp/zig-* /tmp/testbase /tmp/testbed 2>/dev/null; rm -f /tmp/tmp*.tmp /tmp/*.bak /tmp/expect* /tmp/butwas* 2>/dev/null; rm -rf /root/.cache/go-build 2>/dev/null; rm -rf /tests 2>/dev/null; find /logs -mindepth 1 -delete 2>/dev/null; mkdir -p /logs/agent /logs/verifier /logs/artifacts; chmod 777 /logs/agent /logs/verifier /logs/artifacts; find /var/log -type f -delete 2>/dev/null || true; rm -rf /var/lib/postgresql/*/*/log /var/lib/postgresql/*/*/pg_log 2>/dev/null || true; find /var/lib/mysql /var/lib/mongodb -type f -name '*.log' -delete 2>/dev/null || true; rm -rf /root/.npm/_logs /root/.babel.json /root/.pytest_cache 2>/dev/null || true; find / -maxdepth 4 -xdev -name task_description.md -path '*/.build_env/*' -delete 2>/dev/null || true; true +git clean -fdx --exclude=node_modules --exclude=bower_components --exclude=.husky --exclude=vendor --exclude=third_party --exclude=_deps --exclude=vcpkg_installed --exclude=.venv --exclude=venv --exclude=.gradle --exclude=target --exclude=.build --exclude=lib --exclude=.bundle --exclude=Manifest.toml --exclude=_build --exclude=.stack-work --exclude=dist-newstyle >/dev/null 2>&1 +find /root/.m2 -type f \( -name '*-SNAPSHOT.jar' -o -name '*-SNAPSHOT-sources.jar' -o -name '*-SNAPSHOT-tests.jar' -o -name '*-SNAPSHOT-test-sources.jar' \) -delete 2>/dev/null; rm -rf /root/.julia/compiled 2>/dev/null; rm -rf /root/.gradle/caches/build-cache-* /root/.gradle/daemon 2>/dev/null; rm -rf /root/.gradle/caches/*/scripts /root/.gradle/caches/jars-* 2>/dev/null; rm -rf /root/.cache/bazel 2>/dev/null; true +if [ "$LATER" -gt 0 ]; then + mv "$CWD/.git" "$M/git-hidden" + echo "history not truncated at ${BASE:0:12}: .git hidden while the agent works" +fi +write_blocklist + +touch "$M/ready" +echo "setup done" diff --git a/tasks/format-code-task-002026/tests/test.patch b/tasks/format-code-task-002026/tests/test.patch new file mode 100644 index 0000000000000000000000000000000000000000..b7bdffd31735e9bb4ecaf6584560bce30d66b0b9 --- /dev/null +++ b/tasks/format-code-task-002026/tests/test.patch @@ -0,0 +1,11188 @@ +diff --git a/usercase-test-coderl/fixtures/6jxr.pdb b/usercase-test-coderl/fixtures/6jxr.pdb +new file mode 100644 +--- /dev/null ++++ b/usercase-test-coderl/fixtures/6jxr.pdb +@@ -0,0 +1,10722 @@ ++REMARK 1/2 of bilayer thickness: 15.9 ++HEADER IMMUNE SYSTEM 24-APR-19 6JXR ++TITLE STRUCTURE OF A PROTEIN ++COMPND MOL_ID: 1; ++COMPND 2 MOLECULE: T-CELL SURFACE GLYCOPROTEIN CD3 ZETA CHAIN; ++COMPND 4 SYNONYM: T-CELL RECEPTOR T3 ZETA CHAIN; ++COMPND 5 ENGINEERED: YES; ++COMPND 6 MOL_ID: 2; ++COMPND 7 MOLECULE: T-CELL SURFACE GLYCOPROTEIN CD3 DELTA CHAIN; ++COMPND 9 SYNONYM: T-CELL RECEPTOR T3 DELTA CHAIN; ++COMPND 10 ENGINEERED: YES; ++COMPND 11 MOL_ID: 3; ++COMPND 12 MOLECULE: T-CELL SURFACE GLYCOPROTEIN CD3 EPSILON CHAIN; ++COMPND 14 SYNONYM: T-CELL SURFACE ANTIGEN T3/LEU-4 EPSILON CHAIN; ++COMPND 15 ENGINEERED: YES; ++COMPND 16 MOL_ID: 4; ++COMPND 17 MOLECULE: T-CELL SURFACE GLYCOPROTEIN CD3 GAMMA CHAIN; ++COMPND 19 SYNONYM: T-CELL RECEPTOR T3 GAMMA CHAIN; ++COMPND 20 ENGINEERED: YES; ++COMPND 21 MOL_ID: 5; ++COMPND 22 MOLECULE: T CELL RECEPTOR ALPHA VARIABLE 12-3,POSSIBLE J 11 GENE ++COMPND 23 SEGMENT,T CELL RECEPTOR ALPHA CONSTANT; ++COMPND 25 ENGINEERED: YES; ++COMPND 27 RESIDUES 116-132 FROM A0N4Z6 AND RESIDUES 134-273 FROM P01848.; ++COMPND 28 MOL_ID: 6; ++COMPND 29 MOLECULE: T CELL RECEPTOR BETA VARIABLE 6-5,M1-SPECIFIC T CELL ++COMPND 30 RECEPTOR BETA CHAIN,T CELL RECEPTOR BETA CONSTANT 2; ++COMPND 32 SYNONYM: TR BETA CHAIN TRBV19*01J2S7*01C*02; ++COMPND 33 ENGINEERED: YES; ++COMPND 35 RESIDUES 121-134 FROM P0DSE2 AND RESIDUES 135-312 FROM A0A0G2JMB4. ++SOURCE MOL_ID: 1; ++SOURCE 2 ORGANISM_SCIENTIFIC: HOMO SAPIENS; ++SOURCE 3 ORGANISM_COMMON: HUMAN; ++SOURCE 4 ORGANISM_TAXID: 9606; ++SOURCE 5 GENE: CD247, CD3Z, T3Z, TCRZ; ++SOURCE 6 EXPRESSION_SYSTEM: HOMO SAPIENS; ++SOURCE 7 EXPRESSION_SYSTEM_TAXID: 9606; ++SOURCE 8 MOL_ID: 2; ++SOURCE 9 ORGANISM_SCIENTIFIC: HOMO SAPIENS; ++SOURCE 10 ORGANISM_COMMON: HUMAN; ++SOURCE 11 ORGANISM_TAXID: 9606; ++SOURCE 12 GENE: CD3D, T3D; ++SOURCE 13 EXPRESSION_SYSTEM: HOMO SAPIENS; ++SOURCE 14 EXPRESSION_SYSTEM_TAXID: 9606; ++SOURCE 15 MOL_ID: 3; ++SOURCE 16 ORGANISM_SCIENTIFIC: HOMO SAPIENS; ++SOURCE 17 ORGANISM_COMMON: HUMAN; ++SOURCE 18 ORGANISM_TAXID: 9606; ++SOURCE 19 GENE: CD3E, T3E; ++SOURCE 20 EXPRESSION_SYSTEM: HOMO SAPIENS; ++SOURCE 21 EXPRESSION_SYSTEM_TAXID: 9606; ++SOURCE 22 MOL_ID: 4; ++SOURCE 23 ORGANISM_SCIENTIFIC: HOMO SAPIENS; ++SOURCE 24 ORGANISM_COMMON: HUMAN; ++SOURCE 25 ORGANISM_TAXID: 9606; ++SOURCE 26 GENE: CD3G, T3G; ++SOURCE 27 EXPRESSION_SYSTEM: HOMO SAPIENS; ++SOURCE 28 EXPRESSION_SYSTEM_TAXID: 9606; ++SOURCE 29 MOL_ID: 5; ++SOURCE 30 ORGANISM_SCIENTIFIC: HOMO SAPIENS; ++SOURCE 31 ORGANISM_COMMON: HUMAN; ++SOURCE 32 ORGANISM_TAXID: 9606; ++SOURCE 33 GENE: TRAV12-3, TCR-ALPHA, TRAC, TCRA; ++SOURCE 34 EXPRESSION_SYSTEM: HOMO SAPIENS; ++SOURCE 35 EXPRESSION_SYSTEM_TAXID: 9606; ++SOURCE 36 MOL_ID: 6; ++SOURCE 37 ORGANISM_SCIENTIFIC: HOMO SAPIENS; ++SOURCE 38 ORGANISM_COMMON: HUMAN; ++SOURCE 39 ORGANISM_TAXID: 9606; ++SOURCE 40 GENE: TRBV6-5, TRB, TRBC2; ++SOURCE 41 EXPRESSION_SYSTEM: HOMO SAPIENS; ++SOURCE 42 EXPRESSION_SYSTEM_TAXID: 9606 ++KEYWDS IMMUNE SYSTEM ++EXPDTA ELECTRON MICROSCOPY ++AUTHOR D.DONG,L.ZHENG,J.LIN,Y.ZHU,N.LI,B.ZHANG,S.XIE,J.ZHENG,Y.WANG,N.GAO, ++REVDAT 1 11-SEP-19 6JXR 0 ++JRNL AUTH D.DONG,L.ZHENG,J.LIN,B.ZHANG,Y.ZHU,N.LI,S.XIE,Y.WANG,N.GAO, ++JRNL AUTH 2 Z.HUANG ++JRNL TITL STRUCTURAL BASIS OF ASSEMBLY OF THE HUMAN TCR–CD3 ++JRNL TITL 2 COMPLEX ++JRNL REF NATURE 2019 ++JRNL REFN ESSN 1476-4687 ++JRNL DOI 10.1038/S41586-019-1537-0 ++REMARK 2 ++REMARK 2 RESOLUTION. 3.70 ANGSTROMS. ++REMARK 3 ++REMARK 3 REFINEMENT. ++REMARK 3 SOFTWARE PACKAGES : NULL ++REMARK 3 RECONSTRUCTION SCHEMA : NULL ++REMARK 3 ++REMARK 3 EM MAP-MODEL FITTING AND REFINEMENT ++REMARK 3 PDB ENTRY : NULL ++REMARK 3 REFINEMENT SPACE : NULL ++REMARK 3 REFINEMENT PROTOCOL : NULL ++REMARK 3 REFINEMENT TARGET : NULL ++REMARK 3 OVERALL ANISOTROPIC B VALUE : NULL ++REMARK 3 ++REMARK 3 FITTING PROCEDURE : NULL ++REMARK 3 ++REMARK 3 EM IMAGE RECONSTRUCTION STATISTICS ++REMARK 3 NOMINAL PIXEL SIZE (ANGSTROMS) : NULL ++REMARK 3 ACTUAL PIXEL SIZE (ANGSTROMS) : NULL ++REMARK 3 EFFECTIVE RESOLUTION (ANGSTROMS) : 3.700 ++REMARK 3 NUMBER OF PARTICLES : 197487 ++REMARK 3 CTF CORRECTION METHOD : PHASE FLIPPING AND AMPLITUDE ++REMARK 3 CORRECTION ++REMARK 3 ++REMARK 3 EM RECONSTRUCTION MAGNIFICATION CALIBRATION: NULL ++REMARK 3 ++REMARK 4 ++REMARK 4 6JXR COMPLIES WITH FORMAT V. 3.30, 13-JUL-11 ++REMARK 100 ++REMARK 245 ++REMARK 245 EXPERIMENTAL DETAILS ++REMARK 245 RECONSTRUCTION METHOD : SINGLE PARTICLE ++REMARK 245 SPECIMEN TYPE : NULL ++REMARK 245 ++REMARK 245 ELECTRON MICROSCOPE SAMPLE ++REMARK 245 SAMPLE TYPE : CELL ++REMARK 245 PARTICLE TYPE : POINT ++REMARK 245 NAME OF SAMPLE : COMPLEX ++REMARK 245 SAMPLE CONCENTRATION (MG ML-1) : NULL ++REMARK 245 SAMPLE SUPPORT DETAILS : NULL ++REMARK 245 SAMPLE VITRIFICATION DETAILS : NULL ++REMARK 245 SAMPLE BUFFER : NULL ++REMARK 245 PH : 7.50 ++REMARK 245 SAMPLE DETAILS : NULL ++REMARK 245 ++REMARK 245 DATA ACQUISITION ++REMARK 245 NUMBER OF MICROGRAPHS-IMAGES : NULL ++REMARK 245 TEMPERATURE (KELVIN) : NULL ++REMARK 245 MICROSCOPE MODEL : FEI TITAN KRIOS ++REMARK 245 MINIMUM DEFOCUS (NM) : NULL ++REMARK 245 MAXIMUM DEFOCUS (NM) : NULL ++REMARK 245 MINIMUM TILT ANGLE (DEGREES) : NULL ++REMARK 245 MAXIMUM TILT ANGLE (DEGREES) : NULL ++REMARK 245 NOMINAL CS : NULL ++REMARK 245 IMAGING MODE : DARK FIELD ++REMARK 245 ELECTRON DOSE (ELECTRONS NM**-2) : 64.40 ++REMARK 245 ILLUMINATION MODE : SPOT SCAN ++REMARK 245 NOMINAL MAGNIFICATION : NULL ++REMARK 245 CALIBRATED MAGNIFICATION : NULL ++REMARK 245 SOURCE : FIELD EMISSION GUN ++REMARK 245 ACCELERATION VOLTAGE (KV) : 300 ++REMARK 245 IMAGING DETAILS : NULL ++REMARK 247 ++REMARK 247 ELECTRON MICROSCOPY ++REMARK 247 MICROSCOPY DATA. PROTEIN DATA BANK CONVENTIONS REQUIRE ++REMARK 247 ON THESE RECORDS ARE MEANINGLESS EXCEPT FOR THE CALCULATION ++REMARK 247 OF THE STRUCTURE FACTORS. ++REMARK 300 ++REMARK 300 BIOMOLECULE: 1 ++REMARK 300 SEE REMARK 350 FOR THE AUTHOR PROVIDED AND/OR PROGRAM ++REMARK 300 GENERATED ASSEMBLY INFORMATION FOR THE STRUCTURE IN ++REMARK 300 BURIED SURFACE AREA. ++REMARK 350 ++REMARK 350 COORDINATES FOR A COMPLETE MULTIMER REPRESENTING THE KNOWN ++REMARK 350 BIOLOGICALLY SIGNIFICANT OLIGOMERIZATION STATE OF THE ++REMARK 350 MOLECULE CAN BE GENERATED BY APPLYING BIOMT TRANSFORMATIONS ++REMARK 350 GIVEN BELOW. BOTH NON-CRYSTALLOGRAPHIC AND ++REMARK 350 CRYSTALLOGRAPHIC OPERATIONS ARE GIVEN. ++REMARK 350 ++REMARK 350 BIOMOLECULE: 1 ++REMARK 350 AUTHOR DETERMINED BIOLOGICAL UNIT: OCTAMERIC ++REMARK 350 APPLY THE FOLLOWING TO CHAINS: a, b, d, f, g, m, n, e ++REMARK 350 BIOMT1 1 1.000000 0.000000 0.000000 0.00000 ++REMARK 350 BIOMT2 1 0.000000 1.000000 0.000000 0.00000 ++REMARK 350 BIOMT3 1 0.000000 0.000000 1.000000 0.00000 ++REMARK 465 ++REMARK 465 MISSING RESIDUES ++REMARK 465 EXPERIMENT. (M=MODEL NUMBER; RES=RESIDUE NAME; C=CHAIN ++REMARK 465 IDENTIFIER; SSSEQ=SEQUENCE NUMBER; I=INSERTION CODE.) ++REMARK 465 ++REMARK 465 M RES C SSSEQI ++REMARK 465 MET a 1 ++REMARK 465 LYS a 2 ++REMARK 465 TRP a 3 ++REMARK 465 LYS a 4 ++REMARK 465 ALA a 5 ++REMARK 465 LEU a 6 ++REMARK 465 PHE a 7 ++REMARK 465 THR a 8 ++REMARK 465 ALA a 9 ++REMARK 465 ALA a 10 ++REMARK 465 ILE a 11 ++REMARK 465 LEU a 12 ++REMARK 465 GLN a 13 ++REMARK 465 ALA a 14 ++REMARK 465 GLN a 15 ++REMARK 465 LEU a 16 ++REMARK 465 PRO a 17 ++REMARK 465 ILE a 18 ++REMARK 465 THR a 19 ++REMARK 465 GLU a 20 ++REMARK 465 ALA a 21 ++REMARK 465 SER a 58 ++REMARK 465 ALA a 59 ++REMARK 465 ASP a 60 ++REMARK 465 ALA a 61 ++REMARK 465 PRO a 62 ++REMARK 465 ALA a 63 ++REMARK 465 TYR a 64 ++REMARK 465 GLN a 65 ++REMARK 465 GLN a 66 ++REMARK 465 GLY a 67 ++REMARK 465 GLN a 68 ++REMARK 465 ASN a 69 ++REMARK 465 GLN a 70 ++REMARK 465 LEU a 71 ++REMARK 465 TYR a 72 ++REMARK 465 ASN a 73 ++REMARK 465 GLU a 74 ++REMARK 465 LEU a 75 ++REMARK 465 ASN a 76 ++REMARK 465 LEU a 77 ++REMARK 465 GLY a 78 ++REMARK 465 ARG a 79 ++REMARK 465 ARG a 80 ++REMARK 465 GLU a 81 ++REMARK 465 GLU a 82 ++REMARK 465 TYR a 83 ++REMARK 465 ASP a 84 ++REMARK 465 VAL a 85 ++REMARK 465 LEU a 86 ++REMARK 465 ASP a 87 ++REMARK 465 LYS a 88 ++REMARK 465 ARG a 89 ++REMARK 465 ARG a 90 ++REMARK 465 GLY a 91 ++REMARK 465 ARG a 92 ++REMARK 465 ASP a 93 ++REMARK 465 PRO a 94 ++REMARK 465 GLU a 95 ++REMARK 465 MET a 96 ++REMARK 465 GLY a 97 ++REMARK 465 GLY a 98 ++REMARK 465 LYS a 99 ++REMARK 465 PRO a 100 ++REMARK 465 GLN a 101 ++REMARK 465 ARG a 102 ++REMARK 465 ARG a 103 ++REMARK 465 LYS a 104 ++REMARK 465 ASN a 105 ++REMARK 465 PRO a 106 ++REMARK 465 GLN a 107 ++REMARK 465 GLU a 108 ++REMARK 465 GLY a 109 ++REMARK 465 LEU a 110 ++REMARK 465 TYR a 111 ++REMARK 465 ASN a 112 ++REMARK 465 GLU a 113 ++REMARK 465 LEU a 114 ++REMARK 465 GLN a 115 ++REMARK 465 LYS a 116 ++REMARK 465 ASP a 117 ++REMARK 465 LYS a 118 ++REMARK 465 MET a 119 ++REMARK 465 ALA a 120 ++REMARK 465 GLU a 121 ++REMARK 465 ALA a 122 ++REMARK 465 TYR a 123 ++REMARK 465 SER a 124 ++REMARK 465 GLU a 125 ++REMARK 465 ILE a 126 ++REMARK 465 GLY a 127 ++REMARK 465 MET a 128 ++REMARK 465 LYS a 129 ++REMARK 465 GLY a 130 ++REMARK 465 GLU a 131 ++REMARK 465 ARG a 132 ++REMARK 465 ARG a 133 ++REMARK 465 ARG a 134 ++REMARK 465 GLY a 135 ++REMARK 465 LYS a 136 ++REMARK 465 GLY a 137 ++REMARK 465 HIS a 138 ++REMARK 465 ASP a 139 ++REMARK 465 GLY a 140 ++REMARK 465 LEU a 141 ++REMARK 465 TYR a 142 ++REMARK 465 GLN a 143 ++REMARK 465 GLY a 144 ++REMARK 465 LEU a 145 ++REMARK 465 SER a 146 ++REMARK 465 THR a 147 ++REMARK 465 ALA a 148 ++REMARK 465 THR a 149 ++REMARK 465 LYS a 150 ++REMARK 465 ASP a 151 ++REMARK 465 THR a 152 ++REMARK 465 TYR a 153 ++REMARK 465 ASP a 154 ++REMARK 465 ALA a 155 ++REMARK 465 LEU a 156 ++REMARK 465 HIS a 157 ++REMARK 465 MET a 158 ++REMARK 465 GLN a 159 ++REMARK 465 ALA a 160 ++REMARK 465 LEU a 161 ++REMARK 465 PRO a 162 ++REMARK 465 PRO a 163 ++REMARK 465 ARG a 164 ++REMARK 465 MET b 1 ++REMARK 465 LYS b 2 ++REMARK 465 TRP b 3 ++REMARK 465 LYS b 4 ++REMARK 465 ALA b 5 ++REMARK 465 LEU b 6 ++REMARK 465 PHE b 7 ++REMARK 465 THR b 8 ++REMARK 465 ALA b 9 ++REMARK 465 ALA b 10 ++REMARK 465 ILE b 11 ++REMARK 465 LEU b 12 ++REMARK 465 GLN b 13 ++REMARK 465 ALA b 14 ++REMARK 465 GLN b 15 ++REMARK 465 LEU b 16 ++REMARK 465 PRO b 17 ++REMARK 465 ILE b 18 ++REMARK 465 THR b 19 ++REMARK 465 GLU b 20 ++REMARK 465 ALA b 21 ++REMARK 465 GLN b 22 ++REMARK 465 SER b 23 ++REMARK 465 SER b 56 ++REMARK 465 ARG b 57 ++REMARK 465 SER b 58 ++REMARK 465 ALA b 59 ++REMARK 465 ASP b 60 ++REMARK 465 ALA b 61 ++REMARK 465 PRO b 62 ++REMARK 465 ALA b 63 ++REMARK 465 TYR b 64 ++REMARK 465 GLN b 65 ++REMARK 465 GLN b 66 ++REMARK 465 GLY b 67 ++REMARK 465 GLN b 68 ++REMARK 465 ASN b 69 ++REMARK 465 GLN b 70 ++REMARK 465 LEU b 71 ++REMARK 465 TYR b 72 ++REMARK 465 ASN b 73 ++REMARK 465 GLU b 74 ++REMARK 465 LEU b 75 ++REMARK 465 ASN b 76 ++REMARK 465 LEU b 77 ++REMARK 465 GLY b 78 ++REMARK 465 ARG b 79 ++REMARK 465 ARG b 80 ++REMARK 465 GLU b 81 ++REMARK 465 GLU b 82 ++REMARK 465 TYR b 83 ++REMARK 465 ASP b 84 ++REMARK 465 VAL b 85 ++REMARK 465 LEU b 86 ++REMARK 465 ASP b 87 ++REMARK 465 LYS b 88 ++REMARK 465 ARG b 89 ++REMARK 465 ARG b 90 ++REMARK 465 GLY b 91 ++REMARK 465 ARG b 92 ++REMARK 465 ASP b 93 ++REMARK 465 PRO b 94 ++REMARK 465 GLU b 95 ++REMARK 465 MET b 96 ++REMARK 465 GLY b 97 ++REMARK 465 GLY b 98 ++REMARK 465 LYS b 99 ++REMARK 465 PRO b 100 ++REMARK 465 GLN b 101 ++REMARK 465 ARG b 102 ++REMARK 465 ARG b 103 ++REMARK 465 LYS b 104 ++REMARK 465 ASN b 105 ++REMARK 465 PRO b 106 ++REMARK 465 GLN b 107 ++REMARK 465 GLU b 108 ++REMARK 465 GLY b 109 ++REMARK 465 LEU b 110 ++REMARK 465 TYR b 111 ++REMARK 465 ASN b 112 ++REMARK 465 GLU b 113 ++REMARK 465 LEU b 114 ++REMARK 465 GLN b 115 ++REMARK 465 LYS b 116 ++REMARK 465 ASP b 117 ++REMARK 465 LYS b 118 ++REMARK 465 MET b 119 ++REMARK 465 ALA b 120 ++REMARK 465 GLU b 121 ++REMARK 465 ALA b 122 ++REMARK 465 TYR b 123 ++REMARK 465 SER b 124 ++REMARK 465 GLU b 125 ++REMARK 465 ILE b 126 ++REMARK 465 GLY b 127 ++REMARK 465 MET b 128 ++REMARK 465 LYS b 129 ++REMARK 465 GLY b 130 ++REMARK 465 GLU b 131 ++REMARK 465 ARG b 132 ++REMARK 465 ARG b 133 ++REMARK 465 ARG b 134 ++REMARK 465 GLY b 135 ++REMARK 465 LYS b 136 ++REMARK 465 GLY b 137 ++REMARK 465 HIS b 138 ++REMARK 465 ASP b 139 ++REMARK 465 GLY b 140 ++REMARK 465 LEU b 141 ++REMARK 465 TYR b 142 ++REMARK 465 GLN b 143 ++REMARK 465 GLY b 144 ++REMARK 465 LEU b 145 ++REMARK 465 SER b 146 ++REMARK 465 THR b 147 ++REMARK 465 ALA b 148 ++REMARK 465 THR b 149 ++REMARK 465 LYS b 150 ++REMARK 465 ASP b 151 ++REMARK 465 THR b 152 ++REMARK 465 TYR b 153 ++REMARK 465 ASP b 154 ++REMARK 465 ALA b 155 ++REMARK 465 LEU b 156 ++REMARK 465 HIS b 157 ++REMARK 465 MET b 158 ++REMARK 465 GLN b 159 ++REMARK 465 ALA b 160 ++REMARK 465 LEU b 161 ++REMARK 465 PRO b 162 ++REMARK 465 PRO b 163 ++REMARK 465 ARG b 164 ++REMARK 465 MET d 1 ++REMARK 465 GLU d 2 ++REMARK 465 HIS d 3 ++REMARK 465 SER d 4 ++REMARK 465 THR d 5 ++REMARK 465 PHE d 6 ++REMARK 465 LEU d 7 ++REMARK 465 SER d 8 ++REMARK 465 GLY d 9 ++REMARK 465 LEU d 10 ++REMARK 465 VAL d 11 ++REMARK 465 LEU d 12 ++REMARK 465 ALA d 13 ++REMARK 465 THR d 14 ++REMARK 465 LEU d 15 ++REMARK 465 LEU d 16 ++REMARK 465 SER d 17 ++REMARK 465 GLN d 18 ++REMARK 465 VAL d 19 ++REMARK 465 SER d 20 ++REMARK 465 PRO d 21 ++REMARK 465 THR d 130 ++REMARK 465 GLY d 131 ++REMARK 465 ARG d 132 ++REMARK 465 LEU d 133 ++REMARK 465 SER d 134 ++REMARK 465 GLY d 135 ++REMARK 465 ALA d 136 ++REMARK 465 ALA d 137 ++REMARK 465 ASP d 138 ++REMARK 465 THR d 139 ++REMARK 465 GLN d 140 ++REMARK 465 ALA d 141 ++REMARK 465 LEU d 142 ++REMARK 465 LEU d 143 ++REMARK 465 ARG d 144 ++REMARK 465 ASN d 145 ++REMARK 465 ASP d 146 ++REMARK 465 GLN d 147 ++REMARK 465 VAL d 148 ++REMARK 465 TYR d 149 ++REMARK 465 GLN d 150 ++REMARK 465 PRO d 151 ++REMARK 465 LEU d 152 ++REMARK 465 ARG d 153 ++REMARK 465 ASP d 154 ++REMARK 465 ARG d 155 ++REMARK 465 ASP d 156 ++REMARK 465 ASP d 157 ++REMARK 465 ALA d 158 ++REMARK 465 GLN d 159 ++REMARK 465 TYR d 160 ++REMARK 465 SER d 161 ++REMARK 465 HIS d 162 ++REMARK 465 LEU d 163 ++REMARK 465 GLY d 164 ++REMARK 465 GLY d 165 ++REMARK 465 ASN d 166 ++REMARK 465 TRP d 167 ++REMARK 465 ALA d 168 ++REMARK 465 ARG d 169 ++REMARK 465 ASN d 170 ++REMARK 465 LYS d 171 ++REMARK 465 MET f 1 ++REMARK 465 GLN f 2 ++REMARK 465 SER f 3 ++REMARK 465 GLY f 4 ++REMARK 465 THR f 5 ++REMARK 465 HIS f 6 ++REMARK 465 TRP f 7 ++REMARK 465 ARG f 8 ++REMARK 465 VAL f 9 ++REMARK 465 LEU f 10 ++REMARK 465 GLY f 11 ++REMARK 465 LEU f 12 ++REMARK 465 CYS f 13 ++REMARK 465 LEU f 14 ++REMARK 465 LEU f 15 ++REMARK 465 SER f 16 ++REMARK 465 VAL f 17 ++REMARK 465 GLY f 18 ++REMARK 465 VAL f 19 ++REMARK 465 TRP f 20 ++REMARK 465 GLY f 21 ++REMARK 465 GLN f 22 ++REMARK 465 ASP f 23 ++REMARK 465 GLY f 24 ++REMARK 465 ASN f 25 ++REMARK 465 GLU f 26 ++REMARK 465 GLU f 27 ++REMARK 465 MET f 28 ++REMARK 465 GLY f 29 ++REMARK 465 GLY f 30 ++REMARK 465 ILE f 31 ++REMARK 465 THR f 32 ++REMARK 465 ALA f 157 ++REMARK 465 LYS f 158 ++REMARK 465 ALA f 159 ++REMARK 465 LYS f 160 ++REMARK 465 PRO f 161 ++REMARK 465 VAL f 162 ++REMARK 465 THR f 163 ++REMARK 465 ARG f 164 ++REMARK 465 GLY f 165 ++REMARK 465 ALA f 166 ++REMARK 465 GLY f 167 ++REMARK 465 ALA f 168 ++REMARK 465 GLY f 169 ++REMARK 465 GLY f 170 ++REMARK 465 ARG f 171 ++REMARK 465 GLN f 172 ++REMARK 465 ARG f 173 ++REMARK 465 GLY f 174 ++REMARK 465 GLN f 175 ++REMARK 465 ASN f 176 ++REMARK 465 LYS f 177 ++REMARK 465 GLU f 178 ++REMARK 465 ARG f 179 ++REMARK 465 PRO f 180 ++REMARK 465 PRO f 181 ++REMARK 465 PRO f 182 ++REMARK 465 VAL f 183 ++REMARK 465 PRO f 184 ++REMARK 465 ASN f 185 ++REMARK 465 PRO f 186 ++REMARK 465 ASP f 187 ++REMARK 465 TYR f 188 ++REMARK 465 GLU f 189 ++REMARK 465 PRO f 190 ++REMARK 465 ILE f 191 ++REMARK 465 ARG f 192 ++REMARK 465 LYS f 193 ++REMARK 465 GLY f 194 ++REMARK 465 GLN f 195 ++REMARK 465 ARG f 196 ++REMARK 465 ASP f 197 ++REMARK 465 LEU f 198 ++REMARK 465 TYR f 199 ++REMARK 465 SER f 200 ++REMARK 465 GLY f 201 ++REMARK 465 LEU f 202 ++REMARK 465 ASN f 203 ++REMARK 465 GLN f 204 ++REMARK 465 ARG f 205 ++REMARK 465 ARG f 206 ++REMARK 465 ILE f 207 ++REMARK 465 MET g 1 ++REMARK 465 GLU g 2 ++REMARK 465 GLN g 3 ++REMARK 465 GLY g 4 ++REMARK 465 LYS g 5 ++REMARK 465 GLY g 6 ++REMARK 465 LEU g 7 ++REMARK 465 ALA g 8 ++REMARK 465 VAL g 9 ++REMARK 465 LEU g 10 ++REMARK 465 ILE g 11 ++REMARK 465 LEU g 12 ++REMARK 465 ALA g 13 ++REMARK 465 ILE g 14 ++REMARK 465 ILE g 15 ++REMARK 465 LEU g 16 ++REMARK 465 LEU g 17 ++REMARK 465 GLN g 18 ++REMARK 465 GLY g 19 ++REMARK 465 THR g 20 ++REMARK 465 LEU g 21 ++REMARK 465 ALA g 22 ++REMARK 465 GLN g 23 ++REMARK 465 GLN g 139 ++REMARK 465 ASP g 140 ++REMARK 465 GLY g 141 ++REMARK 465 VAL g 142 ++REMARK 465 ARG g 143 ++REMARK 465 GLN g 144 ++REMARK 465 SER g 145 ++REMARK 465 ARG g 146 ++REMARK 465 ALA g 147 ++REMARK 465 SER g 148 ++REMARK 465 ASP g 149 ++REMARK 465 LYS g 150 ++REMARK 465 GLN g 151 ++REMARK 465 THR g 152 ++REMARK 465 LEU g 153 ++REMARK 465 LEU g 154 ++REMARK 465 PRO g 155 ++REMARK 465 ASN g 156 ++REMARK 465 ASP g 157 ++REMARK 465 GLN g 158 ++REMARK 465 LEU g 159 ++REMARK 465 TYR g 160 ++REMARK 465 GLN g 161 ++REMARK 465 PRO g 162 ++REMARK 465 LEU g 163 ++REMARK 465 LYS g 164 ++REMARK 465 ASP g 165 ++REMARK 465 ARG g 166 ++REMARK 465 GLU g 167 ++REMARK 465 ASP g 168 ++REMARK 465 ASP g 169 ++REMARK 465 GLN g 170 ++REMARK 465 TYR g 171 ++REMARK 465 SER g 172 ++REMARK 465 HIS g 173 ++REMARK 465 LEU g 174 ++REMARK 465 GLN g 175 ++REMARK 465 GLY g 176 ++REMARK 465 ASN g 177 ++REMARK 465 GLN g 178 ++REMARK 465 LEU g 179 ++REMARK 465 ARG g 180 ++REMARK 465 ARG g 181 ++REMARK 465 ASN g 182 ++REMARK 465 GLN m 22 ++REMARK 465 GLN m 23 ++REMARK 465 LYS m 24 ++REMARK 465 GLU m 25 ++REMARK 465 ASP n 309 ++REMARK 465 SER n 310 ++REMARK 465 ARG n 311 ++REMARK 465 GLY n 312 ++REMARK 465 MET e 1 ++REMARK 465 GLN e 2 ++REMARK 465 SER e 3 ++REMARK 465 GLY e 4 ++REMARK 465 THR e 5 ++REMARK 465 HIS e 6 ++REMARK 465 TRP e 7 ++REMARK 465 ARG e 8 ++REMARK 465 VAL e 9 ++REMARK 465 LEU e 10 ++REMARK 465 GLY e 11 ++REMARK 465 LEU e 12 ++REMARK 465 CYS e 13 ++REMARK 465 LEU e 14 ++REMARK 465 LEU e 15 ++REMARK 465 SER e 16 ++REMARK 465 VAL e 17 ++REMARK 465 GLY e 18 ++REMARK 465 VAL e 19 ++REMARK 465 TRP e 20 ++REMARK 465 GLY e 21 ++REMARK 465 GLN e 22 ++REMARK 465 ASP e 23 ++REMARK 465 GLY e 24 ++REMARK 465 ASN e 25 ++REMARK 465 GLU e 26 ++REMARK 465 GLU e 27 ++REMARK 465 MET e 28 ++REMARK 465 GLY e 29 ++REMARK 465 GLY e 30 ++REMARK 465 ILE e 31 ++REMARK 465 THR e 32 ++REMARK 465 LYS e 156 ++REMARK 465 ALA e 157 ++REMARK 465 LYS e 158 ++REMARK 465 ALA e 159 ++REMARK 465 LYS e 160 ++REMARK 465 PRO e 161 ++REMARK 465 VAL e 162 ++REMARK 465 THR e 163 ++REMARK 465 ARG e 164 ++REMARK 465 GLY e 165 ++REMARK 465 ALA e 166 ++REMARK 465 GLY e 167 ++REMARK 465 ALA e 168 ++REMARK 465 GLY e 169 ++REMARK 465 GLY e 170 ++REMARK 465 ARG e 171 ++REMARK 465 GLN e 172 ++REMARK 465 ARG e 173 ++REMARK 465 GLY e 174 ++REMARK 465 GLN e 175 ++REMARK 465 ASN e 176 ++REMARK 465 LYS e 177 ++REMARK 465 GLU e 178 ++REMARK 465 ARG e 179 ++REMARK 465 PRO e 180 ++REMARK 465 PRO e 181 ++REMARK 465 PRO e 182 ++REMARK 465 VAL e 183 ++REMARK 465 PRO e 184 ++REMARK 465 ASN e 185 ++REMARK 465 PRO e 186 ++REMARK 465 ASP e 187 ++REMARK 465 TYR e 188 ++REMARK 465 GLU e 189 ++REMARK 465 PRO e 190 ++REMARK 465 ILE e 191 ++REMARK 465 ARG e 192 ++REMARK 465 LYS e 193 ++REMARK 465 GLY e 194 ++REMARK 465 GLN e 195 ++REMARK 465 ARG e 196 ++REMARK 465 ASP e 197 ++REMARK 465 LEU e 198 ++REMARK 465 TYR e 199 ++REMARK 465 SER e 200 ++REMARK 465 GLY e 201 ++REMARK 465 LEU e 202 ++REMARK 465 ASN e 203 ++REMARK 465 GLN e 204 ++REMARK 465 ARG e 205 ++REMARK 465 ARG e 206 ++REMARK 465 ILE e 207 ++REMARK 470 ++REMARK 470 MISSING ATOM ++REMARK 470 RES=RESIDUE NAME; C=CHAIN IDENTIFIER; SSEQ=SEQUENCE NUMBER; ++REMARK 470 I=INSERTION CODE): ++REMARK 470 M RES CSSEQI ATOMS ++REMARK 470 ARG a 57 CG CD NE CZ NH1 NH2 ++REMARK 470 LYS f 156 CG CD CE NZ ++REMARK 470 ASP m 29 CG OD1 OD2 ++REMARK 470 TYR m 117 CG CD1 CD2 CE1 CE2 CZ OH ++REMARK 470 MET n 60 CG SD CE ++REMARK 470 ARG n 115 CG CD NE CZ NH1 NH2 ++REMARK 500 ++REMARK 500 GEOMETRY AND STEREOCHEMISTRY ++REMARK 500 SUBTOPIC: COVALENT BOND ANGLES ++REMARK 500 ++REMARK 500 HAVE VALUES WHICH DEVIATE FROM EXPECTED VALUES BY MORE ++REMARK 500 IDENTIFIER; SSEQ=SEQUENCE NUMBER; I=INSERTION CODE). ++REMARK 500 ++REMARK 500 STANDARD TABLE: ++REMARK 500 FORMAT: (10X,I3,1X,A3,1X,A1,I4,A1,3(1X,A4,2X),12X,F5.1) ++REMARK 500 ++REMARK 500 EXPECTED VALUES PROTEIN: ENGH AND HUBER, 1999 ++REMARK 500 EXPECTED VALUES NUCLEIC ACID: CLOWNEY ET AL 1996 ++REMARK 500 ++REMARK 500 M RES CSSEQI ATM1 ATM2 ATM3 ++REMARK 500 CYS d 93 CA - CB - SG ANGL. DEV. = 8.4 DEGREES ++REMARK 500 ++REMARK 500 REMARK: NULL ++REMARK 500 ++REMARK 500 GEOMETRY AND STEREOCHEMISTRY ++REMARK 500 SUBTOPIC: TORSION ANGLES ++REMARK 500 ++REMARK 500 TORSION ANGLES OUTSIDE THE EXPECTED RAMACHANDRAN REGIONS: ++REMARK 500 (M=MODEL NUMBER; RES=RESIDUE NAME; C=CHAIN IDENTIFIER; ++REMARK 500 SSEQ=SEQUENCE NUMBER; I=INSERTION CODE). ++REMARK 500 ++REMARK 500 STANDARD TABLE: ++REMARK 500 FORMAT:(10X,I3,1X,A3,1X,A1,I4,A1,4X,F7.2,3X,F7.2) ++REMARK 500 ++REMARK 500 EXPECTED VALUES: GJ KLEYWEGT AND TA JONES (1996). PHI/PSI- ++REMARK 500 ++REMARK 500 M RES CSSEQI PSI PHI ++REMARK 500 LEU b 27 45.14 -140.17 ++REMARK 500 LEU d 29 -159.80 -81.67 ++REMARK 500 VAL d 44 -63.41 -120.62 ++REMARK 500 ASP d 66 71.54 56.66 ++REMARK 500 ASP d 77 -12.78 73.54 ++REMARK 500 TYR d 79 -3.57 80.82 ++REMARK 500 MET d 92 99.66 -67.68 ++REMARK 500 SER d 95 34.50 -95.52 ++REMARK 500 TYR f 52 70.25 54.23 ++REMARK 500 ASP f 78 -164.48 -127.51 ++REMARK 500 ASP g 58 11.56 58.67 ++REMARK 500 ASP g 80 73.04 53.63 ++REMARK 500 CYS g 104 -70.68 -49.92 ++REMARK 500 GLN g 105 14.72 48.18 ++REMARK 500 ASN g 106 -15.55 -142.29 ++REMARK 500 ALA g 137 34.42 -99.80 ++REMARK 500 TYR m 117 -65.77 -94.89 ++REMARK 500 SER m 118 -166.82 -163.93 ++REMARK 500 GLN m 135 -10.72 67.48 ++REMARK 500 ASN m 136 73.13 -156.47 ++REMARK 500 ASP m 159 -18.88 78.65 ++REMARK 500 PHE m 160 -13.02 58.35 ++REMARK 500 ASP m 161 7.73 59.32 ++REMARK 500 GLN m 163 17.87 -140.43 ++REMARK 500 PHE m 209 37.63 -99.20 ++REMARK 500 PRO m 215 -168.61 -74.33 ++REMARK 500 ASP m 217 -13.07 78.02 ++REMARK 500 THR m 218 64.58 20.43 ++REMARK 500 CYS m 227 66.49 61.15 ++REMARK 500 SER n 103 30.81 -93.49 ++REMARK 500 SER n 112 117.92 -161.11 ++REMARK 500 SER e 55 -11.87 72.86 ++REMARK 500 ASP e 71 -168.37 -126.51 ++REMARK 500 ASP e 72 71.12 58.69 ++REMARK 500 ASP e 78 -163.87 -127.02 ++REMARK 500 ++REMARK 500 REMARK: NULL ++REMARK 500 ++REMARK 500 GEOMETRY AND STEREOCHEMISTRY ++REMARK 500 SUBTOPIC: NON-CIS, NON-TRANS ++REMARK 500 ++REMARK 500 CIS AND TRANS CONFORMATION. CIS BONDS, IF ANY, ARE LISTED ++REMARK 500 ON CISPEP RECORDS. TRANS IS DEFINED AS 180 +/- 30 AND ++REMARK 500 CIS IS DEFINED AS 0 +/- 30 DEGREES. ++REMARK 500 MODEL OMEGA ++REMARK 500 ILE b 38 LEU b 39 132.28 ++REMARK 500 ASP m 159 PHE m 160 144.29 ++REMARK 500 ASP m 217 THR m 218 129.80 ++REMARK 500 ++REMARK 500 REMARK: NULL ++REMARK 900 ++REMARK 900 RELATED ENTRIES ++REMARK 900 RELATED ID: EMD-9895 RELATED DB: EMDB ++REMARK 900 STRUCTURE OF A PROTEIN ++DBREF 6JXR a 1 164 UNP P20963 CD3Z_HUMAN 1 164 ++DBREF 6JXR b 1 164 UNP P20963 CD3Z_HUMAN 1 164 ++DBREF 6JXR d 1 171 UNP P04234 CD3D_HUMAN 1 171 ++DBREF 6JXR f 1 207 UNP P07766 CD3E_HUMAN 1 207 ++DBREF 6JXR g 1 182 UNP P09693 CD3G_HUMAN 1 182 ++DBREF1 6JXR m 22 114 UNP TVAL3_HUMAN ++DBREF2 6JXR m A0A0B4J271 22 114 ++DBREF 6JXR m 116 132 UNP A0N4Z6 A0N4Z6_HUMAN 4 20 ++DBREF 6JXR m 134 273 UNP P01848 TRAC_HUMAN 1 140 ++DBREF1 6JXR n 22 112 UNP TVB65_HUMAN ++DBREF2 6JXR n A0A0K0K1A5 22 112 ++DBREF 6JXR n 121 134 UNP P0DSE2 TRBR1_HUMAN 119 132 ++DBREF1 6JXR n 135 312 UNP A0A0G2JMB4_HUMAN ++DBREF2 6JXR n A0A0G2JMB4 2 179 ++DBREF 6JXR e 1 207 UNP P07766 CD3E_HUMAN 1 207 ++SEQADV 6JXR LYS m 115 UNP A0A0B4J27 LINKER ++SEQADV 6JXR ASP m 133 UNP A0N4Z6 LINKER ++SEQADV 6JXR ARG n 113 UNP A0A0K0K1A LINKER ++SEQADV 6JXR ARG n 114 UNP A0A0K0K1A LINKER ++SEQADV 6JXR ARG n 115 UNP A0A0K0K1A LINKER ++SEQADV 6JXR GLN n 116 UNP A0A0K0K1A LINKER ++SEQADV 6JXR GLY n 117 UNP A0A0K0K1A LINKER ++SEQADV 6JXR ALA n 118 UNP A0A0K0K1A LINKER ++SEQADV 6JXR SER n 119 UNP A0A0K0K1A LINKER ++SEQADV 6JXR GLY n 120 UNP A0A0K0K1A LINKER ++SEQRES 1 a 164 MET LYS TRP LYS ALA LEU PHE THR ALA ALA ILE LEU GLN ++SEQRES 2 a 164 ALA GLN LEU PRO ILE THR GLU ALA GLN SER PHE GLY LEU ++SEQRES 3 a 164 LEU ASP PRO LYS LEU CYS TYR LEU LEU ASP GLY ILE LEU ++SEQRES 4 a 164 PHE ILE TYR GLY VAL ILE LEU THR ALA LEU PHE LEU ARG ++SEQRES 5 a 164 VAL LYS PHE SER ARG SER ALA ASP ALA PRO ALA TYR GLN ++SEQRES 6 a 164 GLN GLY GLN ASN GLN LEU TYR ASN GLU LEU ASN LEU GLY ++SEQRES 7 a 164 ARG ARG GLU GLU TYR ASP VAL LEU ASP LYS ARG ARG GLY ++SEQRES 8 a 164 ARG ASP PRO GLU MET GLY GLY LYS PRO GLN ARG ARG LYS ++SEQRES 9 a 164 ASN PRO GLN GLU GLY LEU TYR ASN GLU LEU GLN LYS ASP ++SEQRES 10 a 164 LYS MET ALA GLU ALA TYR SER GLU ILE GLY MET LYS GLY ++SEQRES 11 a 164 GLU ARG ARG ARG GLY LYS GLY HIS ASP GLY LEU TYR GLN ++SEQRES 12 a 164 GLY LEU SER THR ALA THR LYS ASP THR TYR ASP ALA LEU ++SEQRES 13 a 164 HIS MET GLN ALA LEU PRO PRO ARG ++SEQRES 1 b 164 MET LYS TRP LYS ALA LEU PHE THR ALA ALA ILE LEU GLN ++SEQRES 2 b 164 ALA GLN LEU PRO ILE THR GLU ALA GLN SER PHE GLY LEU ++SEQRES 3 b 164 LEU ASP PRO LYS LEU CYS TYR LEU LEU ASP GLY ILE LEU ++SEQRES 4 b 164 PHE ILE TYR GLY VAL ILE LEU THR ALA LEU PHE LEU ARG ++SEQRES 5 b 164 VAL LYS PHE SER ARG SER ALA ASP ALA PRO ALA TYR GLN ++SEQRES 6 b 164 GLN GLY GLN ASN GLN LEU TYR ASN GLU LEU ASN LEU GLY ++SEQRES 7 b 164 ARG ARG GLU GLU TYR ASP VAL LEU ASP LYS ARG ARG GLY ++SEQRES 8 b 164 ARG ASP PRO GLU MET GLY GLY LYS PRO GLN ARG ARG LYS ++SEQRES 9 b 164 ASN PRO GLN GLU GLY LEU TYR ASN GLU LEU GLN LYS ASP ++SEQRES 10 b 164 LYS MET ALA GLU ALA TYR SER GLU ILE GLY MET LYS GLY ++SEQRES 11 b 164 GLU ARG ARG ARG GLY LYS GLY HIS ASP GLY LEU TYR GLN ++SEQRES 12 b 164 GLY LEU SER THR ALA THR LYS ASP THR TYR ASP ALA LEU ++SEQRES 13 b 164 HIS MET GLN ALA LEU PRO PRO ARG ++SEQRES 1 d 171 MET GLU HIS SER THR PHE LEU SER GLY LEU VAL LEU ALA ++SEQRES 2 d 171 THR LEU LEU SER GLN VAL SER PRO PHE LYS ILE PRO ILE ++SEQRES 3 d 171 GLU GLU LEU GLU ASP ARG VAL PHE VAL ASN CYS ASN THR ++SEQRES 4 d 171 SER ILE THR TRP VAL GLU GLY THR VAL GLY THR LEU LEU ++SEQRES 5 d 171 SER ASP ILE THR ARG LEU ASP LEU GLY LYS ARG ILE LEU ++SEQRES 6 d 171 ASP PRO ARG GLY ILE TYR ARG CYS ASN GLY THR ASP ILE ++SEQRES 7 d 171 TYR LYS ASP LYS GLU SER THR VAL GLN VAL HIS TYR ARG ++SEQRES 8 d 171 MET CYS GLN SER CYS VAL GLU LEU ASP PRO ALA THR VAL ++SEQRES 9 d 171 ALA GLY ILE ILE VAL THR ASP VAL ILE ALA THR LEU LEU ++SEQRES 10 d 171 LEU ALA LEU GLY VAL PHE CYS PHE ALA GLY HIS GLU THR ++SEQRES 11 d 171 GLY ARG LEU SER GLY ALA ALA ASP THR GLN ALA LEU LEU ++SEQRES 12 d 171 ARG ASN ASP GLN VAL TYR GLN PRO LEU ARG ASP ARG ASP ++SEQRES 13 d 171 ASP ALA GLN TYR SER HIS LEU GLY GLY ASN TRP ALA ARG ++SEQRES 14 d 171 ASN LYS ++SEQRES 1 f 207 MET GLN SER GLY THR HIS TRP ARG VAL LEU GLY LEU CYS ++SEQRES 2 f 207 LEU LEU SER VAL GLY VAL TRP GLY GLN ASP GLY ASN GLU ++SEQRES 3 f 207 GLU MET GLY GLY ILE THR GLN THR PRO TYR LYS VAL SER ++SEQRES 4 f 207 ILE SER GLY THR THR VAL ILE LEU THR CYS PRO GLN TYR ++SEQRES 5 f 207 PRO GLY SER GLU ILE LEU TRP GLN HIS ASN ASP LYS ASN ++SEQRES 6 f 207 ILE GLY GLY ASP GLU ASP ASP LYS ASN ILE GLY SER ASP ++SEQRES 7 f 207 GLU ASP HIS LEU SER LEU LYS GLU PHE SER GLU LEU GLU ++SEQRES 8 f 207 GLN SER GLY TYR TYR VAL CYS TYR PRO ARG GLY SER LYS ++SEQRES 9 f 207 PRO GLU ASP ALA ASN PHE TYR LEU TYR LEU ARG ALA ARG ++SEQRES 10 f 207 VAL CYS GLU ASN CYS MET GLU MET ASP VAL MET SER VAL ++SEQRES 11 f 207 ALA THR ILE VAL ILE VAL ASP ILE CYS ILE THR GLY GLY ++SEQRES 12 f 207 LEU LEU LEU LEU VAL TYR TYR TRP SER LYS ASN ARG LYS ++SEQRES 13 f 207 ALA LYS ALA LYS PRO VAL THR ARG GLY ALA GLY ALA GLY ++SEQRES 14 f 207 GLY ARG GLN ARG GLY GLN ASN LYS GLU ARG PRO PRO PRO ++SEQRES 15 f 207 VAL PRO ASN PRO ASP TYR GLU PRO ILE ARG LYS GLY GLN ++SEQRES 16 f 207 ARG ASP LEU TYR SER GLY LEU ASN GLN ARG ARG ILE ++SEQRES 1 g 182 MET GLU GLN GLY LYS GLY LEU ALA VAL LEU ILE LEU ALA ++SEQRES 2 g 182 ILE ILE LEU LEU GLN GLY THR LEU ALA GLN SER ILE LYS ++SEQRES 3 g 182 GLY ASN HIS LEU VAL LYS VAL TYR ASP TYR GLN GLU ASP ++SEQRES 4 g 182 GLY SER VAL LEU LEU THR CYS ASP ALA GLU ALA LYS ASN ++SEQRES 5 g 182 ILE THR TRP PHE LYS ASP GLY LYS MET ILE GLY PHE LEU ++SEQRES 6 g 182 THR GLU ASP LYS LYS LYS TRP ASN LEU GLY SER ASN ALA ++SEQRES 7 g 182 LYS ASP PRO ARG GLY MET TYR GLN CYS LYS GLY SER GLN ++SEQRES 8 g 182 ASN LYS SER LYS PRO LEU GLN VAL TYR TYR ARG MET CYS ++SEQRES 9 g 182 GLN ASN CYS ILE GLU LEU ASN ALA ALA THR ILE SER GLY ++SEQRES 10 g 182 PHE LEU PHE ALA GLU ILE VAL SER ILE PHE VAL LEU ALA ++SEQRES 11 g 182 VAL GLY VAL TYR PHE ILE ALA GLY GLN ASP GLY VAL ARG ++SEQRES 12 g 182 GLN SER ARG ALA SER ASP LYS GLN THR LEU LEU PRO ASN ++SEQRES 13 g 182 ASP GLN LEU TYR GLN PRO LEU LYS ASP ARG GLU ASP ASP ++SEQRES 14 g 182 GLN TYR SER HIS LEU GLN GLY ASN GLN LEU ARG ARG ASN ++SEQRES 1 m 252 GLN GLN LYS GLU VAL GLU GLN ASP PRO GLY PRO LEU SER ++SEQRES 2 m 252 VAL PRO GLU GLY ALA ILE VAL SER LEU ASN CYS THR TYR ++SEQRES 3 m 252 SER ASN SER ALA PHE GLN TYR PHE MET TRP TYR ARG GLN ++SEQRES 4 m 252 TYR SER ARG LYS GLY PRO GLU LEU LEU MET TYR THR TYR ++SEQRES 5 m 252 SER SER GLY ASN LYS GLU ASP GLY ARG PHE THR ALA GLN ++SEQRES 6 m 252 VAL ASP LYS SER SER LYS TYR ILE SER LEU PHE ILE ARG ++SEQRES 7 m 252 ASP SER GLN PRO SER ASP SER ALA THR TYR LEU CYS ALA ++SEQRES 8 m 252 MET SER LYS GLY TYR SER THR LEU THR PHE GLY LYS GLY ++SEQRES 9 m 252 THR MET LEU LEU VAL SER PRO ASP ILE GLN ASN PRO ASP ++SEQRES 10 m 252 PRO ALA VAL TYR GLN LEU ARG ASP SER LYS SER SER ASP ++SEQRES 11 m 252 LYS SER VAL CYS LEU PHE THR ASP PHE ASP SER GLN THR ++SEQRES 12 m 252 ASN VAL SER GLN SER LYS ASP SER ASP VAL TYR ILE THR ++SEQRES 13 m 252 ASP LYS THR VAL LEU ASP MET ARG SER MET ASP PHE LYS ++SEQRES 14 m 252 SER ASN SER ALA VAL ALA TRP SER ASN LYS SER ASP PHE ++SEQRES 15 m 252 ALA CYS ALA ASN ALA PHE ASN ASN SER ILE ILE PRO GLU ++SEQRES 16 m 252 ASP THR PHE PHE PRO SER PRO GLU SER SER CYS ASP VAL ++SEQRES 17 m 252 LYS LEU VAL GLU LYS SER PHE GLU THR ASP THR ASN LEU ++SEQRES 18 m 252 ASN PHE GLN ASN LEU SER VAL ILE GLY PHE ARG ILE LEU ++SEQRES 19 m 252 LEU LEU LYS VAL ALA GLY PHE ASN LEU LEU MET THR LEU ++SEQRES 20 m 252 ARG LEU TRP SER SER ++SEQRES 1 n 291 GLY VAL THR GLN THR PRO LYS PHE GLN VAL LEU LYS THR ++SEQRES 2 n 291 GLY GLN SER MET THR LEU GLN CYS ALA GLN ASP MET ASN ++SEQRES 3 n 291 HIS GLU TYR MET SER TRP TYR ARG GLN ASP PRO GLY MET ++SEQRES 4 n 291 GLY LEU ARG LEU ILE HIS TYR SER VAL GLY ALA GLY ILE ++SEQRES 5 n 291 THR ASP GLN GLY GLU VAL PRO ASN GLY TYR ASN VAL SER ++SEQRES 6 n 291 ARG SER THR THR GLU ASP PHE PRO LEU ARG LEU LEU SER ++SEQRES 7 n 291 ALA ALA PRO SER GLN THR SER VAL TYR PHE CYS ALA SER ++SEQRES 8 n 291 ARG ARG ARG GLN GLY ALA SER GLY GLU GLN TYR PHE GLY ++SEQRES 9 n 291 PRO GLY THR ARG LEU THR VAL THR GLU ASP LEU LYS ASN ++SEQRES 10 n 291 VAL PHE PRO PRO GLU VAL ALA VAL PHE GLU PRO SER GLU ++SEQRES 11 n 291 ALA GLU ILE SER HIS THR GLN LYS ALA THR LEU VAL CYS ++SEQRES 12 n 291 LEU ALA THR GLY PHE TYR PRO ASP HIS VAL GLU LEU SER ++SEQRES 13 n 291 TRP TRP VAL ASN GLY LYS GLU VAL HIS SER GLY VAL SER ++SEQRES 14 n 291 THR ASP PRO GLN PRO LEU LYS GLU GLN PRO ALA LEU ASN ++SEQRES 15 n 291 ASP SER ARG TYR CYS LEU SER SER ARG LEU ARG VAL SER ++SEQRES 16 n 291 ALA THR PHE TRP GLN ASN PRO ARG ASN HIS PHE ARG CYS ++SEQRES 17 n 291 GLN VAL GLN PHE TYR GLY LEU SER GLU ASN ASP GLU TRP ++SEQRES 18 n 291 THR GLN ASP ARG ALA LYS PRO VAL THR GLN ILE VAL SER ++SEQRES 19 n 291 ALA GLU ALA TRP GLY ARG ALA ASP CYS GLY PHE THR SER ++SEQRES 20 n 291 GLU SER TYR GLN GLN GLY VAL LEU SER ALA THR ILE LEU ++SEQRES 21 n 291 TYR GLU ILE LEU LEU GLY LYS ALA THR LEU TYR ALA VAL ++SEQRES 22 n 291 LEU VAL SER ALA LEU VAL LEU MET ALA MET VAL LYS ARG ++SEQRES 23 n 291 LYS ASP SER ARG GLY ++SEQRES 1 e 207 MET GLN SER GLY THR HIS TRP ARG VAL LEU GLY LEU CYS ++SEQRES 2 e 207 LEU LEU SER VAL GLY VAL TRP GLY GLN ASP GLY ASN GLU ++SEQRES 3 e 207 GLU MET GLY GLY ILE THR GLN THR PRO TYR LYS VAL SER ++SEQRES 4 e 207 ILE SER GLY THR THR VAL ILE LEU THR CYS PRO GLN TYR ++SEQRES 5 e 207 PRO GLY SER GLU ILE LEU TRP GLN HIS ASN ASP LYS ASN ++SEQRES 6 e 207 ILE GLY GLY ASP GLU ASP ASP LYS ASN ILE GLY SER ASP ++SEQRES 7 e 207 GLU ASP HIS LEU SER LEU LYS GLU PHE SER GLU LEU GLU ++SEQRES 8 e 207 GLN SER GLY TYR TYR VAL CYS TYR PRO ARG GLY SER LYS ++SEQRES 9 e 207 PRO GLU ASP ALA ASN PHE TYR LEU TYR LEU ARG ALA ARG ++SEQRES 10 e 207 VAL CYS GLU ASN CYS MET GLU MET ASP VAL MET SER VAL ++SEQRES 11 e 207 ALA THR ILE VAL ILE VAL ASP ILE CYS ILE THR GLY GLY ++SEQRES 12 e 207 LEU LEU LEU LEU VAL TYR TYR TRP SER LYS ASN ARG LYS ++SEQRES 13 e 207 ALA LYS ALA LYS PRO VAL THR ARG GLY ALA GLY ALA GLY ++SEQRES 14 e 207 GLY ARG GLN ARG GLY GLN ASN LYS GLU ARG PRO PRO PRO ++SEQRES 15 e 207 VAL PRO ASN PRO ASP TYR GLU PRO ILE ARG LYS GLY GLN ++SEQRES 16 e 207 ARG ASP LEU TYR SER GLY LEU ASN GLN ARG ARG ILE ++HELIX 1 AA1 ASP a 28 ARG a 57 1 30 ++HELIX 2 AA2 LEU b 27 LYS b 54 1 28 ++HELIX 3 AA3 ASP d 100 HIS d 128 1 29 ++HELIX 4 AA4 LYS f 104 ALA f 108 5 5 ++HELIX 5 AA5 MET f 128 ARG f 155 1 28 ++HELIX 6 AA6 ASN g 111 ALA g 137 1 27 ++HELIX 7 AA7 GLN m 102 SER m 106 5 5 ++HELIX 8 AA8 ALA m 204 ALA m 208 5 5 ++HELIX 9 AA9 ASP m 228 GLU m 233 1 6 ++HELIX 10 AB1 ASP m 239 SER m 273 1 35 ++HELIX 11 AB2 ALA n 101 THR n 105 5 5 ++HELIX 12 AB3 SER n 150 THR n 157 1 8 ++HELIX 13 AB4 GLU n 269 LYS n 308 1 40 ++HELIX 14 AB5 LYS e 104 ALA e 108 5 5 ++HELIX 15 AB6 ASP e 126 ASN e 154 1 29 ++SHEET 1 AA1 4 ILE d 26 GLU d 27 0 ++SHEET 2 AA1 4 ARG d 32 ASN d 36 -1 O PHE d 34 N GLU d 27 ++SHEET 3 AA1 4 ARG d 57 LYS d 62 -1 O LEU d 58 N VAL d 35 ++SHEET 4 AA1 4 THR d 50 LEU d 51 -1 N THR d 50 O ASP d 59 ++SHEET 1 AA2 7 THR d 42 GLY d 46 0 ++SHEET 2 AA2 7 GLY d 69 ASN d 74 -1 O ARG d 72 N THR d 42 ++SHEET 3 AA2 7 GLU d 83 ARG d 91 -1 O SER d 84 N CYS d 73 ++SHEET 4 AA2 7 PHE e 110 ALA e 116 1 O TYR e 113 N GLN d 87 ++SHEET 5 AA2 7 GLY e 94 PRO e 100 -1 N TYR e 96 O LEU e 112 ++SHEET 6 AA2 7 ILE e 57 HIS e 61 -1 N GLN e 60 O VAL e 97 ++SHEET 7 AA2 7 ASN e 65 ILE e 66 -1 O ILE e 66 N TRP e 59 ++SHEET 1 AA3 2 CYS d 96 GLU d 98 0 ++SHEET 2 AA3 2 CYS e 122 GLU e 124 -1 O MET e 123 N VAL d 97 ++SHEET 1 AA4 4 LYS f 37 SER f 41 0 ++SHEET 2 AA4 4 THR f 44 THR f 48 -1 O THR f 44 N SER f 41 ++SHEET 3 AA4 4 HIS f 81 LYS f 85 -1 O LEU f 84 N VAL f 45 ++SHEET 4 AA4 4 ILE f 75 SER f 77 -1 N GLY f 76 O SER f 83 ++SHEET 1 AA5 8 ASN f 65 ILE f 66 0 ++SHEET 2 AA5 8 ILE f 57 GLN f 60 -1 N TRP f 59 O ILE f 66 ++SHEET 3 AA5 8 GLY f 94 PRO f 100 -1 O TYR f 99 N LEU f 58 ++SHEET 4 AA5 8 TYR f 111 ALA f 116 -1 O LEU f 112 N TYR f 96 ++SHEET 5 AA5 8 LEU g 97 ARG g 102 1 O GLN g 98 N TYR f 111 ++SHEET 6 AA5 8 GLY g 83 LYS g 88 -1 N GLY g 83 O VAL g 99 ++SHEET 7 AA5 8 ILE g 53 LYS g 57 -1 N THR g 54 O LYS g 88 ++SHEET 8 AA5 8 LYS g 60 LEU g 65 -1 O LEU g 65 N ILE g 53 ++SHEET 1 AA6 2 CYS f 122 MET f 123 0 ++SHEET 2 AA6 2 ILE g 108 GLU g 109 -1 O ILE g 108 N MET f 123 ++SHEET 1 AA7 3 VAL g 31 TYR g 34 0 ++SHEET 2 AA7 3 SER g 41 CYS g 46 -1 O THR g 45 N LYS g 32 ++SHEET 3 AA7 3 TRP g 72 SER g 76 -1 O TRP g 72 N LEU g 44 ++SHEET 1 AA8 5 GLU m 27 GLN m 28 0 ++SHEET 2 AA8 5 VAL m 41 THR m 46 -1 O THR m 46 N GLU m 27 ++SHEET 3 AA8 5 TYR m 93 ILE m 98 -1 O LEU m 96 N LEU m 43 ++SHEET 4 AA8 5 PHE m 83 ASP m 88 -1 N GLN m 86 O SER m 95 ++SHEET 5 AA8 5 GLY m 76 ASP m 80 -1 N ASP m 80 O PHE m 83 ++SHEET 1 AA9 5 LEU m 33 PRO m 36 0 ++SHEET 2 AA9 5 THR m 126 SER m 131 1 O LEU m 129 N LEU m 33 ++SHEET 3 AA9 5 ALA m 107 SER m 114 -1 N ALA m 107 O LEU m 128 ++SHEET 4 AA9 5 TYR m 54 GLN m 60 -1 N GLN m 60 O THR m 108 ++SHEET 5 AA9 5 GLU m 67 THR m 72 -1 O GLU m 67 N ARG m 59 ++SHEET 1 AB1 4 LEU m 33 PRO m 36 0 ++SHEET 2 AB1 4 THR m 126 SER m 131 1 O LEU m 129 N LEU m 33 ++SHEET 3 AB1 4 ALA m 107 SER m 114 -1 N ALA m 107 O LEU m 128 ++SHEET 4 AB1 4 THR m 121 PHE m 122 -1 O THR m 121 N MET m 113 ++SHEET 1 AB2 4 ALA m 140 GLN m 143 0 ++SHEET 2 AB2 4 SER m 153 THR m 158 -1 O LEU m 156 N TYR m 142 ++SHEET 3 AB2 4 PHE m 189 SER m 198 -1 O ALA m 194 N PHE m 157 ++SHEET 4 AB2 4 THR m 180 MET m 184 -1 N LEU m 182 O SER m 191 ++SHEET 1 AB3 4 VAL n 23 THR n 26 0 ++SHEET 2 AB3 4 MET n 38 GLN n 44 -1 O ALA n 43 N THR n 24 ++SHEET 3 AB3 4 LEU n 95 LEU n 97 -1 O LEU n 95 N LEU n 40 ++SHEET 4 AB3 4 ASN n 84 VAL n 85 -1 N ASN n 84 O ARG n 96 ++SHEET 1 AB4 6 PHE n 29 LYS n 33 0 ++SHEET 2 AB4 6 THR n 128 THR n 133 1 O THR n 131 N LEU n 32 ++SHEET 3 AB4 6 SER n 106 CYS n 110 -1 N TYR n 108 O THR n 128 ++SHEET 4 AB4 6 MET n 51 ASP n 57 -1 N TYR n 54 O PHE n 109 ++SHEET 5 AB4 6 GLY n 61 SER n 68 -1 O ARG n 63 N ARG n 55 ++SHEET 6 AB4 6 THR n 74 GLN n 76 -1 O ASP n 75 N TYR n 67 ++SHEET 1 AB5 4 GLU n 143 PHE n 147 0 ++SHEET 2 AB5 4 LYS n 159 PHE n 169 -1 O VAL n 163 N PHE n 147 ++SHEET 3 AB5 4 TYR n 207 SER n 216 -1 O VAL n 215 N ALA n 160 ++SHEET 4 AB5 4 VAL n 189 THR n 191 -1 N SER n 190 O ARG n 212 ++SHEET 1 AB6 4 LYS n 183 GLU n 184 0 ++SHEET 2 AB6 4 LEU n 176 VAL n 180 -1 N VAL n 180 O LYS n 183 ++SHEET 3 AB6 4 HIS n 226 PHE n 233 -1 O ARG n 228 N TRP n 179 ++SHEET 4 AB6 4 GLN n 252 TRP n 259 -1 O ALA n 258 N PHE n 227 ++SHEET 1 AB7 4 LYS e 37 SER e 41 0 ++SHEET 2 AB7 4 THR e 44 THR e 48 -1 O THR e 44 N SER e 41 ++SHEET 3 AB7 4 HIS e 81 LYS e 85 -1 O LEU e 84 N VAL e 45 ++SHEET 4 AB7 4 ILE e 75 SER e 77 -1 N GLY e 76 O SER e 83 ++SSBOND 1 CYS a 32 CYS b 32 1555 1555 2.03 ++SSBOND 2 CYS d 37 CYS d 73 1555 1555 2.04 ++SSBOND 3 CYS d 93 CYS d 96 1555 1555 2.02 ++SSBOND 4 CYS f 49 CYS f 98 1555 1555 2.03 ++SSBOND 5 CYS f 119 CYS f 122 1555 1555 2.03 ++SSBOND 6 CYS g 46 CYS g 87 1555 1555 2.03 ++SSBOND 7 CYS g 104 CYS g 107 1555 1555 2.04 ++SSBOND 8 CYS m 45 CYS m 111 1555 1555 2.03 ++SSBOND 9 CYS m 155 CYS m 205 1555 1555 2.03 ++SSBOND 10 CYS m 227 CYS n 264 1555 1555 2.03 ++SSBOND 11 CYS n 42 CYS n 110 1555 1555 2.03 ++SSBOND 12 CYS n 164 CYS n 229 1555 1555 2.03 ++SSBOND 13 CYS e 49 CYS e 98 1555 1555 2.03 ++SSBOND 14 CYS e 119 CYS e 122 1555 1555 2.03 ++CISPEP 1 GLU g 67 ASP g 68 0 16.27 ++CISPEP 2 SER m 48 ASN m 49 0 0.93 ++CISPEP 4 TYR n 170 PRO n 171 0 -1.21 ++CRYST1 1.000 1.000 1.000 90.00 90.00 90.00 P 1 ++ORIGX1 1.000000 0.000000 0.000000 0.00000 ++ORIGX2 0.000000 1.000000 0.000000 0.00000 ++ORIGX3 0.000000 0.000000 1.000000 0.00000 ++SCALE1 0.003379 0.000000 0.000000 0.00000 ++SCALE2 0.000000 0.003379 0.000000 0.00000 ++SCALE3 0.000000 0.000000 0.003379 0.00000 ++ATOM 1 N GLN a 22 -0.569 19.323 28.258 1.00 36.13 N ++ATOM 2 CA GLN a 22 -0.952 18.285 27.310 1.00 36.13 C ++ATOM 3 C GLN a 22 0.263 17.614 26.722 1.00 36.13 C ++ATOM 4 O GLN a 22 1.072 18.265 26.065 1.00 36.13 O ++ATOM 5 CB GLN a 22 -1.800 18.864 26.194 1.00 36.13 C ++ATOM 6 CG GLN a 22 -2.300 17.822 25.248 1.00 36.13 C ++ATOM 7 CD GLN a 22 -3.357 18.374 24.340 1.00 36.13 C ++ATOM 8 OE1 GLN a 22 -3.560 19.583 24.282 1.00 36.13 O ++ATOM 9 NE2 GLN a 22 -4.103 17.493 23.697 1.00 36.13 N ++ATOM 10 N SER a 23 0.394 16.311 26.931 1.00 32.85 N ++ATOM 11 CA SER a 23 1.621 15.609 26.576 1.00 32.85 C ++ATOM 12 C SER a 23 1.329 14.447 25.644 1.00 32.85 C ++ATOM 13 O SER a 23 0.982 13.353 26.093 1.00 32.85 O ++ATOM 14 CB SER a 23 2.337 15.113 27.808 1.00 32.85 C ++ATOM 15 OG SER a 23 3.497 14.427 27.400 1.00 32.85 O ++ATOM 16 N PHE a 24 1.506 14.673 24.348 1.00 34.25 N ++ATOM 17 CA PHE a 24 1.467 13.572 23.402 1.00 34.25 C ++ATOM 18 C PHE a 24 2.793 12.828 23.371 1.00 34.25 C ++ATOM 19 O PHE a 24 2.829 11.601 23.467 1.00 34.25 O ++ATOM 20 CB PHE a 24 1.134 14.089 22.011 1.00 34.25 C ++ATOM 21 CG PHE a 24 -0.263 14.578 21.865 1.00 34.25 C ++ATOM 22 CD1 PHE a 24 -1.308 13.682 21.786 1.00 34.25 C ++ATOM 23 CD2 PHE a 24 -0.534 15.929 21.751 1.00 34.25 C ++ATOM 24 CE1 PHE a 24 -2.603 14.115 21.634 1.00 34.25 C ++ATOM 25 CE2 PHE a 24 -1.829 16.371 21.592 1.00 34.25 C ++ATOM 26 CZ PHE a 24 -2.864 15.459 21.529 1.00 34.25 C ++ATOM 27 N GLY a 25 3.891 13.549 23.239 1.00 34.64 N ++ATOM 28 CA GLY a 25 5.159 12.890 23.004 1.00 34.64 C ++ATOM 29 C GLY a 25 5.205 12.411 21.582 1.00 34.64 C ++ATOM 30 O GLY a 25 4.839 13.141 20.666 1.00 34.64 O ++ATOM 31 N LEU a 26 5.586 11.149 21.386 1.00 34.56 N ++ATOM 32 CA LEU a 26 5.747 10.578 20.047 1.00 34.56 C ++ATOM 33 C LEU a 26 4.401 10.051 19.537 1.00 34.56 C ++ATOM 34 O LEU a 26 4.203 8.878 19.230 1.00 34.56 O ++ATOM 35 CB LEU a 26 6.817 9.495 20.080 1.00 34.56 C ++ATOM 36 CG LEU a 26 7.385 9.034 18.749 1.00 34.56 C ++ATOM 37 CD1 LEU a 26 7.954 10.230 18.051 1.00 34.56 C ++ATOM 38 CD2 LEU a 26 8.462 8.027 18.978 1.00 34.56 C ++ATOM 39 N LEU a 27 3.443 10.961 19.514 1.00 37.53 N ++ATOM 40 CA LEU a 27 2.052 10.587 19.381 1.00 37.53 C ++ATOM 41 C LEU a 27 1.261 11.609 18.578 1.00 37.53 C ++ATOM 42 O LEU a 27 0.048 11.446 18.431 1.00 37.53 O ++ATOM 43 CB LEU a 27 1.491 10.409 20.794 1.00 37.53 C ++ATOM 44 CG LEU a 27 0.395 9.470 21.264 1.00 37.53 C ++ATOM 45 CD1 LEU a 27 -0.987 10.014 21.084 1.00 37.53 C ++ATOM 46 CD2 LEU a 27 0.603 8.173 20.543 1.00 37.53 C ++ATOM 47 N ASP a 28 1.922 12.634 18.035 1.00 48.23 N ++ATOM 48 CA ASP a 28 1.273 13.796 17.444 1.00 48.23 C ++ATOM 49 C ASP a 28 0.434 13.412 16.228 1.00 48.23 C ++ATOM 50 O ASP a 28 0.677 12.380 15.597 1.00 48.23 O ++ATOM 51 CB ASP a 28 2.327 14.813 17.015 1.00 48.23 C ++ATOM 52 CG ASP a 28 3.027 15.452 18.181 1.00 48.23 C ++ATOM 53 OD1 ASP a 28 2.390 15.614 19.237 1.00 48.23 O ++ATOM 54 OD2 ASP a 28 4.220 15.786 18.046 1.00 48.23 O ++ATOM 55 N PRO a 29 -0.566 14.224 15.874 1.00 57.69 N ++ATOM 56 CA PRO a 29 -1.196 14.078 14.552 1.00 57.69 C ++ATOM 57 C PRO a 29 -0.338 14.609 13.411 1.00 57.69 C ++ATOM 58 O PRO a 29 -0.720 14.459 12.239 1.00 57.69 O ++ATOM 59 CB PRO a 29 -2.497 14.874 14.696 1.00 57.69 C ++ATOM 60 CG PRO a 29 -2.218 15.851 15.780 1.00 57.69 C ++ATOM 61 CD PRO a 29 -1.291 15.174 16.733 1.00 57.69 C ++ATOM 62 N LYS a 30 0.819 15.199 13.718 1.00 55.46 N ++ATOM 63 CA LYS a 30 1.743 15.645 12.688 1.00 55.46 C ++ATOM 64 C LYS a 30 2.287 14.483 11.870 1.00 55.46 C ++ATOM 65 O LYS a 30 2.585 14.656 10.690 1.00 55.46 O ++ATOM 66 CB LYS a 30 2.888 16.420 13.328 1.00 55.46 C ++ATOM 67 CG LYS a 30 2.452 17.706 14.000 1.00 55.46 C ++ATOM 68 CD LYS a 30 3.624 18.420 14.645 1.00 55.46 C ++ATOM 69 CE LYS a 30 3.163 19.666 15.373 1.00 55.46 C ++ATOM 70 NZ LYS a 30 4.299 20.367 16.022 1.00 55.46 N ++ATOM 71 N LEU a 31 2.343 13.278 12.438 1.00 51.53 N ++ATOM 72 CA LEU a 31 2.951 12.164 11.718 1.00 51.53 C ++ATOM 73 C LEU a 31 1.975 11.530 10.727 1.00 51.53 C ++ATOM 74 O LEU a 31 2.334 11.273 9.561 1.00 51.53 O ++ATOM 75 CB LEU a 31 3.471 11.148 12.727 1.00 51.53 C ++ATOM 76 CG LEU a 31 4.476 11.811 13.672 1.00 51.53 C ++ATOM 77 CD1 LEU a 31 4.957 10.844 14.724 1.00 51.53 C ++ATOM 78 CD2 LEU a 31 5.644 12.401 12.912 1.00 51.53 C ++ATOM 79 N CYS a 32 0.729 11.290 11.158 1.00 60.98 N ++ATOM 80 CA CYS a 32 -0.287 10.818 10.222 1.00 60.98 C ++ATOM 81 C CYS a 32 -0.566 11.875 9.163 1.00 60.98 C ++ATOM 82 O CYS a 32 -0.829 11.545 7.999 1.00 60.98 O ++ATOM 83 CB CYS a 32 -1.582 10.458 10.950 1.00 60.98 C ++ATOM 84 SG CYS a 32 -2.454 11.919 11.500 1.00 60.98 S ++ATOM 85 N TYR a 33 -0.451 13.153 9.527 1.00 58.12 N ++ATOM 86 CA TYR a 33 -0.631 14.170 8.504 1.00 58.12 C ++ATOM 87 C TYR a 33 0.600 14.347 7.627 1.00 58.12 C ++ATOM 88 O TYR a 33 0.457 14.830 6.504 1.00 58.12 O ++ATOM 89 CB TYR a 33 -1.064 15.485 9.147 1.00 58.12 C ++ATOM 90 CG TYR a 33 -2.475 15.405 9.687 1.00 58.12 C ++ATOM 91 CD1 TYR a 33 -3.371 14.456 9.205 1.00 58.12 C ++ATOM 92 CD2 TYR a 33 -2.900 16.246 10.702 1.00 58.12 C ++ATOM 93 CE1 TYR a 33 -4.647 14.360 9.702 1.00 58.12 C ++ATOM 94 CE2 TYR a 33 -4.180 16.156 11.208 1.00 58.12 C ++ATOM 95 CZ TYR a 33 -5.046 15.210 10.703 1.00 58.12 C ++ATOM 96 OH TYR a 33 -6.323 15.116 11.200 1.00 58.12 O ++ATOM 97 N LEU a 34 1.784 13.901 8.065 1.00 55.16 N ++ATOM 98 CA LEU a 34 2.898 13.766 7.130 1.00 55.16 C ++ATOM 99 C LEU a 34 2.610 12.716 6.075 1.00 55.16 C ++ATOM 100 O LEU a 34 2.842 12.951 4.884 1.00 55.16 O ++ATOM 101 CB LEU a 34 4.199 13.408 7.839 1.00 55.16 C ++ATOM 102 CG LEU a 34 5.021 14.488 8.515 1.00 55.16 C ++ATOM 103 CD1 LEU a 34 6.199 13.839 9.198 1.00 55.16 C ++ATOM 104 CD2 LEU a 34 5.480 15.492 7.482 1.00 55.16 C ++ATOM 105 N LEU a 35 2.123 11.548 6.493 1.00 55.98 N ++ATOM 106 CA LEU a 35 1.842 10.495 5.515 1.00 55.98 C ++ATOM 107 C LEU a 35 0.705 10.893 4.572 1.00 55.98 C ++ATOM 108 O LEU a 35 0.761 10.629 3.357 1.00 55.98 O ++ATOM 109 CB LEU a 35 1.539 9.190 6.239 1.00 55.98 C ++ATOM 110 CG LEU a 35 2.796 8.653 6.920 1.00 55.98 C ++ATOM 111 CD1 LEU a 35 2.466 7.541 7.878 1.00 55.98 C ++ATOM 112 CD2 LEU a 35 3.763 8.156 5.870 1.00 55.98 C ++ATOM 113 N ASP a 36 -0.298 11.595 5.098 1.00 62.93 N ++ATOM 114 CA ASP a 36 -1.365 12.083 4.236 1.00 62.93 C ++ATOM 115 C ASP a 36 -0.891 13.215 3.335 1.00 62.93 C ++ATOM 116 O ASP a 36 -1.392 13.358 2.218 1.00 62.93 O ++ATOM 117 CB ASP a 36 -2.552 12.520 5.082 1.00 62.93 C ++ATOM 118 CG ASP a 36 -3.187 11.365 5.817 1.00 62.93 C ++ATOM 119 OD1 ASP a 36 -3.096 10.226 5.316 1.00 62.93 O ++ATOM 120 OD2 ASP a 36 -3.768 11.588 6.898 1.00 62.93 O ++ATOM 121 N GLY a 37 0.096 14.000 3.773 1.00 64.48 N ++ATOM 122 CA GLY a 37 0.693 14.981 2.886 1.00 64.48 C ++ATOM 123 C GLY a 37 1.509 14.353 1.778 1.00 64.48 C ++ATOM 124 O GLY a 37 1.599 14.910 0.685 1.00 64.48 O ++ATOM 125 N ILE a 38 2.104 13.190 2.043 1.00 68.49 N ++ATOM 126 CA ILE a 38 2.796 12.435 0.994 1.00 68.49 C ++ATOM 127 C ILE a 38 1.809 11.971 -0.069 1.00 68.49 C ++ATOM 128 O ILE a 38 2.045 12.128 -1.280 1.00 68.49 O ++ATOM 129 CB ILE a 38 3.550 11.249 1.615 1.00 68.49 C ++ATOM 130 CG1 ILE a 38 4.668 11.764 2.511 1.00 68.49 C ++ATOM 131 CG2 ILE a 38 4.088 10.315 0.537 1.00 68.49 C ++ATOM 132 CD1 ILE a 38 5.013 10.798 3.593 1.00 68.49 C ++ATOM 133 N LEU a 39 0.681 11.399 0.374 1.00 69.74 N ++ATOM 134 CA LEU a 39 -0.385 11.048 -0.569 1.00 69.74 C ++ATOM 135 C LEU a 39 -0.940 12.266 -1.303 1.00 69.74 C ++ATOM 136 O LEU a 39 -1.259 12.177 -2.495 1.00 69.74 O ++ATOM 137 CB LEU a 39 -1.514 10.315 0.146 1.00 69.74 C ++ATOM 138 CG LEU a 39 -1.230 8.853 0.453 1.00 69.74 C ++ATOM 139 CD1 LEU a 39 -2.324 8.291 1.323 1.00 69.74 C ++ATOM 140 CD2 LEU a 39 -1.157 8.103 -0.858 1.00 69.74 C ++ATOM 141 N PHE a 40 -1.017 13.415 -0.628 1.00 69.06 N ++ATOM 142 CA PHE a 40 -1.518 14.623 -1.274 1.00 69.06 C ++ATOM 143 C PHE a 40 -0.552 15.137 -2.329 1.00 69.06 C ++ATOM 144 O PHE a 40 -0.984 15.578 -3.395 1.00 69.06 O ++ATOM 145 CB PHE a 40 -1.790 15.708 -0.235 1.00 69.06 C ++ATOM 146 CG PHE a 40 -2.347 16.971 -0.819 1.00 69.06 C ++ATOM 147 CD1 PHE a 40 -3.669 17.031 -1.227 1.00 69.06 C ++ATOM 148 CD2 PHE a 40 -1.549 18.094 -0.968 1.00 69.06 C ++ATOM 149 CE1 PHE a 40 -4.188 18.186 -1.770 1.00 69.06 C ++ATOM 150 CE2 PHE a 40 -2.062 19.253 -1.510 1.00 69.06 C ++ATOM 151 CZ PHE a 40 -3.384 19.297 -1.913 1.00 69.06 C ++ATOM 152 N ILE a 41 0.752 15.090 -2.053 1.00 71.98 N ++ATOM 153 CA ILE a 41 1.739 15.566 -3.018 1.00 71.98 C ++ATOM 154 C ILE a 41 1.783 14.651 -4.237 1.00 71.98 C ++ATOM 155 O ILE a 41 1.866 15.121 -5.383 1.00 71.98 O ++ATOM 156 CB ILE a 41 3.113 15.717 -2.334 1.00 71.98 C ++ATOM 157 CG1 ILE a 41 3.090 16.920 -1.390 1.00 71.98 C ++ATOM 158 CG2 ILE a 41 4.244 15.866 -3.336 1.00 71.98 C ++ATOM 159 CD1 ILE a 41 4.305 17.036 -0.508 1.00 71.98 C ++ATOM 160 N TYR a 42 1.649 13.338 -4.020 1.00 76.32 N ++ATOM 161 CA TYR a 42 1.570 12.404 -5.145 1.00 76.32 C ++ATOM 162 C TYR a 42 0.305 12.625 -5.977 1.00 76.32 C ++ATOM 163 O TYR a 42 0.348 12.579 -7.218 1.00 76.32 O ++ATOM 164 CB TYR a 42 1.636 10.976 -4.615 1.00 76.32 C ++ATOM 165 CG TYR a 42 1.570 9.904 -5.669 1.00 76.32 C ++ATOM 166 CD1 TYR a 42 2.669 9.616 -6.467 1.00 76.32 C ++ATOM 167 CD2 TYR a 42 0.410 9.161 -5.847 1.00 76.32 C ++ATOM 168 CE1 TYR a 42 2.611 8.622 -7.427 1.00 76.32 C ++ATOM 169 CE2 TYR a 42 0.340 8.167 -6.795 1.00 76.32 C ++ATOM 170 CZ TYR a 42 1.441 7.902 -7.587 1.00 76.32 C ++ATOM 171 OH TYR a 42 1.370 6.910 -8.539 1.00 76.32 O ++ATOM 172 N GLY a 43 -0.822 12.898 -5.310 1.00 73.84 N ++ATOM 173 CA GLY a 43 -2.045 13.212 -6.032 1.00 73.84 C ++ATOM 174 C GLY a 43 -1.960 14.511 -6.813 1.00 73.84 C ++ATOM 175 O GLY a 43 -2.476 14.604 -7.930 1.00 73.84 O ++ATOM 176 N VAL a 44 -1.298 15.522 -6.242 1.00 71.43 N ++ATOM 177 CA VAL a 44 -1.095 16.794 -6.933 1.00 71.43 C ++ATOM 178 C VAL a 44 -0.234 16.601 -8.175 1.00 71.43 C ++ATOM 179 O VAL a 44 -0.537 17.153 -9.242 1.00 71.43 O ++ATOM 180 CB VAL a 44 -0.496 17.834 -5.965 1.00 71.43 C ++ATOM 181 CG1 VAL a 44 0.060 19.036 -6.705 1.00 71.43 C ++ATOM 182 CG2 VAL a 44 -1.568 18.328 -5.019 1.00 71.43 C ++ATOM 183 N ILE a 45 0.811 15.772 -8.073 1.00 73.55 N ++ATOM 184 CA ILE a 45 1.681 15.516 -9.220 1.00 73.55 C ++ATOM 185 C ILE a 45 0.927 14.797 -10.337 1.00 73.55 C ++ATOM 186 O ILE a 45 1.023 15.183 -11.513 1.00 73.55 O ++ATOM 187 CB ILE a 45 2.939 14.742 -8.778 1.00 73.55 C ++ATOM 188 CG1 ILE a 45 3.843 15.643 -7.935 1.00 73.55 C ++ATOM 189 CG2 ILE a 45 3.717 14.209 -9.971 1.00 73.55 C ++ATOM 190 CD1 ILE a 45 5.001 14.918 -7.288 1.00 73.55 C ++ATOM 191 N LEU a 46 0.118 13.787 -9.993 1.00 74.46 N ++ATOM 192 CA LEU a 46 -0.592 13.075 -11.056 1.00 74.46 C ++ATOM 193 C LEU a 46 -1.727 13.905 -11.652 1.00 74.46 C ++ATOM 194 O LEU a 46 -1.971 13.828 -12.861 1.00 74.46 O ++ATOM 195 CB LEU a 46 -1.121 11.728 -10.577 1.00 74.46 C ++ATOM 196 CG LEU a 46 -0.097 10.623 -10.329 1.00 74.46 C ++ATOM 197 CD1 LEU a 46 -0.816 9.329 -9.980 1.00 74.46 C ++ATOM 198 CD2 LEU a 46 0.825 10.438 -11.525 1.00 74.46 C ++ATOM 199 N THR a 47 -2.418 14.719 -10.842 1.00 74.44 N ++ATOM 200 CA THR a 47 -3.443 15.603 -11.400 1.00 74.44 C ++ATOM 201 C THR a 47 -2.832 16.675 -12.291 1.00 74.44 C ++ATOM 202 O THR a 47 -3.404 17.023 -13.331 1.00 74.44 O ++ATOM 203 CB THR a 47 -4.266 16.263 -10.293 1.00 74.44 C ++ATOM 204 OG1 THR a 47 -3.392 16.875 -9.338 1.00 74.44 O ++ATOM 205 CG2 THR a 47 -5.197 15.273 -9.614 1.00 74.44 C ++ATOM 206 N ALA a 48 -1.660 17.192 -11.915 1.00 73.59 N ++ATOM 207 CA ALA a 48 -0.996 18.200 -12.731 1.00 73.59 C ++ATOM 208 C ALA a 48 -0.534 17.614 -14.058 1.00 73.59 C ++ATOM 209 O ALA a 48 -0.689 18.244 -15.111 1.00 73.59 O ++ATOM 210 CB ALA a 48 0.180 18.802 -11.962 1.00 73.59 C ++ATOM 211 N LEU a 49 -0.004 16.388 -14.038 1.00 74.21 N ++ATOM 212 CA LEU a 49 0.431 15.790 -15.296 1.00 74.21 C ++ATOM 213 C LEU a 49 -0.757 15.354 -16.150 1.00 74.21 C ++ATOM 214 O LEU a 49 -0.676 15.384 -17.382 1.00 74.21 O ++ATOM 215 CB LEU a 49 1.385 14.629 -15.030 1.00 74.21 C ++ATOM 216 CG LEU a 49 2.736 15.078 -14.464 1.00 74.21 C ++ATOM 217 CD1 LEU a 49 3.628 13.887 -14.174 1.00 74.21 C ++ATOM 218 CD2 LEU a 49 3.427 16.045 -15.408 1.00 74.21 C ++ATOM 219 N PHE a 50 -1.882 15.000 -15.521 1.00 76.67 N ++ATOM 220 CA PHE a 50 -3.103 14.713 -16.274 1.00 76.67 C ++ATOM 221 C PHE a 50 -3.632 15.964 -16.966 1.00 76.67 C ++ATOM 222 O PHE a 50 -4.059 15.919 -18.126 1.00 76.67 O ++ATOM 223 CB PHE a 50 -4.162 14.131 -15.340 1.00 76.67 C ++ATOM 224 CG PHE a 50 -5.472 13.840 -16.009 1.00 76.67 C ++ATOM 225 CD1 PHE a 50 -5.612 12.737 -16.833 1.00 76.67 C ++ATOM 226 CD2 PHE a 50 -6.569 14.664 -15.800 1.00 76.67 C ++ATOM 227 CE1 PHE a 50 -6.821 12.464 -17.447 1.00 76.67 C ++ATOM 228 CE2 PHE a 50 -7.780 14.400 -16.410 1.00 76.67 C ++ATOM 229 CZ PHE a 50 -7.907 13.297 -17.233 1.00 76.67 C ++ATOM 230 N LEU a 51 -3.598 17.100 -16.267 1.00 73.10 N ++ATOM 231 CA LEU a 51 -4.038 18.341 -16.891 1.00 73.10 C ++ATOM 232 C LEU a 51 -3.059 18.805 -17.964 1.00 73.10 C ++ATOM 233 O LEU a 51 -3.479 19.411 -18.951 1.00 73.10 O ++ATOM 234 CB LEU a 51 -4.248 19.427 -15.835 1.00 73.10 C ++ATOM 235 CG LEU a 51 -5.416 19.173 -14.871 1.00 73.10 C ++ATOM 236 CD1 LEU a 51 -5.497 20.245 -13.796 1.00 73.10 C ++ATOM 237 CD2 LEU a 51 -6.736 19.052 -15.615 1.00 73.10 C ++ATOM 238 N ARG a 52 -1.766 18.493 -17.821 1.00 73.96 N ++ATOM 239 CA ARG a 52 -0.827 18.804 -18.901 1.00 73.96 C ++ATOM 240 C ARG a 52 -1.025 17.891 -20.111 1.00 73.96 C ++ATOM 241 O ARG a 52 -0.784 18.314 -21.250 1.00 73.96 O ++ATOM 242 CB ARG a 52 0.617 18.730 -18.402 1.00 73.96 C ++ATOM 243 CG ARG a 52 1.009 19.862 -17.459 1.00 73.96 C ++ATOM 244 CD ARG a 52 2.480 19.780 -17.066 1.00 73.96 C ++ATOM 245 NE ARG a 52 2.860 20.823 -16.117 1.00 73.96 N ++ATOM 246 CZ ARG a 52 4.079 20.964 -15.599 1.00 73.96 C ++ATOM 247 NH1 ARG a 52 5.052 20.133 -15.945 1.00 73.96 N ++ATOM 248 NH2 ARG a 52 4.327 21.941 -14.741 1.00 73.96 N ++ATOM 249 N VAL a 53 -1.461 16.647 -19.890 1.00 73.52 N ++ATOM 250 CA VAL a 53 -1.908 15.802 -20.996 1.00 73.52 C ++ATOM 251 C VAL a 53 -3.133 16.407 -21.675 1.00 73.52 C ++ATOM 252 O VAL a 53 -3.240 16.399 -22.910 1.00 73.52 O ++ATOM 253 CB VAL a 53 -2.170 14.366 -20.490 1.00 73.52 C ++ATOM 254 CG1 VAL a 53 -2.901 13.527 -21.525 1.00 73.52 C ++ATOM 255 CG2 VAL a 53 -0.856 13.689 -20.151 1.00 73.52 C ++ATOM 256 N LYS a 54 -4.048 16.978 -20.887 1.00 76.52 N ++ATOM 257 CA LYS a 54 -5.225 17.636 -21.454 1.00 76.52 C ++ATOM 258 C LYS a 54 -4.845 18.887 -22.249 1.00 76.52 C ++ATOM 259 O LYS a 54 -5.476 19.197 -23.267 1.00 76.52 O ++ATOM 260 CB LYS a 54 -6.209 17.984 -20.336 1.00 76.52 C ++ATOM 261 CG LYS a 54 -7.552 18.502 -20.812 1.00 76.52 C ++ATOM 262 CD LYS a 54 -8.301 17.419 -21.567 1.00 76.52 C ++ATOM 263 CE LYS a 54 -8.743 16.307 -20.630 1.00 76.52 C ++ATOM 264 NZ LYS a 54 -9.536 15.259 -21.326 1.00 76.52 N ++ATOM 265 N PHE a 55 -3.816 19.616 -21.800 1.00 77.25 N ++ATOM 266 CA PHE a 55 -3.254 20.704 -22.605 1.00 77.25 C ++ATOM 267 C PHE a 55 -2.592 20.190 -23.878 1.00 77.25 C ++ATOM 268 O PHE a 55 -2.593 20.888 -24.899 1.00 77.25 O ++ATOM 269 CB PHE a 55 -2.218 21.517 -21.819 1.00 77.25 C ++ATOM 270 CG PHE a 55 -2.800 22.548 -20.896 1.00 77.25 C ++ATOM 271 CD1 PHE a 55 -3.317 23.730 -21.404 1.00 77.25 C ++ATOM 272 CD2 PHE a 55 -2.764 22.376 -19.526 1.00 77.25 C ++ATOM 273 CE1 PHE a 55 -3.837 24.693 -20.559 1.00 77.25 C ++ATOM 274 CE2 PHE a 55 -3.285 23.328 -18.673 1.00 77.25 C ++ATOM 275 CZ PHE a 55 -3.819 24.492 -19.190 1.00 77.25 C ++ATOM 276 N SER a 56 -2.011 18.986 -23.836 1.00 74.44 N ++ATOM 277 CA SER a 56 -1.184 18.512 -24.941 1.00 74.44 C ++ATOM 278 C SER a 56 -1.984 18.136 -26.183 1.00 74.44 C ++ATOM 279 O SER a 56 -1.404 18.048 -27.270 1.00 74.44 O ++ATOM 280 CB SER a 56 -0.358 17.309 -24.493 1.00 74.44 C ++ATOM 281 OG SER a 56 -1.195 16.197 -24.238 1.00 74.44 O ++ATOM 282 N ARG a 57 -3.288 17.912 -26.056 1.00 72.03 N ++ATOM 283 CA ARG a 57 -4.107 17.532 -27.206 1.00 72.03 C ++ATOM 284 C ARG a 57 -5.526 18.083 -27.094 1.00 72.03 C ++ATOM 285 O ARG a 57 -5.894 19.029 -27.790 1.00 72.03 O ++ATOM 286 CB ARG a 57 -4.148 16.011 -27.351 1.00 72.03 C ++ATOM 288 N PHE b 24 -8.231 20.775 16.780 1.00 90.23 N ++ATOM 289 CA PHE b 24 -7.033 20.154 16.231 1.00 90.23 C ++ATOM 290 C PHE b 24 -6.791 18.795 16.886 1.00 90.23 C ++ATOM 291 O PHE b 24 -6.064 17.959 16.355 1.00 90.23 O ++ATOM 292 CB PHE b 24 -5.823 21.079 16.420 1.00 90.23 C ++ATOM 293 CG PHE b 24 -4.552 20.569 15.783 1.00 90.23 C ++ATOM 294 CD1 PHE b 24 -4.377 20.619 14.407 1.00 90.23 C ++ATOM 295 CD2 PHE b 24 -3.531 20.045 16.565 1.00 90.23 C ++ATOM 296 CE1 PHE b 24 -3.211 20.150 13.822 1.00 90.23 C ++ATOM 297 CE2 PHE b 24 -2.363 19.578 15.987 1.00 90.23 C ++ATOM 298 CZ PHE b 24 -2.204 19.630 14.616 1.00 90.23 C ++ATOM 299 N GLY b 25 -7.415 18.577 18.044 1.00 82.72 N ++ATOM 300 CA GLY b 25 -7.184 17.339 18.771 1.00 82.72 C ++ATOM 301 C GLY b 25 -8.463 16.621 19.163 1.00 82.72 C ++ATOM 302 O GLY b 25 -8.496 15.914 20.173 1.00 82.72 O ++ATOM 303 N LEU b 26 -9.538 16.818 18.395 1.00 87.30 N ++ATOM 304 CA LEU b 26 -10.895 16.341 18.734 1.00 87.30 C ++ATOM 305 C LEU b 26 -10.933 14.809 18.710 1.00 87.30 C ++ATOM 306 O LEU b 26 -11.080 14.192 19.774 1.00 87.30 O ++ATOM 307 CB LEU b 26 -11.898 17.035 17.817 1.00 87.30 C ++ATOM 308 CG LEU b 26 -12.498 18.390 18.226 1.00 87.30 C ++ATOM 309 CD1 LEU b 26 -13.252 18.254 19.540 1.00 87.30 C ++ATOM 310 CD2 LEU b 26 -11.490 19.529 18.295 1.00 87.30 C ++ATOM 311 N LEU b 27 -10.833 14.159 17.549 1.00 79.83 N ++ATOM 312 CA LEU b 27 -10.799 12.699 17.468 1.00 79.83 C ++ATOM 313 C LEU b 27 -9.810 12.185 16.432 1.00 79.83 C ++ATOM 314 O LEU b 27 -10.131 11.239 15.708 1.00 79.83 O ++ATOM 315 CB LEU b 27 -12.217 12.150 17.229 1.00 79.83 C ++ATOM 316 CG LEU b 27 -13.220 12.656 16.179 1.00 79.83 C ++ATOM 317 CD1 LEU b 27 -13.149 11.976 14.823 1.00 79.83 C ++ATOM 318 CD2 LEU b 27 -14.633 12.530 16.740 1.00 79.83 C ++ATOM 319 N ASP b 28 -8.601 12.746 16.407 1.00 77.87 N ++ATOM 320 CA ASP b 28 -7.576 12.748 15.362 1.00 77.87 C ++ATOM 321 C ASP b 28 -7.348 11.492 14.506 1.00 77.87 C ++ATOM 322 O ASP b 28 -7.215 11.663 13.283 1.00 77.87 O ++ATOM 323 CB ASP b 28 -6.246 13.165 15.996 1.00 77.87 C ++ATOM 324 CG ASP b 28 -6.309 14.544 16.594 1.00 77.87 C ++ATOM 325 OD1 ASP b 28 -7.158 15.338 16.140 1.00 77.87 O ++ATOM 326 OD2 ASP b 28 -5.512 14.831 17.509 1.00 77.87 O ++ATOM 327 N PRO b 29 -7.262 10.254 15.047 1.00 71.51 N ++ATOM 328 CA PRO b 29 -6.944 9.114 14.162 1.00 71.51 C ++ATOM 329 C PRO b 29 -7.986 8.837 13.093 1.00 71.51 C ++ATOM 330 O PRO b 29 -7.614 8.479 11.967 1.00 71.51 O ++ATOM 331 CB PRO b 29 -6.834 7.932 15.134 1.00 71.51 C ++ATOM 332 CG PRO b 29 -6.542 8.518 16.405 1.00 71.51 C ++ATOM 333 CD PRO b 29 -7.297 9.787 16.449 1.00 71.51 C ++ATOM 334 N LYS b 30 -9.269 9.033 13.406 1.00 73.20 N ++ATOM 335 CA LYS b 30 -10.315 8.873 12.405 1.00 73.20 C ++ATOM 336 C LYS b 30 -10.168 9.890 11.279 1.00 73.20 C ++ATOM 337 O LYS b 30 -10.395 9.558 10.112 1.00 73.20 O ++ATOM 338 CB LYS b 30 -11.685 8.982 13.068 1.00 73.20 C ++ATOM 339 CG LYS b 30 -11.969 7.884 14.082 1.00 73.20 C ++ATOM 340 CD LYS b 30 -12.068 6.525 13.406 1.00 73.20 C ++ATOM 341 CE LYS b 30 -13.355 6.412 12.590 1.00 73.20 C ++ATOM 342 NZ LYS b 30 -13.537 5.069 11.965 1.00 73.20 N ++ATOM 343 N LEU b 31 -9.726 11.111 11.597 1.00 66.59 N ++ATOM 344 CA LEU b 31 -9.490 12.101 10.549 1.00 66.59 C ++ATOM 345 C LEU b 31 -8.285 11.740 9.689 1.00 66.59 C ++ATOM 346 O LEU b 31 -8.344 11.879 8.457 1.00 66.59 O ++ATOM 347 CB LEU b 31 -9.319 13.493 11.149 1.00 66.59 C ++ATOM 348 CG LEU b 31 -10.550 14.401 11.156 1.00 66.59 C ++ATOM 349 CD1 LEU b 31 -10.919 14.740 9.724 1.00 66.59 C ++ATOM 350 CD2 LEU b 31 -11.730 13.783 11.875 1.00 66.59 C ++ATOM 351 N CYS b 32 -7.201 11.254 10.317 1.00 68.80 N ++ATOM 352 CA CYS b 32 -6.023 10.814 9.563 1.00 68.80 C ++ATOM 353 C CYS b 32 -6.384 9.694 8.597 1.00 68.80 C ++ATOM 354 O CYS b 32 -6.004 9.713 7.420 1.00 68.80 O ++ATOM 355 CB CYS b 32 -4.923 10.323 10.510 1.00 68.80 C ++ATOM 356 SG CYS b 32 -4.406 11.452 11.808 1.00 68.80 S ++ATOM 357 N TYR b 33 -7.193 8.751 9.059 1.00 63.23 N ++ATOM 358 CA TYR b 33 -7.448 7.559 8.267 1.00 63.23 C ++ATOM 359 C TYR b 33 -8.534 7.782 7.225 1.00 63.23 C ++ATOM 360 O TYR b 33 -8.469 7.188 6.145 1.00 63.23 O ++ATOM 361 CB TYR b 33 -7.820 6.395 9.190 1.00 63.23 C ++ATOM 362 CG TYR b 33 -6.734 6.045 10.191 1.00 63.23 C ++ATOM 363 CD1 TYR b 33 -5.396 6.361 9.954 1.00 63.23 C ++ATOM 364 CD2 TYR b 33 -7.055 5.452 11.401 1.00 63.23 C ++ATOM 365 CE1 TYR b 33 -4.423 6.079 10.875 1.00 63.23 C ++ATOM 366 CE2 TYR b 33 -6.083 5.175 12.329 1.00 63.23 C ++ATOM 367 CZ TYR b 33 -4.766 5.480 12.058 1.00 63.23 C ++ATOM 368 OH TYR b 33 -3.781 5.201 12.971 1.00 63.23 O ++ATOM 369 N LEU b 34 -9.498 8.666 7.492 1.00 59.25 N ++ATOM 370 CA LEU b 34 -10.434 9.054 6.445 1.00 59.25 C ++ATOM 371 C LEU b 34 -9.759 9.903 5.381 1.00 59.25 C ++ATOM 372 O LEU b 34 -10.171 9.873 4.215 1.00 59.25 O ++ATOM 373 CB LEU b 34 -11.626 9.799 7.043 1.00 59.25 C ++ATOM 374 CG LEU b 34 -12.884 9.002 7.409 1.00 59.25 C ++ATOM 375 CD1 LEU b 34 -13.528 8.458 6.147 1.00 59.25 C ++ATOM 376 CD2 LEU b 34 -12.626 7.867 8.394 1.00 59.25 C ++ATOM 377 N LEU b 35 -8.713 10.651 5.744 1.00 59.61 N ++ATOM 378 CA LEU b 35 -7.989 11.390 4.719 1.00 59.61 C ++ATOM 379 C LEU b 35 -7.105 10.447 3.901 1.00 59.61 C ++ATOM 380 O LEU b 35 -6.930 10.648 2.689 1.00 59.61 O ++ATOM 381 CB LEU b 35 -7.188 12.508 5.385 1.00 59.61 C ++ATOM 382 CG LEU b 35 -6.887 13.800 4.625 1.00 59.61 C ++ATOM 383 CD1 LEU b 35 -5.760 13.664 3.644 1.00 59.61 C ++ATOM 384 CD2 LEU b 35 -8.152 14.284 3.925 1.00 59.61 C ++ATOM 385 N ASP b 36 -6.578 9.398 4.545 1.00 59.99 N ++ATOM 386 CA ASP b 36 -5.959 8.289 3.822 1.00 59.99 C ++ATOM 387 C ASP b 36 -6.938 7.662 2.832 1.00 59.99 C ++ATOM 388 O ASP b 36 -6.584 7.410 1.672 1.00 59.99 O ++ATOM 389 CB ASP b 36 -5.464 7.244 4.827 1.00 59.99 C ++ATOM 390 CG ASP b 36 -4.564 6.176 4.205 1.00 59.99 C ++ATOM 391 OD1 ASP b 36 -4.277 6.211 2.992 1.00 59.99 O ++ATOM 392 OD2 ASP b 36 -4.134 5.277 4.959 1.00 59.99 O ++ATOM 393 N GLY b 37 -8.174 7.427 3.270 1.00 61.73 N ++ATOM 394 CA GLY b 37 -9.226 6.875 2.437 1.00 61.73 C ++ATOM 395 C GLY b 37 -9.572 7.716 1.226 1.00 61.73 C ++ATOM 396 O GLY b 37 -9.427 7.248 0.084 1.00 61.73 O ++ATOM 397 N ILE b 38 -10.041 8.951 1.442 1.00 63.64 N ++ATOM 398 CA ILE b 38 -10.204 9.824 0.288 1.00 63.64 C ++ATOM 399 C ILE b 38 -8.927 10.645 0.140 1.00 63.64 C ++ATOM 400 O ILE b 38 -8.930 11.874 0.268 1.00 63.64 O ++ATOM 401 CB ILE b 38 -11.441 10.738 0.422 1.00 63.64 C ++ATOM 402 CG1 ILE b 38 -12.668 9.972 0.922 1.00 63.64 C ++ATOM 403 CG2 ILE b 38 -11.840 11.306 -0.934 1.00 63.64 C ++ATOM 404 CD1 ILE b 38 -12.972 10.157 2.407 1.00 63.64 C ++ATOM 405 N LEU b 39 -7.819 9.949 -0.083 1.00 63.44 N ++ATOM 406 CA LEU b 39 -6.834 10.247 -1.113 1.00 63.44 C ++ATOM 407 C LEU b 39 -6.388 9.000 -1.850 1.00 63.44 C ++ATOM 408 O LEU b 39 -5.953 9.109 -3.001 1.00 63.44 O ++ATOM 409 CB LEU b 39 -5.596 10.946 -0.548 1.00 63.44 C ++ATOM 410 CG LEU b 39 -5.699 12.400 -0.106 1.00 63.44 C ++ATOM 411 CD1 LEU b 39 -4.339 12.859 0.350 1.00 63.44 C ++ATOM 412 CD2 LEU b 39 -6.225 13.274 -1.230 1.00 63.44 C ++ATOM 413 N PHE b 40 -6.511 7.812 -1.250 1.00 66.02 N ++ATOM 414 CA PHE b 40 -6.264 6.577 -1.982 1.00 66.02 C ++ATOM 415 C PHE b 40 -7.325 6.339 -3.047 1.00 66.02 C ++ATOM 416 O PHE b 40 -7.009 5.815 -4.125 1.00 66.02 O ++ATOM 417 CB PHE b 40 -6.212 5.406 -1.006 1.00 66.02 C ++ATOM 418 CG PHE b 40 -5.942 4.084 -1.654 1.00 66.02 C ++ATOM 419 CD1 PHE b 40 -4.669 3.759 -2.091 1.00 66.02 C ++ATOM 420 CD2 PHE b 40 -6.960 3.153 -1.805 1.00 66.02 C ++ATOM 421 CE1 PHE b 40 -4.418 2.535 -2.679 1.00 66.02 C ++ATOM 422 CE2 PHE b 40 -6.717 1.929 -2.392 1.00 66.02 C ++ATOM 423 CZ PHE b 40 -5.444 1.619 -2.830 1.00 66.02 C ++ATOM 424 N ILE b 41 -8.578 6.726 -2.769 1.00 70.73 N ++ATOM 425 CA ILE b 41 -9.627 6.644 -3.786 1.00 70.73 C ++ATOM 426 C ILE b 41 -9.308 7.559 -4.966 1.00 70.73 C ++ATOM 427 O ILE b 41 -9.462 7.171 -6.132 1.00 70.73 O ++ATOM 428 CB ILE b 41 -10.996 6.966 -3.159 1.00 70.73 C ++ATOM 429 CG1 ILE b 41 -11.405 5.864 -2.187 1.00 70.73 C ++ATOM 430 CG2 ILE b 41 -12.075 7.145 -4.211 1.00 70.73 C ++ATOM 431 CD1 ILE b 41 -12.617 6.217 -1.364 1.00 70.73 C ++ATOM 432 N TYR b 42 -8.800 8.762 -4.688 1.00 73.97 N ++ATOM 433 CA TYR b 42 -8.435 9.661 -5.777 1.00 73.97 C ++ATOM 434 C TYR b 42 -7.184 9.187 -6.501 1.00 73.97 C ++ATOM 435 O TYR b 42 -7.037 9.446 -7.698 1.00 73.97 O ++ATOM 436 CB TYR b 42 -8.244 11.085 -5.260 1.00 73.97 C ++ATOM 437 CG TYR b 42 -9.532 11.781 -4.876 1.00 73.97 C ++ATOM 438 CD1 TYR b 42 -10.768 11.269 -5.258 1.00 73.97 C ++ATOM 439 CD2 TYR b 42 -9.511 12.959 -4.138 1.00 73.97 C ++ATOM 440 CE1 TYR b 42 -11.947 11.904 -4.905 1.00 73.97 C ++ATOM 441 CE2 TYR b 42 -10.687 13.603 -3.783 1.00 73.97 C ++ATOM 442 CZ TYR b 42 -11.900 13.069 -4.170 1.00 73.97 C ++ATOM 443 OH TYR b 42 -13.072 13.701 -3.822 1.00 73.97 O ++ATOM 444 N GLY b 43 -6.298 8.465 -5.815 1.00 69.46 N ++ATOM 445 CA GLY b 43 -5.184 7.833 -6.508 1.00 69.46 C ++ATOM 446 C GLY b 43 -5.631 6.749 -7.473 1.00 69.46 C ++ATOM 447 O GLY b 43 -5.117 6.649 -8.595 1.00 69.46 O ++ATOM 448 N VAL b 44 -6.613 5.939 -7.062 1.00 72.96 N ++ATOM 449 CA VAL b 44 -7.163 4.915 -7.950 1.00 72.96 C ++ATOM 450 C VAL b 44 -7.893 5.555 -9.131 1.00 72.96 C ++ATOM 451 O VAL b 44 -7.790 5.084 -10.272 1.00 72.96 O ++ATOM 452 CB VAL b 44 -8.069 3.956 -7.151 1.00 72.96 C ++ATOM 453 CG1 VAL b 44 -8.778 2.961 -8.058 1.00 72.96 C ++ATOM 454 CG2 VAL b 44 -7.245 3.202 -6.134 1.00 72.96 C ++ATOM 455 N ILE b 45 -8.593 6.667 -8.890 1.00 71.89 N ++ATOM 456 CA ILE b 45 -9.271 7.377 -9.975 1.00 71.89 C ++ATOM 457 C ILE b 45 -8.267 8.021 -10.937 1.00 71.89 C ++ATOM 458 O ILE b 45 -8.488 8.037 -12.157 1.00 71.89 O ++ATOM 459 CB ILE b 45 -10.273 8.384 -9.370 1.00 71.89 C ++ATOM 460 CG1 ILE b 45 -11.460 7.621 -8.773 1.00 71.89 C ++ATOM 461 CG2 ILE b 45 -10.761 9.414 -10.376 1.00 71.89 C ++ATOM 462 CD1 ILE b 45 -12.420 8.476 -7.982 1.00 71.89 C ++ATOM 463 N LEU b 46 -7.123 8.490 -10.432 1.00 76.75 N ++ATOM 464 CA LEU b 46 -6.071 8.980 -11.320 1.00 76.75 C ++ATOM 465 C LEU b 46 -5.457 7.865 -12.158 1.00 76.75 C ++ATOM 466 O LEU b 46 -5.184 8.071 -13.350 1.00 76.75 O ++ATOM 467 CB LEU b 46 -4.993 9.690 -10.514 1.00 76.75 C ++ATOM 468 CG LEU b 46 -5.447 11.070 -10.054 1.00 76.75 C ++ATOM 469 CD1 LEU b 46 -4.487 11.646 -9.031 1.00 76.75 C ++ATOM 470 CD2 LEU b 46 -5.559 11.968 -11.272 1.00 76.75 C ++ATOM 471 N THR b 47 -5.253 6.680 -11.573 1.00 79.52 N ++ATOM 472 CA THR b 47 -4.792 5.546 -12.377 1.00 79.52 C ++ATOM 473 C THR b 47 -5.830 5.121 -13.414 1.00 79.52 C ++ATOM 474 O THR b 47 -5.464 4.700 -14.518 1.00 79.52 O ++ATOM 475 CB THR b 47 -4.436 4.364 -11.484 1.00 79.52 C ++ATOM 476 OG1 THR b 47 -5.584 3.974 -10.725 1.00 79.52 O ++ATOM 477 CG2 THR b 47 -3.303 4.736 -10.551 1.00 79.52 C ++ATOM 478 N ALA b 48 -7.120 5.254 -13.094 1.00 81.20 N ++ATOM 479 CA ALA b 48 -8.160 4.968 -14.080 1.00 81.20 C ++ATOM 480 C ALA b 48 -8.161 6.002 -15.198 1.00 81.20 C ++ATOM 481 O ALA b 48 -8.444 5.675 -16.356 1.00 81.20 O ++ATOM 482 CB ALA b 48 -9.528 4.910 -13.401 1.00 81.20 C ++ATOM 483 N LEU b 49 -7.827 7.253 -14.875 1.00 84.10 N ++ATOM 484 CA LEU b 49 -7.669 8.266 -15.916 1.00 84.10 C ++ATOM 485 C LEU b 49 -6.479 7.974 -16.821 1.00 84.10 C ++ATOM 486 O LEU b 49 -6.561 8.202 -18.034 1.00 84.10 O ++ATOM 487 CB LEU b 49 -7.527 9.653 -15.296 1.00 84.10 C ++ATOM 488 CG LEU b 49 -8.806 10.242 -14.706 1.00 84.10 C ++ATOM 489 CD1 LEU b 49 -8.514 11.552 -13.990 1.00 84.10 C ++ATOM 490 CD2 LEU b 49 -9.837 10.445 -15.807 1.00 84.10 C ++ATOM 491 N PHE b 50 -5.379 7.459 -16.267 1.00 87.44 N ++ATOM 492 CA PHE b 50 -4.271 7.038 -17.124 1.00 87.44 C ++ATOM 493 C PHE b 50 -4.654 5.834 -17.982 1.00 87.44 C ++ATOM 494 O PHE b 50 -4.267 5.742 -19.153 1.00 87.44 O ++ATOM 495 CB PHE b 50 -3.015 6.745 -16.304 1.00 87.44 C ++ATOM 496 CG PHE b 50 -2.332 7.976 -15.799 1.00 87.44 C ++ATOM 497 CD1 PHE b 50 -1.717 8.844 -16.683 1.00 87.44 C ++ATOM 498 CD2 PHE b 50 -2.259 8.243 -14.446 1.00 87.44 C ++ATOM 499 CE1 PHE b 50 -1.075 9.978 -16.235 1.00 87.44 C ++ATOM 500 CE2 PHE b 50 -1.623 9.378 -13.984 1.00 87.44 C ++ATOM 501 CZ PHE b 50 -1.025 10.246 -14.883 1.00 87.44 C ++ATOM 502 N LEU b 51 -5.446 4.914 -17.422 1.00 89.60 N ++ATOM 503 CA LEU b 51 -5.912 3.763 -18.193 1.00 89.60 C ++ATOM 504 C LEU b 51 -6.956 4.130 -19.247 1.00 89.60 C ++ATOM 505 O LEU b 51 -7.172 3.347 -20.179 1.00 89.60 O ++ATOM 506 CB LEU b 51 -6.485 2.688 -17.264 1.00 89.60 C ++ATOM 507 CG LEU b 51 -5.517 1.914 -16.366 1.00 89.60 C ++ATOM 508 CD1 LEU b 51 -6.271 0.993 -15.419 1.00 89.60 C ++ATOM 509 CD2 LEU b 51 -4.540 1.118 -17.203 1.00 89.60 C ++ATOM 510 N ARG b 52 -7.615 5.281 -19.121 1.00 90.13 N ++ATOM 511 CA ARG b 52 -8.593 5.706 -20.116 1.00 90.13 C ++ATOM 512 C ARG b 52 -8.092 6.819 -21.029 1.00 90.13 C ++ATOM 513 O ARG b 52 -8.827 7.233 -21.931 1.00 90.13 O ++ATOM 514 CB ARG b 52 -9.889 6.151 -19.435 1.00 90.13 C ++ATOM 515 CG ARG b 52 -10.649 5.012 -18.789 1.00 90.13 C ++ATOM 516 CD ARG b 52 -11.965 5.472 -18.189 1.00 90.13 C ++ATOM 517 NE ARG b 52 -12.655 4.370 -17.524 1.00 90.13 N ++ATOM 518 CZ ARG b 52 -13.818 4.487 -16.893 1.00 90.13 C ++ATOM 519 NH1 ARG b 52 -14.435 5.660 -16.845 1.00 90.13 N ++ATOM 520 NH2 ARG b 52 -14.365 3.428 -16.314 1.00 90.13 N ++ATOM 521 N VAL b 53 -6.879 7.320 -20.820 1.00 90.58 N ++ATOM 522 CA VAL b 53 -6.278 8.293 -21.721 1.00 90.58 C ++ATOM 523 C VAL b 53 -5.095 7.707 -22.488 1.00 90.58 C ++ATOM 524 O VAL b 53 -4.993 7.899 -23.703 1.00 90.58 O ++ATOM 525 CB VAL b 53 -5.875 9.571 -20.949 1.00 90.58 C ++ATOM 526 CG1 VAL b 53 -5.059 10.508 -21.814 1.00 90.58 C ++ATOM 527 CG2 VAL b 53 -7.124 10.293 -20.480 1.00 90.58 C ++ATOM 528 N LYS b 54 -4.211 6.961 -21.808 1.00 93.93 N ++ATOM 529 CA LYS b 54 -2.993 6.465 -22.450 1.00 93.93 C ++ATOM 530 C LYS b 54 -3.290 5.416 -23.515 1.00 93.93 C ++ATOM 531 O LYS b 54 -2.578 5.330 -24.521 1.00 93.93 O ++ATOM 532 CB LYS b 54 -2.037 5.883 -21.409 1.00 93.93 C ++ATOM 533 CG LYS b 54 -1.277 6.897 -20.578 1.00 93.93 C ++ATOM 534 CD LYS b 54 -0.329 6.181 -19.625 1.00 93.93 C ++ATOM 535 CE LYS b 54 0.531 7.159 -18.844 1.00 93.93 C ++ATOM 536 NZ LYS b 54 1.432 6.477 -17.868 1.00 93.93 N ++ATOM 537 N PHE b 55 -4.325 4.609 -23.314 1.00 99.32 N ++ATOM 538 CA PHE b 55 -4.675 3.574 -24.280 1.00 99.32 C ++ATOM 539 C PHE b 55 -6.186 3.482 -24.459 1.00 99.32 C ++ATOM 540 O PHE b 55 -6.818 4.406 -24.972 1.00 99.32 O ++ATOM 541 CB PHE b 55 -4.115 2.214 -23.848 1.00 99.32 C ++ATOM 542 CG PHE b 55 -2.613 2.131 -23.887 1.00 99.32 C ++ATOM 543 CD1 PHE b 55 -1.946 1.935 -25.087 1.00 99.32 C ++ATOM 544 CD2 PHE b 55 -1.869 2.241 -22.721 1.00 99.32 C ++ATOM 545 CE1 PHE b 55 -0.561 1.859 -25.125 1.00 99.32 C ++ATOM 546 CE2 PHE b 55 -0.483 2.163 -22.750 1.00 99.32 C ++ATOM 547 CZ PHE b 55 0.170 1.973 -23.954 1.00 99.32 C ++ATOM 549 N PHE d 22 22.209 21.912 52.664 1.00 37.53 N ++ATOM 550 CA PHE d 22 20.907 22.551 52.776 1.00 37.53 C ++ATOM 551 C PHE d 22 19.996 22.115 51.631 1.00 37.53 C ++ATOM 552 O PHE d 22 20.075 22.639 50.526 1.00 37.53 O ++ATOM 553 CB PHE d 22 21.075 24.072 52.805 1.00 37.53 C ++ATOM 554 CG PHE d 22 19.791 24.825 52.985 1.00 37.53 C ++ATOM 555 CD1 PHE d 22 19.079 24.723 54.163 1.00 37.53 C ++ATOM 556 CD2 PHE d 22 19.324 25.677 52.005 1.00 37.53 C ++ATOM 557 CE1 PHE d 22 17.900 25.425 54.342 1.00 37.53 C ++ATOM 558 CE2 PHE d 22 18.156 26.385 52.176 1.00 37.53 C ++ATOM 559 CZ PHE d 22 17.440 26.257 53.343 1.00 37.53 C ++ATOM 560 N LYS d 23 19.137 21.138 51.907 1.00 29.90 N ++ATOM 561 CA LYS d 23 18.254 20.610 50.881 1.00 29.90 C ++ATOM 562 C LYS d 23 17.128 21.590 50.596 1.00 29.90 C ++ATOM 563 O LYS d 23 16.311 21.880 51.470 1.00 29.90 O ++ATOM 564 CB LYS d 23 17.648 19.276 51.321 1.00 29.90 C ++ATOM 565 CG LYS d 23 18.640 18.171 51.619 1.00 29.90 C ++ATOM 566 CD LYS d 23 17.985 16.805 51.697 1.00 29.90 C ++ATOM 567 CE LYS d 23 17.183 16.619 52.965 1.00 29.90 C ++ATOM 568 NZ LYS d 23 16.649 15.232 53.055 1.00 29.90 N ++ATOM 569 N ILE d 24 17.087 22.099 49.374 1.00 25.53 N ++ATOM 570 CA ILE d 24 15.941 22.876 48.894 1.00 25.53 C ++ATOM 571 C ILE d 24 14.800 21.896 48.691 1.00 25.53 C ++ATOM 572 O ILE d 24 14.937 20.958 47.892 1.00 25.53 O ++ATOM 573 CB ILE d 24 16.265 23.603 47.584 1.00 25.53 C ++ATOM 574 CG1 ILE d 24 17.621 24.289 47.659 1.00 25.53 C ++ATOM 575 CG2 ILE d 24 15.215 24.646 47.301 1.00 25.53 C ++ATOM 576 CD1 ILE d 24 17.716 25.349 48.695 1.00 25.53 C ++ATOM 577 N PRO d 25 13.687 22.037 49.390 1.00 20.97 N ++ATOM 578 CA PRO d 25 12.625 21.033 49.275 1.00 20.97 C ++ATOM 579 C PRO d 25 11.878 21.087 47.953 1.00 20.97 C ++ATOM 580 O PRO d 25 11.078 21.992 47.695 1.00 20.97 O ++ATOM 581 CB PRO d 25 11.709 21.356 50.458 1.00 20.97 C ++ATOM 582 CG PRO d 25 11.968 22.779 50.756 1.00 20.97 C ++ATOM 583 CD PRO d 25 13.405 23.023 50.444 1.00 20.97 C ++ATOM 584 N ILE d 26 12.152 20.095 47.107 1.00 18.80 N ++ATOM 585 CA ILE d 26 11.475 19.944 45.822 1.00 18.80 C ++ATOM 586 C ILE d 26 10.290 19.026 46.086 1.00 18.80 C ++ATOM 587 O ILE d 26 10.391 17.809 45.980 1.00 18.80 O ++ATOM 588 CB ILE d 26 12.400 19.374 44.755 1.00 18.80 C ++ATOM 589 CG1 ILE d 26 13.721 20.130 44.709 1.00 18.80 C ++ATOM 590 CG2 ILE d 26 11.736 19.433 43.409 1.00 18.80 C ++ATOM 591 CD1 ILE d 26 13.584 21.552 44.372 1.00 18.80 C ++ATOM 592 N GLU d 27 9.155 19.604 46.449 1.00 19.61 N ++ATOM 593 CA GLU d 27 7.994 18.776 46.705 1.00 19.61 C ++ATOM 594 C GLU d 27 7.315 18.409 45.402 1.00 19.61 C ++ATOM 595 O GLU d 27 7.346 19.164 44.428 1.00 19.61 O ++ATOM 596 CB GLU d 27 7.007 19.474 47.630 1.00 19.61 C ++ATOM 597 CG GLU d 27 7.480 19.523 49.059 1.00 19.61 C ++ATOM 598 CD GLU d 27 6.454 20.123 49.979 1.00 19.61 C ++ATOM 599 OE1 GLU d 27 5.416 20.603 49.474 1.00 19.61 O ++ATOM 600 OE2 GLU d 27 6.686 20.114 51.205 1.00 19.61 O ++ATOM 601 N GLU d 28 6.716 17.232 45.385 1.00 19.44 N ++ATOM 602 CA GLU d 28 5.959 16.757 44.242 1.00 19.44 C ++ATOM 603 C GLU d 28 4.522 16.623 44.700 1.00 19.44 C ++ATOM 604 O GLU d 28 4.185 15.687 45.428 1.00 19.44 O ++ATOM 605 CB GLU d 28 6.492 15.425 43.729 1.00 19.44 C ++ATOM 606 CG GLU d 28 7.891 15.496 43.160 1.00 19.44 C ++ATOM 607 CD GLU d 28 8.382 14.156 42.664 1.00 19.44 C ++ATOM 608 OE1 GLU d 28 7.667 13.156 42.861 1.00 19.44 O ++ATOM 609 OE2 GLU d 28 9.483 14.098 42.079 1.00 19.44 O ++ATOM 610 N LEU d 29 3.681 17.538 44.264 1.00 19.72 N ++ATOM 611 CA LEU d 29 2.250 17.461 44.509 1.00 19.72 C ++ATOM 612 C LEU d 29 1.619 16.523 43.483 1.00 19.72 C ++ATOM 613 O LEU d 29 2.296 15.644 42.947 1.00 19.72 O ++ATOM 614 CB LEU d 29 1.618 18.849 44.509 1.00 19.72 C ++ATOM 615 CG LEU d 29 1.496 19.506 45.881 1.00 19.72 C ++ATOM 616 CD1 LEU d 29 0.731 18.567 46.766 1.00 19.72 C ++ATOM 617 CD2 LEU d 29 2.810 19.869 46.519 1.00 19.72 C ++ATOM 618 N GLU d 30 0.302 16.655 43.293 1.00 20.75 N ++ATOM 619 CA GLU d 30 -0.539 15.797 42.461 1.00 20.75 C ++ATOM 620 C GLU d 30 0.060 15.380 41.111 1.00 20.75 C ++ATOM 621 O GLU d 30 0.313 14.193 40.888 1.00 20.75 O ++ATOM 622 CB GLU d 30 -1.884 16.516 42.312 1.00 20.75 C ++ATOM 623 CG GLU d 30 -1.742 18.003 42.039 1.00 20.75 C ++ATOM 624 CD GLU d 30 -3.040 18.754 42.126 1.00 20.75 C ++ATOM 625 OE1 GLU d 30 -4.078 18.118 42.377 1.00 20.75 O ++ATOM 626 OE2 GLU d 30 -3.013 19.991 41.970 1.00 20.75 O ++ATOM 627 N ASP d 31 0.375 16.326 40.229 1.00 20.48 N ++ATOM 628 CA ASP d 31 1.153 15.979 39.048 1.00 20.48 C ++ATOM 629 C ASP d 31 2.150 17.075 38.720 1.00 20.48 C ++ATOM 630 O ASP d 31 2.807 17.035 37.679 1.00 20.48 O ++ATOM 631 CB ASP d 31 0.246 15.691 37.849 1.00 20.48 C ++ATOM 632 CG ASP d 31 -0.664 16.856 37.489 1.00 20.48 C ++ATOM 633 OD1 ASP d 31 -0.732 17.854 38.234 1.00 20.48 O ++ATOM 634 OD2 ASP d 31 -1.320 16.772 36.430 1.00 20.48 O ++ATOM 635 N ARG d 32 2.254 18.062 39.597 1.00 22.00 N ++ATOM 636 CA ARG d 32 3.165 19.165 39.385 1.00 22.00 C ++ATOM 637 C ARG d 32 4.417 18.994 40.233 1.00 22.00 C ++ATOM 638 O ARG d 32 4.583 18.015 40.954 1.00 22.00 O ++ATOM 639 CB ARG d 32 2.466 20.472 39.705 1.00 22.00 C ++ATOM 640 CG ARG d 32 1.360 20.784 38.743 1.00 22.00 C ++ATOM 641 CD ARG d 32 0.728 22.108 39.048 1.00 22.00 C ++ATOM 642 NE ARG d 32 -0.287 22.432 38.061 1.00 22.00 N ++ATOM 643 CZ ARG d 32 -0.028 23.045 36.912 1.00 22.00 C ++ATOM 644 NH1 ARG d 32 1.213 23.395 36.607 1.00 22.00 N ++ATOM 645 NH2 ARG d 32 -1.012 23.306 36.064 1.00 22.00 N ++ATOM 646 N VAL d 33 5.319 19.962 40.122 1.00 20.44 N ++ATOM 647 CA VAL d 33 6.536 20.014 40.921 1.00 20.44 C ++ATOM 648 C VAL d 33 6.647 21.410 41.495 1.00 20.44 C ++ATOM 649 O VAL d 33 6.675 22.389 40.744 1.00 20.44 O ++ATOM 650 CB VAL d 33 7.787 19.685 40.099 1.00 20.44 C ++ATOM 651 CG1 VAL d 33 9.008 19.933 40.910 1.00 20.44 C ++ATOM 652 CG2 VAL d 33 7.774 18.284 39.730 1.00 20.44 C ++ATOM 653 N PHE d 34 6.726 21.514 42.811 1.00 20.22 N ++ATOM 654 CA PHE d 34 6.796 22.806 43.463 1.00 20.22 C ++ATOM 655 C PHE d 34 8.111 22.902 44.212 1.00 20.22 C ++ATOM 656 O PHE d 34 8.373 22.103 45.115 1.00 20.22 O ++ATOM 657 CB PHE d 34 5.615 22.981 44.408 1.00 20.22 C ++ATOM 658 CG PHE d 34 4.300 23.041 43.709 1.00 20.22 C ++ATOM 659 CD1 PHE d 34 3.868 24.219 43.146 1.00 20.22 C ++ATOM 660 CD2 PHE d 34 3.501 21.926 43.602 1.00 20.22 C ++ATOM 661 CE1 PHE d 34 2.660 24.287 42.504 1.00 20.22 C ++ATOM 662 CE2 PHE d 34 2.294 21.991 42.957 1.00 20.22 C ++ATOM 663 CZ PHE d 34 1.874 23.169 42.405 1.00 20.22 C ++ATOM 664 N VAL d 35 8.944 23.857 43.826 1.00 21.34 N ++ATOM 665 CA VAL d 35 10.116 24.196 44.617 1.00 21.34 C ++ATOM 666 C VAL d 35 9.644 25.068 45.769 1.00 21.34 C ++ATOM 667 O VAL d 35 9.045 26.126 45.543 1.00 21.34 O ++ATOM 668 CB VAL d 35 11.165 24.922 43.769 1.00 21.34 C ++ATOM 669 CG1 VAL d 35 12.358 25.292 44.606 1.00 21.34 C ++ATOM 670 CG2 VAL d 35 11.576 24.066 42.616 1.00 21.34 C ++ATOM 671 N ASN d 36 9.869 24.614 46.998 1.00 25.41 N ++ATOM 672 CA ASN d 36 9.578 25.408 48.178 1.00 25.41 C ++ATOM 673 C ASN d 36 10.870 26.006 48.699 1.00 25.41 C ++ATOM 674 O ASN d 36 11.925 25.376 48.617 1.00 25.41 O ++ATOM 675 CB ASN d 36 8.936 24.566 49.280 1.00 25.41 C ++ATOM 676 CG ASN d 36 7.586 24.030 48.891 1.00 25.41 C ++ATOM 677 OD1 ASN d 36 7.406 22.827 48.739 1.00 25.41 O ++ATOM 678 ND2 ASN d 36 6.620 24.916 48.741 1.00 25.41 N ++ATOM 679 N CYS d 37 10.795 27.220 49.230 1.00 41.09 N ++ATOM 680 CA CYS d 37 11.909 27.743 50.003 1.00 41.09 C ++ATOM 681 C CYS d 37 11.328 28.634 51.089 1.00 41.09 C ++ATOM 682 O CYS d 37 10.127 28.909 51.112 1.00 41.09 O ++ATOM 683 CB CYS d 37 12.920 28.485 49.111 1.00 41.09 C ++ATOM 684 SG CYS d 37 14.473 28.985 49.920 1.00 41.09 S ++ATOM 685 N ASN d 38 12.171 29.054 52.027 1.00 42.54 N ++ATOM 686 CA ASN d 38 11.699 29.994 53.031 1.00 42.54 C ++ATOM 687 C ASN d 38 11.785 31.434 52.554 1.00 42.54 C ++ATOM 688 O ASN d 38 11.240 32.324 53.212 1.00 42.54 O ++ATOM 689 CB ASN d 38 12.479 29.825 54.334 1.00 42.54 C ++ATOM 690 CG ASN d 38 12.096 28.570 55.089 1.00 42.54 C ++ATOM 691 OD1 ASN d 38 10.927 28.190 55.130 1.00 42.54 O ++ATOM 692 ND2 ASN d 38 13.078 27.932 55.717 1.00 42.54 N ++ATOM 693 N THR d 39 12.453 31.680 51.435 1.00 38.40 N ++ATOM 694 CA THR d 39 12.552 32.989 50.812 1.00 38.40 C ++ATOM 695 C THR d 39 12.305 32.833 49.309 1.00 38.40 C ++ATOM 696 O THR d 39 11.916 31.764 48.837 1.00 38.40 O ++ATOM 697 CB THR d 39 13.906 33.616 51.123 1.00 38.40 C ++ATOM 698 OG1 THR d 39 13.948 34.950 50.611 1.00 38.40 O ++ATOM 699 CG2 THR d 39 15.005 32.802 50.496 1.00 38.40 C ++ATOM 700 N SER d 40 12.512 33.911 48.556 1.00 36.72 N ++ATOM 701 CA SER d 40 12.185 33.902 47.135 1.00 36.72 C ++ATOM 702 C SER d 40 13.201 33.088 46.347 1.00 36.72 C ++ATOM 703 O SER d 40 14.406 33.171 46.588 1.00 36.72 O ++ATOM 704 CB SER d 40 12.138 35.326 46.592 1.00 36.72 C ++ATOM 705 OG SER d 40 13.426 35.912 46.592 1.00 36.72 O ++ATOM 706 N ILE d 41 12.706 32.312 45.387 1.00 29.10 N ++ATOM 707 CA ILE d 41 13.548 31.432 44.583 1.00 29.10 C ++ATOM 708 C ILE d 41 14.071 32.207 43.384 1.00 29.10 C ++ATOM 709 O ILE d 41 13.292 32.743 42.591 1.00 29.10 O ++ATOM 710 CB ILE d 41 12.789 30.175 44.132 1.00 29.10 C ++ATOM 711 CG1 ILE d 41 12.542 29.239 45.303 1.00 29.10 C ++ATOM 712 CG2 ILE d 41 13.568 29.425 43.088 1.00 29.10 C ++ATOM 713 CD1 ILE d 41 11.217 29.386 45.910 1.00 29.10 C ++ATOM 714 N THR d 42 15.390 32.258 43.246 1.00 28.74 N ++ATOM 715 CA THR d 42 16.025 32.918 42.116 1.00 28.74 C ++ATOM 716 C THR d 42 16.217 31.890 41.011 1.00 28.74 C ++ATOM 717 O THR d 42 16.964 30.925 41.182 1.00 28.74 O ++ATOM 718 CB THR d 42 17.362 33.526 42.531 1.00 28.74 C ++ATOM 719 OG1 THR d 42 17.163 34.436 43.619 1.00 28.74 O ++ATOM 720 CG2 THR d 42 17.988 34.273 41.365 1.00 28.74 C ++ATOM 721 N TRP d 43 15.523 32.083 39.897 1.00 26.41 N ++ATOM 722 CA TRP d 43 15.754 31.286 38.701 1.00 26.41 C ++ATOM 723 C TRP d 43 17.174 31.502 38.199 1.00 26.41 C ++ATOM 724 O TRP d 43 17.725 32.595 38.324 1.00 26.41 O ++ATOM 725 CB TRP d 43 14.761 31.698 37.621 1.00 26.41 C ++ATOM 726 CG TRP d 43 14.914 31.007 36.322 1.00 26.41 C ++ATOM 727 CD1 TRP d 43 14.553 29.736 36.024 1.00 26.41 C ++ATOM 728 CD2 TRP d 43 15.504 31.547 35.137 1.00 26.41 C ++ATOM 729 NE1 TRP d 43 14.856 29.451 34.717 1.00 26.41 N ++ATOM 730 CE2 TRP d 43 15.446 30.550 34.152 1.00 26.41 C ++ATOM 731 CE3 TRP d 43 16.067 32.782 34.811 1.00 26.41 C ++ATOM 732 CZ2 TRP d 43 15.928 30.746 32.863 1.00 26.41 C ++ATOM 733 CZ3 TRP d 43 16.549 32.974 33.533 1.00 26.41 C ++ATOM 734 CH2 TRP d 43 16.478 31.961 32.575 1.00 26.41 C ++ATOM 735 N VAL d 44 17.786 30.454 37.649 1.00 25.01 N ++ATOM 736 CA VAL d 44 19.085 30.631 37.009 1.00 25.01 C ++ATOM 737 C VAL d 44 18.978 30.214 35.554 1.00 25.01 C ++ATOM 738 O VAL d 44 19.140 31.039 34.650 1.00 25.01 O ++ATOM 739 CB VAL d 44 20.201 29.851 37.717 1.00 25.01 C ++ATOM 740 CG1 VAL d 44 21.493 29.996 36.947 1.00 25.01 C ++ATOM 741 CG2 VAL d 44 20.382 30.355 39.125 1.00 25.01 C ++ATOM 742 N GLU d 45 18.689 28.940 35.314 1.00 23.18 N ++ATOM 743 CA GLU d 45 18.519 28.457 33.954 1.00 23.18 C ++ATOM 744 C GLU d 45 17.608 27.248 33.987 1.00 23.18 C ++ATOM 745 O GLU d 45 17.432 26.612 35.026 1.00 23.18 O ++ATOM 746 CB GLU d 45 19.860 28.118 33.303 1.00 23.18 C ++ATOM 747 CG GLU d 45 20.568 26.950 33.925 1.00 23.18 C ++ATOM 748 CD GLU d 45 21.952 26.749 33.354 1.00 23.18 C ++ATOM 749 OE1 GLU d 45 22.372 27.569 32.516 1.00 23.18 O ++ATOM 750 OE2 GLU d 45 22.621 25.772 33.742 1.00 23.18 O ++ATOM 751 N GLY d 46 17.021 26.945 32.838 1.00 19.61 N ++ATOM 752 CA GLY d 46 16.111 25.825 32.750 1.00 19.61 C ++ATOM 753 C GLY d 46 14.669 26.263 32.657 1.00 19.61 C ++ATOM 754 O GLY d 46 14.383 27.324 32.101 1.00 19.61 O ++ATOM 755 N THR d 47 13.755 25.458 33.197 1.00 19.39 N ++ATOM 756 CA THR d 47 12.335 25.775 33.124 1.00 19.39 C ++ATOM 757 C THR d 47 12.014 26.946 34.043 1.00 19.39 C ++ATOM 758 O THR d 47 12.389 26.945 35.217 1.00 19.39 O ++ATOM 759 CB THR d 47 11.503 24.557 33.508 1.00 19.39 C ++ATOM 760 OG1 THR d 47 11.863 23.459 32.670 1.00 19.39 O ++ATOM 761 CG2 THR d 47 10.036 24.841 33.314 1.00 19.39 C ++ATOM 762 N VAL d 48 11.333 27.956 33.499 1.00 21.87 N ++ATOM 763 CA VAL d 48 11.066 29.168 34.265 1.00 21.87 C ++ATOM 764 C VAL d 48 9.971 28.920 35.292 1.00 21.87 C ++ATOM 765 O VAL d 48 10.145 29.184 36.487 1.00 21.87 O ++ATOM 766 CB VAL d 48 10.701 30.321 33.319 1.00 21.87 C ++ATOM 767 CG1 VAL d 48 10.294 31.550 34.112 1.00 21.87 C ++ATOM 768 CG2 VAL d 48 11.868 30.633 32.407 1.00 21.87 C ++ATOM 769 N GLY d 49 8.831 28.416 34.846 1.00 22.91 N ++ATOM 770 CA GLY d 49 7.750 28.093 35.751 1.00 22.91 C ++ATOM 771 C GLY d 49 6.979 29.311 36.216 1.00 22.91 C ++ATOM 772 O GLY d 49 7.146 30.430 35.735 1.00 22.91 O ++ATOM 773 N THR d 50 6.121 29.074 37.203 1.00 19.32 N ++ATOM 774 CA THR d 50 5.170 30.068 37.678 1.00 19.32 C ++ATOM 775 C THR d 50 5.433 30.374 39.141 1.00 19.32 C ++ATOM 776 O THR d 50 5.360 29.471 39.975 1.00 19.32 O ++ATOM 777 CB THR d 50 3.735 29.558 37.517 1.00 19.32 C ++ATOM 778 OG1 THR d 50 3.455 29.339 36.132 1.00 19.32 O ++ATOM 779 CG2 THR d 50 2.746 30.548 38.082 1.00 19.32 C ++ATOM 780 N LEU d 51 5.756 31.624 39.455 1.00 24.35 N ++ATOM 781 CA LEU d 51 5.691 32.056 40.844 1.00 24.35 C ++ATOM 782 C LEU d 51 4.244 32.009 41.301 1.00 24.35 C ++ATOM 783 O LEU d 51 3.358 32.564 40.646 1.00 24.35 O ++ATOM 784 CB LEU d 51 6.240 33.471 41.013 1.00 24.35 C ++ATOM 785 CG LEU d 51 7.717 33.709 41.335 1.00 24.35 C ++ATOM 786 CD1 LEU d 51 8.061 33.120 42.685 1.00 24.35 C ++ATOM 787 CD2 LEU d 51 8.651 33.174 40.270 1.00 24.35 C ++ATOM 788 N LEU d 52 3.992 31.336 42.426 1.00 27.63 N ++ATOM 789 CA LEU d 52 2.596 31.128 42.796 1.00 27.63 C ++ATOM 790 C LEU d 52 1.955 32.401 43.350 1.00 27.63 C ++ATOM 791 O LEU d 52 2.535 33.491 43.329 1.00 27.63 O ++ATOM 792 CB LEU d 52 2.463 29.987 43.800 1.00 27.63 C ++ATOM 793 CG LEU d 52 2.572 28.596 43.191 1.00 27.63 C ++ATOM 794 CD1 LEU d 52 2.569 27.535 44.267 1.00 27.63 C ++ATOM 795 CD2 LEU d 52 1.417 28.386 42.236 1.00 27.63 C ++ATOM 796 N SER d 53 0.715 32.243 43.832 1.00 36.07 N ++ATOM 797 CA SER d 53 -0.050 33.366 44.375 1.00 36.07 C ++ATOM 798 C SER d 53 0.628 33.963 45.600 1.00 36.07 C ++ATOM 799 O SER d 53 0.469 35.153 45.890 1.00 36.07 O ++ATOM 800 CB SER d 53 -1.468 32.914 44.717 1.00 36.07 C ++ATOM 801 OG SER d 53 -2.199 33.965 45.315 1.00 36.07 O ++ATOM 802 N ASP d 54 1.380 33.151 46.334 1.00 34.31 N ++ATOM 803 CA ASP d 54 2.378 33.658 47.259 1.00 34.31 C ++ATOM 804 C ASP d 54 3.761 33.500 46.645 1.00 34.31 C ++ATOM 805 O ASP d 54 3.968 32.661 45.764 1.00 34.31 O ++ATOM 806 CB ASP d 54 2.303 32.944 48.612 1.00 34.31 C ++ATOM 807 CG ASP d 54 2.438 31.431 48.507 1.00 34.31 C ++ATOM 808 OD1 ASP d 54 2.405 30.877 47.393 1.00 34.31 O ++ATOM 809 OD2 ASP d 54 2.594 30.785 49.564 1.00 34.31 O ++ATOM 810 N ILE d 55 4.702 34.315 47.110 1.00 34.66 N ++ATOM 811 CA ILE d 55 6.108 34.098 46.812 1.00 34.66 C ++ATOM 812 C ILE d 55 6.603 32.936 47.677 1.00 34.66 C ++ATOM 813 O ILE d 55 5.858 32.414 48.520 1.00 34.66 O ++ATOM 814 CB ILE d 55 6.880 35.411 47.057 1.00 34.66 C ++ATOM 815 CG1 ILE d 55 8.178 35.499 46.248 1.00 34.66 C ++ATOM 816 CG2 ILE d 55 7.151 35.616 48.541 1.00 34.66 C ++ATOM 817 CD1 ILE d 55 8.777 36.881 46.241 1.00 34.66 C ++ATOM 818 N THR d 56 7.846 32.489 47.419 1.00 29.98 N ++ATOM 819 CA THR d 56 8.633 31.411 48.044 1.00 29.98 C ++ATOM 820 C THR d 56 8.210 30.047 47.525 1.00 29.98 C ++ATOM 821 O THR d 56 8.693 29.017 48.017 1.00 29.98 O ++ATOM 822 CB THR d 56 8.578 31.365 49.584 1.00 29.98 C ++ATOM 823 OG1 THR d 56 7.262 30.992 50.004 1.00 29.98 O ++ATOM 824 CG2 THR d 56 8.924 32.700 50.206 1.00 29.98 C ++ATOM 825 N ARG d 57 7.327 30.022 46.530 1.00 24.85 N ++ATOM 826 CA ARG d 57 6.904 28.777 45.908 1.00 24.85 C ++ATOM 827 C ARG d 57 6.883 28.915 44.395 1.00 24.85 C ++ATOM 828 O ARG d 57 6.201 29.793 43.844 1.00 24.85 O ++ATOM 829 CB ARG d 57 5.535 28.341 46.402 1.00 24.85 C ++ATOM 830 CG ARG d 57 5.509 27.947 47.846 1.00 24.85 C ++ATOM 831 CD ARG d 57 4.215 27.300 48.122 1.00 24.85 C ++ATOM 832 NE ARG d 57 4.142 26.110 47.300 1.00 24.85 N ++ATOM 833 CZ ARG d 57 3.043 25.404 47.132 1.00 24.85 C ++ATOM 834 NH1 ARG d 57 1.932 25.781 47.734 1.00 24.85 N ++ATOM 835 NH2 ARG d 57 3.053 24.334 46.360 1.00 24.85 N ++ATOM 836 N LEU d 58 7.615 28.024 43.733 1.00 16.92 N ++ATOM 837 CA LEU d 58 7.805 28.065 42.288 1.00 16.92 C ++ATOM 838 C LEU d 58 7.243 26.790 41.685 1.00 16.92 C ++ATOM 839 O LEU d 58 7.767 25.702 41.933 1.00 16.92 O ++ATOM 840 CB LEU d 58 9.284 28.225 41.954 1.00 16.92 C ++ATOM 841 CG LEU d 58 9.699 28.283 40.492 1.00 16.92 C ++ATOM 842 CD1 LEU d 58 9.073 29.462 39.808 1.00 16.92 C ++ATOM 843 CD2 LEU d 58 11.192 28.365 40.403 1.00 16.92 C ++ATOM 844 N ASP d 59 6.165 26.917 40.925 1.00 18.37 N ++ATOM 845 CA ASP d 59 5.596 25.808 40.181 1.00 18.37 C ++ATOM 846 C ASP d 59 6.435 25.557 38.941 1.00 18.37 C ++ATOM 847 O ASP d 59 6.901 26.494 38.295 1.00 18.37 O ++ATOM 848 CB ASP d 59 4.155 26.147 39.796 1.00 18.37 C ++ATOM 849 CG ASP d 59 3.381 24.969 39.236 1.00 18.37 C ++ATOM 850 OD1 ASP d 59 3.944 23.871 39.068 1.00 18.37 O ++ATOM 851 OD2 ASP d 59 2.172 25.140 38.974 1.00 18.37 O ++ATOM 852 N LEU d 60 6.620 24.283 38.601 1.00 14.01 N ++ATOM 853 CA LEU d 60 7.417 23.921 37.439 1.00 14.01 C ++ATOM 854 C LEU d 60 6.599 23.225 36.365 1.00 14.01 C ++ATOM 855 O LEU d 60 7.156 22.470 35.567 1.00 14.01 O ++ATOM 856 CB LEU d 60 8.591 23.033 37.843 1.00 14.01 C ++ATOM 857 CG LEU d 60 9.632 23.640 38.764 1.00 14.01 C ++ATOM 858 CD1 LEU d 60 10.743 22.663 38.983 1.00 14.01 C ++ATOM 859 CD2 LEU d 60 10.156 24.888 38.160 1.00 14.01 C ++ATOM 860 N GLY d 61 5.297 23.459 36.324 1.00 15.54 N ++ATOM 861 CA GLY d 61 4.527 22.742 35.333 1.00 15.54 C ++ATOM 862 C GLY d 61 4.313 21.304 35.769 1.00 15.54 C ++ATOM 863 O GLY d 61 4.477 20.949 36.934 1.00 15.54 O ++ATOM 864 N LYS d 62 3.958 20.463 34.805 1.00 20.47 N ++ATOM 865 CA LYS d 62 3.715 19.068 35.123 1.00 20.47 C ++ATOM 866 C LYS d 62 5.025 18.310 35.292 1.00 20.47 C ++ATOM 867 O LYS d 62 6.116 18.848 35.117 1.00 20.47 O ++ATOM 868 CB LYS d 62 2.886 18.395 34.042 1.00 20.47 C ++ATOM 869 CG LYS d 62 1.448 18.811 33.973 1.00 20.47 C ++ATOM 870 CD LYS d 62 0.744 17.935 32.964 1.00 20.47 C ++ATOM 871 CE LYS d 62 -0.724 18.255 32.859 1.00 20.47 C ++ATOM 872 NZ LYS d 62 -1.380 17.352 31.876 1.00 20.47 N ++ATOM 873 N ARG d 63 4.904 17.029 35.630 1.00 22.87 N ++ATOM 874 CA ARG d 63 6.060 16.154 35.731 1.00 22.87 C ++ATOM 875 C ARG d 63 6.361 15.432 34.434 1.00 22.87 C ++ATOM 876 O ARG d 63 7.529 15.237 34.101 1.00 22.87 O ++ATOM 877 CB ARG d 63 5.856 15.108 36.828 1.00 22.87 C ++ATOM 878 CG ARG d 63 5.755 15.686 38.196 1.00 22.87 C ++ATOM 879 CD ARG d 63 5.664 14.635 39.261 1.00 22.87 C ++ATOM 880 NE ARG d 63 4.451 13.850 39.151 1.00 22.87 N ++ATOM 881 CZ ARG d 63 4.171 12.827 39.943 1.00 22.87 C ++ATOM 882 NH1 ARG d 63 5.018 12.493 40.903 1.00 22.87 N ++ATOM 883 NH2 ARG d 63 3.044 12.149 39.786 1.00 22.87 N ++ATOM 884 N ILE d 64 5.324 15.031 33.699 1.00 23.67 N ++ATOM 885 CA ILE d 64 5.495 14.319 32.441 1.00 23.67 C ++ATOM 886 C ILE d 64 6.032 15.196 31.323 1.00 23.67 C ++ATOM 887 O ILE d 64 6.539 14.668 30.332 1.00 23.67 O ++ATOM 888 CB ILE d 64 4.147 13.692 32.050 1.00 23.67 C ++ATOM 889 CG1 ILE d 64 3.076 14.774 32.012 1.00 23.67 C ++ATOM 890 CG2 ILE d 64 3.768 12.600 33.019 1.00 23.67 C ++ATOM 891 CD1 ILE d 64 1.768 14.311 31.486 1.00 23.67 C ++ATOM 892 N LEU d 65 5.955 16.518 31.453 1.00 19.82 N ++ATOM 893 CA LEU d 65 6.553 17.434 30.491 1.00 19.82 C ++ATOM 894 C LEU d 65 7.999 17.764 30.819 1.00 19.82 C ++ATOM 895 O LEU d 65 8.537 18.733 30.271 1.00 19.82 O ++ATOM 896 CB LEU d 65 5.746 18.726 30.399 1.00 19.82 C ++ATOM 897 CG LEU d 65 4.551 18.781 29.454 1.00 19.82 C ++ATOM 898 CD1 LEU d 65 3.371 18.013 29.984 1.00 19.82 C ++ATOM 899 CD2 LEU d 65 4.165 20.221 29.214 1.00 19.82 C ++ATOM 900 N ASP d 66 8.620 17.000 31.721 1.00 17.57 N ++ATOM 901 CA ASP d 66 10.043 16.989 32.042 1.00 17.57 C ++ATOM 902 C ASP d 66 10.598 18.343 32.469 1.00 17.57 C ++ATOM 903 O ASP d 66 11.345 18.956 31.701 1.00 17.57 O ++ATOM 904 CB ASP d 66 10.829 16.494 30.831 1.00 17.57 C ++ATOM 905 CG ASP d 66 10.406 15.117 30.396 1.00 17.57 C ++ATOM 906 OD1 ASP d 66 9.923 14.354 31.251 1.00 17.57 O ++ATOM 907 OD2 ASP d 66 10.549 14.798 29.198 1.00 17.57 O ++ATOM 908 N PRO d 67 10.273 18.855 33.658 1.00 14.91 N ++ATOM 909 CA PRO d 67 10.834 20.145 34.062 1.00 14.91 C ++ATOM 910 C PRO d 67 12.274 19.984 34.526 1.00 14.91 C ++ATOM 911 O PRO d 67 12.586 19.128 35.352 1.00 14.91 O ++ATOM 912 CB PRO d 67 9.918 20.587 35.204 1.00 14.91 C ++ATOM 913 CG PRO d 67 9.418 19.349 35.767 1.00 14.91 C ++ATOM 914 CD PRO d 67 9.313 18.357 34.653 1.00 14.91 C ++ATOM 915 N ARG d 68 13.163 20.787 33.958 1.00 13.89 N ++ATOM 916 CA ARG d 68 14.570 20.749 34.308 1.00 13.89 C ++ATOM 917 C ARG d 68 15.050 22.163 34.568 1.00 13.89 C ++ATOM 918 O ARG d 68 14.513 23.124 34.016 1.00 13.89 O ++ATOM 919 CB ARG d 68 15.404 20.127 33.201 1.00 13.89 C ++ATOM 920 CG ARG d 68 15.033 18.703 32.897 1.00 13.89 C ++ATOM 921 CD ARG d 68 15.843 18.120 31.772 1.00 13.89 C ++ATOM 922 NE ARG d 68 15.365 16.787 31.446 1.00 13.89 N ++ATOM 923 CZ ARG d 68 15.865 16.033 30.481 1.00 13.89 C ++ATOM 924 NH1 ARG d 68 16.867 16.483 29.747 1.00 13.89 N ++ATOM 925 NH2 ARG d 68 15.365 14.829 30.255 1.00 13.89 N ++ATOM 926 N GLY d 69 16.061 22.286 35.413 1.00 14.82 N ++ATOM 927 CA GLY d 69 16.612 23.598 35.684 1.00 14.82 C ++ATOM 928 C GLY d 69 17.492 23.596 36.910 1.00 14.82 C ++ATOM 929 O GLY d 69 17.670 22.581 37.580 1.00 14.82 O ++ATOM 930 N ILE d 70 18.050 24.769 37.183 1.00 16.91 N ++ATOM 931 CA ILE d 70 18.936 24.993 38.319 1.00 16.91 C ++ATOM 932 C ILE d 70 18.400 26.194 39.080 1.00 16.91 C ++ATOM 933 O ILE d 70 18.278 27.282 38.511 1.00 16.91 O ++ATOM 934 CB ILE d 70 20.389 25.234 37.879 1.00 16.91 C ++ATOM 935 CG1 ILE d 70 21.034 23.956 37.355 1.00 16.91 C ++ATOM 936 CG2 ILE d 70 21.214 25.798 38.996 1.00 16.91 C ++ATOM 937 CD1 ILE d 70 20.964 23.784 35.865 1.00 16.91 C ++ATOM 938 N TYR d 71 18.082 26.008 40.359 1.00 18.86 N ++ATOM 939 CA TYR d 71 17.414 27.036 41.139 1.00 18.86 C ++ATOM 940 C TYR d 71 18.221 27.326 42.391 1.00 18.86 C ++ATOM 941 O TYR d 71 18.949 26.468 42.883 1.00 18.86 O ++ATOM 942 CB TYR d 71 16.007 26.601 41.488 1.00 18.86 C ++ATOM 943 CG TYR d 71 15.214 26.310 40.250 1.00 18.86 C ++ATOM 944 CD1 TYR d 71 14.660 27.329 39.507 1.00 18.86 C ++ATOM 945 CD2 TYR d 71 15.052 25.012 39.804 1.00 18.86 C ++ATOM 946 CE1 TYR d 71 13.950 27.061 38.368 1.00 18.86 C ++ATOM 947 CE2 TYR d 71 14.349 24.735 38.670 1.00 18.86 C ++ATOM 948 CZ TYR d 71 13.799 25.760 37.958 1.00 18.86 C ++ATOM 949 OH TYR d 71 13.098 25.475 36.822 1.00 18.86 O ++ATOM 950 N ARG d 72 18.094 28.546 42.901 1.00 29.79 N ++ATOM 951 CA ARG d 72 18.933 29.012 43.996 1.00 29.79 C ++ATOM 952 C ARG d 72 18.117 29.887 44.930 1.00 29.79 C ++ATOM 953 O ARG d 72 17.427 30.800 44.473 1.00 29.79 O ++ATOM 954 CB ARG d 72 20.140 29.792 43.462 1.00 29.79 C ++ATOM 955 CG ARG d 72 21.045 30.332 44.538 1.00 29.79 C ++ATOM 956 CD ARG d 72 22.267 31.037 43.980 1.00 29.79 C ++ATOM 957 NE ARG d 72 23.213 30.130 43.340 1.00 29.79 N ++ATOM 958 CZ ARG d 72 23.532 30.175 42.054 1.00 29.79 C ++ATOM 959 NH1 ARG d 72 22.979 31.087 41.269 1.00 29.79 N ++ATOM 960 NH2 ARG d 72 24.405 29.315 41.553 1.00 29.79 N ++ATOM 961 N CYS d 73 18.190 29.617 46.235 1.00 37.73 N ++ATOM 962 CA CYS d 73 17.536 30.501 47.193 1.00 37.73 C ++ATOM 963 C CYS d 73 18.377 30.640 48.452 1.00 37.73 C ++ATOM 964 O CYS d 73 19.221 29.797 48.764 1.00 37.73 O ++ATOM 965 CB CYS d 73 16.119 30.032 47.569 1.00 37.73 C ++ATOM 966 SG CYS d 73 15.974 28.563 48.602 1.00 37.73 S ++ATOM 967 N ASN d 74 18.135 31.737 49.169 1.00 48.47 N ++ATOM 968 CA ASN d 74 18.741 31.988 50.465 1.00 48.47 C ++ATOM 969 C ASN d 74 18.089 31.105 51.525 1.00 48.47 C ++ATOM 970 O ASN d 74 17.132 30.374 51.264 1.00 48.47 O ++ATOM 971 CB ASN d 74 18.599 33.462 50.859 1.00 48.47 C ++ATOM 972 CG ASN d 74 19.469 34.387 50.030 1.00 48.47 C ++ATOM 973 OD1 ASN d 74 20.640 34.110 49.789 1.00 48.47 O ++ATOM 974 ND2 ASN d 74 18.894 35.499 49.590 1.00 48.47 N ++ATOM 975 N GLY d 75 18.616 31.175 52.740 1.00 55.44 N ++ATOM 976 CA GLY d 75 18.015 30.438 53.830 1.00 55.44 C ++ATOM 977 C GLY d 75 17.809 31.270 55.074 1.00 55.44 C ++ATOM 978 O GLY d 75 18.779 31.711 55.694 1.00 55.44 O ++ATOM 979 N THR d 76 16.557 31.486 55.461 1.00 62.81 N ++ATOM 980 CA THR d 76 16.246 32.198 56.691 1.00 62.81 C ++ATOM 981 C THR d 76 15.750 31.210 57.736 1.00 62.81 C ++ATOM 982 O THR d 76 15.493 30.043 57.422 1.00 62.81 O ++ATOM 983 CB THR d 76 15.200 33.291 56.461 1.00 62.81 C ++ATOM 984 OG1 THR d 76 15.118 34.123 57.623 1.00 62.81 O ++ATOM 985 CG2 THR d 76 13.843 32.685 56.215 1.00 62.81 C ++ATOM 986 N ASP d 77 15.687 31.680 58.987 1.00 73.24 N ++ATOM 987 CA ASP d 77 15.288 31.037 60.254 1.00 73.24 C ++ATOM 988 C ASP d 77 16.355 30.060 60.750 1.00 73.24 C ++ATOM 989 O ASP d 77 16.357 29.718 61.941 1.00 73.24 O ++ATOM 990 CB ASP d 77 13.925 30.319 60.146 1.00 73.24 C ++ATOM 991 CG ASP d 77 13.380 29.851 61.482 1.00 73.24 C ++ATOM 992 OD1 ASP d 77 12.902 30.695 62.268 1.00 73.24 O ++ATOM 993 OD2 ASP d 77 13.431 28.632 61.744 1.00 73.24 O ++ATOM 994 N ILE d 78 17.333 29.709 59.917 1.00 75.59 N ++ATOM 995 CA ILE d 78 18.299 28.660 60.220 1.00 75.59 C ++ATOM 996 C ILE d 78 19.401 28.776 59.171 1.00 75.59 C ++ATOM 997 O ILE d 78 19.216 29.417 58.133 1.00 75.59 O ++ATOM 998 CB ILE d 78 17.595 27.274 60.243 1.00 75.59 C ++ATOM 999 CG1 ILE d 78 18.486 26.146 60.797 1.00 75.59 C ++ATOM 1000 CG2 ILE d 78 16.899 26.984 58.910 1.00 75.59 C ++ATOM 1001 CD1 ILE d 78 18.871 26.335 62.247 1.00 75.59 C ++ATOM 1002 N TYR d 79 20.573 28.223 59.423 1.00 76.15 N ++ATOM 1003 CA TYR d 79 21.609 28.231 58.389 1.00 76.15 C ++ATOM 1004 C TYR d 79 22.401 29.527 58.256 1.00 76.15 C ++ATOM 1005 O TYR d 79 23.329 29.625 57.455 1.00 76.15 O ++ATOM 1006 CB TYR d 79 21.008 27.795 57.055 1.00 76.15 C ++ATOM 1007 CG TYR d 79 20.397 26.422 57.151 1.00 76.15 C ++ATOM 1008 CD1 TYR d 79 21.193 25.288 57.133 1.00 76.15 C ++ATOM 1009 CD2 TYR d 79 19.028 26.258 57.298 1.00 76.15 C ++ATOM 1010 CE1 TYR d 79 20.645 24.027 57.234 1.00 76.15 C ++ATOM 1011 CE2 TYR d 79 18.470 24.998 57.400 1.00 76.15 C ++ATOM 1012 CZ TYR d 79 19.284 23.887 57.368 1.00 76.15 C ++ATOM 1013 OH TYR d 79 18.740 22.629 57.469 1.00 76.15 O ++ATOM 1014 N LYS d 80 22.012 30.522 59.039 1.00 82.86 N ++ATOM 1015 CA LYS d 80 22.768 31.781 59.151 1.00 82.86 C ++ATOM 1016 C LYS d 80 22.971 32.488 57.812 1.00 82.86 C ++ATOM 1017 O LYS d 80 24.087 32.887 57.468 1.00 82.86 O ++ATOM 1018 CB LYS d 80 24.114 31.541 59.839 1.00 82.86 C ++ATOM 1019 CG LYS d 80 24.048 30.945 61.247 1.00 82.86 C ++ATOM 1020 CD LYS d 80 23.564 31.934 62.308 1.00 82.86 C ++ATOM 1021 CE LYS d 80 22.115 31.688 62.725 1.00 82.86 C ++ATOM 1022 NZ LYS d 80 21.687 32.598 63.819 1.00 82.86 N ++ATOM 1023 N ASP d 81 21.879 32.606 57.050 1.00 79.69 N ++ATOM 1024 CA ASP d 81 21.833 33.307 55.760 1.00 79.69 C ++ATOM 1025 C ASP d 81 22.793 32.704 54.733 1.00 79.69 C ++ATOM 1026 O ASP d 81 23.426 33.419 53.954 1.00 79.69 O ++ATOM 1027 CB ASP d 81 22.082 34.809 55.929 1.00 79.69 C ++ATOM 1028 CG ASP d 81 20.963 35.497 56.673 1.00 79.69 C ++ATOM 1029 OD1 ASP d 81 19.810 35.035 56.566 1.00 79.69 O ++ATOM 1030 OD2 ASP d 81 21.235 36.493 57.375 1.00 79.69 O ++ATOM 1031 N LYS d 82 22.905 31.380 54.733 1.00 65.78 N ++ATOM 1032 CA LYS d 82 23.558 30.697 53.627 1.00 65.78 C ++ATOM 1033 C LYS d 82 22.650 30.688 52.406 1.00 65.78 C ++ATOM 1034 O LYS d 82 21.430 30.836 52.509 1.00 65.78 O ++ATOM 1035 CB LYS d 82 23.924 29.266 54.012 1.00 65.78 C ++ATOM 1036 CG LYS d 82 25.164 29.141 54.878 1.00 65.78 C ++ATOM 1037 CD LYS d 82 25.317 27.729 55.424 1.00 65.78 C ++ATOM 1038 CE LYS d 82 26.211 26.859 54.551 1.00 65.78 C ++ATOM 1039 NZ LYS d 82 25.596 26.443 53.263 1.00 65.78 N ++ATOM 1040 N GLU d 83 23.259 30.518 51.240 1.00 51.26 N ++ATOM 1041 CA GLU d 83 22.528 30.452 49.986 1.00 51.26 C ++ATOM 1042 C GLU d 83 22.867 29.156 49.268 1.00 51.26 C ++ATOM 1043 O GLU d 83 24.035 28.789 49.133 1.00 51.26 O ++ATOM 1044 CB GLU d 83 22.865 31.660 49.112 1.00 51.26 C ++ATOM 1045 CG GLU d 83 22.039 31.799 47.852 1.00 51.26 C ++ATOM 1046 CD GLU d 83 22.287 33.125 47.154 1.00 51.26 C ++ATOM 1047 OE1 GLU d 83 23.132 33.904 47.634 1.00 51.26 O ++ATOM 1048 OE2 GLU d 83 21.618 33.404 46.139 1.00 51.26 O ++ATOM 1049 N SER d 84 21.833 28.458 48.805 1.00 40.73 N ++ATOM 1050 CA SER d 84 22.018 27.109 48.299 1.00 40.73 C ++ATOM 1051 C SER d 84 21.326 26.947 46.959 1.00 40.73 C ++ATOM 1052 O SER d 84 20.507 27.776 46.548 1.00 40.73 O ++ATOM 1053 CB SER d 84 21.484 26.075 49.274 1.00 40.73 C ++ATOM 1054 OG SER d 84 22.139 26.202 50.519 1.00 40.73 O ++ATOM 1055 N THR d 85 21.641 25.836 46.300 1.00 26.38 N ++ATOM 1056 CA THR d 85 21.315 25.633 44.900 1.00 26.38 C ++ATOM 1057 C THR d 85 20.918 24.186 44.679 1.00 26.38 C ++ATOM 1058 O THR d 85 21.639 23.275 45.095 1.00 26.38 O ++ATOM 1059 CB THR d 85 22.516 25.992 44.022 1.00 26.38 C ++ATOM 1060 OG1 THR d 85 22.889 27.354 44.256 1.00 26.38 O ++ATOM 1061 CG2 THR d 85 22.179 25.833 42.574 1.00 26.38 C ++ATOM 1062 N VAL d 86 19.780 23.976 44.030 1.00 19.60 N ++ATOM 1063 CA VAL d 86 19.281 22.650 43.701 1.00 19.60 C ++ATOM 1064 C VAL d 86 19.229 22.547 42.183 1.00 19.60 C ++ATOM 1065 O VAL d 86 19.105 23.558 41.486 1.00 19.60 O ++ATOM 1066 CB VAL d 86 17.903 22.407 44.359 1.00 19.60 C ++ATOM 1067 CG1 VAL d 86 16.838 23.283 43.745 1.00 19.60 C ++ATOM 1068 CG2 VAL d 86 17.505 20.950 44.329 1.00 19.60 C ++ATOM 1069 N GLN d 87 19.420 21.341 41.662 1.00 16.73 N ++ATOM 1070 CA GLN d 87 19.289 21.076 40.235 1.00 16.73 C ++ATOM 1071 C GLN d 87 18.163 20.078 40.042 1.00 16.73 C ++ATOM 1072 O GLN d 87 18.319 18.897 40.353 1.00 16.73 O ++ATOM 1073 CB GLN d 87 20.580 20.536 39.635 1.00 16.73 C ++ATOM 1074 CG GLN d 87 20.421 20.214 38.170 1.00 16.73 C ++ATOM 1075 CD GLN d 87 21.691 19.747 37.523 1.00 16.73 C ++ATOM 1076 OE1 GLN d 87 22.735 19.670 38.159 1.00 16.73 O ++ATOM 1077 NE2 GLN d 87 21.609 19.422 36.243 1.00 16.73 N ++ATOM 1078 N VAL d 88 17.040 20.539 39.518 1.00 11.16 N ++ATOM 1079 CA VAL d 88 15.894 19.675 39.290 1.00 11.16 C ++ATOM 1080 C VAL d 88 16.031 19.065 37.908 1.00 11.16 C ++ATOM 1081 O VAL d 88 16.104 19.789 36.913 1.00 11.16 O ++ATOM 1082 CB VAL d 88 14.582 20.452 39.418 1.00 11.16 C ++ATOM 1083 CG1 VAL d 88 13.425 19.544 39.133 1.00 11.16 C ++ATOM 1084 CG2 VAL d 88 14.460 21.025 40.795 1.00 11.16 C ++ATOM 1085 N HIS d 89 16.065 17.737 37.843 1.00 15.87 N ++ATOM 1086 CA HIS d 89 16.304 17.020 36.594 1.00 15.87 C ++ATOM 1087 C HIS d 89 15.359 15.834 36.501 1.00 15.87 C ++ATOM 1088 O HIS d 89 15.486 14.889 37.280 1.00 15.87 O ++ATOM 1089 CB HIS d 89 17.750 16.548 36.510 1.00 15.87 C ++ATOM 1090 CG HIS d 89 18.051 15.762 35.277 1.00 15.87 C ++ATOM 1091 ND1 HIS d 89 18.154 16.342 34.032 1.00 15.87 N ++ATOM 1092 CD2 HIS d 89 18.260 14.439 35.093 1.00 15.87 C ++ATOM 1093 CE1 HIS d 89 18.413 15.410 33.135 1.00 15.87 C ++ATOM 1094 NE2 HIS d 89 18.486 14.247 33.753 1.00 15.87 N ++ATOM 1095 N TYR d 90 14.426 15.868 35.554 1.00 15.12 N ++ATOM 1096 CA TYR d 90 13.526 14.746 35.327 1.00 15.12 C ++ATOM 1097 C TYR d 90 13.759 14.127 33.960 1.00 15.12 C ++ATOM 1098 O TYR d 90 14.156 14.799 33.006 1.00 15.12 O ++ATOM 1099 CB TYR d 90 12.053 15.129 35.406 1.00 15.12 C ++ATOM 1100 CG TYR d 90 11.507 15.369 36.782 1.00 15.12 C ++ATOM 1101 CD1 TYR d 90 12.314 15.308 37.898 1.00 15.12 C ++ATOM 1102 CD2 TYR d 90 10.155 15.549 36.970 1.00 15.12 C ++ATOM 1103 CE1 TYR d 90 11.807 15.511 39.147 1.00 15.12 C ++ATOM 1104 CE2 TYR d 90 9.641 15.726 38.214 1.00 15.12 C ++ATOM 1105 CZ TYR d 90 10.471 15.711 39.300 1.00 15.12 C ++ATOM 1106 OH TYR d 90 9.975 15.894 40.558 1.00 15.12 O ++ATOM 1107 N ARG d 91 13.489 12.832 33.879 1.00 25.42 N ++ATOM 1108 CA ARG d 91 13.542 12.084 32.635 1.00 25.42 C ++ATOM 1109 C ARG d 91 12.307 11.196 32.565 1.00 25.42 C ++ATOM 1110 O ARG d 91 12.389 9.972 32.497 1.00 25.42 O ++ATOM 1111 CB ARG d 91 14.866 11.323 32.527 1.00 25.42 C ++ATOM 1112 CG ARG d 91 15.244 10.767 31.143 1.00 25.42 C ++ATOM 1113 CD ARG d 91 15.122 9.255 31.077 1.00 25.42 C ++ATOM 1114 NE ARG d 91 15.599 8.684 29.829 1.00 25.42 N ++ATOM 1115 CZ ARG d 91 15.451 7.405 29.510 1.00 25.42 C ++ATOM 1116 NH1 ARG d 91 14.842 6.584 30.349 1.00 25.42 N ++ATOM 1117 NH2 ARG d 91 15.908 6.949 28.358 1.00 25.42 N ++ATOM 1118 N MET d 92 11.132 11.798 32.711 1.00 26.35 N ++ATOM 1119 CA MET d 92 9.893 11.037 32.566 1.00 26.35 C ++ATOM 1120 C MET d 92 9.756 10.613 31.114 1.00 26.35 C ++ATOM 1121 O MET d 92 9.329 11.379 30.249 1.00 26.35 O ++ATOM 1122 CB MET d 92 8.694 11.847 33.035 1.00 26.35 C ++ATOM 1123 CG MET d 92 8.586 11.914 34.533 1.00 26.35 C ++ATOM 1124 SD MET d 92 8.292 10.267 35.184 1.00 26.35 S ++ATOM 1125 CE MET d 92 8.347 10.575 36.937 1.00 26.35 C ++ATOM 1126 N CYS d 93 10.120 9.362 30.867 1.00 35.70 N ++ATOM 1127 CA CYS d 93 10.407 8.829 29.543 1.00 35.70 C ++ATOM 1128 C CYS d 93 9.072 8.500 28.887 1.00 35.70 C ++ATOM 1129 O CYS d 93 8.520 7.408 29.033 1.00 35.70 O ++ATOM 1130 CB CYS d 93 11.313 7.610 29.697 1.00 35.70 C ++ATOM 1131 SG CYS d 93 12.206 6.878 28.307 1.00 35.70 S ++ATOM 1132 N GLN d 94 8.526 9.482 28.172 1.00 32.18 N ++ATOM 1133 CA GLN d 94 7.279 9.277 27.450 1.00 32.18 C ++ATOM 1134 C GLN d 94 7.311 9.757 26.011 1.00 32.18 C ++ATOM 1135 O GLN d 94 6.314 9.600 25.302 1.00 32.18 O ++ATOM 1136 CB GLN d 94 6.117 9.961 28.155 1.00 32.18 C ++ATOM 1137 CG GLN d 94 6.182 11.431 28.075 1.00 32.18 C ++ATOM 1138 CD GLN d 94 4.980 12.043 28.695 1.00 32.18 C ++ATOM 1139 OE1 GLN d 94 4.042 11.350 29.084 1.00 32.18 O ++ATOM 1140 NE2 GLN d 94 4.994 13.354 28.811 1.00 32.18 N ++ATOM 1141 N SER d 95 8.413 10.341 25.554 1.00 41.56 N ++ATOM 1142 CA SER d 95 8.709 10.382 24.132 1.00 41.56 C ++ATOM 1143 C SER d 95 9.630 9.235 23.755 1.00 41.56 C ++ATOM 1144 O SER d 95 10.504 9.382 22.897 1.00 41.56 O ++ATOM 1145 CB SER d 95 9.311 11.727 23.731 1.00 41.56 C ++ATOM 1146 OG SER d 95 10.583 11.910 24.316 1.00 41.56 O ++ATOM 1147 N CYS d 96 9.455 8.099 24.419 1.00 42.25 N ++ATOM 1148 CA CYS d 96 10.330 6.950 24.332 1.00 42.25 C ++ATOM 1149 C CYS d 96 9.571 5.779 23.735 1.00 42.25 C ++ATOM 1150 O CYS d 96 8.339 5.747 23.724 1.00 42.25 O ++ATOM 1151 CB CYS d 96 10.843 6.553 25.708 1.00 42.25 C ++ATOM 1152 SG CYS d 96 11.651 7.858 26.625 1.00 42.25 S ++ATOM 1153 N VAL d 97 10.331 4.809 23.240 1.00 42.65 N ++ATOM 1154 CA VAL d 97 9.801 3.657 22.522 1.00 42.65 C ++ATOM 1155 C VAL d 97 10.614 2.439 22.915 1.00 42.65 C ++ATOM 1156 O VAL d 97 11.844 2.458 22.823 1.00 42.65 O ++ATOM 1157 CB VAL d 97 9.849 3.872 20.997 1.00 42.65 C ++ATOM 1158 CG1 VAL d 97 9.703 2.580 20.267 1.00 42.65 C ++ATOM 1159 CG2 VAL d 97 8.714 4.736 20.570 1.00 42.65 C ++ATOM 1160 N GLU d 98 9.941 1.386 23.366 1.00 44.94 N ++ATOM 1161 CA GLU d 98 10.633 0.133 23.609 1.00 44.94 C ++ATOM 1162 C GLU d 98 10.955 -0.521 22.271 1.00 44.94 C ++ATOM 1163 O GLU d 98 10.146 -0.511 21.341 1.00 44.94 O ++ATOM 1164 CB GLU d 98 9.800 -0.788 24.511 1.00 44.94 C ++ATOM 1165 CG GLU d 98 8.556 -1.444 23.906 1.00 44.94 C ++ATOM 1166 CD GLU d 98 7.321 -0.558 23.920 1.00 44.94 C ++ATOM 1167 OE1 GLU d 98 7.448 0.664 24.134 1.00 44.94 O ++ATOM 1168 OE2 GLU d 98 6.214 -1.093 23.702 1.00 44.94 O ++ATOM 1169 N LEU d 99 12.176 -1.022 22.144 1.00 53.43 N ++ATOM 1170 CA LEU d 99 12.581 -1.644 20.892 1.00 53.43 C ++ATOM 1171 C LEU d 99 13.591 -2.738 21.179 1.00 53.43 C ++ATOM 1172 O LEU d 99 14.606 -2.502 21.837 1.00 53.43 O ++ATOM 1173 CB LEU d 99 13.131 -0.606 19.898 1.00 53.43 C ++ATOM 1174 CG LEU d 99 14.225 0.429 20.186 1.00 53.43 C ++ATOM 1175 CD1 LEU d 99 15.643 -0.065 19.986 1.00 53.43 C ++ATOM 1176 CD2 LEU d 99 13.981 1.637 19.299 1.00 53.43 C ++ATOM 1177 N ASP d 100 13.279 -3.929 20.740 1.00 68.68 N ++ATOM 1178 CA ASP d 100 14.264 -4.986 20.735 1.00 68.68 C ++ATOM 1179 C ASP d 100 15.237 -4.747 19.585 1.00 68.68 C ++ATOM 1180 O ASP d 100 14.883 -4.098 18.599 1.00 68.68 O ++ATOM 1181 CB ASP d 100 13.579 -6.335 20.567 1.00 68.68 C ++ATOM 1182 CG ASP d 100 12.684 -6.679 21.733 1.00 68.68 C ++ATOM 1183 OD1 ASP d 100 12.975 -6.224 22.857 1.00 68.68 O ++ATOM 1184 OD2 ASP d 100 11.688 -7.401 21.526 1.00 68.68 O ++ATOM 1185 N PRO d 101 16.478 -5.234 19.688 1.00 67.66 N ++ATOM 1186 CA PRO d 101 17.341 -5.228 18.498 1.00 67.66 C ++ATOM 1187 C PRO d 101 16.820 -6.132 17.396 1.00 67.66 C ++ATOM 1188 O PRO d 101 17.026 -5.832 16.212 1.00 67.66 O ++ATOM 1189 CB PRO d 101 18.695 -5.704 19.040 1.00 67.66 C ++ATOM 1190 CG PRO d 101 18.361 -6.467 20.275 1.00 67.66 C ++ATOM 1191 CD PRO d 101 17.173 -5.771 20.870 1.00 67.66 C ++ATOM 1192 N ALA d 102 16.126 -7.215 17.762 1.00 67.01 N ++ATOM 1193 CA ALA d 102 15.495 -8.080 16.772 1.00 67.01 C ++ATOM 1194 C ALA d 102 14.388 -7.352 16.019 1.00 67.01 C ++ATOM 1195 O ALA d 102 14.241 -7.520 14.805 1.00 67.01 O ++ATOM 1196 CB ALA d 102 14.944 -9.333 17.450 1.00 67.01 C ++ATOM 1197 N THR d 103 13.617 -6.513 16.715 1.00 63.98 N ++ATOM 1198 CA THR d 103 12.548 -5.781 16.044 1.00 63.98 C ++ATOM 1199 C THR d 103 13.092 -4.662 15.162 1.00 63.98 C ++ATOM 1200 O THR d 103 12.519 -4.381 14.101 1.00 63.98 O ++ATOM 1201 CB THR d 103 11.565 -5.228 17.072 1.00 63.98 C ++ATOM 1202 OG1 THR d 103 12.254 -4.364 17.981 1.00 63.98 O ++ATOM 1203 CG2 THR d 103 10.932 -6.363 17.851 1.00 63.98 C ++ATOM 1204 N VAL d 104 14.206 -4.041 15.560 1.00 63.12 N ++ATOM 1205 CA VAL d 104 14.852 -3.047 14.707 1.00 63.12 C ++ATOM 1206 C VAL d 104 15.409 -3.708 13.454 1.00 63.12 C ++ATOM 1207 O VAL d 104 15.261 -3.183 12.340 1.00 63.12 O ++ATOM 1208 CB VAL d 104 15.944 -2.300 15.493 1.00 63.12 C ++ATOM 1209 CG1 VAL d 104 16.734 -1.368 14.591 1.00 63.12 C ++ATOM 1210 CG2 VAL d 104 15.316 -1.509 16.593 1.00 63.12 C ++ATOM 1211 N ALA d 105 16.024 -4.886 13.613 1.00 58.81 N ++ATOM 1212 CA ALA d 105 16.500 -5.643 12.461 1.00 58.81 C ++ATOM 1213 C ALA d 105 15.349 -6.065 11.555 1.00 58.81 C ++ATOM 1214 O ALA d 105 15.479 -6.031 10.329 1.00 58.81 O ++ATOM 1215 CB ALA d 105 17.293 -6.862 12.926 1.00 58.81 C ++ATOM 1216 N GLY d 106 14.202 -6.419 12.143 1.00 56.99 N ++ATOM 1217 CA GLY d 106 13.041 -6.777 11.341 1.00 56.99 C ++ATOM 1218 C GLY d 106 12.491 -5.615 10.534 1.00 56.99 C ++ATOM 1219 O GLY d 106 12.164 -5.775 9.352 1.00 56.99 O ++ATOM 1220 N ILE d 107 12.409 -4.429 11.150 1.00 56.67 N ++ATOM 1221 CA ILE d 107 11.958 -3.230 10.440 1.00 56.67 C ++ATOM 1222 C ILE d 107 12.912 -2.881 9.304 1.00 56.67 C ++ATOM 1223 O ILE d 107 12.478 -2.611 8.174 1.00 56.67 O ++ATOM 1224 CB ILE d 107 11.793 -2.053 11.420 1.00 56.67 C ++ATOM 1225 CG1 ILE d 107 10.647 -2.321 12.390 1.00 56.67 C ++ATOM 1226 CG2 ILE d 107 11.537 -0.755 10.680 1.00 56.67 C ++ATOM 1227 CD1 ILE d 107 10.581 -1.341 13.536 1.00 56.67 C ++ATOM 1228 N ILE d 108 14.222 -2.936 9.567 1.00 55.72 N ++ATOM 1229 CA ILE d 108 15.204 -2.577 8.545 1.00 55.72 C ++ATOM 1230 C ILE d 108 15.194 -3.582 7.394 1.00 55.72 C ++ATOM 1231 O ILE d 108 15.213 -3.190 6.219 1.00 55.72 O ++ATOM 1232 CB ILE d 108 16.600 -2.436 9.180 1.00 55.72 C ++ATOM 1233 CG1 ILE d 108 16.630 -1.238 10.123 1.00 55.72 C ++ATOM 1234 CG2 ILE d 108 17.674 -2.258 8.125 1.00 55.72 C ++ATOM 1235 CD1 ILE d 108 17.880 -1.169 10.963 1.00 55.72 C ++ATOM 1236 N VAL d 109 15.103 -4.880 7.704 1.00 54.75 N ++ATOM 1237 CA VAL d 109 15.131 -5.902 6.661 1.00 54.75 C ++ATOM 1238 C VAL d 109 13.868 -5.854 5.804 1.00 54.75 C ++ATOM 1239 O VAL d 109 13.947 -5.939 4.570 1.00 54.75 O ++ATOM 1240 CB VAL d 109 15.370 -7.290 7.290 1.00 54.75 C ++ATOM 1241 CG1 VAL d 109 15.066 -8.404 6.313 1.00 54.75 C ++ATOM 1242 CG2 VAL d 109 16.822 -7.414 7.712 1.00 54.75 C ++ATOM 1243 N THR d 110 12.691 -5.662 6.419 1.00 54.28 N ++ATOM 1244 CA THR d 110 11.480 -5.556 5.605 1.00 54.28 C ++ATOM 1245 C THR d 110 11.440 -4.264 4.800 1.00 54.28 C ++ATOM 1246 O THR d 110 10.894 -4.257 3.689 1.00 54.28 O ++ATOM 1247 CB THR d 110 10.228 -5.667 6.468 1.00 54.28 C ++ATOM 1248 OG1 THR d 110 10.263 -4.676 7.499 1.00 54.28 O ++ATOM 1249 CG2 THR d 110 10.121 -7.047 7.077 1.00 54.28 C ++ATOM 1250 N ASP d 111 12.054 -3.187 5.304 1.00 56.01 N ++ATOM 1251 CA ASP d 111 12.165 -1.969 4.506 1.00 56.01 C ++ATOM 1252 C ASP d 111 13.064 -2.186 3.293 1.00 56.01 C ++ATOM 1253 O ASP d 111 12.741 -1.733 2.187 1.00 56.01 O ++ATOM 1254 CB ASP d 111 12.702 -0.831 5.372 1.00 56.01 C ++ATOM 1255 CG ASP d 111 12.513 0.534 4.738 1.00 56.01 C ++ATOM 1256 OD1 ASP d 111 11.889 0.625 3.661 1.00 56.01 O ++ATOM 1257 OD2 ASP d 111 13.002 1.526 5.317 1.00 56.01 O ++ATOM 1258 N VAL d 112 14.181 -2.896 3.479 1.00 55.79 N ++ATOM 1259 CA VAL d 112 15.096 -3.161 2.369 1.00 55.79 C ++ATOM 1260 C VAL d 112 14.440 -4.070 1.332 1.00 55.79 C ++ATOM 1261 O VAL d 112 14.572 -3.848 0.120 1.00 55.79 O ++ATOM 1262 CB VAL d 112 16.422 -3.738 2.906 1.00 55.79 C ++ATOM 1263 CG1 VAL d 112 17.305 -4.249 1.786 1.00 55.79 C ++ATOM 1264 CG2 VAL d 112 17.174 -2.666 3.667 1.00 55.79 C ++ATOM 1265 N ILE d 113 13.671 -5.064 1.789 1.00 53.31 N ++ATOM 1266 CA ILE d 113 12.954 -5.954 0.875 1.00 53.31 C ++ATOM 1267 C ILE d 113 11.887 -5.191 0.092 1.00 53.31 C ++ATOM 1268 O ILE d 113 11.730 -5.396 -1.117 1.00 53.31 O ++ATOM 1269 CB ILE d 113 12.364 -7.147 1.652 1.00 53.31 C ++ATOM 1270 CG1 ILE d 113 13.483 -8.069 2.134 1.00 53.31 C ++ATOM 1271 CG2 ILE d 113 11.380 -7.941 0.817 1.00 53.31 C ++ATOM 1272 CD1 ILE d 113 13.018 -9.138 3.098 1.00 53.31 C ++ATOM 1273 N ALA d 114 11.183 -4.258 0.743 1.00 52.43 N ++ATOM 1274 CA ALA d 114 10.177 -3.468 0.034 1.00 52.43 C ++ATOM 1275 C ALA d 114 10.810 -2.533 -0.993 1.00 52.43 C ++ATOM 1276 O ALA d 114 10.272 -2.358 -2.099 1.00 52.43 O ++ATOM 1277 CB ALA d 114 9.336 -2.677 1.031 1.00 52.43 C ++ATOM 1278 N THR d 115 11.962 -1.942 -0.662 1.00 55.52 N ++ATOM 1279 CA THR d 115 12.646 -1.094 -1.634 1.00 55.52 C ++ATOM 1280 C THR d 115 13.186 -1.904 -2.807 1.00 55.52 C ++ATOM 1281 O THR d 115 13.177 -1.429 -3.947 1.00 55.52 O ++ATOM 1282 CB THR d 115 13.775 -0.317 -0.968 1.00 55.52 C ++ATOM 1283 OG1 THR d 115 14.661 -1.232 -0.316 1.00 55.52 O ++ATOM 1284 CG2 THR d 115 13.225 0.679 0.031 1.00 55.52 C ++ATOM 1285 N LEU d 116 13.635 -3.137 -2.557 1.00 56.03 N ++ATOM 1286 CA LEU d 116 14.072 -3.973 -3.672 1.00 56.03 C ++ATOM 1287 C LEU d 116 12.900 -4.433 -4.528 1.00 56.03 C ++ATOM 1288 O LEU d 116 13.061 -4.615 -5.739 1.00 56.03 O ++ATOM 1289 CB LEU d 116 14.860 -5.182 -3.172 1.00 56.03 C ++ATOM 1290 CG LEU d 116 16.224 -4.883 -2.554 1.00 56.03 C ++ATOM 1291 CD1 LEU d 116 16.889 -6.174 -2.102 1.00 56.03 C ++ATOM 1292 CD2 LEU d 116 17.113 -4.111 -3.515 1.00 56.03 C ++ATOM 1293 N LEU d 117 11.722 -4.616 -3.926 1.00 56.16 N ++ATOM 1294 CA LEU d 117 10.535 -4.913 -4.723 1.00 56.16 C ++ATOM 1295 C LEU d 117 10.166 -3.741 -5.620 1.00 56.16 C ++ATOM 1296 O LEU d 117 9.822 -3.942 -6.787 1.00 56.16 O ++ATOM 1297 CB LEU d 117 9.352 -5.282 -3.832 1.00 56.16 C ++ATOM 1298 CG LEU d 117 9.408 -6.625 -3.111 1.00 56.16 C ++ATOM 1299 CD1 LEU d 117 8.200 -6.779 -2.210 1.00 56.16 C ++ATOM 1300 CD2 LEU d 117 9.498 -7.765 -4.103 1.00 56.16 C ++ATOM 1301 N LEU d 118 10.259 -2.509 -5.107 1.00 54.45 N ++ATOM 1302 CA LEU d 118 10.026 -1.354 -5.975 1.00 54.45 C ++ATOM 1303 C LEU d 118 11.100 -1.204 -7.047 1.00 54.45 C ++ATOM 1304 O LEU d 118 10.797 -0.764 -8.167 1.00 54.45 O ++ATOM 1305 CB LEU d 118 9.929 -0.071 -5.164 1.00 54.45 C ++ATOM 1306 CG LEU d 118 8.593 0.138 -4.478 1.00 54.45 C ++ATOM 1307 CD1 LEU d 118 8.661 1.382 -3.633 1.00 54.45 C ++ATOM 1308 CD2 LEU d 118 7.523 0.273 -5.536 1.00 54.45 C ++ATOM 1309 N ALA d 119 12.345 -1.574 -6.733 1.00 60.09 N ++ATOM 1310 CA ALA d 119 13.410 -1.529 -7.730 1.00 60.09 C ++ATOM 1311 C ALA d 119 13.158 -2.525 -8.856 1.00 60.09 C ++ATOM 1312 O ALA d 119 13.287 -2.179 -10.035 1.00 60.09 O ++ATOM 1313 CB ALA d 119 14.760 -1.794 -7.068 1.00 60.09 C ++ATOM 1314 N LEU d 120 12.758 -3.754 -8.509 1.00 61.67 N ++ATOM 1315 CA LEU d 120 12.403 -4.735 -9.530 1.00 61.67 C ++ATOM 1316 C LEU d 120 11.135 -4.341 -10.274 1.00 61.67 C ++ATOM 1317 O LEU d 120 10.984 -4.675 -11.452 1.00 61.67 O ++ATOM 1318 CB LEU d 120 12.229 -6.117 -8.909 1.00 61.67 C ++ATOM 1319 CG LEU d 120 13.476 -6.744 -8.289 1.00 61.67 C ++ATOM 1320 CD1 LEU d 120 13.139 -8.083 -7.661 1.00 61.67 C ++ATOM 1321 CD2 LEU d 120 14.583 -6.887 -9.310 1.00 61.67 C ++ATOM 1322 N GLY d 121 10.230 -3.616 -9.611 1.00 62.39 N ++ATOM 1323 CA GLY d 121 9.030 -3.150 -10.285 1.00 62.39 C ++ATOM 1324 C GLY d 121 9.328 -2.124 -11.360 1.00 62.39 C ++ATOM 1325 O GLY d 121 8.831 -2.231 -12.484 1.00 62.39 O ++ATOM 1326 N VAL d 122 10.171 -1.136 -11.043 1.00 64.59 N ++ATOM 1327 CA VAL d 122 10.550 -0.147 -12.053 1.00 64.59 C ++ATOM 1328 C VAL d 122 11.439 -0.780 -13.119 1.00 64.59 C ++ATOM 1329 O VAL d 122 11.344 -0.428 -14.301 1.00 64.59 O ++ATOM 1330 CB VAL d 122 11.217 1.072 -11.387 1.00 64.59 C ++ATOM 1331 CG1 VAL d 122 11.638 2.122 -12.411 1.00 64.59 C ++ATOM 1332 CG2 VAL d 122 10.268 1.697 -10.408 1.00 64.59 C ++ATOM 1333 N PHE d 123 12.253 -1.772 -12.737 1.00 69.95 N ++ATOM 1334 CA PHE d 123 13.083 -2.503 -13.693 1.00 69.95 C ++ATOM 1335 C PHE d 123 12.236 -3.243 -14.727 1.00 69.95 C ++ATOM 1336 O PHE d 123 12.386 -3.029 -15.938 1.00 69.95 O ++ATOM 1337 CB PHE d 123 13.985 -3.465 -12.917 1.00 69.95 C ++ATOM 1338 CG PHE d 123 14.873 -4.313 -13.772 1.00 69.95 C ++ATOM 1339 CD1 PHE d 123 15.955 -3.763 -14.436 1.00 69.95 C ++ATOM 1340 CD2 PHE d 123 14.657 -5.679 -13.864 1.00 69.95 C ++ATOM 1341 CE1 PHE d 123 16.784 -4.554 -15.210 1.00 69.95 C ++ATOM 1342 CE2 PHE d 123 15.482 -6.476 -14.632 1.00 69.95 C ++ATOM 1343 CZ PHE d 123 16.547 -5.913 -15.307 1.00 69.95 C ++ATOM 1344 N CYS d 124 11.305 -4.076 -14.263 1.00 68.75 N ++ATOM 1345 CA CYS d 124 10.420 -4.824 -15.145 1.00 68.75 C ++ATOM 1346 C CYS d 124 9.403 -3.946 -15.860 1.00 68.75 C ++ATOM 1347 O CYS d 124 8.914 -4.347 -16.920 1.00 68.75 O ++ATOM 1348 CB CYS d 124 9.692 -5.916 -14.360 1.00 68.75 C ++ATOM 1349 SG CYS d 124 10.769 -7.219 -13.727 1.00 68.75 S ++ATOM 1350 N PHE d 125 9.075 -2.768 -15.330 1.00 72.72 N ++ATOM 1351 CA PHE d 125 8.163 -1.886 -16.048 1.00 72.72 C ++ATOM 1352 C PHE d 125 8.875 -1.103 -17.138 1.00 72.72 C ++ATOM 1353 O PHE d 125 8.322 -0.905 -18.223 1.00 72.72 O ++ATOM 1354 CB PHE d 125 7.475 -0.929 -15.081 1.00 72.72 C ++ATOM 1355 CG PHE d 125 6.591 0.070 -15.756 1.00 72.72 C ++ATOM 1356 CD1 PHE d 125 5.387 -0.320 -16.312 1.00 72.72 C ++ATOM 1357 CD2 PHE d 125 6.961 1.403 -15.830 1.00 72.72 C ++ATOM 1358 CE1 PHE d 125 4.570 0.598 -16.940 1.00 72.72 C ++ATOM 1359 CE2 PHE d 125 6.149 2.327 -16.452 1.00 72.72 C ++ATOM 1360 CZ PHE d 125 4.949 1.924 -17.007 1.00 72.72 C ++ATOM 1361 N ALA d 126 10.097 -0.642 -16.872 1.00 75.70 N ++ATOM 1362 CA ALA d 126 10.813 0.148 -17.858 1.00 75.70 C ++ATOM 1363 C ALA d 126 11.429 -0.714 -18.946 1.00 75.70 C ++ATOM 1364 O ALA d 126 11.621 -0.229 -20.066 1.00 75.70 O ++ATOM 1365 CB ALA d 126 11.891 0.983 -17.175 1.00 75.70 C ++ATOM 1366 N GLY d 127 11.743 -1.978 -18.647 1.00 76.05 N ++ATOM 1367 CA GLY d 127 12.259 -2.852 -19.684 1.00 76.05 C ++ATOM 1368 C GLY d 127 11.229 -3.258 -20.718 1.00 76.05 C ++ATOM 1369 O GLY d 127 11.599 -3.594 -21.847 1.00 76.05 O ++ATOM 1370 N HIS d 128 9.950 -3.232 -20.362 1.00 76.83 N ++ATOM 1371 CA HIS d 128 8.884 -3.725 -21.225 1.00 76.83 C ++ATOM 1372 C HIS d 128 7.717 -2.742 -21.228 1.00 76.83 C ++ATOM 1373 O HIS d 128 6.566 -3.106 -20.981 1.00 76.83 O ++ATOM 1374 CB HIS d 128 8.461 -5.125 -20.789 1.00 76.83 C ++ATOM 1375 CG HIS d 128 9.542 -6.150 -20.947 1.00 76.83 C ++ATOM 1376 ND1 HIS d 128 9.852 -6.721 -22.163 1.00 76.83 N ++ATOM 1377 CD2 HIS d 128 10.411 -6.676 -20.053 1.00 76.83 C ++ATOM 1378 CE1 HIS d 128 10.850 -7.574 -22.005 1.00 76.83 C ++ATOM 1379 NE2 HIS d 128 11.207 -7.565 -20.734 1.00 76.83 N ++ATOM 1380 N GLU d 129 8.029 -1.469 -21.476 1.00 81.70 N ++ATOM 1381 CA GLU d 129 7.051 -0.377 -21.520 1.00 81.70 C ++ATOM 1382 C GLU d 129 5.951 -0.586 -22.558 1.00 81.70 C ++ATOM 1383 O GLU d 129 5.300 0.368 -22.983 1.00 81.70 O ++ATOM 1384 CB GLU d 129 7.756 0.948 -21.817 1.00 81.70 C ++ATOM 1385 CG GLU d 129 8.726 1.403 -20.751 1.00 81.70 C ++ATOM 1386 CD GLU d 129 9.412 2.699 -21.121 1.00 81.70 C ++ATOM 1387 OE1 GLU d 129 9.201 3.182 -22.253 1.00 81.70 O ++ATOM 1388 OE2 GLU d 129 10.169 3.233 -20.285 1.00 81.70 O ++ATOM 1390 N GLN f 33 2.600 -25.650 43.852 1.00 60.87 N ++ATOM 1391 CA GLN f 33 1.949 -26.937 43.661 1.00 60.87 C ++ATOM 1392 C GLN f 33 1.105 -26.909 42.389 1.00 60.87 C ++ATOM 1393 O GLN f 33 1.590 -27.260 41.314 1.00 60.87 O ++ATOM 1394 CB GLN f 33 1.094 -27.298 44.885 1.00 60.87 C ++ATOM 1395 CG GLN f 33 0.476 -28.705 44.865 1.00 60.87 C ++ATOM 1396 CD GLN f 33 1.511 -29.812 44.784 1.00 60.87 C ++ATOM 1397 OE1 GLN f 33 1.685 -30.441 43.740 1.00 60.87 O ++ATOM 1398 NE2 GLN f 33 2.208 -30.052 45.887 1.00 60.87 N ++ATOM 1399 N THR f 34 -0.150 -26.476 42.507 1.00 50.73 N ++ATOM 1400 CA THR f 34 -1.057 -26.477 41.371 1.00 50.73 C ++ATOM 1401 C THR f 34 -1.802 -25.151 41.338 1.00 50.73 C ++ATOM 1402 O THR f 34 -2.540 -24.837 42.280 1.00 50.73 O ++ATOM 1403 CB THR f 34 -2.039 -27.641 41.458 1.00 50.73 C ++ATOM 1404 OG1 THR f 34 -1.311 -28.859 41.635 1.00 50.73 O ++ATOM 1405 CG2 THR f 34 -2.827 -27.743 40.176 1.00 50.73 C ++ATOM 1406 N PRO f 35 -1.636 -24.353 40.288 1.00 39.91 N ++ATOM 1407 CA PRO f 35 -2.168 -22.990 40.297 1.00 39.91 C ++ATOM 1408 C PRO f 35 -3.682 -22.964 40.169 1.00 39.91 C ++ATOM 1409 O PRO f 35 -4.313 -23.917 39.711 1.00 39.91 O ++ATOM 1410 CB PRO f 35 -1.505 -22.349 39.074 1.00 39.91 C ++ATOM 1411 CG PRO f 35 -0.331 -23.208 38.775 1.00 39.91 C ++ATOM 1412 CD PRO f 35 -0.766 -24.586 39.127 1.00 39.91 C ++ATOM 1413 N TYR f 36 -4.264 -21.851 40.612 1.00 34.35 N ++ATOM 1414 CA TYR f 36 -5.687 -21.629 40.423 1.00 34.35 C ++ATOM 1415 C TYR f 36 -5.999 -21.436 38.949 1.00 34.35 C ++ATOM 1416 O TYR f 36 -5.229 -20.830 38.206 1.00 34.35 O ++ATOM 1417 CB TYR f 36 -6.156 -20.394 41.178 1.00 34.35 C ++ATOM 1418 CG TYR f 36 -6.213 -20.517 42.671 1.00 34.35 C ++ATOM 1419 CD1 TYR f 36 -6.127 -21.739 43.292 1.00 34.35 C ++ATOM 1420 CD2 TYR f 36 -6.378 -19.398 43.458 1.00 34.35 C ++ATOM 1421 CE1 TYR f 36 -6.187 -21.840 44.654 1.00 34.35 C ++ATOM 1422 CE2 TYR f 36 -6.433 -19.485 44.816 1.00 34.35 C ++ATOM 1423 CZ TYR f 36 -6.341 -20.706 45.411 1.00 34.35 C ++ATOM 1424 OH TYR f 36 -6.400 -20.804 46.775 1.00 34.35 O ++ATOM 1425 N LYS f 37 -7.145 -21.937 38.526 1.00 31.81 N ++ATOM 1426 CA LYS f 37 -7.561 -21.777 37.141 1.00 31.81 C ++ATOM 1427 C LYS f 37 -8.517 -20.599 37.069 1.00 31.81 C ++ATOM 1428 O LYS f 37 -9.620 -20.653 37.616 1.00 31.81 O ++ATOM 1429 CB LYS f 37 -8.200 -23.053 36.608 1.00 31.81 C ++ATOM 1430 CG LYS f 37 -7.202 -24.177 36.421 1.00 31.81 C ++ATOM 1431 CD LYS f 37 -7.856 -25.433 35.885 1.00 31.81 C ++ATOM 1432 CE LYS f 37 -7.748 -25.513 34.363 1.00 31.81 C ++ATOM 1433 NZ LYS f 37 -8.611 -24.540 33.640 1.00 31.81 N ++ATOM 1434 N VAL f 38 -8.088 -19.534 36.406 1.00 28.36 N ++ATOM 1435 CA VAL f 38 -8.880 -18.319 36.276 1.00 28.36 C ++ATOM 1436 C VAL f 38 -9.441 -18.300 34.864 1.00 28.36 C ++ATOM 1437 O VAL f 38 -8.784 -17.827 33.934 1.00 28.36 O ++ATOM 1438 CB VAL f 38 -8.036 -17.070 36.548 1.00 28.36 C ++ATOM 1439 CG1 VAL f 38 -8.901 -15.827 36.517 1.00 28.36 C ++ATOM 1440 CG2 VAL f 38 -7.303 -17.207 37.858 1.00 28.36 C ++ATOM 1441 N SER f 39 -10.646 -18.823 34.681 1.00 24.70 N ++ATOM 1442 CA SER f 39 -11.263 -18.882 33.366 1.00 24.70 C ++ATOM 1443 C SER f 39 -12.153 -17.664 33.206 1.00 24.70 C ++ATOM 1444 O SER f 39 -13.180 -17.554 33.878 1.00 24.70 O ++ATOM 1445 CB SER f 39 -12.070 -20.169 33.201 1.00 24.70 C ++ATOM 1446 OG SER f 39 -12.718 -20.208 31.944 1.00 24.70 O ++ATOM 1447 N ILE f 40 -11.766 -16.752 32.330 1.00 26.12 N ++ATOM 1448 CA ILE f 40 -12.527 -15.530 32.111 1.00 26.12 C ++ATOM 1449 C ILE f 40 -13.319 -15.658 30.822 1.00 26.12 C ++ATOM 1450 O ILE f 40 -12.740 -15.810 29.742 1.00 26.12 O ++ATOM 1451 CB ILE f 40 -11.612 -14.300 32.062 1.00 26.12 C ++ATOM 1452 CG1 ILE f 40 -10.861 -14.160 33.382 1.00 26.12 C ++ATOM 1453 CG2 ILE f 40 -12.443 -13.070 31.819 1.00 26.12 C ++ATOM 1454 CD1 ILE f 40 -9.772 -13.133 33.352 1.00 26.12 C ++ATOM 1455 N SER f 41 -14.641 -15.576 30.932 1.00 32.63 N ++ATOM 1456 CA SER f 41 -15.540 -15.660 29.788 1.00 32.63 C ++ATOM 1457 C SER f 41 -16.334 -14.362 29.726 1.00 32.63 C ++ATOM 1458 O SER f 41 -17.215 -14.132 30.561 1.00 32.63 O ++ATOM 1459 CB SER f 41 -16.461 -16.866 29.904 1.00 32.63 C ++ATOM 1460 OG SER f 41 -17.385 -16.899 28.833 1.00 32.63 O ++ATOM 1461 N GLY f 42 -16.019 -13.521 28.745 1.00 35.76 N ++ATOM 1462 CA GLY f 42 -16.742 -12.282 28.545 1.00 35.76 C ++ATOM 1463 C GLY f 42 -16.500 -11.294 29.662 1.00 35.76 C ++ATOM 1464 O GLY f 42 -15.417 -10.714 29.765 1.00 35.76 O ++ATOM 1465 N THR f 43 -17.515 -11.091 30.499 1.00 34.56 N ++ATOM 1466 CA THR f 43 -17.418 -10.324 31.734 1.00 34.56 C ++ATOM 1467 C THR f 43 -17.791 -11.191 32.925 1.00 34.56 C ++ATOM 1468 O THR f 43 -18.531 -10.769 33.812 1.00 34.56 O ++ATOM 1469 CB THR f 43 -18.314 -9.091 31.693 1.00 34.56 C ++ATOM 1470 OG1 THR f 43 -19.680 -9.503 31.585 1.00 34.56 O ++ATOM 1471 CG2 THR f 43 -17.966 -8.211 30.515 1.00 34.56 C ++ATOM 1472 N THR f 44 -17.303 -12.427 32.951 1.00 29.12 N ++ATOM 1473 CA THR f 44 -17.638 -13.369 34.009 1.00 29.12 C ++ATOM 1474 C THR f 44 -16.409 -14.196 34.328 1.00 29.12 C ++ATOM 1475 O THR f 44 -15.901 -14.906 33.459 1.00 29.12 O ++ATOM 1476 CB THR f 44 -18.785 -14.284 33.590 1.00 29.12 C ++ATOM 1477 OG1 THR f 44 -19.962 -13.503 33.367 1.00 29.12 O ++ATOM 1478 CG2 THR f 44 -19.056 -15.315 34.655 1.00 29.12 C ++ATOM 1479 N VAL f 45 -15.944 -14.128 35.565 1.00 27.48 N ++ATOM 1480 CA VAL f 45 -14.717 -14.806 35.962 1.00 27.48 C ++ATOM 1481 C VAL f 45 -15.085 -16.036 36.775 1.00 27.48 C ++ATOM 1482 O VAL f 45 -15.818 -15.938 37.762 1.00 27.48 O ++ATOM 1483 CB VAL f 45 -13.795 -13.870 36.747 1.00 27.48 C ++ATOM 1484 CG1 VAL f 45 -12.614 -14.625 37.290 1.00 27.48 C ++ATOM 1485 CG2 VAL f 45 -13.332 -12.765 35.840 1.00 27.48 C ++ATOM 1486 N ILE f 46 -14.591 -17.195 36.366 1.00 27.46 N ++ATOM 1487 CA ILE f 46 -14.798 -18.431 37.098 1.00 27.46 C ++ATOM 1488 C ILE f 46 -13.448 -18.864 37.642 1.00 27.46 C ++ATOM 1489 O ILE f 46 -12.546 -19.236 36.881 1.00 27.46 O ++ATOM 1490 CB ILE f 46 -15.430 -19.511 36.219 1.00 27.46 C ++ATOM 1491 CG1 ILE f 46 -16.841 -19.087 35.818 1.00 27.46 C ++ATOM 1492 CG2 ILE f 46 -15.447 -20.838 36.935 1.00 27.46 C ++ATOM 1493 CD1 ILE f 46 -17.469 -19.962 34.769 1.00 27.46 C ++ATOM 1494 N LEU f 47 -13.297 -18.779 38.953 1.00 33.57 N ++ATOM 1495 CA LEU f 47 -12.098 -19.261 39.613 1.00 33.57 C ++ATOM 1496 C LEU f 47 -12.278 -20.725 39.967 1.00 33.57 C ++ATOM 1497 O LEU f 47 -13.376 -21.162 40.321 1.00 33.57 O ++ATOM 1498 CB LEU f 47 -11.808 -18.470 40.884 1.00 33.57 C ++ATOM 1499 CG LEU f 47 -11.578 -16.974 40.753 1.00 33.57 C ++ATOM 1500 CD1 LEU f 47 -11.408 -16.390 42.121 1.00 33.57 C ++ATOM 1501 CD2 LEU f 47 -10.366 -16.705 39.935 1.00 33.57 C ++ATOM 1502 N THR f 48 -11.189 -21.480 39.886 1.00 42.84 N ++ATOM 1503 CA THR f 48 -11.228 -22.904 40.181 1.00 42.84 C ++ATOM 1504 C THR f 48 -10.051 -23.257 41.067 1.00 42.84 C ++ATOM 1505 O THR f 48 -8.895 -23.103 40.657 1.00 42.84 O ++ATOM 1506 CB THR f 48 -11.190 -23.735 38.903 1.00 42.84 C ++ATOM 1507 OG1 THR f 48 -12.339 -23.438 38.105 1.00 42.84 O ++ATOM 1508 CG2 THR f 48 -11.179 -25.208 39.244 1.00 42.84 C ++ATOM 1509 N CYS f 49 -10.357 -23.718 42.280 1.00 56.70 N ++ATOM 1510 CA CYS f 49 -9.405 -24.205 43.266 1.00 56.70 C ++ATOM 1511 C CYS f 49 -9.114 -25.670 42.992 1.00 56.70 C ++ATOM 1512 O CYS f 49 -9.970 -26.527 43.243 1.00 56.70 O ++ATOM 1513 CB CYS f 49 -9.954 -24.028 44.681 1.00 56.70 C ++ATOM 1514 SG CYS f 49 -8.915 -24.674 45.998 1.00 56.70 S ++ATOM 1515 N PRO f 50 -7.922 -26.000 42.495 1.00 64.31 N ++ATOM 1516 CA PRO f 50 -7.683 -27.363 42.000 1.00 64.31 C ++ATOM 1517 C PRO f 50 -7.477 -28.391 43.094 1.00 64.31 C ++ATOM 1518 O PRO f 50 -7.734 -29.579 42.859 1.00 64.31 O ++ATOM 1519 CB PRO f 50 -6.412 -27.205 41.159 1.00 64.31 C ++ATOM 1520 CG PRO f 50 -5.695 -26.078 41.825 1.00 64.31 C ++ATOM 1521 CD PRO f 50 -6.742 -25.138 42.337 1.00 64.31 C ++ATOM 1522 N GLN f 51 -7.041 -27.977 44.274 1.00 75.45 N ++ATOM 1523 CA GLN f 51 -6.709 -28.901 45.342 1.00 75.45 C ++ATOM 1524 C GLN f 51 -7.971 -29.303 46.099 1.00 75.45 C ++ATOM 1525 O GLN f 51 -9.094 -28.984 45.702 1.00 75.45 O ++ATOM 1526 CB GLN f 51 -5.691 -28.266 46.279 1.00 75.45 C ++ATOM 1527 CG GLN f 51 -4.357 -27.982 45.657 1.00 75.45 C ++ATOM 1528 CD GLN f 51 -3.458 -27.226 46.603 1.00 75.45 C ++ATOM 1529 OE1 GLN f 51 -3.881 -26.827 47.688 1.00 75.45 O ++ATOM 1530 NE2 GLN f 51 -2.208 -27.027 46.204 1.00 75.45 N ++ATOM 1531 N TYR f 52 -7.769 -30.006 47.213 1.00 85.74 N ++ATOM 1532 CA TYR f 52 -8.749 -30.441 48.204 1.00 85.74 C ++ATOM 1533 C TYR f 52 -9.901 -31.226 47.585 1.00 85.74 C ++ATOM 1534 O TYR f 52 -11.030 -30.721 47.532 1.00 85.74 O ++ATOM 1535 CB TYR f 52 -9.272 -29.225 48.974 1.00 85.74 C ++ATOM 1536 CG TYR f 52 -8.157 -28.489 49.675 1.00 85.74 C ++ATOM 1537 CD1 TYR f 52 -7.609 -28.979 50.851 1.00 85.74 C ++ATOM 1538 CD2 TYR f 52 -7.636 -27.318 49.146 1.00 85.74 C ++ATOM 1539 CE1 TYR f 52 -6.575 -28.318 51.484 1.00 85.74 C ++ATOM 1540 CE2 TYR f 52 -6.604 -26.651 49.770 1.00 85.74 C ++ATOM 1541 CZ TYR f 52 -6.081 -27.154 50.938 1.00 85.74 C ++ATOM 1542 OH TYR f 52 -5.055 -26.487 51.564 1.00 85.74 O ++ATOM 1543 N PRO f 53 -9.672 -32.448 47.109 1.00 91.64 N ++ATOM 1544 CA PRO f 53 -10.742 -33.182 46.434 1.00 91.64 C ++ATOM 1545 C PRO f 53 -11.741 -33.780 47.412 1.00 91.64 C ++ATOM 1546 O PRO f 53 -11.385 -34.334 48.456 1.00 91.64 O ++ATOM 1547 CB PRO f 53 -9.986 -34.280 45.677 1.00 91.64 C ++ATOM 1548 CG PRO f 53 -8.786 -34.528 46.507 1.00 91.64 C ++ATOM 1549 CD PRO f 53 -8.409 -33.212 47.119 1.00 91.64 C ++ATOM 1550 N GLY f 54 -13.015 -33.652 47.059 1.00 88.09 N ++ATOM 1551 CA GLY f 54 -14.107 -34.192 47.852 1.00 88.09 C ++ATOM 1552 C GLY f 54 -14.634 -33.294 48.955 1.00 88.09 C ++ATOM 1553 O GLY f 54 -15.844 -33.240 49.181 1.00 88.09 O ++ATOM 1554 N SER f 55 -13.747 -32.581 49.647 1.00 81.93 N ++ATOM 1555 CA SER f 55 -14.156 -31.687 50.719 1.00 81.93 C ++ATOM 1556 C SER f 55 -14.789 -30.421 50.145 1.00 81.93 C ++ATOM 1557 O SER f 55 -14.824 -30.201 48.932 1.00 81.93 O ++ATOM 1558 CB SER f 55 -12.969 -31.348 51.613 1.00 81.93 C ++ATOM 1559 OG SER f 55 -12.498 -32.500 52.285 1.00 81.93 O ++ATOM 1560 N GLU f 56 -15.285 -29.566 51.031 1.00 68.09 N ++ATOM 1561 CA GLU f 56 -16.061 -28.402 50.636 1.00 68.09 C ++ATOM 1562 C GLU f 56 -15.205 -27.151 50.780 1.00 68.09 C ++ATOM 1563 O GLU f 56 -14.369 -27.058 51.682 1.00 68.09 O ++ATOM 1564 CB GLU f 56 -17.339 -28.310 51.473 1.00 68.09 C ++ATOM 1565 CG GLU f 56 -18.359 -27.303 50.986 1.00 68.09 C ++ATOM 1566 CD GLU f 56 -19.651 -27.375 51.768 1.00 68.09 C ++ATOM 1567 OE1 GLU f 56 -19.732 -28.202 52.702 1.00 68.09 O ++ATOM 1568 OE2 GLU f 56 -20.586 -26.612 51.447 1.00 68.09 O ++ATOM 1569 N ILE f 57 -15.421 -26.195 49.881 1.00 56.28 N ++ATOM 1570 CA ILE f 57 -14.495 -25.098 49.630 1.00 56.28 C ++ATOM 1571 C ILE f 57 -15.131 -23.791 50.079 1.00 56.28 C ++ATOM 1572 O ILE f 57 -16.277 -23.498 49.720 1.00 56.28 O ++ATOM 1573 CB ILE f 57 -14.121 -25.045 48.140 1.00 56.28 C ++ATOM 1574 CG1 ILE f 57 -13.466 -26.358 47.713 1.00 56.28 C ++ATOM 1575 CG2 ILE f 57 -13.218 -23.882 47.845 1.00 56.28 C ++ATOM 1576 CD1 ILE f 57 -12.193 -26.674 48.455 1.00 56.28 C ++ATOM 1577 N LEU f 58 -14.390 -23.006 50.859 1.00 53.16 N ++ATOM 1578 CA LEU f 58 -14.798 -21.664 51.238 1.00 53.16 C ++ATOM 1579 C LEU f 58 -13.783 -20.664 50.708 1.00 53.16 C ++ATOM 1580 O LEU f 58 -12.591 -20.964 50.607 1.00 53.16 O ++ATOM 1581 CB LEU f 58 -14.928 -21.530 52.748 1.00 53.16 C ++ATOM 1582 CG LEU f 58 -16.039 -22.367 53.369 1.00 53.16 C ++ATOM 1583 CD1 LEU f 58 -16.008 -22.242 54.880 1.00 53.16 C ++ATOM 1584 CD2 LEU f 58 -17.386 -21.945 52.812 1.00 53.16 C ++ATOM 1585 N TRP f 59 -14.258 -19.470 50.375 1.00 45.36 N ++ATOM 1586 CA TRP f 59 -13.473 -18.484 49.649 1.00 45.36 C ++ATOM 1587 C TRP f 59 -13.355 -17.209 50.463 1.00 45.36 C ++ATOM 1588 O TRP f 59 -14.370 -16.590 50.793 1.00 45.36 O ++ATOM 1589 CB TRP f 59 -14.122 -18.168 48.307 1.00 45.36 C ++ATOM 1590 CG TRP f 59 -14.073 -19.276 47.331 1.00 45.36 C ++ATOM 1591 CD1 TRP f 59 -15.049 -20.185 47.079 1.00 45.36 C ++ATOM 1592 CD2 TRP f 59 -12.995 -19.585 46.452 1.00 45.36 C ++ATOM 1593 NE1 TRP f 59 -14.641 -21.052 46.099 1.00 45.36 N ++ATOM 1594 CE2 TRP f 59 -13.380 -20.703 45.699 1.00 45.36 C ++ATOM 1595 CE3 TRP f 59 -11.738 -19.028 46.233 1.00 45.36 C ++ATOM 1596 CZ2 TRP f 59 -12.557 -21.272 44.748 1.00 45.36 C ++ATOM 1597 CZ3 TRP f 59 -10.924 -19.593 45.289 1.00 45.36 C ++ATOM 1598 CH2 TRP f 59 -11.334 -20.701 44.557 1.00 45.36 C ++ATOM 1599 N GLN f 60 -12.128 -16.797 50.764 1.00 39.57 N ++ATOM 1600 CA GLN f 60 -11.897 -15.465 51.304 1.00 39.57 C ++ATOM 1601 C GLN f 60 -11.394 -14.530 50.220 1.00 39.57 C ++ATOM 1602 O GLN f 60 -10.506 -14.886 49.440 1.00 39.57 O ++ATOM 1603 CB GLN f 60 -10.914 -15.461 52.470 1.00 39.57 C ++ATOM 1604 CG GLN f 60 -11.503 -15.865 53.787 1.00 39.57 C ++ATOM 1605 CD GLN f 60 -10.528 -15.680 54.921 1.00 39.57 C ++ATOM 1606 OE1 GLN f 60 -9.356 -15.382 54.700 1.00 39.57 O ++ATOM 1607 NE2 GLN f 60 -11.013 -15.814 56.148 1.00 39.57 N ++ATOM 1608 N HIS f 61 -11.992 -13.352 50.174 1.00 28.16 N ++ATOM 1609 CA HIS f 61 -11.559 -12.205 49.390 1.00 28.16 C ++ATOM 1610 C HIS f 61 -11.251 -11.085 50.370 1.00 28.16 C ++ATOM 1611 O HIS f 61 -12.177 -10.523 50.961 1.00 28.16 O ++ATOM 1612 CB HIS f 61 -12.664 -11.796 48.423 1.00 28.16 C ++ATOM 1613 CG HIS f 61 -12.408 -10.518 47.687 1.00 28.16 C ++ATOM 1614 ND1 HIS f 61 -13.423 -9.802 47.097 1.00 28.16 N ++ATOM 1615 CD2 HIS f 61 -11.267 -9.841 47.421 1.00 28.16 C ++ATOM 1616 CE1 HIS f 61 -12.923 -8.726 46.520 1.00 28.16 C ++ATOM 1617 NE2 HIS f 61 -11.617 -8.726 46.701 1.00 28.16 N ++ATOM 1618 N ASN f 62 -9.963 -10.745 50.505 1.00 30.00 N ++ATOM 1619 CA ASN f 62 -9.486 -9.650 51.365 1.00 30.00 C ++ATOM 1620 C ASN f 62 -9.924 -9.824 52.818 1.00 30.00 C ++ATOM 1621 O ASN f 62 -10.352 -8.861 53.457 1.00 30.00 O ++ATOM 1622 CB ASN f 62 -9.927 -8.277 50.840 1.00 30.00 C ++ATOM 1623 CG ASN f 62 -9.077 -7.779 49.700 1.00 30.00 C ++ATOM 1624 OD1 ASN f 62 -7.853 -7.848 49.750 1.00 30.00 O ++ATOM 1625 ND2 ASN f 62 -9.723 -7.257 48.667 1.00 30.00 N ++ATOM 1626 N ASP f 63 -9.827 -11.056 53.322 1.00 42.91 N ++ATOM 1627 CA ASP f 63 -10.244 -11.451 54.674 1.00 42.91 C ++ATOM 1628 C ASP f 63 -11.709 -11.099 54.936 1.00 42.91 C ++ATOM 1629 O ASP f 63 -12.067 -10.490 55.943 1.00 42.91 O ++ATOM 1630 CB ASP f 63 -9.331 -10.844 55.745 1.00 42.91 C ++ATOM 1631 CG ASP f 63 -7.957 -11.478 55.770 1.00 42.91 C ++ATOM 1632 OD1 ASP f 63 -7.849 -12.669 55.414 1.00 42.91 O ++ATOM 1633 OD2 ASP f 63 -6.988 -10.791 56.155 1.00 42.91 O ++ATOM 1634 N LYS f 64 -12.558 -11.503 53.997 1.00 39.85 N ++ATOM 1635 CA LYS f 64 -13.984 -11.199 54.055 1.00 39.85 C ++ATOM 1636 C LYS f 64 -14.722 -12.319 53.339 1.00 39.85 C ++ATOM 1637 O LYS f 64 -14.761 -12.326 52.108 1.00 39.85 O ++ATOM 1638 CB LYS f 64 -14.270 -9.852 53.406 1.00 39.85 C ++ATOM 1639 CG LYS f 64 -15.714 -9.422 53.459 1.00 39.85 C ++ATOM 1640 CD LYS f 64 -15.886 -8.054 52.812 1.00 39.85 C ++ATOM 1641 CE LYS f 64 -17.338 -7.602 52.829 1.00 39.85 C ++ATOM 1642 NZ LYS f 64 -17.514 -6.274 52.175 1.00 39.85 N ++ATOM 1643 N ASN f 65 -15.304 -13.247 54.103 1.00 45.83 N ++ATOM 1644 CA ASN f 65 -15.891 -14.476 53.571 1.00 45.83 C ++ATOM 1645 C ASN f 65 -17.021 -14.240 52.580 1.00 45.83 C ++ATOM 1646 O ASN f 65 -18.102 -13.782 52.958 1.00 45.83 O ++ATOM 1647 CB ASN f 65 -16.431 -15.338 54.712 1.00 45.83 C ++ATOM 1648 CG ASN f 65 -15.345 -16.059 55.465 1.00 45.83 C ++ATOM 1649 OD1 ASN f 65 -14.461 -16.661 54.867 1.00 45.83 O ++ATOM 1650 ND2 ASN f 65 -15.402 -15.998 56.789 1.00 45.83 N ++ATOM 1651 N ILE f 66 -16.780 -14.553 51.310 1.00 49.57 N ++ATOM 1652 CA ILE f 66 -17.813 -14.464 50.287 1.00 49.57 C ++ATOM 1653 C ILE f 66 -18.036 -15.847 49.698 1.00 49.57 C ++ATOM 1654 O ILE f 66 -17.386 -16.818 50.100 1.00 49.57 O ++ATOM 1655 CB ILE f 66 -17.450 -13.459 49.186 1.00 49.57 C ++ATOM 1656 CG1 ILE f 66 -16.216 -13.926 48.422 1.00 49.57 C ++ATOM 1657 CG2 ILE f 66 -17.217 -12.086 49.779 1.00 49.57 C ++ATOM 1658 CD1 ILE f 66 -15.961 -13.128 47.179 1.00 49.57 C ++ATOM 1659 N GLY f 67 -18.954 -15.946 48.742 1.00 61.21 N ++ATOM 1660 CA GLY f 67 -19.310 -17.215 48.154 1.00 61.21 C ++ATOM 1661 C GLY f 67 -20.518 -17.875 48.770 1.00 61.21 C ++ATOM 1662 O GLY f 67 -21.049 -18.826 48.186 1.00 61.21 O ++ATOM 1663 N GLY f 68 -20.976 -17.402 49.923 1.00 73.49 N ++ATOM 1664 CA GLY f 68 -22.168 -17.931 50.545 1.00 73.49 C ++ATOM 1665 C GLY f 68 -23.428 -17.390 49.897 1.00 73.49 C ++ATOM 1666 O GLY f 68 -23.411 -16.765 48.836 1.00 73.49 O ++ATOM 1667 N ASP f 69 -24.550 -17.640 50.567 1.00 87.99 N ++ATOM 1668 CA ASP f 69 -25.853 -17.206 50.072 1.00 87.99 C ++ATOM 1669 C ASP f 69 -26.212 -15.899 50.774 1.00 87.99 C ++ATOM 1670 O ASP f 69 -27.031 -15.853 51.690 1.00 87.99 O ++ATOM 1671 CB ASP f 69 -26.900 -18.291 50.299 1.00 87.99 C ++ATOM 1672 CG ASP f 69 -28.179 -18.052 49.516 1.00 87.99 C ++ATOM 1673 OD1 ASP f 69 -28.269 -17.045 48.780 1.00 87.99 O ++ATOM 1674 OD2 ASP f 69 -29.103 -18.881 49.637 1.00 87.99 O ++ATOM 1675 N GLU f 70 -25.571 -14.821 50.336 1.00 85.02 N ++ATOM 1676 CA GLU f 70 -25.913 -13.491 50.808 1.00 85.02 C ++ATOM 1677 C GLU f 70 -26.939 -12.879 49.858 1.00 85.02 C ++ATOM 1678 O GLU f 70 -27.466 -13.550 48.967 1.00 85.02 O ++ATOM 1679 CB GLU f 70 -24.664 -12.619 50.931 1.00 85.02 C ++ATOM 1680 CG GLU f 70 -23.696 -13.036 52.029 1.00 85.02 C ++ATOM 1681 CD GLU f 70 -22.681 -14.062 51.566 1.00 85.02 C ++ATOM 1682 OE1 GLU f 70 -22.667 -14.382 50.360 1.00 85.02 O ++ATOM 1683 OE2 GLU f 70 -21.897 -14.546 52.408 1.00 85.02 O ++ATOM 1684 N ASP f 71 -27.232 -11.587 50.038 1.00 82.25 N ++ATOM 1685 CA ASP f 71 -28.109 -10.876 49.112 1.00 82.25 C ++ATOM 1686 C ASP f 71 -27.457 -10.658 47.756 1.00 82.25 C ++ATOM 1687 O ASP f 71 -28.168 -10.482 46.760 1.00 82.25 O ++ATOM 1688 CB ASP f 71 -28.521 -9.525 49.695 1.00 82.25 C ++ATOM 1689 CG ASP f 71 -29.443 -9.660 50.880 1.00 82.25 C ++ATOM 1690 OD1 ASP f 71 -30.179 -10.666 50.949 1.00 82.25 O ++ATOM 1691 OD2 ASP f 71 -29.434 -8.757 51.742 1.00 82.25 O ++ATOM 1692 N ASP f 72 -26.127 -10.654 47.704 1.00 75.82 N ++ATOM 1693 CA ASP f 72 -25.389 -10.484 46.458 1.00 75.82 C ++ATOM 1694 C ASP f 72 -25.575 -11.729 45.600 1.00 75.82 C ++ATOM 1695 O ASP f 72 -25.063 -12.803 45.931 1.00 75.82 O ++ATOM 1696 CB ASP f 72 -23.917 -10.237 46.775 1.00 75.82 C ++ATOM 1697 CG ASP f 72 -23.151 -9.663 45.605 1.00 75.82 C ++ATOM 1698 OD1 ASP f 72 -23.755 -9.449 44.536 1.00 75.82 O ++ATOM 1699 OD2 ASP f 72 -21.937 -9.418 45.763 1.00 75.82 O ++ATOM 1700 N LYS f 73 -26.323 -11.596 44.507 1.00 68.20 N ++ATOM 1701 CA LYS f 73 -26.628 -12.719 43.635 1.00 68.20 C ++ATOM 1702 C LYS f 73 -25.869 -12.668 42.316 1.00 68.20 C ++ATOM 1703 O LYS f 73 -26.158 -13.460 41.416 1.00 68.20 O ++ATOM 1704 CB LYS f 73 -28.133 -12.790 43.375 1.00 68.20 C ++ATOM 1705 CG LYS f 73 -28.965 -12.985 44.634 1.00 68.20 C ++ATOM 1706 CD LYS f 73 -28.667 -14.325 45.286 1.00 68.20 C ++ATOM 1707 CE LYS f 73 -29.634 -14.626 46.420 1.00 68.20 C ++ATOM 1708 NZ LYS f 73 -29.435 -13.724 47.583 1.00 68.20 N ++ATOM 1709 N ASN f 74 -24.910 -11.757 42.180 1.00 52.12 N ++ATOM 1710 CA ASN f 74 -23.985 -11.768 41.058 1.00 52.12 C ++ATOM 1711 C ASN f 74 -22.787 -12.665 41.313 1.00 52.12 C ++ATOM 1712 O ASN f 74 -21.895 -12.743 40.465 1.00 52.12 O ++ATOM 1713 CB ASN f 74 -23.502 -10.350 40.746 1.00 52.12 C ++ATOM 1714 CG ASN f 74 -24.582 -9.488 40.130 1.00 52.12 C ++ATOM 1715 OD1 ASN f 74 -25.363 -9.953 39.302 1.00 52.12 O ++ATOM 1716 ND2 ASN f 74 -24.620 -8.220 40.515 1.00 52.12 N ++ATOM 1717 N ILE f 75 -22.747 -13.338 42.458 1.00 46.84 N ++ATOM 1718 CA ILE f 75 -21.647 -14.209 42.846 1.00 46.84 C ++ATOM 1719 C ILE f 75 -22.232 -15.559 43.217 1.00 46.84 C ++ATOM 1720 O ILE f 75 -23.031 -15.655 44.156 1.00 46.84 O ++ATOM 1721 CB ILE f 75 -20.846 -13.639 44.026 1.00 46.84 C ++ATOM 1722 CG1 ILE f 75 -20.173 -12.327 43.636 1.00 46.84 C ++ATOM 1723 CG2 ILE f 75 -19.835 -14.647 44.517 1.00 46.84 C ++ATOM 1724 CD1 ILE f 75 -19.569 -11.598 44.798 1.00 46.84 C ++ATOM 1725 N GLY f 76 -21.839 -16.596 42.493 1.00 40.74 N ++ATOM 1726 CA GLY f 76 -22.287 -17.944 42.773 1.00 40.74 C ++ATOM 1727 C GLY f 76 -21.109 -18.827 43.125 1.00 40.74 C ++ATOM 1728 O GLY f 76 -19.975 -18.559 42.732 1.00 40.74 O ++ATOM 1729 N SER f 77 -21.383 -19.886 43.871 1.00 45.84 N ++ATOM 1730 CA SER f 77 -20.339 -20.828 44.227 1.00 45.84 C ++ATOM 1731 C SER f 77 -20.814 -22.234 43.906 1.00 45.84 C ++ATOM 1732 O SER f 77 -22.014 -22.515 43.923 1.00 45.84 O ++ATOM 1733 CB SER f 77 -19.957 -20.715 45.703 1.00 45.84 C ++ATOM 1734 OG SER f 77 -18.956 -21.657 46.041 1.00 45.84 O ++ATOM 1735 N ASP f 78 -19.859 -23.106 43.604 1.00 55.25 N ++ATOM 1736 CA ASP f 78 -20.136 -24.468 43.172 1.00 55.25 C ++ATOM 1737 C ASP f 78 -19.349 -25.435 44.041 1.00 55.25 C ++ATOM 1738 O ASP f 78 -18.917 -25.064 45.136 1.00 55.25 O ++ATOM 1739 CB ASP f 78 -19.789 -24.645 41.695 1.00 55.25 C ++ATOM 1740 CG ASP f 78 -20.694 -23.838 40.787 1.00 55.25 C ++ATOM 1741 OD1 ASP f 78 -21.859 -23.608 41.167 1.00 55.25 O ++ATOM 1742 OD2 ASP f 78 -20.239 -23.429 39.697 1.00 55.25 O ++ATOM 1743 N GLU f 79 -19.228 -26.688 43.594 1.00 60.68 N ++ATOM 1744 CA GLU f 79 -18.389 -27.660 44.290 1.00 60.68 C ++ATOM 1745 C GLU f 79 -16.941 -27.200 44.383 1.00 60.68 C ++ATOM 1746 O GLU f 79 -16.301 -27.381 45.424 1.00 60.68 O ++ATOM 1747 CB GLU f 79 -18.451 -29.010 43.582 1.00 60.68 C ++ATOM 1748 CG GLU f 79 -19.820 -29.648 43.567 1.00 60.68 C ++ATOM 1749 CD GLU f 79 -19.813 -31.005 42.899 1.00 60.68 C ++ATOM 1750 OE1 GLU f 79 -18.750 -31.410 42.385 1.00 60.68 O ++ATOM 1751 OE2 GLU f 79 -20.873 -31.661 42.886 1.00 60.68 O ++ATOM 1752 N ASP f 80 -16.404 -26.620 43.310 1.00 50.14 N ++ATOM 1753 CA ASP f 80 -15.082 -26.016 43.360 1.00 50.14 C ++ATOM 1754 C ASP f 80 -14.955 -24.728 42.561 1.00 50.14 C ++ATOM 1755 O ASP f 80 -13.836 -24.230 42.415 1.00 50.14 O ++ATOM 1756 CB ASP f 80 -14.016 -27.022 42.892 1.00 50.14 C ++ATOM 1757 CG ASP f 80 -14.299 -27.583 41.509 1.00 50.14 C ++ATOM 1758 OD1 ASP f 80 -15.371 -27.295 40.940 1.00 50.14 O ++ATOM 1759 OD2 ASP f 80 -13.440 -28.324 40.990 1.00 50.14 O ++ATOM 1760 N HIS f 81 -16.044 -24.181 42.036 1.00 45.36 N ++ATOM 1761 CA HIS f 81 -15.992 -23.008 41.177 1.00 45.36 C ++ATOM 1762 C HIS f 81 -16.501 -21.783 41.917 1.00 45.36 C ++ATOM 1763 O HIS f 81 -17.349 -21.890 42.807 1.00 45.36 O ++ATOM 1764 CB HIS f 81 -16.821 -23.213 39.909 1.00 45.36 C ++ATOM 1765 CG HIS f 81 -16.271 -24.257 38.989 1.00 45.36 C ++ATOM 1766 ND1 HIS f 81 -15.161 -24.040 38.201 1.00 45.36 N ++ATOM 1767 CD2 HIS f 81 -16.678 -25.520 38.728 1.00 45.36 C ++ATOM 1768 CE1 HIS f 81 -14.907 -25.129 37.496 1.00 45.36 C ++ATOM 1769 NE2 HIS f 81 -15.811 -26.041 37.799 1.00 45.36 N ++ATOM 1770 N LEU f 82 -15.978 -20.621 41.538 1.00 35.34 N ++ATOM 1771 CA LEU f 82 -16.494 -19.327 41.979 1.00 35.34 C ++ATOM 1772 C LEU f 82 -16.854 -18.535 40.731 1.00 35.34 C ++ATOM 1773 O LEU f 82 -15.970 -18.193 39.945 1.00 35.34 O ++ATOM 1774 CB LEU f 82 -15.481 -18.575 42.824 1.00 35.34 C ++ATOM 1775 CG LEU f 82 -15.961 -17.188 43.234 1.00 35.34 C ++ATOM 1776 CD1 LEU f 82 -17.156 -17.303 44.133 1.00 35.34 C ++ATOM 1777 CD2 LEU f 82 -14.863 -16.419 43.917 1.00 35.34 C ++ATOM 1778 N SER f 83 -18.139 -18.254 40.544 1.00 33.54 N ++ATOM 1779 CA SER f 83 -18.634 -17.572 39.357 1.00 33.54 C ++ATOM 1780 C SER f 83 -18.983 -16.134 39.706 1.00 33.54 C ++ATOM 1781 O SER f 83 -20.021 -15.880 40.325 1.00 33.54 O ++ATOM 1782 CB SER f 83 -19.859 -18.288 38.794 1.00 33.54 C ++ATOM 1783 OG SER f 83 -19.525 -19.596 38.376 1.00 33.54 O ++ATOM 1784 N LEU f 84 -18.123 -15.201 39.310 1.00 30.44 N ++ATOM 1785 CA LEU f 84 -18.318 -13.776 39.537 1.00 30.44 C ++ATOM 1786 C LEU f 84 -18.892 -13.205 38.252 1.00 30.44 C ++ATOM 1787 O LEU f 84 -18.200 -13.172 37.230 1.00 30.44 O ++ATOM 1788 CB LEU f 84 -16.996 -13.104 39.881 1.00 30.44 C ++ATOM 1789 CG LEU f 84 -16.187 -13.706 41.027 1.00 30.44 C ++ATOM 1790 CD1 LEU f 84 -14.846 -13.021 41.125 1.00 30.44 C ++ATOM 1791 CD2 LEU f 84 -16.915 -13.603 42.331 1.00 30.44 C ++ATOM 1792 N LYS f 85 -20.151 -12.787 38.293 1.00 34.72 N ++ATOM 1793 CA LYS f 85 -20.801 -12.191 37.136 1.00 34.72 C ++ATOM 1794 C LYS f 85 -20.716 -10.677 37.215 1.00 34.72 C ++ATOM 1795 O LYS f 85 -20.852 -10.101 38.297 1.00 34.72 O ++ATOM 1796 CB LYS f 85 -22.265 -12.620 37.047 1.00 34.72 C ++ATOM 1797 CG LYS f 85 -22.472 -14.077 36.700 1.00 34.72 C ++ATOM 1798 CD LYS f 85 -23.945 -14.391 36.570 1.00 34.72 C ++ATOM 1799 CE LYS f 85 -24.158 -15.849 36.236 1.00 34.72 C ++ATOM 1800 NZ LYS f 85 -25.603 -16.159 36.094 1.00 34.72 N ++ATOM 1801 N GLU f 86 -20.520 -10.047 36.054 1.00 39.00 N ++ATOM 1802 CA GLU f 86 -20.289 -8.609 35.897 1.00 39.00 C ++ATOM 1803 C GLU f 86 -19.144 -8.146 36.798 1.00 39.00 C ++ATOM 1804 O GLU f 86 -19.328 -7.415 37.769 1.00 39.00 O ++ATOM 1805 CB GLU f 86 -21.563 -7.800 36.150 1.00 39.00 C ++ATOM 1806 CG GLU f 86 -22.637 -8.006 35.101 1.00 39.00 C ++ATOM 1807 CD GLU f 86 -23.887 -7.197 35.378 1.00 39.00 C ++ATOM 1808 OE1 GLU f 86 -23.959 -6.561 36.449 1.00 39.00 O ++ATOM 1809 OE2 GLU f 86 -24.802 -7.200 34.528 1.00 39.00 O ++ATOM 1810 N PHE f 87 -17.965 -8.662 36.464 1.00 30.35 N ++ATOM 1811 CA PHE f 87 -16.744 -8.382 37.200 1.00 30.35 C ++ATOM 1812 C PHE f 87 -16.432 -6.894 37.143 1.00 30.35 C ++ATOM 1813 O PHE f 87 -16.594 -6.241 36.111 1.00 30.35 O ++ATOM 1814 CB PHE f 87 -15.588 -9.172 36.598 1.00 30.35 C ++ATOM 1815 CG PHE f 87 -14.380 -9.260 37.469 1.00 30.35 C ++ATOM 1816 CD1 PHE f 87 -14.274 -10.259 38.412 1.00 30.35 C ++ATOM 1817 CD2 PHE f 87 -13.354 -8.353 37.346 1.00 30.35 C ++ATOM 1818 CE1 PHE f 87 -13.156 -10.357 39.208 1.00 30.35 C ++ATOM 1819 CE2 PHE f 87 -12.247 -8.438 38.153 1.00 30.35 C ++ATOM 1820 CZ PHE f 87 -12.147 -9.440 39.074 1.00 30.35 C ++ATOM 1821 N SER f 88 -16.014 -6.348 38.277 1.00 33.34 N ++ATOM 1822 CA SER f 88 -15.695 -4.932 38.378 1.00 33.34 C ++ATOM 1823 C SER f 88 -14.269 -4.819 38.875 1.00 33.34 C ++ATOM 1824 O SER f 88 -13.944 -5.355 39.940 1.00 33.34 O ++ATOM 1825 CB SER f 88 -16.660 -4.209 39.315 1.00 33.34 C ++ATOM 1826 OG SER f 88 -16.342 -2.835 39.403 1.00 33.34 O ++ATOM 1827 N GLU f 89 -13.429 -4.128 38.092 1.00 28.14 N ++ATOM 1828 CA GLU f 89 -11.991 -4.068 38.338 1.00 28.14 C ++ATOM 1829 C GLU f 89 -11.662 -3.461 39.693 1.00 28.14 C ++ATOM 1830 O GLU f 89 -10.708 -3.887 40.350 1.00 28.14 O ++ATOM 1831 CB GLU f 89 -11.318 -3.259 37.232 1.00 28.14 C ++ATOM 1832 CG GLU f 89 -9.810 -3.157 37.351 1.00 28.14 C ++ATOM 1833 CD GLU f 89 -9.204 -2.248 36.309 1.00 28.14 C ++ATOM 1834 OE1 GLU f 89 -9.963 -1.696 35.488 1.00 28.14 O ++ATOM 1835 OE2 GLU f 89 -7.971 -2.069 36.321 1.00 28.14 O ++ATOM 1836 N LEU f 90 -12.463 -2.500 40.148 1.00 25.07 N ++ATOM 1837 CA LEU f 90 -12.158 -1.834 41.405 1.00 25.07 C ++ATOM 1838 C LEU f 90 -12.570 -2.696 42.586 1.00 25.07 C ++ATOM 1839 O LEU f 90 -11.789 -2.903 43.520 1.00 25.07 O ++ATOM 1840 CB LEU f 90 -12.859 -0.483 41.482 1.00 25.07 C ++ATOM 1841 CG LEU f 90 -12.354 0.679 40.633 1.00 25.07 C ++ATOM 1842 CD1 LEU f 90 -10.832 0.780 40.681 1.00 25.07 C ++ATOM 1843 CD2 LEU f 90 -12.924 0.664 39.226 1.00 25.07 C ++ATOM 1844 N GLU f 91 -13.798 -3.209 42.561 1.00 32.08 N ++ATOM 1845 CA GLU f 91 -14.339 -3.907 43.719 1.00 32.08 C ++ATOM 1846 C GLU f 91 -13.753 -5.303 43.857 1.00 32.08 C ++ATOM 1847 O GLU f 91 -13.260 -5.677 44.926 1.00 32.08 O ++ATOM 1848 CB GLU f 91 -15.862 -3.995 43.621 1.00 32.08 C ++ATOM 1849 CG GLU f 91 -16.591 -2.668 43.664 1.00 32.08 C ++ATOM 1850 CD GLU f 91 -18.100 -2.838 43.620 1.00 32.08 C ++ATOM 1851 OE1 GLU f 91 -18.567 -3.984 43.461 1.00 32.08 O ++ATOM 1852 OE2 GLU f 91 -18.820 -1.828 43.746 1.00 32.08 O ++ATOM 1853 N GLN f 92 -13.809 -6.097 42.791 1.00 26.47 N ++ATOM 1854 CA GLN f 92 -13.604 -7.531 42.907 1.00 26.47 C ++ATOM 1855 C GLN f 92 -12.192 -7.969 42.540 1.00 26.47 C ++ATOM 1856 O GLN f 92 -11.983 -9.142 42.222 1.00 26.47 O ++ATOM 1857 CB GLN f 92 -14.646 -8.260 42.062 1.00 26.47 C ++ATOM 1858 CG GLN f 92 -16.057 -8.051 42.582 1.00 26.47 C ++ATOM 1859 CD GLN f 92 -17.117 -8.634 41.683 1.00 26.47 C ++ATOM 1860 OE1 GLN f 92 -16.817 -9.180 40.630 1.00 26.47 O ++ATOM 1861 NE2 GLN f 92 -18.371 -8.493 42.080 1.00 26.47 N ++ATOM 1862 N SER f 93 -11.218 -7.069 42.600 1.00 22.03 N ++ATOM 1863 CA SER f 93 -9.816 -7.425 42.460 1.00 22.03 C ++ATOM 1864 C SER f 93 -9.267 -7.819 43.824 1.00 22.03 C ++ATOM 1865 O SER f 93 -10.013 -8.015 44.783 1.00 22.03 O ++ATOM 1866 CB SER f 93 -9.031 -6.267 41.869 1.00 22.03 C ++ATOM 1867 OG SER f 93 -9.527 -5.923 40.595 1.00 22.03 O ++ATOM 1868 N GLY f 94 -7.956 -7.936 43.938 1.00 20.00 N ++ATOM 1869 CA GLY f 94 -7.346 -8.207 45.217 1.00 20.00 C ++ATOM 1870 C GLY f 94 -7.088 -9.678 45.454 1.00 20.00 C ++ATOM 1871 O GLY f 94 -7.019 -10.494 44.533 1.00 20.00 O ++ATOM 1872 N TYR f 95 -6.936 -10.014 46.727 1.00 24.85 N ++ATOM 1873 CA TYR f 95 -6.514 -11.349 47.103 1.00 24.85 C ++ATOM 1874 C TYR f 95 -7.688 -12.316 47.057 1.00 24.85 C ++ATOM 1875 O TYR f 95 -8.850 -11.927 47.097 1.00 24.85 O ++ATOM 1876 CB TYR f 95 -5.898 -11.349 48.499 1.00 24.85 C ++ATOM 1877 CG TYR f 95 -4.578 -10.626 48.607 1.00 24.85 C ++ATOM 1878 CD1 TYR f 95 -3.829 -10.340 47.490 1.00 24.85 C ++ATOM 1879 CD2 TYR f 95 -4.087 -10.229 49.832 1.00 24.85 C ++ATOM 1880 CE1 TYR f 95 -2.632 -9.680 47.586 1.00 24.85 C ++ATOM 1881 CE2 TYR f 95 -2.887 -9.569 49.934 1.00 24.85 C ++ATOM 1882 CZ TYR f 95 -2.168 -9.297 48.803 1.00 24.85 C ++ATOM 1883 OH TYR f 95 -0.969 -8.635 48.886 1.00 24.85 O ++ATOM 1884 N TYR f 96 -7.359 -13.594 46.946 1.00 24.41 N ++ATOM 1885 CA TYR f 96 -8.328 -14.675 47.030 1.00 24.41 C ++ATOM 1886 C TYR f 96 -7.645 -15.879 47.639 1.00 24.41 C ++ATOM 1887 O TYR f 96 -6.435 -16.060 47.476 1.00 24.41 O ++ATOM 1888 CB TYR f 96 -8.889 -15.078 45.673 1.00 24.41 C ++ATOM 1889 CG TYR f 96 -9.883 -14.131 45.091 1.00 24.41 C ++ATOM 1890 CD1 TYR f 96 -11.213 -14.218 45.426 1.00 24.41 C ++ATOM 1891 CD2 TYR f 96 -9.493 -13.156 44.199 1.00 24.41 C ++ATOM 1892 CE1 TYR f 96 -12.124 -13.362 44.893 1.00 24.41 C ++ATOM 1893 CE2 TYR f 96 -10.398 -12.298 43.663 1.00 24.41 C ++ATOM 1894 CZ TYR f 96 -11.710 -12.404 44.014 1.00 24.41 C ++ATOM 1895 OH TYR f 96 -12.626 -11.543 43.482 1.00 24.41 O ++ATOM 1896 N VAL f 97 -8.434 -16.706 48.321 1.00 33.73 N ++ATOM 1897 CA VAL f 97 -7.944 -17.985 48.832 1.00 33.73 C ++ATOM 1898 C VAL f 97 -9.107 -18.951 49.007 1.00 33.73 C ++ATOM 1899 O VAL f 97 -10.148 -18.599 49.567 1.00 33.73 O ++ATOM 1900 CB VAL f 97 -7.142 -17.800 50.139 1.00 33.73 C ++ATOM 1901 CG1 VAL f 97 -7.869 -16.945 51.123 1.00 33.73 C ++ATOM 1902 CG2 VAL f 97 -6.799 -19.124 50.776 1.00 33.73 C ++ATOM 1903 N CYS f 98 -8.933 -20.165 48.487 1.00 48.07 N ++ATOM 1904 CA CYS f 98 -9.805 -21.288 48.801 1.00 48.07 C ++ATOM 1905 C CYS f 98 -9.241 -22.030 50.002 1.00 48.07 C ++ATOM 1906 O CYS f 98 -8.024 -22.154 50.155 1.00 48.07 O ++ATOM 1907 CB CYS f 98 -9.935 -22.237 47.605 1.00 48.07 C ++ATOM 1908 SG CYS f 98 -8.392 -23.053 47.110 1.00 48.07 S ++ATOM 1909 N TYR f 99 -10.126 -22.502 50.869 1.00 56.17 N ++ATOM 1910 CA TYR f 99 -9.674 -23.262 52.022 1.00 56.17 C ++ATOM 1911 C TYR f 99 -10.762 -24.262 52.372 1.00 56.17 C ++ATOM 1912 O TYR f 99 -11.940 -24.006 52.091 1.00 56.17 O ++ATOM 1913 CB TYR f 99 -9.335 -22.335 53.204 1.00 56.17 C ++ATOM 1914 CG TYR f 99 -10.492 -21.612 53.840 1.00 56.17 C ++ATOM 1915 CD1 TYR f 99 -10.965 -20.427 53.313 1.00 56.17 C ++ATOM 1916 CD2 TYR f 99 -11.067 -22.083 55.007 1.00 56.17 C ++ATOM 1917 CE1 TYR f 99 -12.013 -19.756 53.896 1.00 56.17 C ++ATOM 1918 CE2 TYR f 99 -12.112 -21.417 55.603 1.00 56.17 C ++ATOM 1919 CZ TYR f 99 -12.578 -20.251 55.046 1.00 56.17 C ++ATOM 1920 OH TYR f 99 -13.623 -19.582 55.636 1.00 56.17 O ++ATOM 1921 N PRO f 100 -10.408 -25.425 52.929 1.00 64.15 N ++ATOM 1922 CA PRO f 100 -11.417 -26.461 53.163 1.00 64.15 C ++ATOM 1923 C PRO f 100 -12.394 -26.068 54.257 1.00 64.15 C ++ATOM 1924 O PRO f 100 -12.136 -25.185 55.077 1.00 64.15 O ++ATOM 1925 CB PRO f 100 -10.589 -27.681 53.573 1.00 64.15 C ++ATOM 1926 CG PRO f 100 -9.357 -27.127 54.122 1.00 64.15 C ++ATOM 1927 CD PRO f 100 -9.069 -25.899 53.318 1.00 64.15 C ++ATOM 1928 N ARG f 101 -13.544 -26.738 54.232 1.00 66.42 N ++ATOM 1929 CA ARG f 101 -14.663 -26.396 55.098 1.00 66.42 C ++ATOM 1930 C ARG f 101 -14.322 -26.654 56.560 1.00 66.42 C ++ATOM 1931 O ARG f 101 -14.110 -27.798 56.972 1.00 66.42 O ++ATOM 1932 CB ARG f 101 -15.883 -27.215 54.679 1.00 66.42 C ++ATOM 1933 CG ARG f 101 -17.154 -27.001 55.480 1.00 66.42 C ++ATOM 1934 CD ARG f 101 -17.755 -25.633 55.253 1.00 66.42 C ++ATOM 1935 NE ARG f 101 -19.050 -25.520 55.914 1.00 66.42 N ++ATOM 1936 CZ ARG f 101 -19.216 -25.171 57.184 1.00 66.42 C ++ATOM 1937 NH1 ARG f 101 -18.167 -24.890 57.944 1.00 66.42 N ++ATOM 1938 NH2 ARG f 101 -20.437 -25.100 57.697 1.00 66.42 N ++ATOM 1939 N GLY f 102 -14.258 -25.581 57.341 1.00 62.62 N ++ATOM 1940 CA GLY f 102 -13.980 -25.712 58.755 1.00 62.62 C ++ATOM 1941 C GLY f 102 -12.521 -25.653 59.131 1.00 62.62 C ++ATOM 1942 O GLY f 102 -12.158 -26.072 60.232 1.00 62.62 O ++ATOM 1943 N SER f 103 -11.668 -25.147 58.251 1.00 65.97 N ++ATOM 1944 CA SER f 103 -10.254 -24.986 58.549 1.00 65.97 C ++ATOM 1945 C SER f 103 -9.889 -23.509 58.580 1.00 65.97 C ++ATOM 1946 O SER f 103 -10.706 -22.635 58.282 1.00 65.97 O ++ATOM 1947 CB SER f 103 -9.386 -25.715 57.522 1.00 65.97 C ++ATOM 1948 OG SER f 103 -9.592 -27.114 57.589 1.00 65.97 O ++ATOM 1949 N LYS f 104 -8.652 -23.240 58.945 1.00 64.83 N ++ATOM 1950 CA LYS f 104 -8.206 -21.862 59.065 1.00 64.83 C ++ATOM 1951 C LYS f 104 -7.578 -21.399 57.754 1.00 64.83 C ++ATOM 1952 O LYS f 104 -6.739 -22.108 57.195 1.00 64.83 O ++ATOM 1953 CB LYS f 104 -7.204 -21.730 60.199 1.00 64.83 C ++ATOM 1954 CG LYS f 104 -7.752 -22.130 61.551 1.00 64.83 C ++ATOM 1955 CD LYS f 104 -8.875 -21.205 61.999 1.00 64.83 C ++ATOM 1956 CE LYS f 104 -9.269 -21.483 63.445 1.00 64.83 C ++ATOM 1957 NZ LYS f 104 -9.915 -22.814 63.619 1.00 64.83 N ++ATOM 1958 N PRO f 105 -7.962 -20.229 57.236 1.00 55.20 N ++ATOM 1959 CA PRO f 105 -7.357 -19.742 55.988 1.00 55.20 C ++ATOM 1960 C PRO f 105 -5.912 -19.310 56.125 1.00 55.20 C ++ATOM 1961 O PRO f 105 -5.215 -19.230 55.109 1.00 55.20 O ++ATOM 1962 CB PRO f 105 -8.249 -18.559 55.606 1.00 55.20 C ++ATOM 1963 CG PRO f 105 -9.525 -18.837 56.276 1.00 55.20 C ++ATOM 1964 CD PRO f 105 -9.184 -19.487 57.570 1.00 55.20 C ++ATOM 1965 N GLU f 106 -5.431 -19.028 57.334 1.00 64.84 N ++ATOM 1966 CA GLU f 106 -4.013 -18.740 57.502 1.00 64.84 C ++ATOM 1967 C GLU f 106 -3.151 -19.994 57.468 1.00 64.84 C ++ATOM 1968 O GLU f 106 -1.923 -19.878 57.412 1.00 64.84 O ++ATOM 1969 CB GLU f 106 -3.763 -17.989 58.813 1.00 64.84 C ++ATOM 1970 CG GLU f 106 -3.935 -18.830 60.071 1.00 64.84 C ++ATOM 1971 CD GLU f 106 -5.351 -18.804 60.623 1.00 64.84 C ++ATOM 1972 OE1 GLU f 106 -6.273 -18.356 59.909 1.00 64.84 O ++ATOM 1973 OE2 GLU f 106 -5.546 -19.247 61.776 1.00 64.84 O ++ATOM 1974 N ASP f 107 -3.757 -21.181 57.515 1.00 62.52 N ++ATOM 1975 CA ASP f 107 -3.050 -22.432 57.294 1.00 62.52 C ++ATOM 1976 C ASP f 107 -3.171 -22.941 55.867 1.00 62.52 C ++ATOM 1977 O ASP f 107 -2.610 -23.994 55.558 1.00 62.52 O ++ATOM 1978 CB ASP f 107 -3.551 -23.517 58.253 1.00 62.52 C ++ATOM 1979 CG ASP f 107 -3.025 -23.339 59.655 1.00 62.52 C ++ATOM 1980 OD1 ASP f 107 -1.910 -22.801 59.803 1.00 62.52 O ++ATOM 1981 OD2 ASP f 107 -3.720 -23.742 60.609 1.00 62.52 O ++ATOM 1982 N ALA f 108 -3.898 -22.239 55.004 1.00 52.83 N ++ATOM 1983 CA ALA f 108 -3.877 -22.568 53.589 1.00 52.83 C ++ATOM 1984 C ALA f 108 -2.516 -22.216 53.008 1.00 52.83 C ++ATOM 1985 O ALA f 108 -1.788 -21.384 53.554 1.00 52.83 O ++ATOM 1986 CB ALA f 108 -4.981 -21.826 52.845 1.00 52.83 C ++ATOM 1987 N ASN f 109 -2.163 -22.859 51.903 1.00 46.79 N ++ATOM 1988 CA ASN f 109 -0.807 -22.767 51.387 1.00 46.79 C ++ATOM 1989 C ASN f 109 -0.684 -21.937 50.117 1.00 46.79 C ++ATOM 1990 O ASN f 109 0.375 -21.971 49.484 1.00 46.79 O ++ATOM 1991 CB ASN f 109 -0.245 -24.175 51.157 1.00 46.79 C ++ATOM 1992 CG ASN f 109 -1.142 -25.038 50.285 1.00 46.79 C ++ATOM 1993 OD1 ASN f 109 -2.161 -24.585 49.769 1.00 46.79 O ++ATOM 1994 ND2 ASN f 109 -0.764 -26.301 50.126 1.00 46.79 N ++ATOM 1995 N PHE f 110 -1.715 -21.180 49.737 1.00 36.81 N ++ATOM 1996 CA PHE f 110 -1.741 -20.652 48.377 1.00 36.81 C ++ATOM 1997 C PHE f 110 -2.734 -19.501 48.284 1.00 36.81 C ++ATOM 1998 O PHE f 110 -3.932 -19.711 48.479 1.00 36.81 O ++ATOM 1999 CB PHE f 110 -2.113 -21.776 47.427 1.00 36.81 C ++ATOM 2000 CG PHE f 110 -1.796 -21.497 46.016 1.00 36.81 C ++ATOM 2001 CD1 PHE f 110 -0.490 -21.505 45.593 1.00 36.81 C ++ATOM 2002 CD2 PHE f 110 -2.796 -21.269 45.099 1.00 36.81 C ++ATOM 2003 CE1 PHE f 110 -0.186 -21.256 44.300 1.00 36.81 C ++ATOM 2004 CE2 PHE f 110 -2.493 -21.026 43.786 1.00 36.81 C ++ATOM 2005 CZ PHE f 110 -1.179 -21.025 43.385 1.00 36.81 C ++ATOM 2006 N TYR f 111 -2.235 -18.339 47.864 1.00 35.72 N ++ATOM 2007 CA TYR f 111 -3.021 -17.118 47.695 1.00 35.72 C ++ATOM 2008 C TYR f 111 -2.982 -16.667 46.231 1.00 35.72 C ++ATOM 2009 O TYR f 111 -2.086 -17.034 45.489 1.00 35.72 O ++ATOM 2010 CB TYR f 111 -2.504 -16.010 48.607 1.00 35.72 C ++ATOM 2011 CG TYR f 111 -3.424 -15.688 49.763 1.00 35.72 C ++ATOM 2012 CD1 TYR f 111 -4.666 -16.293 49.877 1.00 35.72 C ++ATOM 2013 CD2 TYR f 111 -3.051 -14.780 50.739 1.00 35.72 C ++ATOM 2014 CE1 TYR f 111 -5.510 -16.002 50.931 1.00 35.72 C ++ATOM 2015 CE2 TYR f 111 -3.888 -14.483 51.796 1.00 35.72 C ++ATOM 2016 CZ TYR f 111 -5.115 -15.096 51.886 1.00 35.72 C ++ATOM 2017 OH TYR f 111 -5.949 -14.800 52.937 1.00 35.72 O ++ATOM 2018 N LEU f 112 -3.970 -15.879 45.826 1.00 30.33 N ++ATOM 2019 CA LEU f 112 -4.122 -15.416 44.452 1.00 30.33 C ++ATOM 2020 C LEU f 112 -4.272 -13.909 44.488 1.00 30.33 C ++ATOM 2021 O LEU f 112 -4.974 -13.400 45.358 1.00 30.33 O ++ATOM 2022 CB LEU f 112 -5.360 -16.028 43.795 1.00 30.33 C ++ATOM 2023 CG LEU f 112 -5.687 -15.699 42.338 1.00 30.33 C ++ATOM 2024 CD1 LEU f 112 -4.652 -16.308 41.438 1.00 30.33 C ++ATOM 2025 CD2 LEU f 112 -7.068 -16.158 41.921 1.00 30.33 C ++ATOM 2026 N TYR f 113 -3.652 -13.190 43.560 1.00 40.24 N ++ATOM 2027 CA TYR f 113 -3.855 -11.745 43.454 1.00 40.24 C ++ATOM 2028 C TYR f 113 -4.446 -11.449 42.085 1.00 40.24 C ++ATOM 2029 O TYR f 113 -3.726 -11.222 41.119 1.00 40.24 O ++ATOM 2030 CB TYR f 113 -2.581 -10.953 43.668 1.00 40.24 C ++ATOM 2031 CG TYR f 113 -2.816 -9.470 43.521 1.00 40.24 C ++ATOM 2032 CD1 TYR f 113 -3.612 -8.797 44.422 1.00 40.24 C ++ATOM 2033 CD2 TYR f 113 -2.248 -8.748 42.494 1.00 40.24 C ++ATOM 2034 CE1 TYR f 113 -3.848 -7.456 44.314 1.00 40.24 C ++ATOM 2035 CE2 TYR f 113 -2.479 -7.393 42.374 1.00 40.24 C ++ATOM 2036 CZ TYR f 113 -3.283 -6.758 43.294 1.00 40.24 C ++ATOM 2037 OH TYR f 113 -3.534 -5.414 43.206 1.00 40.24 O ++ATOM 2038 N LEU f 114 -5.764 -11.429 42.008 1.00 26.54 N ++ATOM 2039 CA LEU f 114 -6.449 -11.222 40.742 1.00 26.54 C ++ATOM 2040 C LEU f 114 -6.670 -9.737 40.504 1.00 26.54 C ++ATOM 2041 O LEU f 114 -7.257 -9.052 41.344 1.00 26.54 O ++ATOM 2042 CB LEU f 114 -7.784 -11.956 40.746 1.00 26.54 C ++ATOM 2043 CG LEU f 114 -8.668 -11.763 39.528 1.00 26.54 C ++ATOM 2044 CD1 LEU f 114 -8.029 -12.367 38.329 1.00 26.54 C ++ATOM 2045 CD2 LEU f 114 -10.018 -12.370 39.787 1.00 26.54 C ++ATOM 2046 N ARG f 115 -6.204 -9.238 39.366 1.00 24.43 N ++ATOM 2047 CA ARG f 115 -6.553 -7.895 38.912 1.00 24.43 C ++ATOM 2048 C ARG f 115 -6.856 -7.970 37.427 1.00 24.43 C ++ATOM 2049 O ARG f 115 -5.936 -7.978 36.610 1.00 24.43 O ++ATOM 2050 CB ARG f 115 -5.439 -6.889 39.169 1.00 24.43 C ++ATOM 2051 CG ARG f 115 -5.834 -5.497 38.721 1.00 24.43 C ++ATOM 2052 CD ARG f 115 -4.700 -4.509 38.796 1.00 24.43 C ++ATOM 2053 NE ARG f 115 -5.084 -3.221 38.236 1.00 24.43 N ++ATOM 2054 CZ ARG f 115 -4.238 -2.230 37.982 1.00 24.43 C ++ATOM 2055 NH1 ARG f 115 -2.950 -2.375 38.225 1.00 24.43 N ++ATOM 2056 NH2 ARG f 115 -4.679 -1.100 37.462 1.00 24.43 N ++ATOM 2057 N ALA f 116 -8.132 -8.008 37.070 1.00 23.47 N ++ATOM 2058 CA ALA f 116 -8.507 -8.274 35.693 1.00 23.47 C ++ATOM 2059 C ALA f 116 -9.548 -7.283 35.212 1.00 23.47 C ++ATOM 2060 O ALA f 116 -10.597 -7.135 35.838 1.00 23.47 O ++ATOM 2061 CB ALA f 116 -9.051 -9.695 35.548 1.00 23.47 C ++ATOM 2062 N ARG f 117 -9.269 -6.610 34.103 1.00 29.29 N ++ATOM 2063 CA ARG f 117 -10.335 -5.904 33.420 1.00 29.29 C ++ATOM 2064 C ARG f 117 -11.213 -6.901 32.689 1.00 29.29 C ++ATOM 2065 O ARG f 117 -10.764 -7.973 32.284 1.00 29.29 O ++ATOM 2066 CB ARG f 117 -9.798 -4.904 32.406 1.00 29.29 C ++ATOM 2067 CG ARG f 117 -9.106 -3.712 32.987 1.00 29.29 C ++ATOM 2068 CD ARG f 117 -8.738 -2.742 31.880 1.00 29.29 C ++ATOM 2069 NE ARG f 117 -7.830 -1.696 32.343 1.00 29.29 N ++ATOM 2070 CZ ARG f 117 -8.214 -0.523 32.830 1.00 29.29 C ++ATOM 2071 NH1 ARG f 117 -9.503 -0.229 32.917 1.00 29.29 N ++ATOM 2072 NH2 ARG f 117 -7.305 0.361 33.220 1.00 29.29 N ++ATOM 2073 N VAL f 118 -12.481 -6.547 32.524 1.00 38.63 N ++ATOM 2074 CA VAL f 118 -13.357 -7.272 31.620 1.00 38.63 C ++ATOM 2075 C VAL f 118 -14.010 -6.258 30.699 1.00 38.63 C ++ATOM 2076 O VAL f 118 -13.988 -5.052 30.946 1.00 38.63 O ++ATOM 2077 CB VAL f 118 -14.424 -8.102 32.347 1.00 38.63 C ++ATOM 2078 CG1 VAL f 118 -13.779 -9.208 33.156 1.00 38.63 C ++ATOM 2079 CG2 VAL f 118 -15.255 -7.203 33.223 1.00 38.63 C ++ATOM 2080 N CYS f 119 -14.609 -6.766 29.632 1.00 58.72 N ++ATOM 2081 CA CYS f 119 -15.057 -5.899 28.552 1.00 58.72 C ++ATOM 2082 C CYS f 119 -16.190 -6.608 27.831 1.00 58.72 C ++ATOM 2083 O CYS f 119 -16.016 -7.742 27.376 1.00 58.72 O ++ATOM 2084 CB CYS f 119 -13.888 -5.602 27.619 1.00 58.72 C ++ATOM 2085 SG CYS f 119 -14.148 -4.338 26.378 1.00 58.72 S ++ATOM 2086 N GLU f 120 -17.345 -5.958 27.744 1.00 72.49 N ++ATOM 2087 CA GLU f 120 -18.515 -6.577 27.136 1.00 72.49 C ++ATOM 2088 C GLU f 120 -18.372 -6.617 25.622 1.00 72.49 C ++ATOM 2089 O GLU f 120 -18.208 -5.570 24.986 1.00 72.49 O ++ATOM 2090 CB GLU f 120 -19.774 -5.805 27.520 1.00 72.49 C ++ATOM 2091 CG GLU f 120 -21.056 -6.388 26.965 1.00 72.49 C ++ATOM 2092 CD GLU f 120 -22.269 -5.559 27.330 1.00 72.49 C ++ATOM 2093 OE1 GLU f 120 -22.098 -4.521 27.999 1.00 72.49 O ++ATOM 2094 OE2 GLU f 120 -23.394 -5.938 26.942 1.00 72.49 O ++ATOM 2095 N ASN f 121 -18.455 -7.829 25.056 1.00 79.71 N ++ATOM 2096 CA ASN f 121 -18.304 -8.107 23.620 1.00 79.71 C ++ATOM 2097 C ASN f 121 -16.950 -7.617 23.102 1.00 79.71 C ++ATOM 2098 O ASN f 121 -16.861 -6.772 22.211 1.00 79.71 O ++ATOM 2099 CB ASN f 121 -19.456 -7.505 22.801 1.00 79.71 C ++ATOM 2100 CG ASN f 121 -20.775 -8.203 23.045 1.00 79.71 C ++ATOM 2101 OD1 ASN f 121 -20.842 -9.429 23.094 1.00 79.71 O ++ATOM 2102 ND2 ASN f 121 -21.835 -7.422 23.203 1.00 79.71 N ++ATOM 2103 N CYS f 122 -15.885 -8.164 23.686 1.00 77.09 N ++ATOM 2104 CA CYS f 122 -14.523 -7.691 23.437 1.00 77.09 C ++ATOM 2105 C CYS f 122 -13.612 -8.883 23.168 1.00 77.09 C ++ATOM 2106 O CYS f 122 -13.142 -9.537 24.099 1.00 77.09 O ++ATOM 2107 CB CYS f 122 -14.027 -6.857 24.611 1.00 77.09 C ++ATOM 2108 SG CYS f 122 -14.986 -5.342 24.832 1.00 77.09 S ++ATOM 2109 N MET f 123 -13.364 -9.160 21.891 1.00 82.89 N ++ATOM 2110 CA MET f 123 -12.437 -10.210 21.499 1.00 82.89 C ++ATOM 2111 C MET f 123 -11.027 -9.641 21.465 1.00 82.89 C ++ATOM 2112 O MET f 123 -10.783 -8.611 20.834 1.00 82.89 O ++ATOM 2113 CB MET f 123 -12.807 -10.794 20.136 1.00 82.89 C ++ATOM 2114 CG MET f 123 -14.121 -11.564 20.129 1.00 82.89 C ++ATOM 2115 SD MET f 123 -14.485 -12.337 18.541 1.00 82.89 S ++ATOM 2116 CE MET f 123 -14.910 -10.900 17.561 1.00 82.89 C ++ATOM 2117 N GLU f 124 -10.105 -10.329 22.128 1.00 76.16 N ++ATOM 2118 CA GLU f 124 -8.757 -9.832 22.355 1.00 76.16 C ++ATOM 2119 C GLU f 124 -7.904 -9.932 21.089 1.00 76.16 C ++ATOM 2120 O GLU f 124 -8.377 -10.263 20.000 1.00 76.16 O ++ATOM 2121 CB GLU f 124 -8.129 -10.583 23.526 1.00 76.16 C ++ATOM 2122 CG GLU f 124 -8.212 -12.097 23.401 1.00 76.16 C ++ATOM 2123 CD GLU f 124 -7.044 -12.702 22.647 1.00 76.16 C ++ATOM 2124 OE1 GLU f 124 -5.977 -12.058 22.590 1.00 76.16 O ++ATOM 2125 OE2 GLU f 124 -7.199 -13.813 22.096 1.00 76.16 O ++ATOM 2126 N MET f 125 -6.618 -9.630 21.242 1.00 65.16 N ++ATOM 2127 CA MET f 125 -5.654 -9.540 20.147 1.00 65.16 C ++ATOM 2128 C MET f 125 -4.420 -10.348 20.522 1.00 65.16 C ++ATOM 2129 O MET f 125 -3.453 -9.802 21.058 1.00 65.16 O ++ATOM 2130 CB MET f 125 -5.291 -8.103 19.906 1.00 65.16 C ++ATOM 2131 CG MET f 125 -6.389 -7.259 19.332 1.00 65.16 C ++ATOM 2132 SD MET f 125 -6.562 -7.503 17.588 1.00 65.16 S ++ATOM 2133 CE MET f 125 -5.029 -6.713 17.110 1.00 65.16 C ++ATOM 2134 N ASP f 126 -4.442 -11.643 20.241 1.00 65.01 N ++ATOM 2135 CA ASP f 126 -3.286 -12.465 20.548 1.00 65.01 C ++ATOM 2136 C ASP f 126 -2.232 -12.276 19.454 1.00 65.01 C ++ATOM 2137 O ASP f 126 -2.461 -11.598 18.454 1.00 65.01 O ++ATOM 2138 CB ASP f 126 -3.712 -13.929 20.682 1.00 65.01 C ++ATOM 2139 CG ASP f 126 -2.739 -14.755 21.496 1.00 65.01 C ++ATOM 2140 OD1 ASP f 126 -1.719 -14.194 21.944 1.00 65.01 O ++ATOM 2141 OD2 ASP f 126 -2.994 -15.961 21.694 1.00 65.01 O ++ATOM 2142 N VAL f 127 -1.052 -12.858 19.665 1.00 64.12 N ++ATOM 2143 CA VAL f 127 -0.017 -12.796 18.636 1.00 64.12 C ++ATOM 2144 C VAL f 127 -0.405 -13.670 17.448 1.00 64.12 C ++ATOM 2145 O VAL f 127 -0.155 -13.317 16.290 1.00 64.12 O ++ATOM 2146 CB VAL f 127 1.346 -13.200 19.232 1.00 64.12 C ++ATOM 2147 CG1 VAL f 127 2.452 -13.157 18.182 1.00 64.12 C ++ATOM 2148 CG2 VAL f 127 1.700 -12.303 20.416 1.00 64.12 C ++ATOM 2149 N MET f 128 -1.079 -14.789 17.711 1.00 66.51 N ++ATOM 2150 CA MET f 128 -1.405 -15.761 16.676 1.00 66.51 C ++ATOM 2151 C MET f 128 -2.858 -15.707 16.218 1.00 66.51 C ++ATOM 2152 O MET f 128 -3.140 -16.061 15.070 1.00 66.51 O ++ATOM 2153 CB MET f 128 -1.067 -17.177 17.173 1.00 66.51 C ++ATOM 2154 CG MET f 128 -1.058 -18.272 16.105 1.00 66.51 C ++ATOM 2155 SD MET f 128 -0.490 -19.875 16.708 1.00 66.51 S ++ATOM 2156 CE MET f 128 1.274 -19.582 16.847 1.00 66.51 C ++ATOM 2157 N SER f 129 -3.779 -15.238 17.066 1.00 56.25 N ++ATOM 2158 CA SER f 129 -5.177 -15.113 16.660 1.00 56.25 C ++ATOM 2159 C SER f 129 -5.348 -14.080 15.555 1.00 56.25 C ++ATOM 2160 O SER f 129 -6.135 -14.279 14.621 1.00 56.25 O ++ATOM 2161 CB SER f 129 -6.041 -14.743 17.859 1.00 56.25 C ++ATOM 2162 OG SER f 129 -7.380 -14.518 17.461 1.00 56.25 O ++ATOM 2163 N VAL f 130 -4.588 -12.988 15.627 1.00 56.11 N ++ATOM 2164 CA VAL f 130 -4.646 -11.966 14.592 1.00 56.11 C ++ATOM 2165 C VAL f 130 -4.030 -12.476 13.298 1.00 56.11 C ++ATOM 2166 O VAL f 130 -4.515 -12.159 12.203 1.00 56.11 O ++ATOM 2167 CB VAL f 130 -3.957 -10.698 15.109 1.00 56.11 C ++ATOM 2168 CG1 VAL f 130 -4.048 -9.578 14.105 1.00 56.11 C ++ATOM 2169 CG2 VAL f 130 -4.595 -10.301 16.392 1.00 56.11 C ++ATOM 2170 N ALA f 131 -2.989 -13.307 13.398 1.00 57.12 N ++ATOM 2171 CA ALA f 131 -2.420 -13.934 12.210 1.00 57.12 C ++ATOM 2172 C ALA f 131 -3.407 -14.896 11.565 1.00 57.12 C ++ATOM 2173 O ALA f 131 -3.472 -14.990 10.334 1.00 57.12 O ++ATOM 2174 CB ALA f 131 -1.121 -14.653 12.566 1.00 57.12 C ++ATOM 2175 N THR f 132 -4.208 -15.594 12.374 1.00 55.40 N ++ATOM 2176 CA THR f 132 -5.239 -16.456 11.798 1.00 55.40 C ++ATOM 2177 C THR f 132 -6.341 -15.642 11.133 1.00 55.40 C ++ATOM 2178 O THR f 132 -6.865 -16.054 10.094 1.00 55.40 O ++ATOM 2179 CB THR f 132 -5.842 -17.383 12.847 1.00 55.40 C ++ATOM 2180 OG1 THR f 132 -6.411 -16.608 13.909 1.00 55.40 O ++ATOM 2181 CG2 THR f 132 -4.795 -18.347 13.380 1.00 55.40 C ++ATOM 2182 N ILE f 133 -6.698 -14.489 11.708 1.00 55.85 N ++ATOM 2183 CA ILE f 133 -7.661 -13.593 11.058 1.00 55.85 C ++ATOM 2184 C ILE f 133 -7.125 -13.108 9.712 1.00 55.85 C ++ATOM 2185 O ILE f 133 -7.849 -13.103 8.703 1.00 55.85 O ++ATOM 2186 CB ILE f 133 -8.002 -12.410 11.983 1.00 55.85 C ++ATOM 2187 CG1 ILE f 133 -8.745 -12.889 13.225 1.00 55.85 C ++ATOM 2188 CG2 ILE f 133 -8.847 -11.371 11.269 1.00 55.85 C ++ATOM 2189 CD1 ILE f 133 -8.875 -11.824 14.291 1.00 55.85 C ++ATOM 2190 N VAL f 134 -5.840 -12.747 9.671 1.00 54.67 N ++ATOM 2191 CA VAL f 134 -5.213 -12.274 8.439 1.00 54.67 C ++ATOM 2192 C VAL f 134 -5.181 -13.374 7.385 1.00 54.67 C ++ATOM 2193 O VAL f 134 -5.512 -13.136 6.219 1.00 54.67 O ++ATOM 2194 CB VAL f 134 -3.805 -11.722 8.740 1.00 54.67 C ++ATOM 2195 CG1 VAL f 134 -3.026 -11.481 7.468 1.00 54.67 C ++ATOM 2196 CG2 VAL f 134 -3.916 -10.420 9.498 1.00 54.67 C ++ATOM 2197 N ILE f 135 -4.849 -14.604 7.784 1.00 54.29 N ++ATOM 2198 CA ILE f 135 -4.737 -15.683 6.804 1.00 54.29 C ++ATOM 2199 C ILE f 135 -6.115 -16.151 6.322 1.00 54.29 C ++ATOM 2200 O ILE f 135 -6.279 -16.489 5.140 1.00 54.29 O ++ATOM 2201 CB ILE f 135 -3.874 -16.817 7.394 1.00 54.29 C ++ATOM 2202 CG1 ILE f 135 -2.436 -16.327 7.542 1.00 54.29 C ++ATOM 2203 CG2 ILE f 135 -3.866 -18.058 6.522 1.00 54.29 C ++ATOM 2204 CD1 ILE f 135 -1.559 -17.245 8.339 1.00 54.29 C ++ATOM 2205 N VAL f 136 -7.137 -16.100 7.182 1.00 57.44 N ++ATOM 2206 CA VAL f 136 -8.502 -16.385 6.737 1.00 57.44 C ++ATOM 2207 C VAL f 136 -8.982 -15.333 5.739 1.00 57.44 C ++ATOM 2208 O VAL f 136 -9.569 -15.670 4.700 1.00 57.44 O ++ATOM 2209 CB VAL f 136 -9.445 -16.510 7.950 1.00 57.44 C ++ATOM 2210 CG1 VAL f 136 -10.903 -16.476 7.529 1.00 57.44 C ++ATOM 2211 CG2 VAL f 136 -9.185 -17.818 8.661 1.00 57.44 C ++ATOM 2212 N ASP f 137 -8.698 -14.053 6.007 1.00 59.63 N ++ATOM 2213 CA ASP f 137 -9.102 -13.002 5.073 1.00 59.63 C ++ATOM 2214 C ASP f 137 -8.331 -13.098 3.757 1.00 59.63 C ++ATOM 2215 O ASP f 137 -8.890 -12.855 2.678 1.00 59.63 O ++ATOM 2216 CB ASP f 137 -8.898 -11.632 5.712 1.00 59.63 C ++ATOM 2217 CG ASP f 137 -9.666 -10.533 5.008 1.00 59.63 C ++ATOM 2218 OD1 ASP f 137 -10.395 -10.810 4.034 1.00 59.63 O ++ATOM 2219 OD2 ASP f 137 -9.545 -9.376 5.445 1.00 59.63 O ++ATOM 2220 N ILE f 138 -7.052 -13.475 3.834 1.00 58.15 N ++ATOM 2221 CA ILE f 138 -6.233 -13.704 2.645 1.00 58.15 C ++ATOM 2222 C ILE f 138 -6.809 -14.829 1.792 1.00 58.15 C ++ATOM 2223 O ILE f 138 -6.917 -14.699 0.568 1.00 58.15 O ++ATOM 2224 CB ILE f 138 -4.774 -13.976 3.060 1.00 58.15 C ++ATOM 2225 CG1 ILE f 138 -4.041 -12.660 3.325 1.00 58.15 C ++ATOM 2226 CG2 ILE f 138 -4.038 -14.877 2.087 1.00 58.15 C ++ATOM 2227 CD1 ILE f 138 -2.670 -12.846 3.909 1.00 58.15 C ++ATOM 2228 N CYS f 139 -7.225 -15.932 2.426 1.00 65.37 N ++ATOM 2229 CA CYS f 139 -7.779 -17.056 1.673 1.00 65.37 C ++ATOM 2230 C CYS f 139 -9.124 -16.710 1.045 1.00 65.37 C ++ATOM 2231 O CYS f 139 -9.389 -17.102 -0.100 1.00 65.37 O ++ATOM 2232 CB CYS f 139 -7.903 -18.282 2.572 1.00 65.37 C ++ATOM 2233 SG CYS f 139 -6.313 -18.993 3.045 1.00 65.37 S ++ATOM 2234 N ILE f 140 -9.967 -15.956 1.761 1.00 62.61 N ++ATOM 2235 CA ILE f 140 -11.258 -15.528 1.213 1.00 62.61 C ++ATOM 2236 C ILE f 140 -11.061 -14.632 -0.004 1.00 62.61 C ++ATOM 2237 O ILE f 140 -11.677 -14.840 -1.061 1.00 62.61 O ++ATOM 2238 CB ILE f 140 -12.093 -14.825 2.298 1.00 62.61 C ++ATOM 2239 CG1 ILE f 140 -12.542 -15.824 3.361 1.00 62.61 C ++ATOM 2240 CG2 ILE f 140 -13.295 -14.131 1.698 1.00 62.61 C ++ATOM 2241 CD1 ILE f 140 -13.132 -15.169 4.591 1.00 62.61 C ++ATOM 2242 N THR f 141 -10.167 -13.649 0.105 1.00 63.21 N ++ATOM 2243 CA THR f 141 -9.985 -12.735 -1.014 1.00 63.21 C ++ATOM 2244 C THR f 141 -9.213 -13.372 -2.161 1.00 63.21 C ++ATOM 2245 O THR f 141 -9.438 -13.012 -3.321 1.00 63.21 O ++ATOM 2246 CB THR f 141 -9.301 -11.472 -0.534 1.00 63.21 C ++ATOM 2247 OG1 THR f 141 -8.061 -11.818 0.095 1.00 63.21 O ++ATOM 2248 CG2 THR f 141 -10.209 -10.787 0.455 1.00 63.21 C ++ATOM 2249 N GLY f 142 -8.339 -14.337 -1.872 1.00 62.77 N ++ATOM 2250 CA GLY f 142 -7.691 -15.075 -2.941 1.00 62.77 C ++ATOM 2251 C GLY f 142 -8.668 -15.940 -3.711 1.00 62.77 C ++ATOM 2252 O GLY f 142 -8.595 -16.024 -4.939 1.00 62.77 O ++ATOM 2253 N GLY f 143 -9.617 -16.561 -3.001 1.00 64.50 N ++ATOM 2254 CA GLY f 143 -10.666 -17.306 -3.676 1.00 64.50 C ++ATOM 2255 C GLY f 143 -11.559 -16.423 -4.528 1.00 64.50 C ++ATOM 2256 O GLY f 143 -11.910 -16.789 -5.654 1.00 64.50 O ++ATOM 2257 N LEU f 144 -11.907 -15.236 -4.015 1.00 62.72 N ++ATOM 2258 CA LEU f 144 -12.727 -14.310 -4.798 1.00 62.72 C ++ATOM 2259 C LEU f 144 -11.986 -13.801 -6.030 1.00 62.72 C ++ATOM 2260 O LEU f 144 -12.575 -13.691 -7.116 1.00 62.72 O ++ATOM 2261 CB LEU f 144 -13.185 -13.143 -3.932 1.00 62.72 C ++ATOM 2262 CG LEU f 144 -14.218 -13.506 -2.872 1.00 62.72 C ++ATOM 2263 CD1 LEU f 144 -14.510 -12.312 -1.984 1.00 62.72 C ++ATOM 2264 CD2 LEU f 144 -15.487 -14.002 -3.535 1.00 62.72 C ++ATOM 2265 N LEU f 145 -10.687 -13.522 -5.899 1.00 66.73 N ++ATOM 2266 CA LEU f 145 -9.939 -13.054 -7.057 1.00 66.73 C ++ATOM 2267 C LEU f 145 -9.690 -14.169 -8.063 1.00 66.73 C ++ATOM 2268 O LEU f 145 -9.625 -13.896 -9.262 1.00 66.73 O ++ATOM 2269 CB LEU f 145 -8.627 -12.410 -6.626 1.00 66.73 C ++ATOM 2270 CG LEU f 145 -8.826 -11.076 -5.905 1.00 66.73 C ++ATOM 2271 CD1 LEU f 145 -7.496 -10.499 -5.458 1.00 66.73 C ++ATOM 2272 CD2 LEU f 145 -9.599 -10.088 -6.768 1.00 66.73 C ++ATOM 2273 N LEU f 146 -9.603 -15.428 -7.619 1.00 70.39 N ++ATOM 2274 CA LEU f 146 -9.508 -16.520 -8.586 1.00 70.39 C ++ATOM 2275 C LEU f 146 -10.833 -16.740 -9.308 1.00 70.39 C ++ATOM 2276 O LEU f 146 -10.844 -17.070 -10.501 1.00 70.39 O ++ATOM 2277 CB LEU f 146 -9.042 -17.809 -7.911 1.00 70.39 C ++ATOM 2278 CG LEU f 146 -7.570 -17.832 -7.494 1.00 70.39 C ++ATOM 2279 CD1 LEU f 146 -7.226 -19.137 -6.796 1.00 70.39 C ++ATOM 2280 CD2 LEU f 146 -6.659 -17.598 -8.686 1.00 70.39 C ++ATOM 2281 N LEU f 147 -11.958 -16.551 -8.607 1.00 69.13 N ++ATOM 2282 CA LEU f 147 -13.261 -16.628 -9.270 1.00 69.13 C ++ATOM 2283 C LEU f 147 -13.409 -15.545 -10.332 1.00 69.13 C ++ATOM 2284 O LEU f 147 -13.821 -15.832 -11.464 1.00 69.13 O ++ATOM 2285 CB LEU f 147 -14.395 -16.525 -8.251 1.00 69.13 C ++ATOM 2286 CG LEU f 147 -14.612 -17.704 -7.297 1.00 69.13 C ++ATOM 2287 CD1 LEU f 147 -15.694 -17.386 -6.279 1.00 69.13 C ++ATOM 2288 CD2 LEU f 147 -14.952 -18.978 -8.055 1.00 69.13 C ++ATOM 2289 N VAL f 148 -13.029 -14.307 -10.003 1.00 70.58 N ++ATOM 2290 CA VAL f 148 -13.114 -13.218 -10.975 1.00 70.58 C ++ATOM 2291 C VAL f 148 -12.096 -13.414 -12.100 1.00 70.58 C ++ATOM 2292 O VAL f 148 -12.370 -13.098 -13.267 1.00 70.58 O ++ATOM 2293 CB VAL f 148 -12.950 -11.864 -10.255 1.00 70.58 C ++ATOM 2294 CG1 VAL f 148 -12.941 -10.698 -11.229 1.00 70.58 C ++ATOM 2295 CG2 VAL f 148 -14.076 -11.675 -9.262 1.00 70.58 C ++ATOM 2296 N TYR f 149 -10.943 -14.016 -11.787 1.00 75.47 N ++ATOM 2297 CA TYR f 149 -9.921 -14.284 -12.794 1.00 75.47 C ++ATOM 2298 C TYR f 149 -10.396 -15.290 -13.832 1.00 75.47 C ++ATOM 2299 O TYR f 149 -10.275 -15.046 -15.039 1.00 75.47 O ++ATOM 2300 CB TYR f 149 -8.653 -14.790 -12.114 1.00 75.47 C ++ATOM 2301 CG TYR f 149 -7.531 -15.131 -13.061 1.00 75.47 C ++ATOM 2302 CD1 TYR f 149 -6.785 -14.133 -13.667 1.00 75.47 C ++ATOM 2303 CD2 TYR f 149 -7.208 -16.452 -13.338 1.00 75.47 C ++ATOM 2304 CE1 TYR f 149 -5.751 -14.439 -14.527 1.00 75.47 C ++ATOM 2305 CE2 TYR f 149 -6.178 -16.767 -14.196 1.00 75.47 C ++ATOM 2306 CZ TYR f 149 -5.454 -15.755 -14.789 1.00 75.47 C ++ATOM 2307 OH TYR f 149 -4.425 -16.058 -15.647 1.00 75.47 O ++ATOM 2308 N TYR f 150 -10.946 -16.424 -13.389 1.00 80.81 N ++ATOM 2309 CA TYR f 150 -11.407 -17.410 -14.360 1.00 80.81 C ++ATOM 2310 C TYR f 150 -12.692 -16.963 -15.046 1.00 80.81 C ++ATOM 2311 O TYR f 150 -12.944 -17.345 -16.193 1.00 80.81 O ++ATOM 2312 CB TYR f 150 -11.571 -18.786 -13.714 1.00 80.81 C ++ATOM 2313 CG TYR f 150 -10.244 -19.448 -13.417 1.00 80.81 C ++ATOM 2314 CD1 TYR f 150 -9.476 -19.988 -14.441 1.00 80.81 C ++ATOM 2315 CD2 TYR f 150 -9.767 -19.545 -12.121 1.00 80.81 C ++ATOM 2316 CE1 TYR f 150 -8.260 -20.590 -14.178 1.00 80.81 C ++ATOM 2317 CE2 TYR f 150 -8.556 -20.144 -11.846 1.00 80.81 C ++ATOM 2318 CZ TYR f 150 -7.806 -20.666 -12.876 1.00 80.81 C ++ATOM 2319 OH TYR f 150 -6.600 -21.266 -12.598 1.00 80.81 O ++ATOM 2320 N TRP f 151 -13.442 -16.083 -14.391 1.00 81.26 N ++ATOM 2321 CA TRP f 151 -14.609 -15.490 -15.024 1.00 81.26 C ++ATOM 2322 C TRP f 151 -14.175 -14.587 -16.187 1.00 81.26 C ++ATOM 2323 O TRP f 151 -14.801 -14.591 -17.243 1.00 81.26 O ++ATOM 2324 CB TRP f 151 -15.446 -14.681 -14.036 1.00 81.26 C ++ATOM 2325 CG TRP f 151 -16.575 -13.973 -14.713 1.00 81.26 C ++ATOM 2326 CD1 TRP f 151 -17.478 -14.520 -15.575 1.00 81.26 C ++ATOM 2327 CD2 TRP f 151 -16.914 -12.586 -14.604 1.00 81.26 C ++ATOM 2328 NE1 TRP f 151 -18.364 -13.564 -16.004 1.00 81.26 N ++ATOM 2329 CE2 TRP f 151 -18.039 -12.367 -15.423 1.00 81.26 C ++ATOM 2330 CE3 TRP f 151 -16.380 -11.510 -13.893 1.00 81.26 C ++ATOM 2331 CZ2 TRP f 151 -18.639 -11.117 -15.548 1.00 81.26 C ++ATOM 2332 CZ3 TRP f 151 -16.978 -10.269 -14.018 1.00 81.26 C ++ATOM 2333 CH2 TRP f 151 -18.095 -10.084 -14.840 1.00 81.26 C ++ATOM 2334 N SER f 152 -13.106 -13.811 -15.989 1.00 80.94 N ++ATOM 2335 CA SER f 152 -12.612 -12.914 -17.026 1.00 80.94 C ++ATOM 2336 C SER f 152 -11.898 -13.679 -18.133 1.00 80.94 C ++ATOM 2337 O SER f 152 -11.938 -13.273 -19.301 1.00 80.94 O ++ATOM 2338 CB SER f 152 -11.688 -11.876 -16.401 1.00 80.94 C ++ATOM 2339 OG SER f 152 -10.555 -12.510 -15.837 1.00 80.94 O ++ATOM 2340 N LYS f 153 -11.231 -14.785 -17.791 1.00 77.75 N ++ATOM 2341 CA LYS f 153 -10.616 -15.609 -18.827 1.00 77.75 C ++ATOM 2342 C LYS f 153 -11.666 -16.369 -19.629 1.00 77.75 C ++ATOM 2343 O LYS f 153 -11.442 -16.697 -20.799 1.00 77.75 O ++ATOM 2344 CB LYS f 153 -9.597 -16.570 -18.217 1.00 77.75 C ++ATOM 2345 CG LYS f 153 -8.374 -15.890 -17.620 1.00 77.75 C ++ATOM 2346 CD LYS f 153 -7.564 -15.167 -18.682 1.00 77.75 C ++ATOM 2347 CE LYS f 153 -6.911 -16.141 -19.651 1.00 77.75 C ++ATOM 2348 NZ LYS f 153 -5.887 -17.001 -18.998 1.00 77.75 N ++ATOM 2349 N ASN f 154 -12.819 -16.660 -19.017 1.00 83.85 N ++ATOM 2350 CA ASN f 154 -13.924 -17.234 -19.780 1.00 83.85 C ++ATOM 2351 C ASN f 154 -14.612 -16.175 -20.632 1.00 83.85 C ++ATOM 2352 O ASN f 154 -15.274 -16.502 -21.622 1.00 83.85 O ++ATOM 2353 CB ASN f 154 -14.927 -17.904 -18.843 1.00 83.85 C ++ATOM 2354 CG ASN f 154 -14.391 -19.186 -18.242 1.00 83.85 C ++ATOM 2355 OD1 ASN f 154 -13.754 -19.988 -18.922 1.00 83.85 O ++ATOM 2356 ND2 ASN f 154 -14.643 -19.383 -16.953 1.00 83.85 N ++ATOM 2357 N ARG f 155 -14.485 -14.900 -20.252 1.00 86.53 N ++ATOM 2358 CA ARG f 155 -14.923 -13.832 -21.148 1.00 86.53 C ++ATOM 2359 C ARG f 155 -13.818 -13.437 -22.119 1.00 86.53 C ++ATOM 2360 O ARG f 155 -14.041 -12.630 -23.027 1.00 86.53 O ++ATOM 2361 CB ARG f 155 -15.400 -12.614 -20.357 1.00 86.53 C ++ATOM 2362 CG ARG f 155 -16.591 -12.862 -19.437 1.00 86.53 C ++ATOM 2363 CD ARG f 155 -17.940 -12.969 -20.162 1.00 86.53 C ++ATOM 2364 NE ARG f 155 -18.163 -14.275 -20.782 1.00 86.53 N ++ATOM 2365 CZ ARG f 155 -18.515 -15.381 -20.129 1.00 86.53 C ++ATOM 2366 NH1 ARG f 155 -18.705 -15.361 -18.816 1.00 86.53 N ++ATOM 2367 NH2 ARG f 155 -18.682 -16.515 -20.795 1.00 86.53 N ++ATOM 2368 N LYS f 156 -12.619 -13.977 -21.934 1.00 82.40 N ++ATOM 2369 CA LYS f 156 -11.528 -13.729 -22.866 1.00 82.40 C ++ATOM 2370 C LYS f 156 -11.645 -14.641 -24.084 1.00 82.40 C ++ATOM 2371 O LYS f 156 -10.838 -15.553 -24.266 1.00 82.40 O ++ATOM 2372 CB LYS f 156 -10.176 -13.933 -22.180 1.00 30.00 C ++ATOM 2374 N SER g 24 -1.407 -10.196 57.004 1.00 67.06 N ++ATOM 2375 CA SER g 24 -1.446 -11.645 57.174 1.00 67.06 C ++ATOM 2376 C SER g 24 -0.047 -12.244 57.188 1.00 67.06 C ++ATOM 2377 O SER g 24 0.185 -13.301 56.610 1.00 67.06 O ++ATOM 2378 CB SER g 24 -2.269 -12.295 56.065 1.00 67.06 C ++ATOM 2379 OG SER g 24 -2.270 -13.703 56.205 1.00 67.06 O ++ATOM 2380 N ILE g 25 0.883 -11.573 57.876 1.00 71.80 N ++ATOM 2381 CA ILE g 25 2.284 -11.991 57.861 1.00 71.80 C ++ATOM 2382 C ILE g 25 2.575 -13.173 58.768 1.00 71.80 C ++ATOM 2383 O ILE g 25 3.736 -13.592 58.858 1.00 71.80 O ++ATOM 2384 CB ILE g 25 3.213 -10.826 58.252 1.00 71.80 C ++ATOM 2385 CG1 ILE g 25 2.886 -10.344 59.665 1.00 71.80 C ++ATOM 2386 CG2 ILE g 25 3.100 -9.702 57.239 1.00 71.80 C ++ATOM 2387 CD1 ILE g 25 3.875 -9.352 60.223 1.00 71.80 C ++ATOM 2388 N LYS g 26 1.578 -13.715 59.457 1.00 64.68 N ++ATOM 2389 CA LYS g 26 1.745 -15.022 60.070 1.00 64.68 C ++ATOM 2390 C LYS g 26 1.016 -16.056 59.228 1.00 64.68 C ++ATOM 2391 O LYS g 26 0.187 -15.728 58.378 1.00 64.68 O ++ATOM 2392 CB LYS g 26 1.236 -15.047 61.512 1.00 64.68 C ++ATOM 2393 CG LYS g 26 -0.271 -15.056 61.662 1.00 64.68 C ++ATOM 2394 CD LYS g 26 -0.655 -15.126 63.129 1.00 64.68 C ++ATOM 2395 CE LYS g 26 -2.157 -15.187 63.303 1.00 64.68 C ++ATOM 2396 NZ LYS g 26 -2.711 -16.461 62.777 1.00 64.68 N ++ATOM 2397 N GLY g 27 1.337 -17.321 59.471 1.00 57.45 N ++ATOM 2398 CA GLY g 27 0.970 -18.351 58.527 1.00 57.45 C ++ATOM 2399 C GLY g 27 1.855 -18.394 57.306 1.00 57.45 C ++ATOM 2400 O GLY g 27 1.476 -19.021 56.310 1.00 57.45 O ++ATOM 2401 N ASN g 28 2.998 -17.701 57.352 1.00 56.59 N ++ATOM 2402 CA ASN g 28 4.055 -17.722 56.337 1.00 56.59 C ++ATOM 2403 C ASN g 28 3.573 -17.201 54.980 1.00 56.59 C ++ATOM 2404 O ASN g 28 4.077 -17.618 53.939 1.00 56.59 O ++ATOM 2405 CB ASN g 28 4.659 -19.126 56.195 1.00 56.59 C ++ATOM 2406 CG ASN g 28 6.114 -19.107 55.766 1.00 56.59 C ++ATOM 2407 OD1 ASN g 28 6.785 -20.134 55.778 1.00 56.59 O ++ATOM 2408 ND2 ASN g 28 6.619 -17.931 55.428 1.00 56.59 N ++ATOM 2409 N HIS g 29 2.609 -16.282 54.965 1.00 54.24 N ++ATOM 2410 CA HIS g 29 2.219 -15.599 53.728 1.00 54.24 C ++ATOM 2411 C HIS g 29 2.971 -14.277 53.622 1.00 54.24 C ++ATOM 2412 O HIS g 29 2.403 -13.194 53.710 1.00 54.24 O ++ATOM 2413 CB HIS g 29 0.717 -15.361 53.688 1.00 54.24 C ++ATOM 2414 CG HIS g 29 -0.092 -16.602 53.520 1.00 54.24 C ++ATOM 2415 ND1 HIS g 29 -0.538 -17.346 54.589 1.00 54.24 N ++ATOM 2416 CD2 HIS g 29 -0.553 -17.222 52.411 1.00 54.24 C ++ATOM 2417 CE1 HIS g 29 -1.234 -18.375 54.144 1.00 54.24 C ++ATOM 2418 NE2 HIS g 29 -1.258 -18.323 52.826 1.00 54.24 N ++ATOM 2419 N LEU g 30 4.273 -14.386 53.413 1.00 54.06 N ++ATOM 2420 CA LEU g 30 5.122 -13.218 53.562 1.00 54.06 C ++ATOM 2421 C LEU g 30 5.160 -12.321 52.331 1.00 54.06 C ++ATOM 2422 O LEU g 30 5.774 -11.251 52.397 1.00 54.06 O ++ATOM 2423 CB LEU g 30 6.538 -13.657 53.922 1.00 54.06 C ++ATOM 2424 CG LEU g 30 6.641 -14.423 55.239 1.00 54.06 C ++ATOM 2425 CD1 LEU g 30 8.079 -14.820 55.502 1.00 54.06 C ++ATOM 2426 CD2 LEU g 30 6.081 -13.621 56.388 1.00 54.06 C ++ATOM 2427 N VAL g 31 4.517 -12.692 51.227 1.00 36.71 N ++ATOM 2428 CA VAL g 31 4.644 -11.961 49.971 1.00 36.71 C ++ATOM 2429 C VAL g 31 3.365 -11.169 49.739 1.00 36.71 C ++ATOM 2430 O VAL g 31 2.276 -11.745 49.686 1.00 36.71 O ++ATOM 2431 CB VAL g 31 4.922 -12.901 48.793 1.00 36.71 C ++ATOM 2432 CG1 VAL g 31 5.168 -12.103 47.542 1.00 36.71 C ++ATOM 2433 CG2 VAL g 31 6.099 -13.781 49.094 1.00 36.71 C ++ATOM 2434 N LYS g 32 3.501 -9.853 49.593 1.00 33.29 N ++ATOM 2435 CA LYS g 32 2.391 -8.953 49.316 1.00 33.29 C ++ATOM 2436 C LYS g 32 2.679 -8.204 48.022 1.00 33.29 C ++ATOM 2437 O LYS g 32 3.833 -8.072 47.615 1.00 33.29 O ++ATOM 2438 CB LYS g 32 2.189 -7.948 50.458 1.00 33.29 C ++ATOM 2439 CG LYS g 32 1.921 -8.523 51.857 1.00 33.29 C ++ATOM 2440 CD LYS g 32 0.476 -8.959 52.093 1.00 33.29 C ++ATOM 2441 CE LYS g 32 0.284 -10.459 51.992 1.00 33.29 C ++ATOM 2442 NZ LYS g 32 -1.091 -10.863 52.397 1.00 33.29 N ++ATOM 2443 N VAL g 33 1.633 -7.698 47.371 1.00 30.90 N ++ATOM 2444 CA VAL g 33 1.782 -6.962 46.120 1.00 30.90 C ++ATOM 2445 C VAL g 33 1.392 -5.511 46.350 1.00 30.90 C ++ATOM 2446 O VAL g 33 0.360 -5.232 46.968 1.00 30.90 O ++ATOM 2447 CB VAL g 33 0.924 -7.566 44.993 1.00 30.90 C ++ATOM 2448 CG1 VAL g 33 1.174 -6.862 43.681 1.00 30.90 C ++ATOM 2449 CG2 VAL g 33 1.201 -9.009 44.849 1.00 30.90 C ++ATOM 2450 N TYR g 34 2.211 -4.583 45.845 1.00 33.81 N ++ATOM 2451 CA TYR g 34 1.897 -3.157 45.859 1.00 33.81 C ++ATOM 2452 C TYR g 34 1.713 -2.709 44.414 1.00 33.81 C ++ATOM 2453 O TYR g 34 2.634 -2.200 43.780 1.00 33.81 O ++ATOM 2454 CB TYR g 34 2.983 -2.360 46.558 1.00 33.81 C ++ATOM 2455 CG TYR g 34 3.006 -2.552 48.053 1.00 33.81 C ++ATOM 2456 CD1 TYR g 34 1.904 -3.065 48.728 1.00 33.81 C ++ATOM 2457 CD2 TYR g 34 4.130 -2.222 48.791 1.00 33.81 C ++ATOM 2458 CE1 TYR g 34 1.923 -3.245 50.094 1.00 33.81 C ++ATOM 2459 CE2 TYR g 34 4.159 -2.397 50.159 1.00 33.81 C ++ATOM 2460 CZ TYR g 34 3.053 -2.910 50.804 1.00 33.81 C ++ATOM 2461 OH TYR g 34 3.077 -3.085 52.166 1.00 33.81 O ++ATOM 2462 N ASP g 35 0.494 -2.872 43.911 1.00 31.64 N ++ATOM 2463 CA ASP g 35 0.270 -2.873 42.472 1.00 31.64 C ++ATOM 2464 C ASP g 35 0.026 -1.485 41.901 1.00 31.64 C ++ATOM 2465 O ASP g 35 0.729 -1.060 40.978 1.00 31.64 O ++ATOM 2466 CB ASP g 35 -0.910 -3.767 42.133 1.00 31.64 C ++ATOM 2467 CG ASP g 35 -1.258 -3.703 40.680 1.00 31.64 C ++ATOM 2468 OD1 ASP g 35 -0.536 -4.289 39.865 1.00 31.64 O ++ATOM 2469 OD2 ASP g 35 -2.238 -3.030 40.342 1.00 31.64 O ++ATOM 2470 N TYR g 36 -1.010 -0.806 42.397 1.00 30.51 N ++ATOM 2471 CA TYR g 36 -1.476 0.461 41.843 1.00 30.51 C ++ATOM 2472 C TYR g 36 -0.385 1.514 41.929 1.00 30.51 C ++ATOM 2473 O TYR g 36 0.114 1.815 43.014 1.00 30.51 O ++ATOM 2474 CB TYR g 36 -2.702 0.911 42.618 1.00 30.51 C ++ATOM 2475 CG TYR g 36 -3.891 0.006 42.456 1.00 30.51 C ++ATOM 2476 CD1 TYR g 36 -4.161 -0.615 41.253 1.00 30.51 C ++ATOM 2477 CD2 TYR g 36 -4.680 -0.318 43.549 1.00 30.51 C ++ATOM 2478 CE1 TYR g 36 -5.244 -1.461 41.118 1.00 30.51 C ++ATOM 2479 CE2 TYR g 36 -5.748 -1.172 43.428 1.00 30.51 C ++ATOM 2480 CZ TYR g 36 -6.022 -1.742 42.212 1.00 30.51 C ++ATOM 2481 OH TYR g 36 -7.089 -2.593 42.081 1.00 30.51 O ++ATOM 2482 N GLN g 37 0.019 2.046 40.782 1.00 30.32 N ++ATOM 2483 CA GLN g 37 1.218 2.868 40.761 1.00 30.32 C ++ATOM 2484 C GLN g 37 1.044 3.905 39.660 1.00 30.32 C ++ATOM 2485 O GLN g 37 0.059 3.880 38.918 1.00 30.32 O ++ATOM 2486 CB GLN g 37 2.453 1.985 40.569 1.00 30.32 C ++ATOM 2487 CG GLN g 37 3.743 2.563 41.088 1.00 30.32 C ++ATOM 2488 CD GLN g 37 3.716 2.695 42.583 1.00 30.32 C ++ATOM 2489 OE1 GLN g 37 3.299 1.779 43.290 1.00 30.32 O ++ATOM 2490 NE2 GLN g 37 4.130 3.848 43.080 1.00 30.32 N ++ATOM 2491 N GLU g 38 2.005 4.833 39.582 1.00 35.79 N ++ATOM 2492 CA GLU g 38 1.941 5.944 38.633 1.00 35.79 C ++ATOM 2493 C GLU g 38 1.993 5.448 37.196 1.00 35.79 C ++ATOM 2494 O GLU g 38 1.163 5.827 36.363 1.00 35.79 O ++ATOM 2495 CB GLU g 38 3.089 6.909 38.907 1.00 35.79 C ++ATOM 2496 CG GLU g 38 3.013 7.565 40.263 1.00 35.79 C ++ATOM 2497 CD GLU g 38 4.222 8.416 40.554 1.00 35.79 C ++ATOM 2498 OE1 GLU g 38 5.190 8.360 39.767 1.00 35.79 O ++ATOM 2499 OE2 GLU g 38 4.204 9.141 41.568 1.00 35.79 O ++ATOM 2500 N ASP g 39 2.971 4.609 36.886 1.00 34.24 N ++ATOM 2501 CA ASP g 39 2.946 3.793 35.686 1.00 34.24 C ++ATOM 2502 C ASP g 39 2.297 2.453 36.023 1.00 34.24 C ++ATOM 2503 O ASP g 39 1.682 2.288 37.076 1.00 34.24 O ++ATOM 2504 CB ASP g 39 4.352 3.649 35.122 1.00 34.24 C ++ATOM 2505 CG ASP g 39 5.345 3.177 36.156 1.00 34.24 C ++ATOM 2506 OD1 ASP g 39 4.991 3.098 37.348 1.00 34.24 O ++ATOM 2507 OD2 ASP g 39 6.491 2.875 35.778 1.00 34.24 O ++ATOM 2508 N GLY g 40 2.424 1.473 35.143 1.00 29.03 N ++ATOM 2509 CA GLY g 40 1.792 0.198 35.412 1.00 29.03 C ++ATOM 2510 C GLY g 40 2.672 -0.787 36.151 1.00 29.03 C ++ATOM 2511 O GLY g 40 2.465 -1.997 36.046 1.00 29.03 O ++ATOM 2512 N SER g 41 3.641 -0.287 36.910 1.00 28.02 N ++ATOM 2513 CA SER g 41 4.670 -1.137 37.490 1.00 28.02 C ++ATOM 2514 C SER g 41 4.120 -1.935 38.665 1.00 28.02 C ++ATOM 2515 O SER g 41 3.692 -1.358 39.667 1.00 28.02 O ++ATOM 2516 CB SER g 41 5.852 -0.282 37.930 1.00 28.02 C ++ATOM 2517 OG SER g 41 6.860 -1.074 38.525 1.00 28.02 O ++ATOM 2518 N VAL g 42 4.130 -3.256 38.538 1.00 26.76 N ++ATOM 2519 CA VAL g 42 3.739 -4.163 39.610 1.00 26.76 C ++ATOM 2520 C VAL g 42 4.945 -4.397 40.501 1.00 26.76 C ++ATOM 2521 O VAL g 42 6.037 -4.686 40.007 1.00 26.76 O ++ATOM 2522 CB VAL g 42 3.233 -5.491 39.037 1.00 26.76 C ++ATOM 2523 CG1 VAL g 42 2.872 -6.446 40.141 1.00 26.76 C ++ATOM 2524 CG2 VAL g 42 2.073 -5.254 38.123 1.00 26.76 C ++ATOM 2525 N LEU g 43 4.765 -4.285 41.808 1.00 31.68 N ++ATOM 2526 CA LEU g 43 5.861 -4.506 42.733 1.00 31.68 C ++ATOM 2527 C LEU g 43 5.485 -5.555 43.767 1.00 31.68 C ++ATOM 2528 O LEU g 43 4.327 -5.661 44.172 1.00 31.68 O ++ATOM 2529 CB LEU g 43 6.248 -3.215 43.433 1.00 31.68 C ++ATOM 2530 CG LEU g 43 6.793 -2.116 42.531 1.00 31.68 C ++ATOM 2531 CD1 LEU g 43 7.025 -0.887 43.346 1.00 31.68 C ++ATOM 2532 CD2 LEU g 43 8.074 -2.552 41.883 1.00 31.68 C ++ATOM 2533 N LEU g 44 6.478 -6.316 44.211 1.00 36.17 N ++ATOM 2534 CA LEU g 44 6.301 -7.311 45.257 1.00 36.17 C ++ATOM 2535 C LEU g 44 7.089 -6.893 46.489 1.00 36.17 C ++ATOM 2536 O LEU g 44 8.109 -6.212 46.377 1.00 36.17 O ++ATOM 2537 CB LEU g 44 6.779 -8.683 44.814 1.00 36.17 C ++ATOM 2538 CG LEU g 44 6.156 -9.378 43.616 1.00 36.17 C ++ATOM 2539 CD1 LEU g 44 6.873 -10.682 43.398 1.00 36.17 C ++ATOM 2540 CD2 LEU g 44 4.705 -9.628 43.833 1.00 36.17 C ++ATOM 2541 N THR g 45 6.618 -7.301 47.667 1.00 43.48 N ++ATOM 2542 CA THR g 45 7.295 -7.043 48.930 1.00 43.48 C ++ATOM 2543 C THR g 45 7.280 -8.294 49.791 1.00 43.48 C ++ATOM 2544 O THR g 45 6.275 -9.006 49.843 1.00 43.48 O ++ATOM 2545 CB THR g 45 6.637 -5.916 49.716 1.00 43.48 C ++ATOM 2546 OG1 THR g 45 5.241 -6.197 49.862 1.00 43.48 O ++ATOM 2547 CG2 THR g 45 6.837 -4.574 49.048 1.00 43.48 C ++ATOM 2548 N CYS g 46 8.387 -8.543 50.484 1.00 60.73 N ++ATOM 2549 CA CYS g 46 8.504 -9.657 51.413 1.00 60.73 C ++ATOM 2550 C CYS g 46 8.824 -9.136 52.804 1.00 60.73 C ++ATOM 2551 O CYS g 46 9.623 -8.208 52.959 1.00 60.73 O ++ATOM 2552 CB CYS g 46 9.589 -10.639 50.963 1.00 60.73 C ++ATOM 2553 SG CYS g 46 9.840 -12.052 52.051 1.00 60.73 S ++ATOM 2554 N ASP g 47 8.204 -9.739 53.814 1.00 73.61 N ++ATOM 2555 CA ASP g 47 8.386 -9.343 55.210 1.00 73.61 C ++ATOM 2556 C ASP g 47 9.199 -10.427 55.913 1.00 73.61 C ++ATOM 2557 O ASP g 47 8.666 -11.481 56.265 1.00 73.61 O ++ATOM 2558 CB ASP g 47 7.040 -9.127 55.893 1.00 73.61 C ++ATOM 2559 CG ASP g 47 7.167 -8.431 57.239 1.00 73.61 C ++ATOM 2560 OD1 ASP g 47 8.295 -8.079 57.646 1.00 73.61 O ++ATOM 2561 OD2 ASP g 47 6.125 -8.238 57.900 1.00 73.61 O ++ATOM 2562 N ALA g 48 10.479 -10.148 56.140 1.00 86.70 N ++ATOM 2563 CA ALA g 48 11.380 -11.066 56.829 1.00 86.70 C ++ATOM 2564 C ALA g 48 12.549 -10.262 57.387 1.00 86.70 C ++ATOM 2565 O ALA g 48 12.517 -9.027 57.419 1.00 86.70 O ++ATOM 2566 CB ALA g 48 11.851 -12.182 55.889 1.00 86.70 C ++ATOM 2567 N GLU g 49 13.586 -10.967 57.830 1.00 93.67 N ++ATOM 2568 CA GLU g 49 14.817 -10.338 58.306 1.00 93.67 C ++ATOM 2569 C GLU g 49 15.581 -9.797 57.106 1.00 93.67 C ++ATOM 2570 O GLU g 49 16.190 -10.550 56.345 1.00 93.67 O ++ATOM 2571 CB GLU g 49 15.664 -11.335 59.091 1.00 93.67 C ++ATOM 2572 CG GLU g 49 15.056 -11.798 60.410 1.00 93.67 C ++ATOM 2573 CD GLU g 49 14.127 -12.988 60.250 1.00 93.67 C ++ATOM 2574 OE1 GLU g 49 13.993 -13.495 59.116 1.00 93.67 O ++ATOM 2575 OE2 GLU g 49 13.536 -13.418 61.262 1.00 93.67 O ++ATOM 2576 N ALA g 50 15.558 -8.481 56.938 1.00 87.94 N ++ATOM 2577 CA ALA g 50 16.022 -7.854 55.704 1.00 87.94 C ++ATOM 2578 C ALA g 50 17.533 -7.648 55.745 1.00 87.94 C ++ATOM 2579 O ALA g 50 18.031 -6.599 56.153 1.00 87.94 O ++ATOM 2580 CB ALA g 50 15.291 -6.537 55.477 1.00 87.94 C ++ATOM 2581 N LYS g 51 18.273 -8.668 55.312 1.00 83.29 N ++ATOM 2582 CA LYS g 51 19.667 -8.493 54.919 1.00 83.29 C ++ATOM 2583 C LYS g 51 19.839 -8.740 53.428 1.00 83.29 C ++ATOM 2584 O LYS g 51 20.268 -7.841 52.697 1.00 83.29 O ++ATOM 2585 CB LYS g 51 20.584 -9.435 55.712 1.00 83.29 C ++ATOM 2586 CG LYS g 51 20.636 -9.197 57.206 1.00 83.29 C ++ATOM 2587 CD LYS g 51 21.384 -7.921 57.560 1.00 83.29 C ++ATOM 2588 CE LYS g 51 21.501 -7.768 59.073 1.00 83.29 C ++ATOM 2589 NZ LYS g 51 22.187 -6.513 59.480 1.00 83.29 N ++ATOM 2590 N ASN g 52 19.484 -9.931 52.955 1.00 74.46 N ++ATOM 2591 CA ASN g 52 19.551 -10.309 51.546 1.00 74.46 C ++ATOM 2592 C ASN g 52 18.296 -11.132 51.286 1.00 74.46 C ++ATOM 2593 O ASN g 52 18.242 -12.316 51.626 1.00 74.46 O ++ATOM 2594 CB ASN g 52 20.811 -11.101 51.217 1.00 74.46 C ++ATOM 2595 CG ASN g 52 22.069 -10.277 51.340 1.00 74.46 C ++ATOM 2596 OD1 ASN g 52 22.907 -10.527 52.208 1.00 74.46 O ++ATOM 2597 ND2 ASN g 52 22.222 -9.297 50.460 1.00 74.46 N ++ATOM 2598 N ILE g 53 17.287 -10.504 50.706 1.00 60.34 N ++ATOM 2599 CA ILE g 53 16.086 -11.230 50.325 1.00 60.34 C ++ATOM 2600 C ILE g 53 16.343 -11.919 48.996 1.00 60.34 C ++ATOM 2601 O ILE g 53 16.816 -11.298 48.038 1.00 60.34 O ++ATOM 2602 CB ILE g 53 14.879 -10.288 50.249 1.00 60.34 C ++ATOM 2603 CG1 ILE g 53 14.667 -9.603 51.595 1.00 60.34 C ++ATOM 2604 CG2 ILE g 53 13.637 -11.051 49.870 1.00 60.34 C ++ATOM 2605 CD1 ILE g 53 14.402 -10.565 52.727 1.00 60.34 C ++ATOM 2606 N THR g 54 16.053 -13.209 48.932 1.00 56.66 N ++ATOM 2607 CA THR g 54 16.271 -13.988 47.726 1.00 56.66 C ++ATOM 2608 C THR g 54 14.908 -14.340 47.150 1.00 56.66 C ++ATOM 2609 O THR g 54 14.131 -15.064 47.781 1.00 56.66 O ++ATOM 2610 CB THR g 54 17.093 -15.239 48.029 1.00 56.66 C ++ATOM 2611 OG1 THR g 54 18.259 -14.862 48.766 1.00 56.66 O ++ATOM 2612 CG2 THR g 54 17.549 -15.871 46.741 1.00 56.66 C ++ATOM 2613 N TRP g 55 14.615 -13.809 45.970 1.00 49.54 N ++ATOM 2614 CA TRP g 55 13.298 -13.919 45.360 1.00 49.54 C ++ATOM 2615 C TRP g 55 13.272 -15.075 44.375 1.00 49.54 C ++ATOM 2616 O TRP g 55 14.115 -15.140 43.472 1.00 49.54 O ++ATOM 2617 CB TRP g 55 12.920 -12.622 44.652 1.00 49.54 C ++ATOM 2618 CG TRP g 55 12.516 -11.541 45.572 1.00 49.54 C ++ATOM 2619 CD1 TRP g 55 13.312 -10.581 46.098 1.00 49.54 C ++ATOM 2620 CD2 TRP g 55 11.202 -11.283 46.056 1.00 49.54 C ++ATOM 2621 NE1 TRP g 55 12.582 -9.747 46.899 1.00 49.54 N ++ATOM 2622 CE2 TRP g 55 11.279 -10.162 46.887 1.00 49.54 C ++ATOM 2623 CE3 TRP g 55 9.966 -11.904 45.876 1.00 49.54 C ++ATOM 2624 CZ2 TRP g 55 10.174 -9.644 47.535 1.00 49.54 C ++ATOM 2625 CZ3 TRP g 55 8.872 -11.389 46.517 1.00 49.54 C ++ATOM 2626 CH2 TRP g 55 8.980 -10.270 47.337 1.00 49.54 C ++ATOM 2627 N PHE g 56 12.281 -15.951 44.533 1.00 49.39 N ++ATOM 2628 CA PHE g 56 12.092 -17.147 43.726 1.00 49.39 C ++ATOM 2629 C PHE g 56 10.813 -16.989 42.919 1.00 49.39 C ++ATOM 2630 O PHE g 56 9.777 -16.611 43.471 1.00 49.39 O ++ATOM 2631 CB PHE g 56 11.973 -18.384 44.614 1.00 49.39 C ++ATOM 2632 CG PHE g 56 13.214 -18.721 45.378 1.00 49.39 C ++ATOM 2633 CD1 PHE g 56 14.458 -18.327 44.935 1.00 49.39 C ++ATOM 2634 CD2 PHE g 56 13.119 -19.408 46.573 1.00 49.39 C ++ATOM 2635 CE1 PHE g 56 15.587 -18.641 45.657 1.00 49.39 C ++ATOM 2636 CE2 PHE g 56 14.243 -19.708 47.303 1.00 49.39 C ++ATOM 2637 CZ PHE g 56 15.479 -19.329 46.844 1.00 49.39 C ++ATOM 2638 N LYS g 57 10.880 -17.275 41.627 1.00 37.37 N ++ATOM 2639 CA LYS g 57 9.694 -17.477 40.807 1.00 37.37 C ++ATOM 2640 C LYS g 57 9.623 -18.944 40.429 1.00 37.37 C ++ATOM 2641 O LYS g 57 10.648 -19.535 40.097 1.00 37.37 O ++ATOM 2642 CB LYS g 57 9.741 -16.618 39.547 1.00 37.37 C ++ATOM 2643 CG LYS g 57 8.569 -16.813 38.616 1.00 37.37 C ++ATOM 2644 CD LYS g 57 8.696 -15.902 37.424 1.00 37.37 C ++ATOM 2645 CE LYS g 57 7.560 -16.112 36.457 1.00 37.37 C ++ATOM 2646 NZ LYS g 57 7.684 -15.224 35.278 1.00 37.37 N ++ATOM 2647 N ASP g 58 8.437 -19.545 40.560 1.00 38.45 N ++ATOM 2648 CA ASP g 58 8.115 -20.863 40.006 1.00 38.45 C ++ATOM 2649 C ASP g 58 8.991 -22.023 40.475 1.00 38.45 C ++ATOM 2650 O ASP g 58 8.928 -23.111 39.897 1.00 38.45 O ++ATOM 2651 CB ASP g 58 8.166 -20.811 38.475 1.00 38.45 C ++ATOM 2652 CG ASP g 58 6.976 -20.104 37.874 1.00 38.45 C ++ATOM 2653 OD1 ASP g 58 5.862 -20.247 38.408 1.00 38.45 O ++ATOM 2654 OD2 ASP g 58 7.153 -19.387 36.872 1.00 38.45 O ++ATOM 2655 N GLY g 59 9.810 -21.820 41.502 1.00 45.89 N ++ATOM 2656 CA GLY g 59 10.787 -22.818 41.884 1.00 45.89 C ++ATOM 2657 C GLY g 59 12.223 -22.378 41.681 1.00 45.89 C ++ATOM 2658 O GLY g 59 13.076 -22.644 42.531 1.00 45.89 O ++ATOM 2659 N LYS g 60 12.504 -21.694 40.573 1.00 50.07 N ++ATOM 2660 CA LYS g 60 13.856 -21.252 40.257 1.00 50.07 C ++ATOM 2661 C LYS g 60 14.213 -20.003 41.061 1.00 50.07 C ++ATOM 2662 O LYS g 60 13.455 -19.542 41.910 1.00 50.07 O ++ATOM 2663 CB LYS g 60 14.001 -20.993 38.754 1.00 50.07 C ++ATOM 2664 CG LYS g 60 13.236 -19.788 38.248 1.00 50.07 C ++ATOM 2665 CD LYS g 60 13.255 -19.660 36.742 1.00 50.07 C ++ATOM 2666 CE LYS g 60 12.448 -18.452 36.301 1.00 50.07 C ++ATOM 2667 NZ LYS g 60 12.392 -18.321 34.825 1.00 50.07 N ++ATOM 2668 N MET g 61 15.400 -19.466 40.800 1.00 57.61 N ++ATOM 2669 CA MET g 61 15.859 -18.246 41.452 1.00 57.61 C ++ATOM 2670 C MET g 61 15.907 -17.110 40.444 1.00 57.61 C ++ATOM 2671 O MET g 61 16.393 -17.291 39.325 1.00 57.61 O ++ATOM 2672 CB MET g 61 17.243 -18.445 42.065 1.00 57.61 C ++ATOM 2673 CG MET g 61 17.757 -17.240 42.827 1.00 57.61 C ++ATOM 2674 SD MET g 61 19.428 -17.466 43.453 1.00 57.61 S ++ATOM 2675 CE MET g 61 19.145 -18.670 44.745 1.00 57.61 C ++ATOM 2676 N ILE g 62 15.396 -15.944 40.832 1.00 52.29 N ++ATOM 2677 CA ILE g 62 15.484 -14.765 39.974 1.00 52.29 C ++ATOM 2678 C ILE g 62 16.092 -13.557 40.661 1.00 52.29 C ++ATOM 2679 O ILE g 62 16.594 -12.658 39.965 1.00 52.29 O ++ATOM 2680 CB ILE g 62 14.100 -14.394 39.393 1.00 52.29 C ++ATOM 2681 CG1 ILE g 62 13.099 -14.128 40.516 1.00 52.29 C ++ATOM 2682 CG2 ILE g 62 13.601 -15.456 38.424 1.00 52.29 C ++ATOM 2683 CD1 ILE g 62 11.816 -13.506 40.047 1.00 52.29 C ++ATOM 2684 N GLY g 63 16.091 -13.445 41.988 1.00 58.24 N ++ATOM 2685 CA GLY g 63 16.527 -12.181 42.556 1.00 58.24 C ++ATOM 2686 C GLY g 63 17.346 -12.230 43.827 1.00 58.24 C ++ATOM 2687 O GLY g 63 17.093 -13.054 44.706 1.00 58.24 O ++ATOM 2688 N PHE g 64 18.292 -11.300 43.949 1.00 67.52 N ++ATOM 2689 CA PHE g 64 19.220 -11.222 45.072 1.00 67.52 C ++ATOM 2690 C PHE g 64 19.246 -9.770 45.531 1.00 67.52 C ++ATOM 2691 O PHE g 64 19.930 -8.941 44.922 1.00 67.52 O ++ATOM 2692 CB PHE g 64 20.608 -11.699 44.638 1.00 67.52 C ++ATOM 2693 CG PHE g 64 21.623 -11.754 45.742 1.00 67.52 C ++ATOM 2694 CD1 PHE g 64 21.608 -12.788 46.666 1.00 67.52 C ++ATOM 2695 CD2 PHE g 64 22.622 -10.798 45.829 1.00 67.52 C ++ATOM 2696 CE1 PHE g 64 22.555 -12.853 47.674 1.00 67.52 C ++ATOM 2697 CE2 PHE g 64 23.573 -10.856 46.835 1.00 67.52 C ++ATOM 2698 CZ PHE g 64 23.540 -11.886 47.757 1.00 67.52 C ++ATOM 2699 N LEU g 65 18.509 -9.453 46.597 1.00 64.09 N ++ATOM 2700 CA LEU g 65 18.164 -8.077 46.939 1.00 64.09 C ++ATOM 2701 C LEU g 65 18.816 -7.689 48.252 1.00 64.09 C ++ATOM 2702 O LEU g 65 18.675 -8.401 49.253 1.00 64.09 O ++ATOM 2703 CB LEU g 65 16.651 -7.886 47.055 1.00 64.09 C ++ATOM 2704 CG LEU g 65 15.837 -7.530 45.817 1.00 64.09 C ++ATOM 2705 CD1 LEU g 65 16.300 -6.206 45.276 1.00 64.09 C ++ATOM 2706 CD2 LEU g 65 15.940 -8.591 44.764 1.00 64.09 C ++ATOM 2707 N THR g 66 19.511 -6.561 48.248 1.00 73.65 N ++ATOM 2708 CA THR g 66 20.033 -5.949 49.456 1.00 73.65 C ++ATOM 2709 C THR g 66 19.517 -4.523 49.573 1.00 73.65 C ++ATOM 2710 O THR g 66 18.897 -3.986 48.653 1.00 73.65 O ++ATOM 2711 CB THR g 66 21.563 -5.944 49.463 1.00 73.65 C ++ATOM 2712 OG1 THR g 66 22.030 -5.456 50.725 1.00 73.65 O ++ATOM 2713 CG2 THR g 66 22.091 -5.052 48.358 1.00 73.65 C ++ATOM 2714 N GLU g 67 19.765 -3.926 50.734 1.00 77.55 N ++ATOM 2715 CA GLU g 67 19.549 -2.498 50.914 1.00 77.55 C ++ATOM 2716 C GLU g 67 20.484 -1.721 49.989 1.00 77.55 C ++ATOM 2717 O GLU g 67 21.649 -2.089 49.825 1.00 77.55 O ++ATOM 2718 CB GLU g 67 19.764 -2.132 52.387 1.00 77.55 C ++ATOM 2719 CG GLU g 67 18.586 -2.510 53.282 1.00 77.55 C ++ATOM 2720 CD GLU g 67 18.548 -3.980 53.662 1.00 77.55 C ++ATOM 2721 OE1 GLU g 67 19.484 -4.729 53.311 1.00 77.55 O ++ATOM 2722 OE2 GLU g 67 17.562 -4.389 54.305 1.00 77.55 O ++ATOM 2723 N ASP g 68 19.986 -0.644 49.369 1.00 74.00 N ++ATOM 2724 CA ASP g 68 18.753 0.078 49.714 1.00 74.00 C ++ATOM 2725 C ASP g 68 17.427 -0.414 49.123 1.00 74.00 C ++ATOM 2726 O ASP g 68 16.371 0.111 49.472 1.00 74.00 O ++ATOM 2727 CB ASP g 68 18.932 1.547 49.324 1.00 74.00 C ++ATOM 2728 CG ASP g 68 19.299 1.724 47.857 1.00 74.00 C ++ATOM 2729 OD1 ASP g 68 19.512 0.711 47.158 1.00 74.00 O ++ATOM 2730 OD2 ASP g 68 19.375 2.883 47.401 1.00 74.00 O ++ATOM 2731 N LYS g 69 17.494 -1.405 48.242 1.00 58.76 N ++ATOM 2732 CA LYS g 69 16.293 -1.940 47.616 1.00 58.76 C ++ATOM 2733 C LYS g 69 15.420 -2.702 48.603 1.00 58.76 C ++ATOM 2734 O LYS g 69 15.911 -3.375 49.507 1.00 58.76 O ++ATOM 2735 CB LYS g 69 16.654 -2.835 46.431 1.00 58.76 C ++ATOM 2736 CG LYS g 69 17.518 -2.153 45.386 1.00 58.76 C ++ATOM 2737 CD LYS g 69 16.804 -2.079 44.049 1.00 58.76 C ++ATOM 2738 CE LYS g 69 17.794 -2.038 42.897 1.00 58.76 C ++ATOM 2739 NZ LYS g 69 18.075 -0.646 42.453 1.00 58.76 N ++ATOM 2740 N LYS g 70 14.114 -2.573 48.418 1.00 57.34 N ++ATOM 2741 CA LYS g 70 13.122 -3.241 49.247 1.00 57.34 C ++ATOM 2742 C LYS g 70 12.111 -4.021 48.424 1.00 57.34 C ++ATOM 2743 O LYS g 70 11.667 -5.088 48.852 1.00 57.34 O ++ATOM 2744 CB LYS g 70 12.410 -2.183 50.112 1.00 57.34 C ++ATOM 2745 CG LYS g 70 11.338 -2.705 51.053 1.00 57.34 C ++ATOM 2746 CD LYS g 70 11.931 -3.463 52.217 1.00 57.34 C ++ATOM 2747 CE LYS g 70 10.852 -3.862 53.205 1.00 57.34 C ++ATOM 2748 NZ LYS g 70 11.411 -4.665 54.326 1.00 57.34 N ++ATOM 2749 N LYS g 71 11.766 -3.534 47.236 1.00 44.26 N ++ATOM 2750 CA LYS g 71 10.662 -4.055 46.447 1.00 44.26 C ++ATOM 2751 C LYS g 71 11.210 -4.670 45.167 1.00 44.26 C ++ATOM 2752 O LYS g 71 11.945 -4.010 44.429 1.00 44.26 O ++ATOM 2753 CB LYS g 71 9.672 -2.933 46.121 1.00 44.26 C ++ATOM 2754 CG LYS g 71 9.113 -2.208 47.343 1.00 44.26 C ++ATOM 2755 CD LYS g 71 8.120 -1.119 46.948 1.00 44.26 C ++ATOM 2756 CE LYS g 71 7.483 -0.439 48.156 1.00 44.26 C ++ATOM 2757 NZ LYS g 71 8.431 0.408 48.924 1.00 44.26 N ++ATOM 2758 N TRP g 72 10.861 -5.926 44.906 1.00 41.18 N ++ATOM 2759 CA TRP g 72 11.214 -6.558 43.642 1.00 41.18 C ++ATOM 2760 C TRP g 72 10.190 -6.210 42.576 1.00 41.18 C ++ATOM 2761 O TRP g 72 8.986 -6.215 42.831 1.00 41.18 O ++ATOM 2762 CB TRP g 72 11.309 -8.074 43.807 1.00 41.18 C ++ATOM 2763 CG TRP g 72 11.535 -8.844 42.534 1.00 41.18 C ++ATOM 2764 CD1 TRP g 72 10.629 -9.625 41.893 1.00 41.18 C ++ATOM 2765 CD2 TRP g 72 12.737 -8.913 41.763 1.00 41.18 C ++ATOM 2766 NE1 TRP g 72 11.187 -10.179 40.774 1.00 41.18 N ++ATOM 2767 CE2 TRP g 72 12.482 -9.751 40.668 1.00 41.18 C ++ATOM 2768 CE3 TRP g 72 13.995 -8.332 41.881 1.00 41.18 C ++ATOM 2769 CZ2 TRP g 72 13.442 -10.031 39.706 1.00 41.18 C ++ATOM 2770 CZ3 TRP g 72 14.951 -8.618 40.934 1.00 41.18 C ++ATOM 2771 CH2 TRP g 72 14.668 -9.455 39.857 1.00 41.18 C ++ATOM 2772 N ASN g 73 10.674 -5.909 41.380 1.00 29.84 N ++ATOM 2773 CA ASN g 73 9.821 -5.443 40.300 1.00 29.84 C ++ATOM 2774 C ASN g 73 9.391 -6.615 39.426 1.00 29.84 C ++ATOM 2775 O ASN g 73 10.016 -7.674 39.409 1.00 29.84 O ++ATOM 2776 CB ASN g 73 10.556 -4.388 39.472 1.00 29.84 C ++ATOM 2777 CG ASN g 73 9.643 -3.611 38.538 1.00 29.84 C ++ATOM 2778 OD1 ASN g 73 8.453 -3.888 38.430 1.00 29.84 O ++ATOM 2779 ND2 ASN g 73 10.205 -2.620 37.865 1.00 29.84 N ++ATOM 2780 N LEU g 74 8.282 -6.413 38.713 1.00 26.36 N ++ATOM 2781 CA LEU g 74 7.814 -7.356 37.710 1.00 26.36 C ++ATOM 2782 C LEU g 74 7.565 -6.686 36.368 1.00 26.36 C ++ATOM 2783 O LEU g 74 6.968 -7.305 35.482 1.00 26.36 O ++ATOM 2784 CB LEU g 74 6.531 -8.049 38.162 1.00 26.36 C ++ATOM 2785 CG LEU g 74 6.652 -8.922 39.393 1.00 26.36 C ++ATOM 2786 CD1 LEU g 74 5.310 -9.514 39.739 1.00 26.36 C ++ATOM 2787 CD2 LEU g 74 7.667 -9.987 39.130 1.00 26.36 C ++ATOM 2788 N GLY g 75 7.999 -5.450 36.192 1.00 27.69 N ++ATOM 2789 CA GLY g 75 7.722 -4.760 34.955 1.00 27.69 C ++ATOM 2790 C GLY g 75 6.310 -4.212 34.955 1.00 27.69 C ++ATOM 2791 O GLY g 75 5.626 -4.187 35.978 1.00 27.69 O ++ATOM 2792 N SER g 76 5.868 -3.769 33.785 1.00 28.64 N ++ATOM 2793 CA SER g 76 4.548 -3.178 33.714 1.00 28.64 C ++ATOM 2794 C SER g 76 3.484 -4.268 33.711 1.00 28.64 C ++ATOM 2795 O SER g 76 3.772 -5.457 33.583 1.00 28.64 O ++ATOM 2796 CB SER g 76 4.418 -2.291 32.483 1.00 28.64 C ++ATOM 2797 OG SER g 76 4.488 -3.058 31.303 1.00 28.64 O ++ATOM 2798 N ASN g 77 2.239 -3.846 33.890 1.00 27.74 N ++ATOM 2799 CA ASN g 77 1.108 -4.756 33.888 1.00 27.74 C ++ATOM 2800 C ASN g 77 0.442 -4.861 32.528 1.00 27.74 C ++ATOM 2801 O ASN g 77 -0.627 -5.463 32.417 1.00 27.74 O ++ATOM 2802 CB ASN g 77 0.094 -4.333 34.951 1.00 27.74 C ++ATOM 2803 CG ASN g 77 -0.309 -2.882 34.832 1.00 27.74 C ++ATOM 2804 OD1 ASN g 77 0.073 -2.188 33.898 1.00 27.74 O ++ATOM 2805 ND2 ASN g 77 -1.073 -2.408 35.799 1.00 27.74 N ++ATOM 2806 N ALA g 78 1.040 -4.272 31.496 1.00 30.03 N ++ATOM 2807 CA ALA g 78 0.581 -4.518 30.141 1.00 30.03 C ++ATOM 2808 C ALA g 78 1.112 -5.836 29.608 1.00 30.03 C ++ATOM 2809 O ALA g 78 0.480 -6.442 28.740 1.00 30.03 O ++ATOM 2810 CB ALA g 78 1.004 -3.371 29.233 1.00 30.03 C ++ATOM 2811 N LYS g 79 2.253 -6.290 30.117 1.00 28.22 N ++ATOM 2812 CA LYS g 79 2.836 -7.573 29.757 1.00 28.22 C ++ATOM 2813 C LYS g 79 2.186 -8.742 30.487 1.00 28.22 C ++ATOM 2814 O LYS g 79 2.561 -9.890 30.226 1.00 28.22 O ++ATOM 2815 CB LYS g 79 4.340 -7.581 30.052 1.00 28.22 C ++ATOM 2816 CG LYS g 79 5.237 -6.930 29.007 1.00 28.22 C ++ATOM 2817 CD LYS g 79 5.283 -5.421 29.127 1.00 28.22 C ++ATOM 2818 CE LYS g 79 6.285 -4.819 28.167 1.00 28.22 C ++ATOM 2819 NZ LYS g 79 6.251 -3.330 28.193 1.00 28.22 N ++ATOM 2820 N ASP g 80 1.234 -8.468 31.390 1.00 24.00 N ++ATOM 2821 CA ASP g 80 0.483 -9.405 32.223 1.00 24.00 C ++ATOM 2822 C ASP g 80 1.376 -10.339 33.030 1.00 24.00 C ++ATOM 2823 O ASP g 80 1.471 -11.526 32.696 1.00 24.00 O ++ATOM 2824 CB ASP g 80 -0.469 -10.228 31.360 1.00 24.00 C ++ATOM 2825 CG ASP g 80 -1.490 -9.376 30.663 1.00 24.00 C ++ATOM 2826 OD1 ASP g 80 -1.784 -8.280 31.172 1.00 24.00 O ++ATOM 2827 OD2 ASP g 80 -2.008 -9.799 29.613 1.00 24.00 O ++ATOM 2828 N PRO g 81 2.047 -9.859 34.079 1.00 22.75 N ++ATOM 2829 CA PRO g 81 2.920 -10.744 34.860 1.00 22.75 C ++ATOM 2830 C PRO g 81 2.110 -11.752 35.655 1.00 22.75 C ++ATOM 2831 O PRO g 81 1.205 -11.387 36.401 1.00 22.75 O ++ATOM 2832 CB PRO g 81 3.673 -9.775 35.775 1.00 22.75 C ++ATOM 2833 CG PRO g 81 2.791 -8.609 35.879 1.00 22.75 C ++ATOM 2834 CD PRO g 81 2.090 -8.478 34.579 1.00 22.75 C ++ATOM 2835 N ARG g 82 2.417 -13.031 35.472 1.00 25.39 N ++ATOM 2836 CA ARG g 82 1.635 -14.091 36.082 1.00 25.39 C ++ATOM 2837 C ARG g 82 2.554 -15.016 36.859 1.00 25.39 C ++ATOM 2838 O ARG g 82 3.759 -14.793 36.954 1.00 25.39 O ++ATOM 2839 CB ARG g 82 0.855 -14.873 35.023 1.00 25.39 C ++ATOM 2840 CG ARG g 82 -0.129 -14.015 34.277 1.00 25.39 C ++ATOM 2841 CD ARG g 82 -1.023 -14.810 33.383 1.00 25.39 C ++ATOM 2842 NE ARG g 82 -1.947 -13.934 32.685 1.00 25.39 N ++ATOM 2843 CZ ARG g 82 -2.932 -14.366 31.912 1.00 25.39 C ++ATOM 2844 NH1 ARG g 82 -3.128 -15.663 31.761 1.00 25.39 N ++ATOM 2845 NH2 ARG g 82 -3.733 -13.503 31.308 1.00 25.39 N ++ATOM 2846 N GLY g 83 1.974 -16.057 37.430 1.00 22.69 N ++ATOM 2847 CA GLY g 83 2.755 -17.164 37.939 1.00 22.69 C ++ATOM 2848 C GLY g 83 3.062 -17.086 39.420 1.00 22.69 C ++ATOM 2849 O GLY g 83 2.661 -16.172 40.144 1.00 22.69 O ++ATOM 2850 N MET g 84 3.810 -18.092 39.857 1.00 31.67 N ++ATOM 2851 CA MET g 84 4.131 -18.317 41.258 1.00 31.67 C ++ATOM 2852 C MET g 84 5.244 -17.385 41.707 1.00 31.67 C ++ATOM 2853 O MET g 84 6.194 -17.142 40.963 1.00 31.67 O ++ATOM 2854 CB MET g 84 4.602 -19.754 41.432 1.00 31.67 C ++ATOM 2855 CG MET g 84 3.681 -20.785 40.835 1.00 31.67 C ++ATOM 2856 SD MET g 84 2.230 -21.127 41.797 1.00 31.67 S ++ATOM 2857 CE MET g 84 3.013 -22.109 43.065 1.00 31.67 C ++ATOM 2858 N TYR g 85 5.153 -16.888 42.934 1.00 30.60 N ++ATOM 2859 CA TYR g 85 6.221 -16.056 43.471 1.00 30.60 C ++ATOM 2860 C TYR g 85 6.394 -16.343 44.951 1.00 30.60 C ++ATOM 2861 O TYR g 85 5.409 -16.570 45.654 1.00 30.60 O ++ATOM 2862 CB TYR g 85 5.922 -14.573 43.264 1.00 30.60 C ++ATOM 2863 CG TYR g 85 6.038 -14.143 41.835 1.00 30.60 C ++ATOM 2864 CD1 TYR g 85 7.265 -13.806 41.305 1.00 30.60 C ++ATOM 2865 CD2 TYR g 85 4.930 -14.097 41.010 1.00 30.60 C ++ATOM 2866 CE1 TYR g 85 7.389 -13.424 40.004 1.00 30.60 C ++ATOM 2867 CE2 TYR g 85 5.043 -13.718 39.700 1.00 30.60 C ++ATOM 2868 CZ TYR g 85 6.277 -13.379 39.204 1.00 30.60 C ++ATOM 2869 OH TYR g 85 6.412 -12.993 37.896 1.00 30.60 O ++ATOM 2870 N GLN g 86 7.641 -16.329 45.421 1.00 40.97 N ++ATOM 2871 CA GLN g 86 7.917 -16.489 46.841 1.00 40.97 C ++ATOM 2872 C GLN g 86 9.264 -15.868 47.171 1.00 40.97 C ++ATOM 2873 O GLN g 86 10.041 -15.516 46.283 1.00 40.97 O ++ATOM 2874 CB GLN g 86 7.864 -17.960 47.269 1.00 40.97 C ++ATOM 2875 CG GLN g 86 8.834 -18.880 46.578 1.00 40.97 C ++ATOM 2876 CD GLN g 86 8.658 -20.317 47.019 1.00 40.97 C ++ATOM 2877 OE1 GLN g 86 7.862 -20.611 47.904 1.00 40.97 O ++ATOM 2878 NE2 GLN g 86 9.392 -21.221 46.396 1.00 40.97 N ++ATOM 2879 N CYS g 87 9.528 -15.719 48.468 1.00 53.61 N ++ATOM 2880 CA CYS g 87 10.711 -15.025 48.951 1.00 53.61 C ++ATOM 2881 C CYS g 87 11.393 -15.832 50.044 1.00 53.61 C ++ATOM 2882 O CYS g 87 10.772 -16.675 50.694 1.00 53.61 O ++ATOM 2883 CB CYS g 87 10.362 -13.638 49.496 1.00 53.61 C ++ATOM 2884 SG CYS g 87 9.299 -13.673 50.951 1.00 53.61 S ++ATOM 2885 N LYS g 88 12.679 -15.554 50.245 1.00 64.51 N ++ATOM 2886 CA LYS g 88 13.450 -16.172 51.315 1.00 64.51 C ++ATOM 2887 C LYS g 88 14.281 -15.105 52.003 1.00 64.51 C ++ATOM 2888 O LYS g 88 14.910 -14.283 51.335 1.00 64.51 O ++ATOM 2889 CB LYS g 88 14.362 -17.278 50.777 1.00 64.51 C ++ATOM 2890 CG LYS g 88 15.151 -18.009 51.854 1.00 64.51 C ++ATOM 2891 CD LYS g 88 15.984 -19.138 51.274 1.00 64.51 C ++ATOM 2892 CE LYS g 88 16.745 -19.873 52.363 1.00 64.51 C ++ATOM 2893 NZ LYS g 88 17.546 -20.996 51.808 1.00 64.51 N ++ATOM 2894 N GLY g 89 14.279 -15.113 53.331 1.00 75.39 N ++ATOM 2895 CA GLY g 89 15.137 -14.221 54.085 1.00 75.39 C ++ATOM 2896 C GLY g 89 16.283 -14.964 54.738 1.00 75.39 C ++ATOM 2897 O GLY g 89 17.196 -15.437 54.056 1.00 75.39 O ++ATOM 2898 N SER g 90 16.252 -15.057 56.068 1.00 80.41 N ++ATOM 2899 CA SER g 90 17.156 -15.938 56.793 1.00 80.41 C ++ATOM 2900 C SER g 90 16.474 -17.227 57.230 1.00 80.41 C ++ATOM 2901 O SER g 90 17.161 -18.201 57.553 1.00 80.41 O ++ATOM 2902 CB SER g 90 17.728 -15.214 58.012 1.00 80.41 C ++ATOM 2903 OG SER g 90 16.709 -14.925 58.952 1.00 80.41 O ++ATOM 2904 N GLN g 91 15.144 -17.245 57.245 1.00 85.29 N ++ATOM 2905 CA GLN g 91 14.346 -18.408 57.595 1.00 85.29 C ++ATOM 2906 C GLN g 91 14.073 -19.237 56.340 1.00 85.29 C ++ATOM 2907 O GLN g 91 14.731 -19.077 55.309 1.00 85.29 O ++ATOM 2908 CB GLN g 91 13.053 -17.973 58.275 1.00 85.29 C ++ATOM 2909 CG GLN g 91 13.273 -17.233 59.580 1.00 85.29 C ++ATOM 2910 CD GLN g 91 13.974 -18.077 60.624 1.00 85.29 C ++ATOM 2911 OE1 GLN g 91 15.144 -17.853 60.932 1.00 85.29 O ++ATOM 2912 NE2 GLN g 91 13.259 -19.048 61.182 1.00 85.29 N ++ATOM 2913 N ASN g 92 13.107 -20.149 56.423 1.00 79.31 N ++ATOM 2914 CA ASN g 92 12.715 -20.975 55.287 1.00 79.31 C ++ATOM 2915 C ASN g 92 12.009 -20.135 54.221 1.00 79.31 C ++ATOM 2916 O ASN g 92 11.801 -18.927 54.369 1.00 79.31 O ++ATOM 2917 CB ASN g 92 11.825 -22.125 55.747 1.00 79.31 C ++ATOM 2918 CG ASN g 92 12.549 -23.107 56.646 1.00 79.31 C ++ATOM 2919 OD1 ASN g 92 12.227 -23.237 57.827 1.00 79.31 O ++ATOM 2920 ND2 ASN g 92 13.524 -23.814 56.085 1.00 79.31 N ++ATOM 2921 N LYS g 93 11.621 -20.783 53.128 1.00 60.97 N ++ATOM 2922 CA LYS g 93 10.919 -20.106 52.052 1.00 60.97 C ++ATOM 2923 C LYS g 93 9.508 -19.738 52.500 1.00 60.97 C ++ATOM 2924 O LYS g 93 8.954 -20.331 53.430 1.00 60.97 O ++ATOM 2925 CB LYS g 93 10.856 -21.012 50.823 1.00 60.97 C ++ATOM 2926 CG LYS g 93 12.212 -21.443 50.289 1.00 60.97 C ++ATOM 2927 CD LYS g 93 12.058 -22.476 49.179 1.00 60.97 C ++ATOM 2928 CE LYS g 93 13.401 -22.912 48.611 1.00 60.97 C ++ATOM 2929 NZ LYS g 93 14.219 -23.665 49.599 1.00 60.97 N ++ATOM 2930 N SER g 94 8.924 -18.750 51.836 1.00 49.52 N ++ATOM 2931 CA SER g 94 7.570 -18.334 52.158 1.00 49.52 C ++ATOM 2932 C SER g 94 6.561 -19.225 51.440 1.00 49.52 C ++ATOM 2933 O SER g 94 6.916 -20.084 50.633 1.00 49.52 O ++ATOM 2934 CB SER g 94 7.366 -16.871 51.784 1.00 49.52 C ++ATOM 2935 OG SER g 94 7.420 -16.713 50.381 1.00 49.52 O ++ATOM 2936 N LYS g 95 5.298 -19.031 51.741 1.00 43.01 N ++ATOM 2937 CA LYS g 95 4.292 -19.685 50.930 1.00 43.01 C ++ATOM 2938 C LYS g 95 4.176 -18.961 49.591 1.00 43.01 C ++ATOM 2939 O LYS g 95 4.520 -17.781 49.493 1.00 43.01 O ++ATOM 2940 CB LYS g 95 2.950 -19.694 51.656 1.00 43.01 C ++ATOM 2941 CG LYS g 95 2.880 -20.695 52.787 1.00 43.01 C ++ATOM 2942 CD LYS g 95 1.504 -20.712 53.410 1.00 43.01 C ++ATOM 2943 CE LYS g 95 1.408 -21.778 54.479 1.00 43.01 C ++ATOM 2944 NZ LYS g 95 0.048 -21.821 55.071 1.00 43.01 N ++ATOM 2945 N PRO g 96 3.736 -19.647 48.534 1.00 29.05 N ++ATOM 2946 CA PRO g 96 3.693 -19.008 47.219 1.00 29.05 C ++ATOM 2947 C PRO g 96 2.600 -17.961 47.112 1.00 29.05 C ++ATOM 2948 O PRO g 96 1.777 -17.769 48.006 1.00 29.05 O ++ATOM 2949 CB PRO g 96 3.415 -20.174 46.268 1.00 29.05 C ++ATOM 2950 CG PRO g 96 3.847 -21.358 46.986 1.00 29.05 C ++ATOM 2951 CD PRO g 96 3.520 -21.097 48.411 1.00 29.05 C ++ATOM 2952 N LEU g 97 2.626 -17.268 45.985 1.00 25.50 N ++ATOM 2953 CA LEU g 97 1.627 -16.276 45.633 1.00 25.50 C ++ATOM 2954 C LEU g 97 1.452 -16.327 44.130 1.00 25.50 C ++ATOM 2955 O LEU g 97 2.402 -16.071 43.392 1.00 25.50 O ++ATOM 2956 CB LEU g 97 2.062 -14.883 46.068 1.00 25.50 C ++ATOM 2957 CG LEU g 97 1.150 -13.721 45.690 1.00 25.50 C ++ATOM 2958 CD1 LEU g 97 -0.175 -13.759 46.406 1.00 25.50 C ++ATOM 2959 CD2 LEU g 97 1.849 -12.439 45.978 1.00 25.50 C ++ATOM 2960 N GLN g 98 0.262 -16.686 43.677 1.00 25.69 N ++ATOM 2961 CA GLN g 98 -0.015 -16.740 42.249 1.00 25.69 C ++ATOM 2962 C GLN g 98 -0.453 -15.357 41.804 1.00 25.69 C ++ATOM 2963 O GLN g 98 -1.626 -15.009 41.899 1.00 25.69 O ++ATOM 2964 CB GLN g 98 -1.082 -17.776 41.932 1.00 25.69 C ++ATOM 2965 CG GLN g 98 -1.334 -17.892 40.450 1.00 25.69 C ++ATOM 2966 CD GLN g 98 -2.346 -18.943 40.091 1.00 25.69 C ++ATOM 2967 OE1 GLN g 98 -2.905 -19.613 40.951 1.00 25.69 O ++ATOM 2968 NE2 GLN g 98 -2.591 -19.091 38.800 1.00 25.69 N ++ATOM 2969 N VAL g 99 0.485 -14.562 41.325 1.00 26.12 N ++ATOM 2970 CA VAL g 99 0.149 -13.248 40.802 1.00 26.12 C ++ATOM 2971 C VAL g 99 -0.482 -13.428 39.431 1.00 26.12 C ++ATOM 2972 O VAL g 99 0.071 -14.118 38.570 1.00 26.12 O ++ATOM 2973 CB VAL g 99 1.398 -12.363 40.740 1.00 26.12 C ++ATOM 2974 CG1 VAL g 99 1.088 -11.073 40.094 1.00 26.12 C ++ATOM 2975 CG2 VAL g 99 1.931 -12.129 42.129 1.00 26.12 C ++ATOM 2976 N TYR g 100 -1.652 -12.836 39.227 1.00 40.24 N ++ATOM 2977 CA TYR g 100 -2.387 -13.011 37.985 1.00 40.24 C ++ATOM 2978 C TYR g 100 -2.891 -11.663 37.503 1.00 40.24 C ++ATOM 2979 O TYR g 100 -3.162 -10.771 38.301 1.00 40.24 O ++ATOM 2980 CB TYR g 100 -3.558 -13.964 38.164 1.00 40.24 C ++ATOM 2981 CG TYR g 100 -4.186 -14.407 36.871 1.00 40.24 C ++ATOM 2982 CD1 TYR g 100 -3.615 -15.420 36.117 1.00 40.24 C ++ATOM 2983 CD2 TYR g 100 -5.334 -13.809 36.395 1.00 40.24 C ++ATOM 2984 CE1 TYR g 100 -4.179 -15.828 34.926 1.00 40.24 C ++ATOM 2985 CE2 TYR g 100 -5.908 -14.207 35.206 1.00 40.24 C ++ATOM 2986 CZ TYR g 100 -5.325 -15.217 34.478 1.00 40.24 C ++ATOM 2987 OH TYR g 100 -5.888 -15.615 33.293 1.00 40.24 O ++ATOM 2988 N TYR g 101 -2.996 -11.510 36.192 1.00 32.80 N ++ATOM 2989 CA TYR g 101 -3.485 -10.277 35.598 1.00 32.80 C ++ATOM 2990 C TYR g 101 -4.141 -10.588 34.271 1.00 32.80 C ++ATOM 2991 O TYR g 101 -3.577 -11.309 33.448 1.00 32.80 O ++ATOM 2992 CB TYR g 101 -2.369 -9.268 35.344 1.00 32.80 C ++ATOM 2993 CG TYR g 101 -1.858 -8.549 36.550 1.00 32.80 C ++ATOM 2994 CD1 TYR g 101 -2.483 -7.418 37.018 1.00 32.80 C ++ATOM 2995 CD2 TYR g 101 -0.736 -8.989 37.207 1.00 32.80 C ++ATOM 2996 CE1 TYR g 101 -2.004 -6.757 38.115 1.00 32.80 C ++ATOM 2997 CE2 TYR g 101 -0.256 -8.333 38.300 1.00 32.80 C ++ATOM 2998 CZ TYR g 101 -0.891 -7.225 38.748 1.00 32.80 C ++ATOM 2999 OH TYR g 101 -0.408 -6.588 39.850 1.00 32.80 O ++ATOM 3000 N ARG g 102 -5.322 -10.032 34.055 1.00 30.16 N ++ATOM 3001 CA ARG g 102 -5.829 -9.878 32.703 1.00 30.16 C ++ATOM 3002 C ARG g 102 -6.057 -8.384 32.588 1.00 30.16 C ++ATOM 3003 O ARG g 102 -7.165 -7.878 32.742 1.00 30.16 O ++ATOM 3004 CB ARG g 102 -7.086 -10.695 32.446 1.00 30.16 C ++ATOM 3005 CG ARG g 102 -7.506 -10.787 30.983 1.00 30.16 C ++ATOM 3006 CD ARG g 102 -8.611 -9.823 30.649 1.00 30.16 C ++ATOM 3007 NE ARG g 102 -8.996 -9.861 29.250 1.00 30.16 N ++ATOM 3008 CZ ARG g 102 -9.932 -10.658 28.762 1.00 30.16 C ++ATOM 3009 NH1 ARG g 102 -10.227 -10.631 27.473 1.00 30.16 N ++ATOM 3010 NH2 ARG g 102 -10.578 -11.476 29.566 1.00 30.16 N ++ATOM 3011 N MET g 103 -4.983 -7.669 32.323 1.00 33.42 N ++ATOM 3012 CA MET g 103 -5.017 -6.224 32.164 1.00 33.42 C ++ATOM 3013 C MET g 103 -4.863 -6.004 30.674 1.00 33.42 C ++ATOM 3014 O MET g 103 -3.748 -6.027 30.152 1.00 33.42 O ++ATOM 3015 CB MET g 103 -3.919 -5.562 32.974 1.00 33.42 C ++ATOM 3016 CG MET g 103 -3.869 -4.083 32.817 1.00 33.42 C ++ATOM 3017 SD MET g 103 -5.441 -3.371 33.264 1.00 33.42 S ++ATOM 3018 CE MET g 103 -5.451 -3.784 34.989 1.00 33.42 C ++ATOM 3019 N CYS g 104 -6.003 -5.794 29.999 1.00 45.29 N ++ATOM 3020 CA CYS g 104 -6.184 -6.060 28.575 1.00 45.29 C ++ATOM 3021 C CYS g 104 -5.138 -5.496 27.633 1.00 45.29 C ++ATOM 3022 O CYS g 104 -4.391 -6.268 27.024 1.00 45.29 O ++ATOM 3023 CB CYS g 104 -7.530 -5.510 28.088 1.00 45.29 C ++ATOM 3024 SG CYS g 104 -8.990 -6.512 28.350 1.00 45.29 S ++ATOM 3025 N GLN g 105 -5.123 -4.166 27.460 1.00 46.83 N ++ATOM 3026 CA GLN g 105 -4.299 -3.359 26.543 1.00 46.83 C ++ATOM 3027 C GLN g 105 -4.273 -3.881 25.100 1.00 46.83 C ++ATOM 3028 O GLN g 105 -3.441 -3.459 24.293 1.00 46.83 O ++ATOM 3029 CB GLN g 105 -2.876 -3.149 27.102 1.00 46.83 C ++ATOM 3030 CG GLN g 105 -1.891 -4.309 27.153 1.00 46.83 C ++ATOM 3031 CD GLN g 105 -0.977 -4.376 25.946 1.00 46.83 C ++ATOM 3032 OE1 GLN g 105 -0.699 -3.360 25.312 1.00 46.83 O ++ATOM 3033 NE2 GLN g 105 -0.480 -5.569 25.642 1.00 46.83 N ++ATOM 3034 N ASN g 106 -5.201 -4.781 24.772 1.00 49.12 N ++ATOM 3035 CA ASN g 106 -5.459 -5.344 23.457 1.00 49.12 C ++ATOM 3036 C ASN g 106 -6.937 -5.549 23.196 1.00 49.12 C ++ATOM 3037 O ASN g 106 -7.309 -5.759 22.039 1.00 49.12 O ++ATOM 3038 CB ASN g 106 -4.751 -6.690 23.286 1.00 49.12 C ++ATOM 3039 CG ASN g 106 -3.265 -6.551 23.132 1.00 49.12 C ++ATOM 3040 OD1 ASN g 106 -2.783 -5.631 22.479 1.00 49.12 O ++ATOM 3041 ND2 ASN g 106 -2.524 -7.486 23.704 1.00 49.12 N ++ATOM 3042 N CYS g 107 -7.783 -5.516 24.225 1.00 60.88 N ++ATOM 3043 CA CYS g 107 -9.205 -5.783 24.070 1.00 60.88 C ++ATOM 3044 C CYS g 107 -9.847 -4.702 23.212 1.00 60.88 C ++ATOM 3045 O CYS g 107 -9.505 -3.523 23.322 1.00 60.88 O ++ATOM 3046 CB CYS g 107 -9.875 -5.851 25.449 1.00 60.88 C ++ATOM 3047 SG CYS g 107 -9.388 -7.268 26.499 1.00 60.88 S ++ATOM 3048 N ILE g 108 -10.745 -5.114 22.322 1.00 66.49 N ++ATOM 3049 CA ILE g 108 -11.364 -4.217 21.356 1.00 66.49 C ++ATOM 3050 C ILE g 108 -12.870 -4.366 21.462 1.00 66.49 C ++ATOM 3051 O ILE g 108 -13.403 -5.459 21.246 1.00 66.49 O ++ATOM 3052 CB ILE g 108 -10.895 -4.504 19.923 1.00 66.49 C ++ATOM 3053 CG1 ILE g 108 -9.421 -4.161 19.784 1.00 66.49 C ++ATOM 3054 CG2 ILE g 108 -11.708 -3.715 18.925 1.00 66.49 C ++ATOM 3055 CD1 ILE g 108 -8.847 -4.576 18.492 1.00 66.49 C ++ATOM 3056 N GLU g 109 -13.554 -3.274 21.784 1.00 74.95 N ++ATOM 3057 CA GLU g 109 -15.004 -3.307 21.864 1.00 74.95 C ++ATOM 3058 C GLU g 109 -15.615 -3.298 20.469 1.00 74.95 C ++ATOM 3059 O GLU g 109 -15.143 -2.603 19.565 1.00 74.95 O ++ATOM 3060 CB GLU g 109 -15.520 -2.144 22.717 1.00 74.95 C ++ATOM 3061 CG GLU g 109 -15.198 -0.750 22.212 1.00 74.95 C ++ATOM 3062 CD GLU g 109 -15.636 0.344 23.177 1.00 74.95 C ++ATOM 3063 OE1 GLU g 109 -16.168 0.015 24.258 1.00 74.95 O ++ATOM 3064 OE2 GLU g 109 -15.441 1.534 22.855 1.00 74.95 O ++ATOM 3065 N LEU g 110 -16.648 -4.119 20.285 1.00 78.50 N ++ATOM 3066 CA LEU g 110 -17.262 -4.302 18.973 1.00 78.50 C ++ATOM 3067 C LEU g 110 -18.416 -3.316 18.833 1.00 78.50 C ++ATOM 3068 O LEU g 110 -19.595 -3.660 18.928 1.00 78.50 O ++ATOM 3069 CB LEU g 110 -17.721 -5.741 18.793 1.00 78.50 C ++ATOM 3070 CG LEU g 110 -16.608 -6.787 18.744 1.00 78.50 C ++ATOM 3071 CD1 LEU g 110 -17.203 -8.182 18.707 1.00 78.50 C ++ATOM 3072 CD2 LEU g 110 -15.699 -6.556 17.552 1.00 78.50 C ++ATOM 3073 N ASN g 111 -18.053 -2.062 18.587 1.00 76.02 N ++ATOM 3074 CA ASN g 111 -19.042 -1.034 18.318 1.00 76.02 C ++ATOM 3075 C ASN g 111 -19.607 -1.197 16.911 1.00 76.02 C ++ATOM 3076 O ASN g 111 -19.160 -2.028 16.118 1.00 76.02 O ++ATOM 3077 CB ASN g 111 -18.422 0.352 18.463 1.00 76.02 C ++ATOM 3078 CG ASN g 111 -18.047 0.670 19.884 1.00 76.02 C ++ATOM 3079 OD1 ASN g 111 -18.791 0.372 20.816 1.00 76.02 O ++ATOM 3080 ND2 ASN g 111 -16.884 1.282 20.062 1.00 76.02 N ++ATOM 3081 N ALA g 112 -20.608 -0.377 16.597 1.00 75.20 N ++ATOM 3082 CA ALA g 112 -21.073 -0.321 15.220 1.00 75.20 C ++ATOM 3083 C ALA g 112 -20.070 0.408 14.337 1.00 75.20 C ++ATOM 3084 O ALA g 112 -19.955 0.100 13.146 1.00 75.20 O ++ATOM 3085 CB ALA g 112 -22.442 0.351 15.148 1.00 75.20 C ++ATOM 3086 N ALA g 113 -19.314 1.347 14.914 1.00 77.36 N ++ATOM 3087 CA ALA g 113 -18.380 2.143 14.125 1.00 77.36 C ++ATOM 3088 C ALA g 113 -17.182 1.320 13.666 1.00 77.36 C ++ATOM 3089 O ALA g 113 -16.773 1.416 12.504 1.00 77.36 O ++ATOM 3090 CB ALA g 113 -17.920 3.356 14.931 1.00 77.36 C ++ATOM 3091 N THR g 114 -16.620 0.493 14.552 1.00 75.96 N ++ATOM 3092 CA THR g 114 -15.450 -0.299 14.179 1.00 75.96 C ++ATOM 3093 C THR g 114 -15.816 -1.405 13.200 1.00 75.96 C ++ATOM 3094 O THR g 114 -15.051 -1.696 12.273 1.00 75.96 O ++ATOM 3095 CB THR g 114 -14.789 -0.893 15.421 1.00 75.96 C ++ATOM 3096 OG1 THR g 114 -15.700 -1.789 16.066 1.00 75.96 O ++ATOM 3097 CG2 THR g 114 -14.403 0.206 16.392 1.00 75.96 C ++ATOM 3098 N ILE g 115 -16.988 -2.020 13.380 1.00 74.52 N ++ATOM 3099 CA ILE g 115 -17.447 -3.046 12.450 1.00 74.52 C ++ATOM 3100 C ILE g 115 -17.759 -2.434 11.089 1.00 74.52 C ++ATOM 3101 O ILE g 115 -17.399 -3.000 10.044 1.00 74.52 O ++ATOM 3102 CB ILE g 115 -18.655 -3.792 13.045 1.00 74.52 C ++ATOM 3103 CG1 ILE g 115 -18.213 -4.611 14.252 1.00 74.52 C ++ATOM 3104 CG2 ILE g 115 -19.307 -4.705 12.029 1.00 74.52 C ++ATOM 3105 CD1 ILE g 115 -19.356 -5.207 15.023 1.00 74.52 C ++ATOM 3106 N SER g 116 -18.387 -1.252 11.079 1.00 70.89 N ++ATOM 3107 CA SER g 116 -18.667 -0.563 9.823 1.00 70.89 C ++ATOM 3108 C SER g 116 -17.379 -0.142 9.125 1.00 70.89 C ++ATOM 3109 O SER g 116 -17.283 -0.228 7.897 1.00 70.89 O ++ATOM 3110 CB SER g 116 -19.554 0.654 10.073 1.00 70.89 C ++ATOM 3111 OG SER g 116 -18.855 1.644 10.804 1.00 70.89 O ++ATOM 3112 N GLY g 117 -16.366 0.261 9.893 1.00 66.57 N ++ATOM 3113 CA GLY g 117 -15.091 0.618 9.296 1.00 66.57 C ++ATOM 3114 C GLY g 117 -14.354 -0.576 8.720 1.00 66.57 C ++ATOM 3115 O GLY g 117 -13.775 -0.487 7.631 1.00 66.57 O ++ATOM 3116 N PHE g 118 -14.374 -1.707 9.437 1.00 65.79 N ++ATOM 3117 CA PHE g 118 -13.744 -2.927 8.934 1.00 65.79 C ++ATOM 3118 C PHE g 118 -14.417 -3.395 7.652 1.00 65.79 C ++ATOM 3119 O PHE g 118 -13.740 -3.725 6.670 1.00 65.79 O ++ATOM 3120 CB PHE g 118 -13.791 -4.047 9.981 1.00 65.79 C ++ATOM 3121 CG PHE g 118 -12.851 -3.860 11.158 1.00 65.79 C ++ATOM 3122 CD1 PHE g 118 -11.897 -2.853 11.173 1.00 65.79 C ++ATOM 3123 CD2 PHE g 118 -12.901 -4.738 12.236 1.00 65.79 C ++ATOM 3124 CE1 PHE g 118 -11.040 -2.702 12.251 1.00 65.79 C ++ATOM 3125 CE2 PHE g 118 -12.045 -4.594 13.312 1.00 65.79 C ++ATOM 3126 CZ PHE g 118 -11.114 -3.576 13.316 1.00 65.79 C ++ATOM 3127 N LEU g 119 -15.754 -3.371 7.623 1.00 65.56 N ++ATOM 3128 CA LEU g 119 -16.471 -3.833 6.435 1.00 65.56 C ++ATOM 3129 C LEU g 119 -16.311 -2.868 5.268 1.00 65.56 C ++ATOM 3130 O LEU g 119 -16.196 -3.303 4.118 1.00 65.56 O ++ATOM 3131 CB LEU g 119 -17.947 -4.054 6.754 1.00 65.56 C ++ATOM 3132 CG LEU g 119 -18.209 -5.247 7.674 1.00 65.56 C ++ATOM 3133 CD1 LEU g 119 -19.688 -5.369 7.994 1.00 65.56 C ++ATOM 3134 CD2 LEU g 119 -17.680 -6.529 7.055 1.00 65.56 C ++ATOM 3135 N PHE g 120 -16.260 -1.562 5.543 1.00 61.80 N ++ATOM 3136 CA PHE g 120 -16.074 -0.584 4.478 1.00 61.80 C ++ATOM 3137 C PHE g 120 -14.687 -0.695 3.858 1.00 61.80 C ++ATOM 3138 O PHE g 120 -14.544 -0.640 2.627 1.00 61.80 O ++ATOM 3139 CB PHE g 120 -16.302 0.821 5.028 1.00 61.80 C ++ATOM 3140 CG PHE g 120 -16.236 1.895 3.993 1.00 61.80 C ++ATOM 3141 CD1 PHE g 120 -17.308 2.119 3.147 1.00 61.80 C ++ATOM 3142 CD2 PHE g 120 -15.105 2.679 3.862 1.00 61.80 C ++ATOM 3143 CE1 PHE g 120 -17.256 3.110 2.188 1.00 61.80 C ++ATOM 3144 CE2 PHE g 120 -15.041 3.670 2.902 1.00 61.80 C ++ATOM 3145 CZ PHE g 120 -16.120 3.887 2.064 1.00 61.80 C ++ATOM 3146 N ALA g 121 -13.657 -0.862 4.695 1.00 58.29 N ++ATOM 3147 CA ALA g 121 -12.305 -1.033 4.176 1.00 58.29 C ++ATOM 3148 C ALA g 121 -12.169 -2.344 3.416 1.00 58.29 C ++ATOM 3149 O ALA g 121 -11.484 -2.398 2.385 1.00 58.29 O ++ATOM 3150 CB ALA g 121 -11.292 -0.965 5.312 1.00 58.29 C ++ATOM 3151 N GLU g 122 -12.859 -3.392 3.878 1.00 57.64 N ++ATOM 3152 CA GLU g 122 -12.834 -4.674 3.181 1.00 57.64 C ++ATOM 3153 C GLU g 122 -13.488 -4.580 1.806 1.00 57.64 C ++ATOM 3154 O GLU g 122 -12.945 -5.098 0.821 1.00 57.64 O ++ATOM 3155 CB GLU g 122 -13.528 -5.732 4.037 1.00 57.64 C ++ATOM 3156 CG GLU g 122 -13.434 -7.137 3.494 1.00 57.64 C ++ATOM 3157 CD GLU g 122 -12.026 -7.688 3.556 1.00 57.64 C ++ATOM 3158 OE1 GLU g 122 -11.254 -7.262 4.440 1.00 57.64 O ++ATOM 3159 OE2 GLU g 122 -11.691 -8.550 2.719 1.00 57.64 O ++ATOM 3160 N ILE g 123 -14.631 -3.891 1.717 1.00 58.08 N ++ATOM 3161 CA ILE g 123 -15.333 -3.760 0.443 1.00 58.08 C ++ATOM 3162 C ILE g 123 -14.541 -2.900 -0.536 1.00 58.08 C ++ATOM 3163 O ILE g 123 -14.425 -3.248 -1.719 1.00 58.08 O ++ATOM 3164 CB ILE g 123 -16.759 -3.222 0.670 1.00 58.08 C ++ATOM 3165 CG1 ILE g 123 -17.612 -4.271 1.387 1.00 58.08 C ++ATOM 3166 CG2 ILE g 123 -17.430 -2.811 -0.633 1.00 58.08 C ++ATOM 3167 CD1 ILE g 123 -17.756 -5.565 0.628 1.00 58.08 C ++ATOM 3168 N VAL g 124 -13.947 -1.796 -0.067 1.00 56.19 N ++ATOM 3169 CA VAL g 124 -13.200 -0.963 -1.012 1.00 56.19 C ++ATOM 3170 C VAL g 124 -11.899 -1.651 -1.439 1.00 56.19 C ++ATOM 3171 O VAL g 124 -11.482 -1.527 -2.604 1.00 56.19 O ++ATOM 3172 CB VAL g 124 -12.970 0.456 -0.442 1.00 56.19 C ++ATOM 3173 CG1 VAL g 124 -12.013 0.467 0.743 1.00 56.19 C ++ATOM 3174 CG2 VAL g 124 -12.500 1.410 -1.533 1.00 56.19 C ++ATOM 3175 N SER g 125 -11.302 -2.470 -0.562 1.00 55.26 N ++ATOM 3176 CA SER g 125 -10.105 -3.212 -0.941 1.00 55.26 C ++ATOM 3177 C SER g 125 -10.425 -4.282 -1.976 1.00 55.26 C ++ATOM 3178 O SER g 125 -9.710 -4.417 -2.979 1.00 55.26 O ++ATOM 3179 CB SER g 125 -9.464 -3.831 0.297 1.00 55.26 C ++ATOM 3180 OG SER g 125 -10.322 -4.801 0.871 1.00 55.26 O ++ATOM 3181 N ILE g 126 -11.512 -5.035 -1.772 1.00 55.71 N ++ATOM 3182 CA ILE g 126 -11.829 -6.073 -2.744 1.00 55.71 C ++ATOM 3183 C ILE g 126 -12.365 -5.487 -4.044 1.00 55.71 C ++ATOM 3184 O ILE g 126 -12.178 -6.099 -5.095 1.00 55.71 O ++ATOM 3185 CB ILE g 126 -12.801 -7.134 -2.187 1.00 55.71 C ++ATOM 3186 CG1 ILE g 126 -14.166 -6.537 -1.853 1.00 55.71 C ++ATOM 3187 CG2 ILE g 126 -12.196 -7.830 -0.981 1.00 55.71 C ++ATOM 3188 CD1 ILE g 126 -15.207 -7.576 -1.520 1.00 55.71 C ++ATOM 3189 N PHE g 127 -12.959 -4.287 -4.031 1.00 60.02 N ++ATOM 3190 CA PHE g 127 -13.319 -3.667 -5.304 1.00 60.02 C ++ATOM 3191 C PHE g 127 -12.107 -3.175 -6.081 1.00 60.02 C ++ATOM 3192 O PHE g 127 -12.074 -3.334 -7.309 1.00 60.02 O ++ATOM 3193 CB PHE g 127 -14.299 -2.512 -5.108 1.00 60.02 C ++ATOM 3194 CG PHE g 127 -15.729 -2.946 -4.988 1.00 60.02 C ++ATOM 3195 CD1 PHE g 127 -16.114 -4.225 -5.361 1.00 60.02 C ++ATOM 3196 CD2 PHE g 127 -16.694 -2.067 -4.525 1.00 60.02 C ++ATOM 3197 CE1 PHE g 127 -17.431 -4.627 -5.259 1.00 60.02 C ++ATOM 3198 CE2 PHE g 127 -18.018 -2.461 -4.421 1.00 60.02 C ++ATOM 3199 CZ PHE g 127 -18.385 -3.742 -4.788 1.00 60.02 C ++ATOM 3200 N VAL g 128 -11.111 -2.590 -5.399 1.00 58.75 N ++ATOM 3201 CA VAL g 128 -9.888 -2.183 -6.092 1.00 58.75 C ++ATOM 3202 C VAL g 128 -9.166 -3.398 -6.668 1.00 58.75 C ++ATOM 3203 O VAL g 128 -8.767 -3.402 -7.844 1.00 58.75 O ++ATOM 3204 CB VAL g 128 -8.982 -1.369 -5.149 1.00 58.75 C ++ATOM 3205 CG1 VAL g 128 -7.618 -1.151 -5.771 1.00 58.75 C ++ATOM 3206 CG2 VAL g 128 -9.617 -0.029 -4.860 1.00 58.75 C ++ATOM 3207 N LEU g 129 -9.051 -4.470 -5.878 1.00 56.26 N ++ATOM 3208 CA LEU g 129 -8.386 -5.669 -6.376 1.00 56.26 C ++ATOM 3209 C LEU g 129 -9.203 -6.368 -7.459 1.00 56.26 C ++ATOM 3210 O LEU g 129 -8.625 -6.970 -8.372 1.00 56.26 O ++ATOM 3211 CB LEU g 129 -8.103 -6.625 -5.222 1.00 56.26 C ++ATOM 3212 CG LEU g 129 -7.129 -6.103 -4.169 1.00 56.26 C ++ATOM 3213 CD1 LEU g 129 -6.988 -7.101 -3.043 1.00 56.26 C ++ATOM 3214 CD2 LEU g 129 -5.791 -5.793 -4.784 1.00 56.26 C ++ATOM 3215 N ALA g 130 -10.534 -6.254 -7.414 1.00 61.87 N ++ATOM 3216 CA ALA g 130 -11.370 -6.874 -8.434 1.00 61.87 C ++ATOM 3217 C ALA g 130 -11.247 -6.151 -9.766 1.00 61.87 C ++ATOM 3218 O ALA g 130 -11.164 -6.799 -10.815 1.00 61.87 O ++ATOM 3219 CB ALA g 130 -12.825 -6.899 -7.975 1.00 61.87 C ++ATOM 3220 N VAL g 131 -11.226 -4.815 -9.743 1.00 60.15 N ++ATOM 3221 CA VAL g 131 -11.007 -4.052 -10.970 1.00 60.15 C ++ATOM 3222 C VAL g 131 -9.608 -4.315 -11.520 1.00 60.15 C ++ATOM 3223 O VAL g 131 -9.421 -4.439 -12.739 1.00 60.15 O ++ATOM 3224 CB VAL g 131 -11.266 -2.555 -10.712 1.00 60.15 C ++ATOM 3225 CG1 VAL g 131 -10.879 -1.702 -11.908 1.00 60.15 C ++ATOM 3226 CG2 VAL g 131 -12.732 -2.331 -10.394 1.00 60.15 C ++ATOM 3227 N GLY g 132 -8.624 -4.481 -10.627 1.00 61.18 N ++ATOM 3228 CA GLY g 132 -7.274 -4.801 -11.072 1.00 61.18 C ++ATOM 3229 C GLY g 132 -7.174 -6.148 -11.767 1.00 61.18 C ++ATOM 3230 O GLY g 132 -6.589 -6.259 -12.849 1.00 61.18 O ++ATOM 3231 N VAL g 133 -7.771 -7.184 -11.168 1.00 63.42 N ++ATOM 3232 CA VAL g 133 -7.753 -8.509 -11.783 1.00 63.42 C ++ATOM 3233 C VAL g 133 -8.573 -8.528 -13.070 1.00 63.42 C ++ATOM 3234 O VAL g 133 -8.168 -9.148 -14.062 1.00 63.42 O ++ATOM 3235 CB VAL g 133 -8.234 -9.556 -10.761 1.00 63.42 C ++ATOM 3236 CG1 VAL g 133 -8.438 -10.920 -11.400 1.00 63.42 C ++ATOM 3237 CG2 VAL g 133 -7.219 -9.676 -9.643 1.00 63.42 C ++ATOM 3238 N TYR g 134 -9.689 -7.797 -13.107 1.00 69.78 N ++ATOM 3239 CA TYR g 134 -10.536 -7.793 -14.294 1.00 69.78 C ++ATOM 3240 C TYR g 134 -9.881 -7.049 -15.454 1.00 69.78 C ++ATOM 3241 O TYR g 134 -10.139 -7.364 -16.620 1.00 69.78 O ++ATOM 3242 CB TYR g 134 -11.893 -7.187 -13.944 1.00 69.78 C ++ATOM 3243 CG TYR g 134 -12.877 -7.122 -15.080 1.00 69.78 C ++ATOM 3244 CD1 TYR g 134 -13.489 -8.269 -15.563 1.00 69.78 C ++ATOM 3245 CD2 TYR g 134 -13.218 -5.904 -15.651 1.00 69.78 C ++ATOM 3246 CE1 TYR g 134 -14.400 -8.208 -16.601 1.00 69.78 C ++ATOM 3247 CE2 TYR g 134 -14.127 -5.830 -16.685 1.00 69.78 C ++ATOM 3248 CZ TYR g 134 -14.715 -6.983 -17.155 1.00 69.78 C ++ATOM 3249 OH TYR g 134 -15.621 -6.908 -18.185 1.00 69.78 O ++ATOM 3250 N PHE g 135 -9.019 -6.075 -15.166 1.00 67.71 N ++ATOM 3251 CA PHE g 135 -8.283 -5.417 -16.238 1.00 67.71 C ++ATOM 3252 C PHE g 135 -6.959 -6.085 -16.577 1.00 67.71 C ++ATOM 3253 O PHE g 135 -6.401 -5.796 -17.638 1.00 67.71 O ++ATOM 3254 CB PHE g 135 -8.037 -3.942 -15.914 1.00 67.71 C ++ATOM 3255 CG PHE g 135 -9.217 -3.061 -16.180 1.00 67.71 C ++ATOM 3256 CD1 PHE g 135 -10.290 -3.524 -16.927 1.00 67.71 C ++ATOM 3257 CD2 PHE g 135 -9.243 -1.760 -15.712 1.00 67.71 C ++ATOM 3258 CE1 PHE g 135 -11.374 -2.714 -17.184 1.00 67.71 C ++ATOM 3259 CE2 PHE g 135 -10.327 -0.941 -15.965 1.00 67.71 C ++ATOM 3260 CZ PHE g 135 -11.393 -1.420 -16.703 1.00 67.71 C ++ATOM 3261 N ILE g 136 -6.431 -6.957 -15.726 1.00 65.85 N ++ATOM 3262 CA ILE g 136 -5.290 -7.760 -16.152 1.00 65.85 C ++ATOM 3263 C ILE g 136 -5.723 -8.859 -17.110 1.00 65.85 C ++ATOM 3264 O ILE g 136 -5.189 -8.984 -18.215 1.00 65.85 O ++ATOM 3265 CB ILE g 136 -4.536 -8.341 -14.938 1.00 65.85 C ++ATOM 3266 CG1 ILE g 136 -3.791 -7.236 -14.202 1.00 65.85 C ++ATOM 3267 CG2 ILE g 136 -3.556 -9.413 -15.372 1.00 65.85 C ++ATOM 3268 CD1 ILE g 136 -3.190 -7.693 -12.908 1.00 65.85 C ++ATOM 3269 N ALA g 137 -6.715 -9.653 -16.721 1.00 71.85 N ++ATOM 3270 CA ALA g 137 -7.152 -10.795 -17.518 1.00 71.85 C ++ATOM 3271 C ALA g 137 -8.400 -10.486 -18.330 1.00 71.85 C ++ATOM 3272 O ALA g 137 -9.245 -11.360 -18.535 1.00 71.85 O ++ATOM 3273 CB ALA g 137 -7.382 -12.002 -16.620 1.00 71.85 C ++ATOM 3274 N GLY g 138 -8.542 -9.255 -18.807 1.00 67.27 N ++ATOM 3275 CA GLY g 138 -9.668 -8.895 -19.649 1.00 67.27 C ++ATOM 3276 C GLY g 138 -9.599 -9.528 -21.026 1.00 67.27 C ++ATOM 3277 O GLY g 138 -9.857 -8.876 -22.039 1.00 67.27 O ++ATOM 3279 N VAL m 26 -7.072 27.593 86.888 1.00 66.78 N ++ATOM 3280 CA VAL m 26 -8.098 26.854 87.603 1.00 66.78 C ++ATOM 3281 C VAL m 26 -9.451 27.217 86.993 1.00 66.78 C ++ATOM 3282 O VAL m 26 -10.453 26.535 87.205 1.00 66.78 O ++ATOM 3283 CB VAL m 26 -8.042 27.149 89.128 1.00 66.78 C ++ATOM 3284 CG1 VAL m 26 -8.556 28.543 89.434 1.00 66.78 C ++ATOM 3285 CG2 VAL m 26 -8.776 26.082 89.949 1.00 66.78 C ++ATOM 3286 N GLU m 27 -9.469 28.287 86.198 1.00 71.65 N ++ATOM 3287 CA GLU m 27 -10.710 28.772 85.599 1.00 71.65 C ++ATOM 3288 C GLU m 27 -10.364 29.384 84.247 1.00 71.65 C ++ATOM 3289 O GLU m 27 -9.908 30.528 84.175 1.00 71.65 O ++ATOM 3290 CB GLU m 27 -11.403 29.781 86.505 1.00 71.65 C ++ATOM 3291 CG GLU m 27 -12.709 30.334 85.948 1.00 71.65 C ++ATOM 3292 CD GLU m 27 -13.815 29.298 85.873 1.00 71.65 C ++ATOM 3293 OE1 GLU m 27 -13.811 28.348 86.686 1.00 71.65 O ++ATOM 3294 OE2 GLU m 27 -14.694 29.434 84.996 1.00 71.65 O ++ATOM 3295 N GLN m 28 -10.581 28.616 83.188 1.00 56.53 N ++ATOM 3296 CA GLN m 28 -10.321 29.049 81.825 1.00 56.53 C ++ATOM 3297 C GLN m 28 -11.642 29.175 81.087 1.00 56.53 C ++ATOM 3298 O GLN m 28 -12.513 28.313 81.218 1.00 56.53 O ++ATOM 3299 CB GLN m 28 -9.410 28.054 81.109 1.00 56.53 C ++ATOM 3300 CG GLN m 28 -9.030 28.454 79.715 1.00 56.53 C ++ATOM 3301 CD GLN m 28 -8.085 27.465 79.078 1.00 56.53 C ++ATOM 3302 OE1 GLN m 28 -7.733 26.454 79.680 1.00 56.53 O ++ATOM 3303 NE2 GLN m 28 -7.674 27.747 77.853 1.00 56.53 N ++ATOM 3304 N ASP m 29 -11.789 30.249 80.324 1.00 57.33 N ++ATOM 3305 CA ASP m 29 -13.027 30.541 79.609 1.00 57.33 C ++ATOM 3306 C ASP m 29 -13.254 29.552 78.474 1.00 57.33 C ++ATOM 3307 O ASP m 29 -12.491 29.562 77.500 1.00 57.33 O ++ATOM 3308 CB ASP m 29 -12.992 31.967 79.066 1.00 57.33 C ++ATOM 3309 N PRO m 30 -14.280 28.705 78.538 1.00 58.28 N ++ATOM 3310 CA PRO m 30 -14.483 27.708 77.482 1.00 58.28 C ++ATOM 3311 C PRO m 30 -15.201 28.298 76.285 1.00 58.28 C ++ATOM 3312 O PRO m 30 -15.392 29.514 76.199 1.00 58.28 O ++ATOM 3313 CB PRO m 30 -15.341 26.647 78.174 1.00 58.28 C ++ATOM 3314 CG PRO m 30 -16.162 27.443 79.124 1.00 58.28 C ++ATOM 3315 CD PRO m 30 -15.293 28.582 79.600 1.00 58.28 C ++ATOM 3316 N GLY m 31 -15.586 27.446 75.345 1.00 57.06 N ++ATOM 3317 CA GLY m 31 -16.367 27.877 74.215 1.00 57.06 C ++ATOM 3318 C GLY m 31 -15.492 28.299 73.058 1.00 57.06 C ++ATOM 3319 O GLY m 31 -14.493 29.002 73.231 1.00 57.06 O ++ATOM 3320 N PRO m 32 -15.852 27.870 71.849 1.00 49.72 N ++ATOM 3321 CA PRO m 32 -15.016 28.154 70.675 1.00 49.72 C ++ATOM 3322 C PRO m 32 -15.081 29.619 70.274 1.00 49.72 C ++ATOM 3323 O PRO m 32 -16.148 30.143 69.951 1.00 49.72 O ++ATOM 3324 CB PRO m 32 -15.604 27.241 69.594 1.00 49.72 C ++ATOM 3325 CG PRO m 32 -16.997 26.992 70.025 1.00 49.72 C ++ATOM 3326 CD PRO m 32 -16.983 26.988 71.520 1.00 49.72 C ++ATOM 3327 N LEU m 33 -13.931 30.283 70.302 1.00 44.03 N ++ATOM 3328 CA LEU m 33 -13.857 31.644 69.796 1.00 44.03 C ++ATOM 3329 C LEU m 33 -13.275 31.633 68.389 1.00 44.03 C ++ATOM 3330 O LEU m 33 -12.436 30.794 68.047 1.00 44.03 O ++ATOM 3331 CB LEU m 33 -13.029 32.561 70.700 1.00 44.03 C ++ATOM 3332 CG LEU m 33 -11.503 32.565 70.671 1.00 44.03 C ++ATOM 3333 CD1 LEU m 33 -10.982 33.872 71.232 1.00 44.03 C ++ATOM 3334 CD2 LEU m 33 -10.960 31.424 71.474 1.00 44.03 C ++ATOM 3335 N SER m 34 -13.731 32.584 67.580 1.00 41.00 N ++ATOM 3336 CA SER m 34 -13.462 32.613 66.151 1.00 41.00 C ++ATOM 3337 C SER m 34 -12.698 33.878 65.806 1.00 41.00 C ++ATOM 3338 O SER m 34 -13.167 34.985 66.075 1.00 41.00 O ++ATOM 3339 CB SER m 34 -14.764 32.553 65.356 1.00 41.00 C ++ATOM 3340 OG SER m 34 -15.454 31.345 65.612 1.00 41.00 O ++ATOM 3341 N VAL m 35 -11.529 33.710 65.195 1.00 41.69 N ++ATOM 3342 CA VAL m 35 -10.636 34.811 64.870 1.00 41.69 C ++ATOM 3343 C VAL m 35 -10.394 34.782 63.360 1.00 41.69 C ++ATOM 3344 O VAL m 35 -10.163 33.706 62.813 1.00 41.69 O ++ATOM 3345 CB VAL m 35 -9.299 34.718 65.624 1.00 41.69 C ++ATOM 3346 CG1 VAL m 35 -8.376 35.846 65.246 1.00 41.69 C ++ATOM 3347 CG2 VAL m 35 -9.538 34.719 67.114 1.00 41.69 C ++ATOM 3348 N PRO m 36 -10.458 35.910 62.660 1.00 46.14 N ++ATOM 3349 CA PRO m 36 -10.109 35.907 61.236 1.00 46.14 C ++ATOM 3350 C PRO m 36 -8.622 35.665 61.026 1.00 46.14 C ++ATOM 3351 O PRO m 36 -7.807 35.803 61.938 1.00 46.14 O ++ATOM 3352 CB PRO m 36 -10.508 37.308 60.769 1.00 46.14 C ++ATOM 3353 CG PRO m 36 -11.502 37.768 61.768 1.00 46.14 C ++ATOM 3354 CD PRO m 36 -11.054 37.190 63.067 1.00 46.14 C ++ATOM 3355 N GLU m 37 -8.279 35.284 59.798 1.00 46.17 N ++ATOM 3356 CA GLU m 37 -6.903 34.930 59.475 1.00 46.17 C ++ATOM 3357 C GLU m 37 -6.009 36.160 59.493 1.00 46.17 C ++ATOM 3358 O GLU m 37 -6.355 37.199 58.926 1.00 46.17 O ++ATOM 3359 CB GLU m 37 -6.830 34.256 58.108 1.00 46.17 C ++ATOM 3360 CG GLU m 37 -5.431 33.831 57.702 1.00 46.17 C ++ATOM 3361 CD GLU m 37 -5.403 33.114 56.372 1.00 46.17 C ++ATOM 3362 OE1 GLU m 37 -6.477 32.970 55.754 1.00 46.17 O ++ATOM 3363 OE2 GLU m 37 -4.309 32.694 55.940 1.00 46.17 O ++ATOM 3364 N GLY m 38 -4.863 36.040 60.150 1.00 55.13 N ++ATOM 3365 CA GLY m 38 -3.949 37.154 60.266 1.00 55.13 C ++ATOM 3366 C GLY m 38 -4.437 38.173 61.268 1.00 55.13 C ++ATOM 3367 O GLY m 38 -4.675 39.333 60.925 1.00 55.13 O ++ATOM 3368 N ALA m 39 -4.601 37.744 62.514 1.00 56.14 N ++ATOM 3369 CA ALA m 39 -5.042 38.636 63.570 1.00 56.14 C ++ATOM 3370 C ALA m 39 -4.487 38.134 64.890 1.00 56.14 C ++ATOM 3371 O ALA m 39 -4.385 36.927 65.117 1.00 56.14 O ++ATOM 3372 CB ALA m 39 -6.567 38.733 63.631 1.00 56.14 C ++ATOM 3373 N ILE m 40 -4.124 39.078 65.756 1.00 58.74 N ++ATOM 3374 CA ILE m 40 -3.533 38.743 67.044 1.00 58.74 C ++ATOM 3375 C ILE m 40 -4.618 38.181 67.952 1.00 58.74 C ++ATOM 3376 O ILE m 40 -5.653 38.819 68.179 1.00 58.74 O ++ATOM 3377 CB ILE m 40 -2.845 39.964 67.673 1.00 58.74 C ++ATOM 3378 CG1 ILE m 40 -1.600 40.365 66.876 1.00 58.74 C ++ATOM 3379 CG2 ILE m 40 -2.469 39.688 69.116 1.00 58.74 C ++ATOM 3380 CD1 ILE m 40 -1.814 41.470 65.847 1.00 58.74 C ++ATOM 3381 N VAL m 41 -4.392 36.968 68.455 1.00 53.48 N ++ATOM 3382 CA VAL m 41 -5.341 36.250 69.294 1.00 53.48 C ++ATOM 3383 C VAL m 41 -4.883 36.370 70.737 1.00 53.48 C ++ATOM 3384 O VAL m 41 -3.687 36.234 71.028 1.00 53.48 O ++ATOM 3385 CB VAL m 41 -5.431 34.774 68.870 1.00 53.48 C ++ATOM 3386 CG1 VAL m 41 -6.557 34.084 69.587 1.00 53.48 C ++ATOM 3387 CG2 VAL m 41 -5.579 34.658 67.374 1.00 53.48 C ++ATOM 3388 N SER m 42 -5.825 36.627 71.641 1.00 51.14 N ++ATOM 3389 CA SER m 42 -5.540 36.799 73.057 1.00 51.14 C ++ATOM 3390 C SER m 42 -6.366 35.820 73.875 1.00 51.14 C ++ATOM 3391 O SER m 42 -7.599 35.836 73.802 1.00 51.14 O ++ATOM 3392 CB SER m 42 -5.844 38.226 73.504 1.00 51.14 C ++ATOM 3393 OG SER m 42 -5.631 38.376 74.896 1.00 51.14 O ++ATOM 3394 N LEU m 43 -5.693 34.984 74.662 1.00 51.67 N ++ATOM 3395 CA LEU m 43 -6.358 34.058 75.567 1.00 51.67 C ++ATOM 3396 C LEU m 43 -5.857 34.319 76.977 1.00 51.67 C ++ATOM 3397 O LEU m 43 -4.742 34.805 77.160 1.00 51.67 O ++ATOM 3398 CB LEU m 43 -6.092 32.591 75.204 1.00 51.67 C ++ATOM 3399 CG LEU m 43 -6.741 31.947 73.979 1.00 51.67 C ++ATOM 3400 CD1 LEU m 43 -5.965 32.243 72.727 1.00 51.67 C ++ATOM 3401 CD2 LEU m 43 -6.878 30.459 74.170 1.00 51.67 C ++ATOM 3402 N ASN m 44 -6.673 33.983 77.976 1.00 61.25 N ++ATOM 3403 CA ASN m 44 -6.243 34.176 79.354 1.00 61.25 C ++ATOM 3404 C ASN m 44 -6.886 33.153 80.283 1.00 61.25 C ++ATOM 3405 O ASN m 44 -8.023 32.723 80.078 1.00 61.25 O ++ATOM 3406 CB ASN m 44 -6.513 35.618 79.829 1.00 61.25 C ++ATOM 3407 CG ASN m 44 -7.946 36.071 79.607 1.00 61.25 C ++ATOM 3408 OD1 ASN m 44 -8.798 35.310 79.155 1.00 61.25 O ++ATOM 3409 ND2 ASN m 44 -8.212 37.333 79.924 1.00 61.25 N ++ATOM 3410 N CYS m 45 -6.118 32.758 81.297 1.00 74.74 N ++ATOM 3411 CA CYS m 45 -6.554 31.870 82.367 1.00 74.74 C ++ATOM 3412 C CYS m 45 -6.463 32.596 83.698 1.00 74.74 C ++ATOM 3413 O CYS m 45 -5.404 33.135 84.039 1.00 74.74 O ++ATOM 3414 CB CYS m 45 -5.698 30.608 82.446 1.00 74.74 C ++ATOM 3415 SG CYS m 45 -5.851 29.468 81.076 1.00 74.74 S ++ATOM 3416 N THR m 46 -7.558 32.581 84.451 1.00 78.60 N ++ATOM 3417 CA THR m 46 -7.616 33.154 85.788 1.00 78.60 C ++ATOM 3418 C THR m 46 -7.358 32.069 86.822 1.00 78.60 C ++ATOM 3419 O THR m 46 -7.830 30.937 86.675 1.00 78.60 O ++ATOM 3420 CB THR m 46 -8.980 33.790 86.043 1.00 78.60 C ++ATOM 3421 OG1 THR m 46 -9.989 32.777 85.976 1.00 78.60 O ++ATOM 3422 CG2 THR m 46 -9.274 34.840 84.996 1.00 78.60 C ++ATOM 3423 N TYR m 47 -6.616 32.416 87.877 1.00 86.57 N ++ATOM 3424 CA TYR m 47 -6.245 31.413 88.867 1.00 86.57 C ++ATOM 3425 C TYR m 47 -6.339 31.916 90.302 1.00 86.57 C ++ATOM 3426 O TYR m 47 -5.735 31.311 91.195 1.00 86.57 O ++ATOM 3427 CB TYR m 47 -4.826 30.887 88.601 1.00 86.57 C ++ATOM 3428 CG TYR m 47 -3.722 31.924 88.637 1.00 86.57 C ++ATOM 3429 CD1 TYR m 47 -3.362 32.613 87.490 1.00 86.57 C ++ATOM 3430 CD2 TYR m 47 -3.015 32.185 89.805 1.00 86.57 C ++ATOM 3431 CE1 TYR m 47 -2.348 33.546 87.507 1.00 86.57 C ++ATOM 3432 CE2 TYR m 47 -2.003 33.117 89.832 1.00 86.57 C ++ATOM 3433 CZ TYR m 47 -1.675 33.795 88.679 1.00 86.57 C ++ATOM 3434 OH TYR m 47 -0.666 34.728 88.694 1.00 86.57 O ++ATOM 3435 N SER m 48 -7.083 32.989 90.550 1.00 91.27 N ++ATOM 3436 CA SER m 48 -7.059 33.636 91.855 1.00 91.27 C ++ATOM 3437 C SER m 48 -7.788 32.798 92.904 1.00 91.27 C ++ATOM 3438 O SER m 48 -8.957 32.444 92.716 1.00 91.27 O ++ATOM 3439 CB SER m 48 -7.686 35.025 91.761 1.00 91.27 C ++ATOM 3440 OG SER m 48 -7.714 35.659 93.026 1.00 91.27 O ++ATOM 3441 N ASN m 49 -7.111 32.478 94.014 1.00 96.84 N ++ATOM 3442 CA ASN m 49 -5.730 32.887 94.307 1.00 96.84 C ++ATOM 3443 C ASN m 49 -4.872 31.783 94.938 1.00 96.84 C ++ATOM 3444 O ASN m 49 -5.363 30.962 95.713 1.00 96.84 O ++ATOM 3445 CB ASN m 49 -5.720 34.132 95.217 1.00 96.84 C ++ATOM 3446 CG ASN m 49 -6.574 33.970 96.473 1.00 96.84 C ++ATOM 3447 OD1 ASN m 49 -7.152 32.915 96.727 1.00 96.84 O ++ATOM 3448 ND2 ASN m 49 -6.656 35.033 97.264 1.00 96.84 N ++ATOM 3449 N SER m 50 -3.593 31.764 94.569 1.00 96.93 N ++ATOM 3450 CA SER m 50 -2.561 30.959 95.221 1.00 96.93 C ++ATOM 3451 C SER m 50 -1.208 31.569 94.877 1.00 96.93 C ++ATOM 3452 O SER m 50 -1.126 32.690 94.365 1.00 96.93 O ++ATOM 3453 CB SER m 50 -2.633 29.484 94.809 1.00 96.93 C ++ATOM 3454 OG SER m 50 -3.804 28.864 95.308 1.00 96.93 O ++ATOM 3455 N ALA m 51 -0.139 30.824 95.154 1.00 90.33 N ++ATOM 3456 CA ALA m 51 1.230 31.246 94.859 1.00 90.33 C ++ATOM 3457 C ALA m 51 1.882 30.163 94.006 1.00 90.33 C ++ATOM 3458 O ALA m 51 2.515 29.244 94.534 1.00 90.33 O ++ATOM 3459 CB ALA m 51 2.010 31.505 96.141 1.00 90.33 C ++ATOM 3460 N PHE m 52 1.734 30.273 92.689 1.00 88.56 N ++ATOM 3461 CA PHE m 52 2.253 29.269 91.773 1.00 88.56 C ++ATOM 3462 C PHE m 52 3.629 29.675 91.262 1.00 88.56 C ++ATOM 3463 O PHE m 52 3.896 30.857 91.032 1.00 88.56 O ++ATOM 3464 CB PHE m 52 1.306 29.073 90.591 1.00 88.56 C ++ATOM 3465 CG PHE m 52 -0.063 28.601 90.979 1.00 88.56 C ++ATOM 3466 CD1 PHE m 52 -0.277 27.294 91.375 1.00 88.56 C ++ATOM 3467 CD2 PHE m 52 -1.143 29.457 90.907 1.00 88.56 C ++ATOM 3468 CE1 PHE m 52 -1.542 26.855 91.719 1.00 88.56 C ++ATOM 3469 CE2 PHE m 52 -2.412 29.026 91.244 1.00 88.56 C ++ATOM 3470 CZ PHE m 52 -2.611 27.724 91.649 1.00 88.56 C ++ATOM 3471 N GLN m 53 4.500 28.684 91.084 1.00 96.14 N ++ATOM 3472 CA GLN m 53 5.839 28.963 90.580 1.00 96.14 C ++ATOM 3473 C GLN m 53 5.827 29.188 89.077 1.00 96.14 C ++ATOM 3474 O GLN m 53 6.150 30.279 88.595 1.00 96.14 O ++ATOM 3475 CB GLN m 53 6.786 27.814 90.934 1.00 96.14 C ++ATOM 3476 CG GLN m 53 7.065 27.680 92.411 1.00 96.14 C ++ATOM 3477 CD GLN m 53 7.839 28.861 92.954 1.00 96.14 C ++ATOM 3478 OE1 GLN m 53 8.743 29.378 92.297 1.00 96.14 O ++ATOM 3479 NE2 GLN m 53 7.486 29.299 94.156 1.00 96.14 N ++ATOM 3480 N TYR m 54 5.435 28.172 88.319 1.00 92.36 N ++ATOM 3481 CA TYR m 54 5.615 28.161 86.879 1.00 92.36 C ++ATOM 3482 C TYR m 54 4.277 28.083 86.158 1.00 92.36 C ++ATOM 3483 O TYR m 54 3.283 27.586 86.689 1.00 92.36 O ++ATOM 3484 CB TYR m 54 6.527 27.002 86.451 1.00 92.36 C ++ATOM 3485 CG TYR m 54 6.108 25.632 86.948 1.00 92.36 C ++ATOM 3486 CD1 TYR m 54 5.234 24.834 86.215 1.00 92.36 C ++ATOM 3487 CD2 TYR m 54 6.604 25.130 88.148 1.00 92.36 C ++ATOM 3488 CE1 TYR m 54 4.859 23.577 86.667 1.00 92.36 C ++ATOM 3489 CE2 TYR m 54 6.235 23.876 88.607 1.00 92.36 C ++ATOM 3490 CZ TYR m 54 5.367 23.104 87.862 1.00 92.36 C ++ATOM 3491 OH TYR m 54 4.999 21.858 88.320 1.00 92.36 O ++ATOM 3492 N PHE m 55 4.280 28.582 84.928 1.00 85.34 N ++ATOM 3493 CA PHE m 55 3.090 28.685 84.104 1.00 85.34 C ++ATOM 3494 C PHE m 55 3.417 28.218 82.695 1.00 85.34 C ++ATOM 3495 O PHE m 55 4.457 28.577 82.132 1.00 85.34 O ++ATOM 3496 CB PHE m 55 2.577 30.121 84.076 1.00 85.34 C ++ATOM 3497 CG PHE m 55 2.105 30.616 85.410 1.00 85.34 C ++ATOM 3498 CD1 PHE m 55 0.816 30.361 85.841 1.00 85.34 C ++ATOM 3499 CD2 PHE m 55 2.961 31.317 86.243 1.00 85.34 C ++ATOM 3500 CE1 PHE m 55 0.379 30.814 87.073 1.00 85.34 C ++ATOM 3501 CE2 PHE m 55 2.534 31.767 87.477 1.00 85.34 C ++ATOM 3502 CZ PHE m 55 1.241 31.517 87.892 1.00 85.34 C ++ATOM 3503 N MET m 56 2.513 27.439 82.108 1.00 72.54 N ++ATOM 3504 CA MET m 56 2.866 26.794 80.855 1.00 72.54 C ++ATOM 3505 C MET m 56 1.610 26.521 80.041 1.00 72.54 C ++ATOM 3506 O MET m 56 0.509 26.421 80.587 1.00 72.54 O ++ATOM 3507 CB MET m 56 3.663 25.521 81.146 1.00 72.54 C ++ATOM 3508 CG MET m 56 2.917 24.499 81.967 1.00 72.54 C ++ATOM 3509 SD MET m 56 4.039 23.286 82.681 1.00 72.54 S ++ATOM 3510 CE MET m 56 4.687 22.499 81.222 1.00 72.54 C ++ATOM 3511 N TRP m 57 1.785 26.434 78.725 1.00 57.50 N ++ATOM 3512 CA TRP m 57 0.671 26.382 77.784 1.00 57.50 C ++ATOM 3513 C TRP m 57 0.784 25.162 76.886 1.00 57.50 C ++ATOM 3514 O TRP m 57 1.780 24.999 76.176 1.00 57.50 O ++ATOM 3515 CB TRP m 57 0.613 27.652 76.937 1.00 57.50 C ++ATOM 3516 CG TRP m 57 0.064 28.811 77.678 1.00 57.50 C ++ATOM 3517 CD1 TRP m 57 0.763 29.726 78.395 1.00 57.50 C ++ATOM 3518 CD2 TRP m 57 -1.308 29.198 77.762 1.00 57.50 C ++ATOM 3519 NE1 TRP m 57 -0.087 30.651 78.939 1.00 57.50 N ++ATOM 3520 CE2 TRP m 57 -1.367 30.348 78.560 1.00 57.50 C ++ATOM 3521 CE3 TRP m 57 -2.493 28.678 77.245 1.00 57.50 C ++ATOM 3522 CZ2 TRP m 57 -2.561 30.987 78.852 1.00 57.50 C ++ATOM 3523 CZ3 TRP m 57 -3.677 29.312 77.537 1.00 57.50 C ++ATOM 3524 CH2 TRP m 57 -3.704 30.453 78.332 1.00 57.50 C ++ATOM 3525 N TYR m 58 -0.246 24.323 76.905 1.00 47.54 N ++ATOM 3526 CA TYR m 58 -0.335 23.160 76.041 1.00 47.54 C ++ATOM 3527 C TYR m 58 -1.272 23.416 74.872 1.00 47.54 C ++ATOM 3528 O TYR m 58 -2.314 24.056 75.020 1.00 47.54 O ++ATOM 3529 CB TYR m 58 -0.834 21.951 76.822 1.00 47.54 C ++ATOM 3530 CG TYR m 58 0.184 21.392 77.760 1.00 47.54 C ++ATOM 3531 CD1 TYR m 58 1.160 20.528 77.297 1.00 47.54 C ++ATOM 3532 CD2 TYR m 58 0.182 21.733 79.097 1.00 47.54 C ++ATOM 3533 CE1 TYR m 58 2.097 20.015 78.136 1.00 47.54 C ++ATOM 3534 CE2 TYR m 58 1.119 21.222 79.948 1.00 47.54 C ++ATOM 3535 CZ TYR m 58 2.072 20.362 79.458 1.00 47.54 C ++ATOM 3536 OH TYR m 58 3.019 19.838 80.295 1.00 47.54 O ++ATOM 3537 N ARG m 59 -0.898 22.893 73.714 1.00 38.36 N ++ATOM 3538 CA ARG m 59 -1.737 22.901 72.530 1.00 38.36 C ++ATOM 3539 C ARG m 59 -2.138 21.480 72.193 1.00 38.36 C ++ATOM 3540 O ARG m 59 -1.276 20.616 72.026 1.00 38.36 O ++ATOM 3541 CB ARG m 59 -1.010 23.525 71.348 1.00 38.36 C ++ATOM 3542 CG ARG m 59 -1.762 23.417 70.052 1.00 38.36 C ++ATOM 3543 CD ARG m 59 -1.028 24.132 68.946 1.00 38.36 C ++ATOM 3544 NE ARG m 59 0.253 23.506 68.656 1.00 38.36 N ++ATOM 3545 CZ ARG m 59 1.188 24.051 67.890 1.00 38.36 C ++ATOM 3546 NH1 ARG m 59 0.979 25.236 67.338 1.00 38.36 N ++ATOM 3547 NH2 ARG m 59 2.330 23.416 67.678 1.00 38.36 N ++ATOM 3548 N GLN m 60 -3.440 21.238 72.086 1.00 33.29 N ++ATOM 3549 CA GLN m 60 -3.963 19.927 71.738 1.00 33.29 C ++ATOM 3550 C GLN m 60 -4.759 20.056 70.454 1.00 33.29 C ++ATOM 3551 O GLN m 60 -5.764 20.773 70.416 1.00 33.29 O ++ATOM 3552 CB GLN m 60 -4.848 19.375 72.855 1.00 33.29 C ++ATOM 3553 CG GLN m 60 -5.441 18.027 72.555 1.00 33.29 C ++ATOM 3554 CD GLN m 60 -6.298 17.503 73.679 1.00 33.29 C ++ATOM 3555 OE1 GLN m 60 -6.438 18.145 74.715 1.00 33.29 O ++ATOM 3556 NE2 GLN m 60 -6.894 16.340 73.475 1.00 33.29 N ++ATOM 3557 N TYR m 61 -4.312 19.382 69.404 1.00 34.18 N ++ATOM 3558 CA TYR m 61 -5.126 19.312 68.207 1.00 34.18 C ++ATOM 3559 C TYR m 61 -6.243 18.303 68.418 1.00 34.18 C ++ATOM 3560 O TYR m 61 -6.281 17.586 69.417 1.00 34.18 O ++ATOM 3561 CB TYR m 61 -4.268 18.953 67.001 1.00 34.18 C ++ATOM 3562 CG TYR m 61 -3.321 20.061 66.617 1.00 34.18 C ++ATOM 3563 CD1 TYR m 61 -3.747 21.120 65.826 1.00 34.18 C ++ATOM 3564 CD2 TYR m 61 -2.010 20.066 67.065 1.00 34.18 C ++ATOM 3565 CE1 TYR m 61 -2.887 22.139 65.481 1.00 34.18 C ++ATOM 3566 CE2 TYR m 61 -1.146 21.084 66.726 1.00 34.18 C ++ATOM 3567 CZ TYR m 61 -1.594 22.114 65.936 1.00 34.18 C ++ATOM 3568 OH TYR m 61 -0.737 23.127 65.600 1.00 34.18 O ++ATOM 3569 N SER m 62 -7.183 18.261 67.484 1.00 33.01 N ++ATOM 3570 CA SER m 62 -8.259 17.286 67.589 1.00 33.01 C ++ATOM 3571 C SER m 62 -7.719 15.886 67.332 1.00 33.01 C ++ATOM 3572 O SER m 62 -7.007 15.661 66.348 1.00 33.01 O ++ATOM 3573 CB SER m 62 -9.383 17.616 66.617 1.00 33.01 C ++ATOM 3574 OG SER m 62 -10.042 18.804 67.008 1.00 33.01 O ++ATOM 3575 N ARG m 63 -8.031 14.973 68.259 1.00 33.86 N ++ATOM 3576 CA ARG m 63 -7.632 13.563 68.224 1.00 33.86 C ++ATOM 3577 C ARG m 63 -6.116 13.394 68.235 1.00 33.86 C ++ATOM 3578 O ARG m 63 -5.564 12.571 67.505 1.00 33.86 O ++ATOM 3579 CB ARG m 63 -8.245 12.830 67.029 1.00 33.86 C ++ATOM 3580 CG ARG m 63 -9.741 12.921 66.987 1.00 33.86 C ++ATOM 3581 CD ARG m 63 -10.334 12.193 68.161 1.00 33.86 C ++ATOM 3582 NE ARG m 63 -11.787 12.266 68.161 1.00 33.86 N ++ATOM 3583 CZ ARG m 63 -12.570 11.394 67.542 1.00 33.86 C ++ATOM 3584 NH1 ARG m 63 -13.885 11.534 67.597 1.00 33.86 N ++ATOM 3585 NH2 ARG m 63 -12.041 10.384 66.866 1.00 33.86 N ++ATOM 3586 N LYS m 64 -5.434 14.175 69.068 1.00 32.04 N ++ATOM 3587 CA LYS m 64 -4.007 13.992 69.306 1.00 32.04 C ++ATOM 3588 C LYS m 64 -3.741 14.187 70.791 1.00 32.04 C ++ATOM 3589 O LYS m 64 -4.663 14.347 71.593 1.00 32.04 O ++ATOM 3590 CB LYS m 64 -3.153 14.949 68.465 1.00 32.04 C ++ATOM 3591 CG LYS m 64 -3.064 14.606 66.992 1.00 32.04 C ++ATOM 3592 CD LYS m 64 -2.145 15.564 66.267 1.00 32.04 C ++ATOM 3593 CE LYS m 64 -2.061 15.232 64.794 1.00 32.04 C ++ATOM 3594 NZ LYS m 64 -1.174 16.180 64.071 1.00 32.04 N ++ATOM 3595 N GLY m 65 -2.465 14.175 71.155 1.00 34.48 N ++ATOM 3596 CA GLY m 65 -2.063 14.417 72.516 1.00 34.48 C ++ATOM 3597 C GLY m 65 -1.661 15.859 72.715 1.00 34.48 C ++ATOM 3598 O GLY m 65 -1.246 16.535 71.770 1.00 34.48 O ++ATOM 3599 N PRO m 66 -1.800 16.368 73.939 1.00 38.95 N ++ATOM 3600 CA PRO m 66 -1.453 17.769 74.208 1.00 38.95 C ++ATOM 3601 C PRO m 66 0.044 18.009 74.093 1.00 38.95 C ++ATOM 3602 O PRO m 66 0.844 17.441 74.837 1.00 38.95 O ++ATOM 3603 CB PRO m 66 -1.959 17.990 75.634 1.00 38.95 C ++ATOM 3604 CG PRO m 66 -3.034 17.014 75.787 1.00 38.95 C ++ATOM 3605 CD PRO m 66 -2.588 15.799 75.039 1.00 38.95 C ++ATOM 3606 N GLU m 67 0.404 18.854 73.140 1.00 50.79 N ++ATOM 3607 CA GLU m 67 1.774 19.236 72.860 1.00 50.79 C ++ATOM 3608 C GLU m 67 2.082 20.534 73.588 1.00 50.79 C ++ATOM 3609 O GLU m 67 1.230 21.421 73.674 1.00 50.79 O ++ATOM 3610 CB GLU m 67 1.957 19.403 71.352 1.00 50.79 C ++ATOM 3611 CG GLU m 67 3.349 19.750 70.885 1.00 50.79 C ++ATOM 3612 CD GLU m 67 3.428 19.830 69.376 1.00 50.79 C ++ATOM 3613 OE1 GLU m 67 2.385 19.614 68.723 1.00 50.79 O ++ATOM 3614 OE2 GLU m 67 4.524 20.107 68.844 1.00 50.79 O ++ATOM 3615 N LEU m 68 3.295 20.640 74.119 1.00 51.88 N ++ATOM 3616 CA LEU m 68 3.690 21.816 74.882 1.00 51.88 C ++ATOM 3617 C LEU m 68 4.137 22.941 73.958 1.00 51.88 C ++ATOM 3618 O LEU m 68 4.789 22.699 72.940 1.00 51.88 O ++ATOM 3619 CB LEU m 68 4.812 21.450 75.850 1.00 51.88 C ++ATOM 3620 CG LEU m 68 5.326 22.547 76.771 1.00 51.88 C ++ATOM 3621 CD1 LEU m 68 4.184 23.090 77.580 1.00 51.88 C ++ATOM 3622 CD2 LEU m 68 6.397 21.999 77.679 1.00 51.88 C ++ATOM 3623 N LEU m 69 3.781 24.179 74.314 1.00 52.89 N ++ATOM 3624 CA LEU m 69 4.214 25.349 73.560 1.00 52.89 C ++ATOM 3625 C LEU m 69 5.200 26.217 74.330 1.00 52.89 C ++ATOM 3626 O LEU m 69 6.318 26.442 73.861 1.00 52.89 O ++ATOM 3627 CB LEU m 69 3.012 26.205 73.151 1.00 52.89 C ++ATOM 3628 CG LEU m 69 2.007 25.629 72.170 1.00 52.89 C ++ATOM 3629 CD1 LEU m 69 0.934 26.663 71.911 1.00 52.89 C ++ATOM 3630 CD2 LEU m 69 2.690 25.211 70.887 1.00 52.89 C ++ATOM 3631 N MET m 70 4.814 26.729 75.497 1.00 69.81 N ++ATOM 3632 CA MET m 70 5.628 27.691 76.225 1.00 69.81 C ++ATOM 3633 C MET m 70 5.648 27.355 77.709 1.00 69.81 C ++ATOM 3634 O MET m 70 4.656 26.891 78.280 1.00 69.81 O ++ATOM 3635 CB MET m 70 5.123 29.132 76.041 1.00 69.81 C ++ATOM 3636 CG MET m 70 5.148 29.634 74.606 1.00 69.81 C ++ATOM 3637 SD MET m 70 4.664 31.349 74.408 1.00 69.81 S ++ATOM 3638 CE MET m 70 6.184 32.162 74.868 1.00 69.81 C ++ATOM 3639 N TYR m 71 6.799 27.627 78.328 1.00 83.87 N ++ATOM 3640 CA TYR m 71 7.017 27.307 79.738 1.00 83.87 C ++ATOM 3641 C TYR m 71 7.801 28.458 80.363 1.00 83.87 C ++ATOM 3642 O TYR m 71 8.998 28.602 80.104 1.00 83.87 O ++ATOM 3643 CB TYR m 71 7.759 25.989 79.887 1.00 83.87 C ++ATOM 3644 CG TYR m 71 8.120 25.657 81.314 1.00 83.87 C ++ATOM 3645 CD1 TYR m 71 7.156 25.218 82.208 1.00 83.87 C ++ATOM 3646 CD2 TYR m 71 9.428 25.782 81.765 1.00 83.87 C ++ATOM 3647 CE1 TYR m 71 7.483 24.913 83.512 1.00 83.87 C ++ATOM 3648 CE2 TYR m 71 9.763 25.481 83.069 1.00 83.87 C ++ATOM 3649 CZ TYR m 71 8.785 25.046 83.939 1.00 83.87 C ++ATOM 3650 OH TYR m 71 9.110 24.742 85.240 1.00 83.87 O ++ATOM 3651 N THR m 72 7.128 29.259 81.180 1.00 89.83 N ++ATOM 3652 CA THR m 72 7.760 30.357 81.891 1.00 89.83 C ++ATOM 3653 C THR m 72 7.621 30.135 83.390 1.00 89.83 C ++ATOM 3654 O THR m 72 6.857 29.284 83.848 1.00 89.83 O ++ATOM 3655 CB THR m 72 7.143 31.698 81.483 1.00 89.83 C ++ATOM 3656 OG1 THR m 72 7.802 32.767 82.174 1.00 89.83 O ++ATOM 3657 CG2 THR m 72 5.669 31.712 81.801 1.00 89.83 C ++ATOM 3658 N TYR m 73 8.380 30.913 84.161 1.00 98.33 N ++ATOM 3659 CA TYR m 73 8.384 30.784 85.613 1.00 98.33 C ++ATOM 3660 C TYR m 73 8.293 32.108 86.361 1.00 98.33 C ++ATOM 3661 O TYR m 73 8.180 32.085 87.592 1.00 98.33 O ++ATOM 3662 CB TYR m 73 9.638 30.024 86.080 1.00 98.33 C ++ATOM 3663 CG TYR m 73 10.957 30.706 85.767 1.00 98.33 C ++ATOM 3664 CD1 TYR m 73 11.594 30.511 84.545 1.00 98.33 C ++ATOM 3665 CD2 TYR m 73 11.583 31.520 86.708 1.00 98.33 C ++ATOM 3666 CE1 TYR m 73 12.802 31.131 84.260 1.00 98.33 C ++ATOM 3667 CE2 TYR m 73 12.788 32.146 86.432 1.00 98.33 C ++ATOM 3668 CZ TYR m 73 13.393 31.946 85.211 1.00 98.33 C ++ATOM 3669 OH TYR m 73 14.593 32.567 84.948 1.00 98.33 O ++ATOM 3670 N SER m 74 8.351 33.248 85.680 1.00 89.77 N ++ATOM 3671 CA SER m 74 8.319 34.551 86.322 1.00 89.77 C ++ATOM 3672 C SER m 74 7.116 35.358 85.849 1.00 89.77 C ++ATOM 3673 O SER m 74 6.465 35.027 84.855 1.00 89.77 O ++ATOM 3674 CB SER m 74 9.607 35.333 86.040 1.00 89.77 C ++ATOM 3675 OG SER m 74 9.552 36.620 86.629 1.00 89.77 O ++ATOM 3676 N SER m 75 6.832 36.431 86.581 1.00 83.68 N ++ATOM 3677 CA SER m 75 5.741 37.333 86.237 1.00 83.68 C ++ATOM 3678 C SER m 75 6.225 38.344 85.207 1.00 83.68 C ++ATOM 3679 O SER m 75 7.202 39.058 85.449 1.00 83.68 O ++ATOM 3680 CB SER m 75 5.228 38.037 87.490 1.00 83.68 C ++ATOM 3681 OG SER m 75 4.173 38.927 87.177 1.00 83.68 O ++ATOM 3682 N GLY m 76 5.547 38.412 84.061 1.00 79.90 N ++ATOM 3683 CA GLY m 76 6.013 39.286 83.001 1.00 79.90 C ++ATOM 3684 C GLY m 76 5.734 38.797 81.594 1.00 79.90 C ++ATOM 3685 O GLY m 76 4.604 38.410 81.287 1.00 79.90 O ++ATOM 3686 N ASN m 77 6.755 38.800 80.733 1.00 79.77 N ++ATOM 3687 CA ASN m 77 6.591 38.533 79.311 1.00 79.77 C ++ATOM 3688 C ASN m 77 7.657 37.551 78.847 1.00 79.77 C ++ATOM 3689 O ASN m 77 8.785 37.562 79.347 1.00 79.77 O ++ATOM 3690 CB ASN m 77 6.720 39.821 78.487 1.00 79.77 C ++ATOM 3691 CG ASN m 77 5.739 40.893 78.917 1.00 79.77 C ++ATOM 3692 OD1 ASN m 77 4.592 40.609 79.242 1.00 79.77 O ++ATOM 3693 ND2 ASN m 77 6.195 42.139 78.923 1.00 79.77 N ++ATOM 3694 N LYS m 78 7.298 36.711 77.875 1.00 80.80 N ++ATOM 3695 CA LYS m 78 8.281 35.869 77.202 1.00 80.80 C ++ATOM 3696 C LYS m 78 7.749 35.543 75.810 1.00 80.80 C ++ATOM 3697 O LYS m 78 6.537 35.464 75.599 1.00 80.80 O ++ATOM 3698 CB LYS m 78 8.588 34.597 78.019 1.00 80.80 C ++ATOM 3699 CG LYS m 78 9.875 33.856 77.623 1.00 80.80 C ++ATOM 3700 CD LYS m 78 9.667 32.720 76.641 1.00 80.80 C ++ATOM 3701 CE LYS m 78 8.959 31.565 77.310 1.00 80.80 C ++ATOM 3702 NZ LYS m 78 9.800 30.962 78.382 1.00 80.80 N ++ATOM 3703 N GLU m 79 8.668 35.383 74.858 1.00 78.88 N ++ATOM 3704 CA GLU m 79 8.323 35.197 73.454 1.00 78.88 C ++ATOM 3705 C GLU m 79 9.089 34.013 72.886 1.00 78.88 C ++ATOM 3706 O GLU m 79 10.316 33.959 72.996 1.00 78.88 O ++ATOM 3707 CB GLU m 79 8.652 36.454 72.639 1.00 78.88 C ++ATOM 3708 CG GLU m 79 7.847 37.700 72.999 1.00 78.88 C ++ATOM 3709 CD GLU m 79 8.269 38.919 72.192 1.00 78.88 C ++ATOM 3710 OE1 GLU m 79 9.266 38.824 71.445 1.00 78.88 O ++ATOM 3711 OE2 GLU m 79 7.606 39.970 72.304 1.00 78.88 O ++ATOM 3712 N ASP m 80 8.368 33.078 72.267 1.00 86.70 N ++ATOM 3713 CA ASP m 80 8.968 31.968 71.529 1.00 86.70 C ++ATOM 3714 C ASP m 80 8.281 31.848 70.178 1.00 86.70 C ++ATOM 3715 O ASP m 80 7.053 31.720 70.114 1.00 86.70 O ++ATOM 3716 CB ASP m 80 8.862 30.647 72.297 1.00 86.70 C ++ATOM 3717 CG ASP m 80 9.866 30.544 73.432 1.00 86.70 C ++ATOM 3718 OD1 ASP m 80 10.951 31.151 73.324 1.00 86.70 O ++ATOM 3719 OD2 ASP m 80 9.582 29.840 74.423 1.00 86.70 O ++ATOM 3720 N GLY m 81 9.073 31.878 69.107 1.00 84.10 N ++ATOM 3721 CA GLY m 81 8.552 31.787 67.757 1.00 84.10 C ++ATOM 3722 C GLY m 81 7.687 32.969 67.379 1.00 84.10 C ++ATOM 3723 O GLY m 81 8.182 34.084 67.199 1.00 84.10 O ++ATOM 3724 N ARG m 82 6.384 32.729 67.255 1.00 77.77 N ++ATOM 3725 CA ARG m 82 5.410 33.793 67.056 1.00 77.77 C ++ATOM 3726 C ARG m 82 4.395 33.850 68.187 1.00 77.77 C ++ATOM 3727 O ARG m 82 3.359 34.511 68.050 1.00 77.77 O ++ATOM 3728 CB ARG m 82 4.700 33.619 65.714 1.00 77.77 C ++ATOM 3729 CG ARG m 82 3.890 32.355 65.604 1.00 77.77 C ++ATOM 3730 CD ARG m 82 3.234 32.271 64.246 1.00 77.77 C ++ATOM 3731 NE ARG m 82 2.416 31.074 64.111 1.00 77.77 N ++ATOM 3732 CZ ARG m 82 1.698 30.786 63.034 1.00 77.77 C ++ATOM 3733 NH1 ARG m 82 1.702 31.613 62.000 1.00 77.77 N ++ATOM 3734 NH2 ARG m 82 0.979 29.676 62.991 1.00 77.77 N ++ATOM 3735 N PHE m 83 4.667 33.187 69.300 1.00 75.20 N ++ATOM 3736 CA PHE m 83 3.764 33.150 70.437 1.00 75.20 C ++ATOM 3737 C PHE m 83 4.295 34.074 71.527 1.00 75.20 C ++ATOM 3738 O PHE m 83 5.454 34.491 71.505 1.00 75.20 O ++ATOM 3739 CB PHE m 83 3.633 31.718 70.960 1.00 75.20 C ++ATOM 3740 CG PHE m 83 2.998 30.755 69.989 1.00 75.20 C ++ATOM 3741 CD1 PHE m 83 2.204 31.199 68.942 1.00 75.20 C ++ATOM 3742 CD2 PHE m 83 3.216 29.399 70.120 1.00 75.20 C ++ATOM 3743 CE1 PHE m 83 1.637 30.306 68.057 1.00 75.20 C ++ATOM 3744 CE2 PHE m 83 2.651 28.504 69.239 1.00 75.20 C ++ATOM 3745 CZ PHE m 83 1.860 28.958 68.207 1.00 75.20 C ++ATOM 3746 N THR m 84 3.437 34.405 72.489 1.00 72.73 N ++ATOM 3747 CA THR m 84 3.847 35.276 73.588 1.00 72.73 C ++ATOM 3748 C THR m 84 3.098 34.895 74.854 1.00 72.73 C ++ATOM 3749 O THR m 84 1.875 35.036 74.916 1.00 72.73 O ++ATOM 3750 CB THR m 84 3.594 36.749 73.258 1.00 72.73 C ++ATOM 3751 OG1 THR m 84 4.370 37.133 72.117 1.00 72.73 O ++ATOM 3752 CG2 THR m 84 3.972 37.621 74.438 1.00 72.73 C ++ATOM 3753 N ALA m 85 3.825 34.439 75.865 1.00 72.12 N ++ATOM 3754 CA ALA m 85 3.232 34.085 77.147 1.00 72.12 C ++ATOM 3755 C ALA m 85 3.487 35.203 78.143 1.00 72.12 C ++ATOM 3756 O ALA m 85 4.636 35.613 78.343 1.00 72.12 O ++ATOM 3757 CB ALA m 85 3.795 32.769 77.682 1.00 72.12 C ++ATOM 3758 N GLN m 86 2.419 35.693 78.763 1.00 76.84 N ++ATOM 3759 CA GLN m 86 2.506 36.742 79.762 1.00 76.84 C ++ATOM 3760 C GLN m 86 1.900 36.249 81.065 1.00 76.84 C ++ATOM 3761 O GLN m 86 0.917 35.504 81.062 1.00 76.84 O ++ATOM 3762 CB GLN m 86 1.793 38.009 79.303 1.00 76.84 C ++ATOM 3763 CG GLN m 86 2.370 38.603 78.041 1.00 76.84 C ++ATOM 3764 CD GLN m 86 1.748 39.936 77.709 1.00 76.84 C ++ATOM 3765 OE1 GLN m 86 0.862 40.410 78.419 1.00 76.84 O ++ATOM 3766 NE2 GLN m 86 2.203 40.550 76.625 1.00 76.84 N ++ATOM 3767 N VAL m 87 2.501 36.661 82.173 1.00 80.03 N ++ATOM 3768 CA VAL m 87 2.083 36.253 83.506 1.00 80.03 C ++ATOM 3769 C VAL m 87 1.778 37.510 84.302 1.00 80.03 C ++ATOM 3770 O VAL m 87 2.600 38.434 84.338 1.00 80.03 O ++ATOM 3771 CB VAL m 87 3.168 35.413 84.208 1.00 80.03 C ++ATOM 3772 CG1 VAL m 87 2.765 35.082 85.630 1.00 80.03 C ++ATOM 3773 CG2 VAL m 87 3.426 34.141 83.442 1.00 80.03 C ++ATOM 3774 N ASP m 88 0.611 37.539 84.952 1.00 83.78 N ++ATOM 3775 CA ASP m 88 0.168 38.675 85.749 1.00 83.78 C ++ATOM 3776 C ASP m 88 -0.119 38.154 87.152 1.00 83.78 C ++ATOM 3777 O ASP m 88 -1.243 37.730 87.445 1.00 83.78 O ++ATOM 3778 CB ASP m 88 -1.074 39.307 85.130 1.00 83.78 C ++ATOM 3779 CG ASP m 88 -0.831 39.814 83.724 1.00 83.78 C ++ATOM 3780 OD1 ASP m 88 0.315 40.198 83.419 1.00 83.78 O ++ATOM 3781 OD2 ASP m 88 -1.789 39.818 82.922 1.00 83.78 O ++ATOM 3782 N LYS m 89 0.896 38.171 88.019 1.00 82.20 N ++ATOM 3783 CA LYS m 89 0.697 37.748 89.398 1.00 82.20 C ++ATOM 3784 C LYS m 89 -0.056 38.780 90.221 1.00 82.20 C ++ATOM 3785 O LYS m 89 -0.745 38.406 91.176 1.00 82.20 O ++ATOM 3786 CB LYS m 89 2.037 37.445 90.070 1.00 82.20 C ++ATOM 3787 CG LYS m 89 2.719 36.182 89.576 1.00 82.20 C ++ATOM 3788 CD LYS m 89 3.998 35.915 90.354 1.00 82.20 C ++ATOM 3789 CE LYS m 89 4.703 34.662 89.863 1.00 82.20 C ++ATOM 3790 NZ LYS m 89 5.960 34.409 90.619 1.00 82.20 N ++ATOM 3791 N SER m 90 0.063 40.064 89.885 1.00 81.11 N ++ATOM 3792 CA SER m 90 -0.717 41.080 90.580 1.00 81.11 C ++ATOM 3793 C SER m 90 -2.164 41.063 90.104 1.00 81.11 C ++ATOM 3794 O SER m 90 -3.097 41.068 90.914 1.00 81.11 O ++ATOM 3795 CB SER m 90 -0.088 42.458 90.372 1.00 81.11 C ++ATOM 3796 OG SER m 90 -0.829 43.468 91.034 1.00 81.11 O ++ATOM 3797 N SER m 91 -2.365 41.024 88.790 1.00 83.76 N ++ATOM 3798 CA SER m 91 -3.695 40.880 88.216 1.00 83.76 C ++ATOM 3799 C SER m 91 -4.223 39.457 88.315 1.00 83.76 C ++ATOM 3800 O SER m 91 -5.422 39.248 88.084 1.00 83.76 O ++ATOM 3801 CB SER m 91 -3.683 41.328 86.753 1.00 83.76 C ++ATOM 3802 OG SER m 91 -3.346 42.698 86.635 1.00 83.76 O ++ATOM 3803 N LYS m 92 -3.344 38.493 88.625 1.00 87.50 N ++ATOM 3804 CA LYS m 92 -3.684 37.091 88.902 1.00 87.50 C ++ATOM 3805 C LYS m 92 -4.348 36.404 87.709 1.00 87.50 C ++ATOM 3806 O LYS m 92 -5.333 35.677 87.857 1.00 87.50 O ++ATOM 3807 CB LYS m 92 -4.551 36.958 90.160 1.00 87.50 C ++ATOM 3808 CG LYS m 92 -3.824 37.299 91.445 1.00 87.50 C ++ATOM 3809 CD LYS m 92 -4.703 37.090 92.663 1.00 87.50 C ++ATOM 3810 CE LYS m 92 -3.987 37.516 93.933 1.00 87.50 C ++ATOM 3811 NZ LYS m 92 -2.829 36.630 94.229 1.00 87.50 N ++ATOM 3812 N TYR m 93 -3.796 36.630 86.518 1.00 80.83 N ++ATOM 3813 CA TYR m 93 -4.163 35.821 85.365 1.00 80.83 C ++ATOM 3814 C TYR m 93 -2.989 35.764 84.400 1.00 80.83 C ++ATOM 3815 O TYR m 93 -2.130 36.651 84.384 1.00 80.83 O ++ATOM 3816 CB TYR m 93 -5.437 36.326 84.661 1.00 80.83 C ++ATOM 3817 CG TYR m 93 -5.363 37.662 83.962 1.00 80.83 C ++ATOM 3818 CD1 TYR m 93 -5.661 38.836 84.637 1.00 80.83 C ++ATOM 3819 CD2 TYR m 93 -5.054 37.745 82.608 1.00 80.83 C ++ATOM 3820 CE1 TYR m 93 -5.619 40.060 83.992 1.00 80.83 C ++ATOM 3821 CE2 TYR m 93 -5.005 38.964 81.957 1.00 80.83 C ++ATOM 3822 CZ TYR m 93 -5.289 40.118 82.653 1.00 80.83 C ++ATOM 3823 OH TYR m 93 -5.244 41.335 82.012 1.00 80.83 O ++ATOM 3824 N ILE m 94 -2.941 34.697 83.616 1.00 74.22 N ++ATOM 3825 CA ILE m 94 -1.902 34.546 82.610 1.00 74.22 C ++ATOM 3826 C ILE m 94 -2.556 34.586 81.243 1.00 74.22 C ++ATOM 3827 O ILE m 94 -3.754 34.348 81.093 1.00 74.22 O ++ATOM 3828 CB ILE m 94 -1.075 33.263 82.791 1.00 74.22 C ++ATOM 3829 CG1 ILE m 94 -1.949 32.028 82.613 1.00 74.22 C ++ATOM 3830 CG2 ILE m 94 -0.434 33.254 84.155 1.00 74.22 C ++ATOM 3831 CD1 ILE m 94 -1.160 30.749 82.564 1.00 74.22 C ++ATOM 3832 N SER m 95 -1.755 34.899 80.231 1.00 63.12 N ++ATOM 3833 CA SER m 95 -2.294 35.194 78.917 1.00 63.12 C ++ATOM 3834 C SER m 95 -1.361 34.678 77.834 1.00 63.12 C ++ATOM 3835 O SER m 95 -0.148 34.576 78.021 1.00 63.12 O ++ATOM 3836 CB SER m 95 -2.519 36.696 78.740 1.00 63.12 C ++ATOM 3837 OG SER m 95 -3.013 36.977 77.448 1.00 63.12 O ++ATOM 3838 N LEU m 96 -1.956 34.368 76.690 1.00 58.23 N ++ATOM 3839 CA LEU m 96 -1.232 33.902 75.516 1.00 58.23 C ++ATOM 3840 C LEU m 96 -1.644 34.755 74.329 1.00 58.23 C ++ATOM 3841 O LEU m 96 -2.839 34.928 74.074 1.00 58.23 O ++ATOM 3842 CB LEU m 96 -1.514 32.427 75.242 1.00 58.23 C ++ATOM 3843 CG LEU m 96 -0.750 31.831 74.063 1.00 58.23 C ++ATOM 3844 CD1 LEU m 96 0.735 31.936 74.310 1.00 58.23 C ++ATOM 3845 CD2 LEU m 96 -1.140 30.385 73.860 1.00 58.23 C ++ATOM 3846 N PHE m 97 -0.659 35.290 73.619 1.00 62.33 N ++ATOM 3847 CA PHE m 97 -0.872 36.137 72.458 1.00 62.33 C ++ATOM 3848 C PHE m 97 -0.268 35.470 71.234 1.00 62.33 C ++ATOM 3849 O PHE m 97 0.824 34.898 71.303 1.00 62.33 O ++ATOM 3850 CB PHE m 97 -0.247 37.516 72.660 1.00 62.33 C ++ATOM 3851 CG PHE m 97 -0.948 38.351 73.684 1.00 62.33 C ++ATOM 3852 CD1 PHE m 97 -2.077 39.078 73.345 1.00 62.33 C ++ATOM 3853 CD2 PHE m 97 -0.492 38.401 74.989 1.00 62.33 C ++ATOM 3854 CE1 PHE m 97 -2.732 39.848 74.285 1.00 62.33 C ++ATOM 3855 CE2 PHE m 97 -1.147 39.168 75.934 1.00 62.33 C ++ATOM 3856 CZ PHE m 97 -2.269 39.890 75.581 1.00 62.33 C ++ATOM 3857 N ILE m 98 -0.986 35.541 70.118 1.00 63.08 N ++ATOM 3858 CA ILE m 98 -0.553 34.939 68.862 1.00 63.08 C ++ATOM 3859 C ILE m 98 -0.632 35.988 67.763 1.00 63.08 C ++ATOM 3860 O ILE m 98 -1.660 36.656 67.610 1.00 63.08 O ++ATOM 3861 CB ILE m 98 -1.403 33.705 68.498 1.00 63.08 C ++ATOM 3862 CG1 ILE m 98 -1.187 32.585 69.510 1.00 63.08 C ++ATOM 3863 CG2 ILE m 98 -1.083 33.197 67.104 1.00 63.08 C ++ATOM 3864 CD1 ILE m 98 -2.119 31.439 69.326 1.00 63.08 C ++ATOM 3865 N ARG m 99 0.451 36.147 67.011 1.00 74.13 N ++ATOM 3866 CA ARG m 99 0.458 37.005 65.838 1.00 74.13 C ++ATOM 3867 C ARG m 99 0.561 36.163 64.572 1.00 74.13 C ++ATOM 3868 O ARG m 99 1.148 35.076 64.576 1.00 74.13 O ++ATOM 3869 CB ARG m 99 1.606 38.015 65.906 1.00 74.13 C ++ATOM 3870 CG ARG m 99 2.995 37.403 65.897 1.00 74.13 C ++ATOM 3871 CD ARG m 99 4.047 38.470 66.094 1.00 74.13 C ++ATOM 3872 NE ARG m 99 3.828 39.153 67.363 1.00 74.13 N ++ATOM 3873 CZ ARG m 99 4.274 38.715 68.534 1.00 74.13 C ++ATOM 3874 NH1 ARG m 99 4.973 37.590 68.603 1.00 74.13 N ++ATOM 3875 NH2 ARG m 99 4.018 39.402 69.638 1.00 74.13 N ++ATOM 3876 N ASP m 100 -0.034 36.687 63.496 1.00 75.77 N ++ATOM 3877 CA ASP m 100 -0.173 36.028 62.193 1.00 75.77 C ++ATOM 3878 C ASP m 100 -0.823 34.653 62.337 1.00 75.77 C ++ATOM 3879 O ASP m 100 -0.225 33.611 62.060 1.00 75.77 O ++ATOM 3880 CB ASP m 100 1.174 35.939 61.472 1.00 75.77 C ++ATOM 3881 CG ASP m 100 1.686 37.293 61.041 1.00 75.77 C ++ATOM 3882 OD1 ASP m 100 0.849 38.181 60.768 1.00 75.77 O ++ATOM 3883 OD2 ASP m 100 2.921 37.477 60.985 1.00 75.77 O ++ATOM 3884 N SER m 101 -2.070 34.676 62.800 1.00 63.76 N ++ATOM 3885 CA SER m 101 -2.810 33.459 63.110 1.00 63.76 C ++ATOM 3886 C SER m 101 -3.172 32.731 61.825 1.00 63.76 C ++ATOM 3887 O SER m 101 -4.073 33.153 61.094 1.00 63.76 O ++ATOM 3888 CB SER m 101 -4.057 33.803 63.915 1.00 63.76 C ++ATOM 3889 OG SER m 101 -4.934 34.610 63.152 1.00 63.76 O ++ATOM 3890 N GLN m 102 -2.462 31.648 61.543 1.00 56.82 N ++ATOM 3891 CA GLN m 102 -2.775 30.784 60.422 1.00 56.82 C ++ATOM 3892 C GLN m 102 -4.071 30.029 60.677 1.00 56.82 C ++ATOM 3893 O GLN m 102 -4.497 29.882 61.822 1.00 56.82 O ++ATOM 3894 CB GLN m 102 -1.638 29.793 60.193 1.00 56.82 C ++ATOM 3895 CG GLN m 102 -0.375 30.408 59.641 1.00 56.82 C ++ATOM 3896 CD GLN m 102 -0.542 30.884 58.212 1.00 56.82 C ++ATOM 3897 OE1 GLN m 102 -1.183 30.220 57.398 1.00 56.82 O ++ATOM 3898 NE2 GLN m 102 0.032 32.039 57.901 1.00 56.82 N ++ATOM 3899 N PRO m 103 -4.724 29.537 59.622 1.00 48.82 N ++ATOM 3900 CA PRO m 103 -5.842 28.606 59.826 1.00 48.82 C ++ATOM 3901 C PRO m 103 -5.418 27.259 60.372 1.00 48.82 C ++ATOM 3902 O PRO m 103 -6.279 26.511 60.851 1.00 48.82 O ++ATOM 3903 CB PRO m 103 -6.436 28.461 58.423 1.00 48.82 C ++ATOM 3904 CG PRO m 103 -6.031 29.687 57.719 1.00 48.82 C ++ATOM 3905 CD PRO m 103 -4.674 30.021 58.235 1.00 48.82 C ++ATOM 3906 N SER m 104 -4.132 26.920 60.320 1.00 50.71 N ++ATOM 3907 CA SER m 104 -3.634 25.653 60.830 1.00 50.71 C ++ATOM 3908 C SER m 104 -3.251 25.722 62.301 1.00 50.71 C ++ATOM 3909 O SER m 104 -2.419 24.928 62.750 1.00 50.71 O ++ATOM 3910 CB SER m 104 -2.439 25.181 60.002 1.00 50.71 C ++ATOM 3911 OG SER m 104 -2.821 24.874 58.670 1.00 50.71 O ++ATOM 3912 N ASP m 105 -3.821 26.658 63.057 1.00 50.73 N ++ATOM 3913 CA ASP m 105 -3.669 26.673 64.505 1.00 50.73 C ++ATOM 3914 C ASP m 105 -5.002 26.559 65.224 1.00 50.73 C ++ATOM 3915 O ASP m 105 -5.094 26.935 66.394 1.00 50.73 O ++ATOM 3916 CB ASP m 105 -2.938 27.933 64.966 1.00 50.73 C ++ATOM 3917 CG ASP m 105 -1.465 27.900 64.629 1.00 50.73 C ++ATOM 3918 OD1 ASP m 105 -0.911 26.787 64.515 1.00 50.73 O ++ATOM 3919 OD2 ASP m 105 -0.856 28.981 64.494 1.00 50.73 O ++ATOM 3920 N SER m 106 -6.034 26.059 64.555 1.00 43.84 N ++ATOM 3921 CA SER m 106 -7.316 25.821 65.204 1.00 43.84 C ++ATOM 3922 C SER m 106 -7.179 24.627 66.132 1.00 43.84 C ++ATOM 3923 O SER m 106 -7.047 23.491 65.670 1.00 43.84 O ++ATOM 3924 CB SER m 106 -8.396 25.575 64.156 1.00 43.84 C ++ATOM 3925 OG SER m 106 -8.590 26.724 63.356 1.00 43.84 O ++ATOM 3926 N ALA m 107 -7.214 24.870 67.438 1.00 40.45 N ++ATOM 3927 CA ALA m 107 -6.873 23.813 68.384 1.00 40.45 C ++ATOM 3928 C ALA m 107 -7.467 24.149 69.741 1.00 40.45 C ++ATOM 3929 O ALA m 107 -8.032 25.224 69.941 1.00 40.45 O ++ATOM 3930 CB ALA m 107 -5.360 23.633 68.481 1.00 40.45 C ++ATOM 3931 N THR m 108 -7.333 23.221 70.681 1.00 37.99 N ++ATOM 3932 CA THR m 108 -7.756 23.441 72.053 1.00 37.99 C ++ATOM 3933 C THR m 108 -6.528 23.817 72.862 1.00 37.99 C ++ATOM 3934 O THR m 108 -5.585 23.025 72.970 1.00 37.99 O ++ATOM 3935 CB THR m 108 -8.420 22.195 72.632 1.00 37.99 C ++ATOM 3936 OG1 THR m 108 -9.576 21.864 71.857 1.00 37.99 O ++ATOM 3937 CG2 THR m 108 -8.845 22.440 74.054 1.00 37.99 C ++ATOM 3938 N TYR m 109 -6.523 25.023 73.411 1.00 40.36 N ++ATOM 3939 CA TYR m 109 -5.407 25.501 74.211 1.00 40.36 C ++ATOM 3940 C TYR m 109 -5.704 25.276 75.685 1.00 40.36 C ++ATOM 3941 O TYR m 109 -6.735 25.728 76.192 1.00 40.36 O ++ATOM 3942 CB TYR m 109 -5.137 26.978 73.939 1.00 40.36 C ++ATOM 3943 CG TYR m 109 -4.536 27.251 72.583 1.00 40.36 C ++ATOM 3944 CD1 TYR m 109 -3.902 26.257 71.863 1.00 40.36 C ++ATOM 3945 CD2 TYR m 109 -4.612 28.507 72.019 1.00 40.36 C ++ATOM 3946 CE1 TYR m 109 -3.357 26.515 70.628 1.00 40.36 C ++ATOM 3947 CE2 TYR m 109 -4.070 28.763 70.780 1.00 40.36 C ++ATOM 3948 CZ TYR m 109 -3.443 27.762 70.094 1.00 40.36 C ++ATOM 3949 OH TYR m 109 -2.902 28.015 68.864 1.00 40.36 O ++ATOM 3950 N LEU m 110 -4.811 24.569 76.363 1.00 41.62 N ++ATOM 3951 CA LEU m 110 -4.933 24.281 77.780 1.00 41.62 C ++ATOM 3952 C LEU m 110 -3.842 25.044 78.506 1.00 41.62 C ++ATOM 3953 O LEU m 110 -2.743 25.206 77.978 1.00 41.62 O ++ATOM 3954 CB LEU m 110 -4.786 22.786 78.069 1.00 41.62 C ++ATOM 3955 CG LEU m 110 -5.895 21.776 77.765 1.00 41.62 C ++ATOM 3956 CD1 LEU m 110 -5.976 21.446 76.294 1.00 41.62 C ++ATOM 3957 CD2 LEU m 110 -5.682 20.511 78.555 1.00 41.62 C ++ATOM 3958 N CYS m 111 -4.136 25.528 79.703 1.00 57.42 N ++ATOM 3959 CA CYS m 111 -3.124 26.187 80.509 1.00 57.42 C ++ATOM 3960 C CYS m 111 -2.878 25.394 81.781 1.00 57.42 C ++ATOM 3961 O CYS m 111 -3.788 24.773 82.333 1.00 57.42 O ++ATOM 3962 CB CYS m 111 -3.529 27.619 80.848 1.00 57.42 C ++ATOM 3963 SG CYS m 111 -5.038 27.755 81.792 1.00 57.42 S ++ATOM 3964 N ALA m 112 -1.633 25.422 82.247 1.00 67.42 N ++ATOM 3965 CA ALA m 112 -1.237 24.564 83.345 1.00 67.42 C ++ATOM 3966 C ALA m 112 -0.312 25.319 84.278 1.00 67.42 C ++ATOM 3967 O ALA m 112 0.596 26.031 83.836 1.00 67.42 O ++ATOM 3968 CB ALA m 112 -0.546 23.300 82.838 1.00 67.42 C ++ATOM 3969 N MET m 113 -0.565 25.160 85.571 1.00 79.02 N ++ATOM 3970 CA MET m 113 0.323 25.658 86.605 1.00 79.02 C ++ATOM 3971 C MET m 113 0.185 24.749 87.812 1.00 79.02 C ++ATOM 3972 O MET m 113 -0.790 24.002 87.939 1.00 79.02 O ++ATOM 3973 CB MET m 113 0.005 27.103 86.991 1.00 79.02 C ++ATOM 3974 CG MET m 113 -1.243 27.277 87.836 1.00 79.02 C ++ATOM 3975 SD MET m 113 -2.757 27.044 86.906 1.00 79.02 S ++ATOM 3976 CE MET m 113 -2.700 28.501 85.871 1.00 79.02 C ++ATOM 3977 N SER m 114 1.173 24.822 88.694 1.00 86.68 N ++ATOM 3978 CA SER m 114 1.110 24.144 89.979 1.00 86.68 C ++ATOM 3979 C SER m 114 2.052 24.855 90.936 1.00 86.68 C ++ATOM 3980 O SER m 114 2.589 25.926 90.632 1.00 86.68 O ++ATOM 3981 CB SER m 114 1.479 22.665 89.860 1.00 86.68 C ++ATOM 3982 OG SER m 114 2.854 22.512 89.580 1.00 86.68 O ++ATOM 3983 N LYS m 115 2.270 24.242 92.089 1.00 90.60 N ++ATOM 3984 CA LYS m 115 3.223 24.727 93.068 1.00 90.60 C ++ATOM 3985 C LYS m 115 4.622 24.273 92.659 1.00 90.60 C ++ATOM 3986 O LYS m 115 4.854 23.826 91.532 1.00 90.60 O ++ATOM 3987 CB LYS m 115 2.830 24.235 94.457 1.00 90.60 C ++ATOM 3988 CG LYS m 115 1.412 24.611 94.853 1.00 90.60 C ++ATOM 3989 CD LYS m 115 1.264 26.104 95.050 1.00 90.60 C ++ATOM 3990 CE LYS m 115 -0.164 26.463 95.423 1.00 90.60 C ++ATOM 3991 NZ LYS m 115 -0.542 25.944 96.766 1.00 90.60 N ++ATOM 3992 N GLY m 116 5.584 24.387 93.573 1.00 87.95 N ++ATOM 3993 CA GLY m 116 6.932 23.955 93.261 1.00 87.95 C ++ATOM 3994 C GLY m 116 7.108 22.452 93.174 1.00 87.95 C ++ATOM 3995 O GLY m 116 8.082 21.991 92.570 1.00 87.95 O ++ATOM 3996 N TYR m 117 6.195 21.673 93.758 1.00 87.61 N ++ATOM 3997 CA TYR m 117 6.433 20.233 93.913 1.00 87.61 C ++ATOM 3998 C TYR m 117 5.830 19.396 92.789 1.00 87.61 C ++ATOM 3999 O TYR m 117 6.559 18.791 91.997 1.00 87.61 O ++ATOM 4000 CB TYR m 117 5.903 19.769 95.270 1.00 87.61 C ++ATOM 4001 N SER m 118 4.504 19.372 92.688 1.00 85.43 N ++ATOM 4002 CA SER m 118 3.814 18.407 91.827 1.00 85.43 C ++ATOM 4003 C SER m 118 2.379 18.873 91.611 1.00 85.43 C ++ATOM 4004 O SER m 118 2.029 20.020 91.913 1.00 85.43 O ++ATOM 4005 CB SER m 118 3.836 16.996 92.432 1.00 85.43 C ++ATOM 4006 OG SER m 118 5.140 16.442 92.481 1.00 85.43 O ++ATOM 4007 N THR m 119 1.555 17.960 91.077 1.00 77.43 N ++ATOM 4008 CA THR m 119 0.100 18.087 90.939 1.00 77.43 C ++ATOM 4009 C THR m 119 -0.271 19.305 90.082 1.00 77.43 C ++ATOM 4010 O THR m 119 -0.744 20.334 90.570 1.00 77.43 O ++ATOM 4011 CB THR m 119 -0.582 18.124 92.316 1.00 77.43 C ++ATOM 4012 OG1 THR m 119 -0.052 17.071 93.129 1.00 77.43 O ++ATOM 4013 CG2 THR m 119 -2.089 17.885 92.180 1.00 77.43 C ++ATOM 4014 N LEU m 120 0.059 19.187 88.796 1.00 67.63 N ++ATOM 4015 CA LEU m 120 -0.344 20.189 87.815 1.00 67.63 C ++ATOM 4016 C LEU m 120 -1.859 20.310 87.752 1.00 67.63 C ++ATOM 4017 O LEU m 120 -2.591 19.324 87.857 1.00 67.63 O ++ATOM 4018 CB LEU m 120 0.193 19.842 86.427 1.00 67.63 C ++ATOM 4019 CG LEU m 120 1.591 20.311 86.028 1.00 67.63 C ++ATOM 4020 CD1 LEU m 120 2.686 19.540 86.728 1.00 67.63 C ++ATOM 4021 CD2 LEU m 120 1.750 20.205 84.529 1.00 67.63 C ++ATOM 4022 N THR m 121 -2.328 21.542 87.592 1.00 59.26 N ++ATOM 4023 CA THR m 121 -3.747 21.827 87.459 1.00 59.26 C ++ATOM 4024 C THR m 121 -4.016 22.317 86.048 1.00 59.26 C ++ATOM 4025 O THR m 121 -3.430 23.310 85.610 1.00 59.26 O ++ATOM 4026 CB THR m 121 -4.204 22.874 88.469 1.00 59.26 C ++ATOM 4027 OG1 THR m 121 -3.887 22.430 89.791 1.00 59.26 O ++ATOM 4028 CG2 THR m 121 -5.702 23.064 88.369 1.00 59.26 C ++ATOM 4029 N PHE m 122 -4.893 21.617 85.344 1.00 50.27 N ++ATOM 4030 CA PHE m 122 -5.208 21.926 83.961 1.00 50.27 C ++ATOM 4031 C PHE m 122 -6.576 22.582 83.880 1.00 50.27 C ++ATOM 4032 O PHE m 122 -7.509 22.183 84.580 1.00 50.27 O ++ATOM 4033 CB PHE m 122 -5.179 20.661 83.104 1.00 50.27 C ++ATOM 4034 CG PHE m 122 -3.813 20.066 82.956 1.00 50.27 C ++ATOM 4035 CD1 PHE m 122 -2.941 20.537 81.995 1.00 50.27 C ++ATOM 4036 CD2 PHE m 122 -3.391 19.056 83.798 1.00 50.27 C ++ATOM 4037 CE1 PHE m 122 -1.683 20.001 81.863 1.00 50.27 C ++ATOM 4038 CE2 PHE m 122 -2.130 18.519 83.673 1.00 50.27 C ++ATOM 4039 CZ PHE m 122 -1.277 18.994 82.704 1.00 50.27 C ++ATOM 4040 N GLY m 123 -6.684 23.592 83.034 1.00 46.95 N ++ATOM 4041 CA GLY m 123 -7.974 24.161 82.732 1.00 46.95 C ++ATOM 4042 C GLY m 123 -8.765 23.276 81.797 1.00 46.95 C ++ATOM 4043 O GLY m 123 -8.309 22.236 81.331 1.00 46.95 O ++ATOM 4044 N LYS m 124 -9.989 23.706 81.510 1.00 48.48 N ++ATOM 4045 CA LYS m 124 -10.838 22.937 80.613 1.00 48.48 C ++ATOM 4046 C LYS m 124 -10.436 23.101 79.156 1.00 48.48 C ++ATOM 4047 O LYS m 124 -10.883 22.320 78.313 1.00 48.48 O ++ATOM 4048 CB LYS m 124 -12.298 23.345 80.800 1.00 48.48 C ++ATOM 4049 CG LYS m 124 -12.774 23.242 82.238 1.00 48.48 C ++ATOM 4050 CD LYS m 124 -12.818 21.805 82.715 1.00 48.48 C ++ATOM 4051 CE LYS m 124 -13.220 21.735 84.178 1.00 48.48 C ++ATOM 4052 NZ LYS m 124 -14.624 22.176 84.390 1.00 48.48 N ++ATOM 4053 N GLY m 125 -9.612 24.087 78.845 1.00 47.49 N ++ATOM 4054 CA GLY m 125 -9.158 24.274 77.480 1.00 47.49 C ++ATOM 4055 C GLY m 125 -10.136 25.086 76.663 1.00 47.49 C ++ATOM 4056 O GLY m 125 -11.348 25.049 76.865 1.00 47.49 O ++ATOM 4057 N THR m 126 -9.595 25.835 75.711 1.00 48.45 N ++ATOM 4058 CA THR m 126 -10.379 26.773 74.925 1.00 48.45 C ++ATOM 4059 C THR m 126 -10.221 26.447 73.451 1.00 48.45 C ++ATOM 4060 O THR m 126 -9.094 26.349 72.958 1.00 48.45 O ++ATOM 4061 CB THR m 126 -9.933 28.207 75.193 1.00 48.45 C ++ATOM 4062 OG1 THR m 126 -10.024 28.472 76.594 1.00 48.45 O ++ATOM 4063 CG2 THR m 126 -10.823 29.175 74.463 1.00 48.45 C ++ATOM 4064 N MET m 127 -11.341 26.257 72.763 1.00 49.65 N ++ATOM 4065 CA MET m 127 -11.315 26.005 71.330 1.00 49.65 C ++ATOM 4066 C MET m 127 -11.052 27.308 70.592 1.00 49.65 C ++ATOM 4067 O MET m 127 -11.784 28.289 70.766 1.00 49.65 O ++ATOM 4068 CB MET m 127 -12.628 25.383 70.871 1.00 49.65 C ++ATOM 4069 CG MET m 127 -12.819 23.942 71.267 1.00 49.65 C ++ATOM 4070 SD MET m 127 -11.671 22.890 70.374 1.00 49.65 S ++ATOM 4071 CE MET m 127 -12.338 23.028 68.717 1.00 49.65 C ++ATOM 4072 N LEU m 128 -10.011 27.316 69.770 1.00 42.61 N ++ATOM 4073 CA LEU m 128 -9.682 28.443 68.913 1.00 42.61 C ++ATOM 4074 C LEU m 128 -9.880 28.021 67.467 1.00 42.61 C ++ATOM 4075 O LEU m 128 -9.220 27.082 66.999 1.00 42.61 O ++ATOM 4076 CB LEU m 128 -8.248 28.906 69.142 1.00 42.61 C ++ATOM 4077 CG LEU m 128 -7.840 30.052 68.229 1.00 42.61 C ++ATOM 4078 CD1 LEU m 128 -8.715 31.243 68.481 1.00 42.61 C ++ATOM 4079 CD2 LEU m 128 -6.396 30.411 68.438 1.00 42.61 C ++ATOM 4080 N LEU m 129 -10.793 28.712 66.773 1.00 43.97 N ++ATOM 4081 CA LEU m 129 -11.102 28.477 65.369 1.00 43.97 C ++ATOM 4082 C LEU m 129 -10.655 29.695 64.575 1.00 43.97 C ++ATOM 4083 O LEU m 129 -11.171 30.801 64.780 1.00 43.97 O ++ATOM 4084 CB LEU m 129 -12.593 28.233 65.172 1.00 43.97 C ++ATOM 4085 CG LEU m 129 -13.164 26.983 65.827 1.00 43.97 C ++ATOM 4086 CD1 LEU m 129 -14.663 26.953 65.648 1.00 43.97 C ++ATOM 4087 CD2 LEU m 129 -12.526 25.746 65.237 1.00 43.97 C ++ATOM 4088 N VAL m 130 -9.712 29.497 63.666 1.00 43.88 N ++ATOM 4089 CA VAL m 130 -9.221 30.573 62.818 1.00 43.88 C ++ATOM 4090 C VAL m 130 -9.771 30.299 61.424 1.00 43.88 C ++ATOM 4091 O VAL m 130 -9.189 29.559 60.632 1.00 43.88 O ++ATOM 4092 CB VAL m 130 -7.700 30.670 62.841 1.00 43.88 C ++ATOM 4093 CG1 VAL m 130 -7.229 31.808 61.963 1.00 43.88 C ++ATOM 4094 CG2 VAL m 130 -7.220 30.863 64.258 1.00 43.88 C ++ATOM 4095 N SER m 131 -10.921 30.888 61.128 1.00 40.52 N ++ATOM 4096 CA SER m 131 -11.473 30.794 59.788 1.00 40.52 C ++ATOM 4097 C SER m 131 -10.670 31.687 58.843 1.00 40.52 C ++ATOM 4098 O SER m 131 -10.246 32.777 59.235 1.00 40.52 O ++ATOM 4099 CB SER m 131 -12.946 31.197 59.792 1.00 40.52 C ++ATOM 4100 OG SER m 131 -13.102 32.552 60.162 1.00 40.52 O ++ATOM 4101 N PRO m 132 -10.433 31.257 57.608 1.00 37.71 N ++ATOM 4102 CA PRO m 132 -9.510 31.985 56.736 1.00 37.71 C ++ATOM 4103 C PRO m 132 -10.150 33.224 56.123 1.00 37.71 C ++ATOM 4104 O PRO m 132 -11.331 33.512 56.305 1.00 37.71 O ++ATOM 4105 CB PRO m 132 -9.183 30.960 55.651 1.00 37.71 C ++ATOM 4106 CG PRO m 132 -10.392 30.124 55.575 1.00 37.71 C ++ATOM 4107 CD PRO m 132 -10.924 30.025 56.971 1.00 37.71 C ++ATOM 4108 N ASP m 133 -9.323 33.972 55.398 1.00 40.55 N ++ATOM 4109 CA ASP m 133 -9.787 34.928 54.403 1.00 40.55 C ++ATOM 4110 C ASP m 133 -9.601 34.283 53.042 1.00 40.55 C ++ATOM 4111 O ASP m 133 -8.499 33.838 52.707 1.00 40.55 O ++ATOM 4112 CB ASP m 133 -9.045 36.260 54.482 1.00 40.55 C ++ATOM 4113 CG ASP m 133 -9.551 37.135 55.601 1.00 40.55 C ++ATOM 4114 OD1 ASP m 133 -10.735 36.985 55.972 1.00 40.55 O ++ATOM 4115 OD2 ASP m 133 -8.778 37.984 56.095 1.00 40.55 O ++ATOM 4116 N ILE m 134 -10.674 34.249 52.259 1.00 37.80 N ++ATOM 4117 CA ILE m 134 -10.754 33.342 51.126 1.00 37.80 C ++ATOM 4118 C ILE m 134 -10.515 34.108 49.823 1.00 37.80 C ++ATOM 4119 O ILE m 134 -10.115 33.520 48.811 1.00 37.80 O ++ATOM 4120 CB ILE m 134 -12.103 32.593 51.175 1.00 37.80 C ++ATOM 4121 CG1 ILE m 134 -12.114 31.398 50.226 1.00 37.80 C ++ATOM 4122 CG2 ILE m 134 -13.269 33.526 50.930 1.00 37.80 C ++ATOM 4123 CD1 ILE m 134 -13.194 30.406 50.529 1.00 37.80 C ++ATOM 4124 N GLN m 135 -10.781 35.419 49.841 1.00 44.20 N ++ATOM 4125 CA GLN m 135 -10.364 36.425 48.858 1.00 44.20 C ++ATOM 4126 C GLN m 135 -10.986 36.312 47.468 1.00 44.20 C ++ATOM 4127 O GLN m 135 -10.898 37.270 46.697 1.00 44.20 O ++ATOM 4128 CB GLN m 135 -8.838 36.428 48.700 1.00 44.20 C ++ATOM 4129 CG GLN m 135 -8.087 36.940 49.904 1.00 44.20 C ++ATOM 4130 CD GLN m 135 -8.358 38.404 50.170 1.00 44.20 C ++ATOM 4131 OE1 GLN m 135 -9.033 38.758 51.136 1.00 44.20 O ++ATOM 4132 NE2 GLN m 135 -7.829 39.266 49.311 1.00 44.20 N ++ATOM 4133 N ASN m 136 -11.678 35.216 47.165 1.00 43.34 N ++ATOM 4134 CA ASN m 136 -12.389 35.053 45.892 1.00 43.34 C ++ATOM 4135 C ASN m 136 -13.499 34.035 46.079 1.00 43.34 C ++ATOM 4136 O ASN m 136 -13.412 32.901 45.593 1.00 43.34 O ++ATOM 4137 CB ASN m 136 -11.456 34.597 44.766 1.00 43.34 C ++ATOM 4138 CG ASN m 136 -10.703 35.736 44.118 1.00 43.34 C ++ATOM 4139 OD1 ASN m 136 -11.267 36.795 43.855 1.00 43.34 O ++ATOM 4140 ND2 ASN m 136 -9.419 35.523 43.858 1.00 43.34 N ++ATOM 4141 N PRO m 137 -14.571 34.403 46.770 1.00 37.43 N ++ATOM 4142 CA PRO m 137 -15.599 33.413 47.077 1.00 37.43 C ++ATOM 4143 C PRO m 137 -16.507 33.160 45.889 1.00 37.43 C ++ATOM 4144 O PRO m 137 -16.784 34.046 45.079 1.00 37.43 O ++ATOM 4145 CB PRO m 137 -16.364 34.057 48.233 1.00 37.43 C ++ATOM 4146 CG PRO m 137 -16.249 35.497 47.963 1.00 37.43 C ++ATOM 4147 CD PRO m 137 -14.912 35.721 47.333 1.00 37.43 C ++ATOM 4148 N ASP m 138 -16.951 31.922 45.785 1.00 38.61 N ++ATOM 4149 CA ASP m 138 -17.864 31.494 44.736 1.00 38.61 C ++ATOM 4150 C ASP m 138 -18.798 30.449 45.329 1.00 38.61 C ++ATOM 4151 O ASP m 138 -18.607 29.254 45.081 1.00 38.61 O ++ATOM 4152 CB ASP m 138 -17.084 30.922 43.549 1.00 38.61 C ++ATOM 4153 CG ASP m 138 -17.949 30.700 42.315 1.00 38.61 C ++ATOM 4154 OD1 ASP m 138 -19.158 31.006 42.344 1.00 38.61 O ++ATOM 4155 OD2 ASP m 138 -17.410 30.205 41.302 1.00 38.61 O ++ATOM 4156 N PRO m 139 -19.796 30.849 46.117 1.00 33.95 N ++ATOM 4157 CA PRO m 139 -20.621 29.858 46.821 1.00 33.95 C ++ATOM 4158 C PRO m 139 -21.518 29.097 45.861 1.00 33.95 C ++ATOM 4159 O PRO m 139 -22.120 29.684 44.963 1.00 33.95 O ++ATOM 4160 CB PRO m 139 -21.434 30.709 47.801 1.00 33.95 C ++ATOM 4161 CG PRO m 139 -21.498 32.037 47.165 1.00 33.95 C ++ATOM 4162 CD PRO m 139 -20.213 32.225 46.424 1.00 33.95 C ++ATOM 4163 N ALA m 140 -21.586 27.781 46.047 1.00 24.83 N ++ATOM 4164 CA ALA m 140 -22.445 26.957 45.202 1.00 24.83 C ++ATOM 4165 C ALA m 140 -22.774 25.649 45.901 1.00 24.83 C ++ATOM 4166 O ALA m 140 -22.066 25.218 46.811 1.00 24.83 O ++ATOM 4167 CB ALA m 140 -21.792 26.666 43.854 1.00 24.83 C ++ATOM 4168 N VAL m 141 -23.840 25.001 45.436 1.00 23.65 N ++ATOM 4169 CA VAL m 141 -24.263 23.693 45.926 1.00 23.65 C ++ATOM 4170 C VAL m 141 -24.256 22.720 44.759 1.00 23.65 C ++ATOM 4171 O VAL m 141 -25.108 22.814 43.873 1.00 23.65 O ++ATOM 4172 CB VAL m 141 -25.671 23.726 46.537 1.00 23.65 C ++ATOM 4173 CG1 VAL m 141 -26.019 22.372 47.088 1.00 23.65 C ++ATOM 4174 CG2 VAL m 141 -25.799 24.782 47.580 1.00 23.65 C ++ATOM 4175 N TYR m 142 -23.337 21.762 44.780 1.00 23.28 N ++ATOM 4176 CA TYR m 142 -23.145 20.817 43.690 1.00 23.28 C ++ATOM 4177 C TYR m 142 -23.666 19.451 44.111 1.00 23.28 C ++ATOM 4178 O TYR m 142 -23.242 18.918 45.139 1.00 23.28 O ++ATOM 4179 CB TYR m 142 -21.667 20.706 43.330 1.00 23.28 C ++ATOM 4180 CG TYR m 142 -21.008 21.999 42.948 1.00 23.28 C ++ATOM 4181 CD1 TYR m 142 -21.195 22.551 41.697 1.00 23.28 C ++ATOM 4182 CD2 TYR m 142 -20.153 22.638 43.826 1.00 23.28 C ++ATOM 4183 CE1 TYR m 142 -20.577 23.723 41.344 1.00 23.28 C ++ATOM 4184 CE2 TYR m 142 -19.527 23.801 43.479 1.00 23.28 C ++ATOM 4185 CZ TYR m 142 -19.740 24.340 42.240 1.00 23.28 C ++ATOM 4186 OH TYR m 142 -19.110 25.514 41.911 1.00 23.28 O ++ATOM 4187 N GLN m 143 -24.585 18.897 43.329 1.00 23.39 N ++ATOM 4188 CA GLN m 143 -24.930 17.486 43.452 1.00 23.39 C ++ATOM 4189 C GLN m 143 -23.732 16.650 43.055 1.00 23.39 C ++ATOM 4190 O GLN m 143 -23.121 16.909 42.021 1.00 23.39 O ++ATOM 4191 CB GLN m 143 -26.111 17.154 42.540 1.00 23.39 C ++ATOM 4192 CG GLN m 143 -26.525 15.686 42.477 1.00 23.39 C ++ATOM 4193 CD GLN m 143 -27.373 15.244 43.638 1.00 23.39 C ++ATOM 4194 OE1 GLN m 143 -28.287 15.943 44.054 1.00 23.39 O ++ATOM 4195 NE2 GLN m 143 -27.087 14.060 44.160 1.00 23.39 N ++ATOM 4196 N LEU m 144 -23.367 15.662 43.863 1.00 23.11 N ++ATOM 4197 CA LEU m 144 -22.319 14.759 43.417 1.00 23.11 C ++ATOM 4198 C LEU m 144 -22.930 13.461 42.909 1.00 23.11 C ++ATOM 4199 O LEU m 144 -24.106 13.168 43.126 1.00 23.11 O ++ATOM 4200 CB LEU m 144 -21.296 14.477 44.516 1.00 23.11 C ++ATOM 4201 CG LEU m 144 -20.469 15.638 45.073 1.00 23.11 C ++ATOM 4202 CD1 LEU m 144 -19.406 15.111 45.976 1.00 23.11 C ++ATOM 4203 CD2 LEU m 144 -19.861 16.497 44.005 1.00 23.11 C ++ATOM 4204 N ARG m 145 -22.106 12.680 42.219 1.00 34.97 N ++ATOM 4205 CA ARG m 145 -22.552 11.503 41.487 1.00 34.97 C ++ATOM 4206 C ARG m 145 -22.335 10.273 42.350 1.00 34.97 C ++ATOM 4207 O ARG m 145 -21.202 9.985 42.737 1.00 34.97 O ++ATOM 4208 CB ARG m 145 -21.795 11.370 40.166 1.00 34.97 C ++ATOM 4209 CG ARG m 145 -22.051 12.516 39.209 1.00 34.97 C ++ATOM 4210 CD ARG m 145 -21.382 12.313 37.856 1.00 34.97 C ++ATOM 4211 NE ARG m 145 -19.925 12.395 37.898 1.00 34.97 N ++ATOM 4212 CZ ARG m 145 -19.146 12.173 36.844 1.00 34.97 C ++ATOM 4213 NH1 ARG m 145 -19.692 11.860 35.681 1.00 34.97 N ++ATOM 4214 NH2 ARG m 145 -17.826 12.264 36.946 1.00 34.97 N ++ATOM 4215 N ASP m 146 -23.416 9.562 42.653 1.00 53.28 N ++ATOM 4216 CA ASP m 146 -23.310 8.353 43.456 1.00 53.28 C ++ATOM 4217 C ASP m 146 -22.561 7.262 42.700 1.00 53.28 C ++ATOM 4218 O ASP m 146 -22.553 7.225 41.469 1.00 53.28 O ++ATOM 4219 CB ASP m 146 -24.696 7.874 43.886 1.00 53.28 C ++ATOM 4220 CG ASP m 146 -25.664 7.729 42.724 1.00 53.28 C ++ATOM 4221 OD1 ASP m 146 -25.317 8.113 41.585 1.00 53.28 O ++ATOM 4222 OD2 ASP m 146 -26.786 7.229 42.954 1.00 53.28 O ++ATOM 4223 N SER m 147 -21.901 6.384 43.453 1.00 59.83 N ++ATOM 4224 CA SER m 147 -20.946 5.445 42.881 1.00 59.83 C ++ATOM 4225 C SER m 147 -21.423 3.999 42.948 1.00 59.83 C ++ATOM 4226 O SER m 147 -20.611 3.094 43.169 1.00 59.83 O ++ATOM 4227 CB SER m 147 -19.594 5.590 43.571 1.00 59.83 C ++ATOM 4228 OG SER m 147 -18.622 4.725 43.013 1.00 59.83 O ++ATOM 4229 N LYS m 148 -22.731 3.772 42.803 1.00 70.66 N ++ATOM 4230 CA LYS m 148 -23.358 2.483 42.508 1.00 70.66 C ++ATOM 4231 C LYS m 148 -23.183 1.439 43.608 1.00 70.66 C ++ATOM 4232 O LYS m 148 -23.509 0.266 43.395 1.00 70.66 O ++ATOM 4233 CB LYS m 148 -22.849 1.916 41.178 1.00 70.66 C ++ATOM 4234 CG LYS m 148 -23.132 2.814 39.994 1.00 70.66 C ++ATOM 4235 CD LYS m 148 -22.598 2.204 38.715 1.00 70.66 C ++ATOM 4236 CE LYS m 148 -21.078 2.227 38.692 1.00 70.66 C ++ATOM 4237 NZ LYS m 148 -20.543 3.617 38.629 1.00 70.66 N ++ATOM 4238 N SER m 149 -22.676 1.822 44.778 1.00 74.55 N ++ATOM 4239 CA SER m 149 -22.494 0.886 45.878 1.00 74.55 C ++ATOM 4240 C SER m 149 -23.566 1.048 46.947 1.00 74.55 C ++ATOM 4241 O SER m 149 -24.125 0.052 47.421 1.00 74.55 O ++ATOM 4242 CB SER m 149 -21.106 1.071 46.497 1.00 74.55 C ++ATOM 4243 OG SER m 149 -20.912 0.200 47.595 1.00 74.55 O ++ATOM 4244 N SER m 150 -23.871 2.286 47.327 1.00 66.42 N ++ATOM 4245 CA SER m 150 -24.846 2.582 48.362 1.00 66.42 C ++ATOM 4246 C SER m 150 -25.891 3.544 47.816 1.00 66.42 C ++ATOM 4247 O SER m 150 -25.746 4.107 46.728 1.00 66.42 O ++ATOM 4248 CB SER m 150 -24.176 3.170 49.607 1.00 66.42 C ++ATOM 4249 OG SER m 150 -23.591 4.421 49.309 1.00 66.42 O ++ATOM 4250 N ASP m 151 -26.948 3.740 48.603 1.00 57.82 N ++ATOM 4251 CA ASP m 151 -28.148 4.439 48.168 1.00 57.82 C ++ATOM 4252 C ASP m 151 -28.177 5.909 48.574 1.00 57.82 C ++ATOM 4253 O ASP m 151 -29.261 6.496 48.658 1.00 57.82 O ++ATOM 4254 CB ASP m 151 -29.385 3.715 48.704 1.00 57.82 C ++ATOM 4255 CG ASP m 151 -29.330 3.494 50.206 1.00 57.82 C ++ATOM 4256 OD1 ASP m 151 -28.305 3.828 50.834 1.00 57.82 O ++ATOM 4257 OD2 ASP m 151 -30.317 2.972 50.762 1.00 57.82 O ++ATOM 4258 N LYS m 152 -27.024 6.513 48.819 1.00 44.46 N ++ATOM 4259 CA LYS m 152 -26.964 7.898 49.251 1.00 44.46 C ++ATOM 4260 C LYS m 152 -26.672 8.814 48.065 1.00 44.46 C ++ATOM 4261 O LYS m 152 -26.343 8.367 46.966 1.00 44.46 O ++ATOM 4262 CB LYS m 152 -25.902 8.057 50.332 1.00 44.46 C ++ATOM 4263 CG LYS m 152 -26.205 7.259 51.567 1.00 44.46 C ++ATOM 4264 CD LYS m 152 -25.108 7.385 52.587 1.00 44.46 C ++ATOM 4265 CE LYS m 152 -25.482 6.648 53.856 1.00 44.46 C ++ATOM 4266 NZ LYS m 152 -25.579 5.183 53.629 1.00 44.46 N ++ATOM 4267 N SER m 153 -26.792 10.116 48.306 1.00 33.31 N ++ATOM 4268 CA SER m 153 -26.541 11.119 47.277 1.00 33.31 C ++ATOM 4269 C SER m 153 -26.261 12.433 47.976 1.00 33.31 C ++ATOM 4270 O SER m 153 -27.123 12.937 48.697 1.00 33.31 O ++ATOM 4271 CB SER m 153 -27.734 11.250 46.342 1.00 33.31 C ++ATOM 4272 OG SER m 153 -28.868 11.711 47.050 1.00 33.31 O ++ATOM 4273 N VAL m 154 -25.079 12.994 47.764 1.00 22.93 N ++ATOM 4274 CA VAL m 154 -24.618 14.114 48.566 1.00 22.93 C ++ATOM 4275 C VAL m 154 -24.700 15.404 47.759 1.00 22.93 C ++ATOM 4276 O VAL m 154 -24.676 15.404 46.521 1.00 22.93 O ++ATOM 4277 CB VAL m 154 -23.188 13.867 49.083 1.00 22.93 C ++ATOM 4278 CG1 VAL m 154 -23.122 12.548 49.749 1.00 22.93 C ++ATOM 4279 CG2 VAL m 154 -22.222 13.870 47.983 1.00 22.93 C ++ATOM 4280 N CYS m 155 -24.825 16.514 48.482 1.00 24.84 N ++ATOM 4281 CA CYS m 155 -24.863 17.857 47.917 1.00 24.84 C ++ATOM 4282 C CYS m 155 -23.773 18.668 48.595 1.00 24.84 C ++ATOM 4283 O CYS m 155 -23.997 19.221 49.673 1.00 24.84 O ++ATOM 4284 CB CYS m 155 -26.219 18.524 48.146 1.00 24.84 C ++ATOM 4285 SG CYS m 155 -27.656 17.839 47.299 1.00 24.84 S ++ATOM 4286 N LEU m 156 -22.608 18.768 47.974 1.00 21.20 N ++ATOM 4287 CA LEU m 156 -21.511 19.522 48.564 1.00 21.20 C ++ATOM 4288 C LEU m 156 -21.742 21.010 48.338 1.00 21.20 C ++ATOM 4289 O LEU m 156 -21.899 21.442 47.199 1.00 21.20 O ++ATOM 4290 CB LEU m 156 -20.173 19.075 47.979 1.00 21.20 C ++ATOM 4291 CG LEU m 156 -18.918 19.759 48.511 1.00 21.20 C ++ATOM 4292 CD1 LEU m 156 -17.838 18.764 48.756 1.00 21.20 C ++ATOM 4293 CD2 LEU m 156 -18.404 20.746 47.492 1.00 21.20 C ++ATOM 4294 N PHE m 157 -21.729 21.791 49.412 1.00 21.64 N ++ATOM 4295 CA PHE m 157 -21.940 23.233 49.361 1.00 21.64 C ++ATOM 4296 C PHE m 157 -20.664 23.924 49.798 1.00 21.64 C ++ATOM 4297 O PHE m 157 -20.117 23.610 50.856 1.00 21.64 O ++ATOM 4298 CB PHE m 157 -23.156 23.604 50.221 1.00 21.64 C ++ATOM 4299 CG PHE m 157 -23.304 25.071 50.563 1.00 21.64 C ++ATOM 4300 CD1 PHE m 157 -23.205 26.064 49.614 1.00 21.64 C ++ATOM 4301 CD2 PHE m 157 -23.766 25.425 51.818 1.00 21.64 C ++ATOM 4302 CE1 PHE m 157 -23.397 27.382 49.945 1.00 21.64 C ++ATOM 4303 CE2 PHE m 157 -23.978 26.748 52.147 1.00 21.64 C ++ATOM 4304 CZ PHE m 157 -23.790 27.723 51.206 1.00 21.64 C ++ATOM 4305 N THR m 158 -20.189 24.861 48.982 1.00 23.20 N ++ATOM 4306 CA THR m 158 -18.823 25.337 49.122 1.00 23.20 C ++ATOM 4307 C THR m 158 -18.656 26.825 48.831 1.00 23.20 C ++ATOM 4308 O THR m 158 -19.447 27.440 48.104 1.00 23.20 O ++ATOM 4309 CB THR m 158 -17.884 24.546 48.224 1.00 23.20 C ++ATOM 4310 OG1 THR m 158 -16.571 25.101 48.323 1.00 23.20 O ++ATOM 4311 CG2 THR m 158 -18.335 24.598 46.805 1.00 23.20 C ++ATOM 4312 N ASP m 159 -17.590 27.361 49.448 1.00 26.25 N ++ATOM 4313 CA ASP m 159 -16.917 28.664 49.392 1.00 26.25 C ++ATOM 4314 C ASP m 159 -17.560 29.825 50.158 1.00 26.25 C ++ATOM 4315 O ASP m 159 -16.884 30.816 50.443 1.00 26.25 O ++ATOM 4316 CB ASP m 159 -16.729 29.069 47.934 1.00 26.25 C ++ATOM 4317 CG ASP m 159 -15.820 28.125 47.191 1.00 26.25 C ++ATOM 4318 OD1 ASP m 159 -14.907 27.570 47.824 1.00 26.25 O ++ATOM 4319 OD2 ASP m 159 -16.019 27.921 45.980 1.00 26.25 O ++ATOM 4320 N PHE m 160 -18.835 29.736 50.506 1.00 27.18 N ++ATOM 4321 CA PHE m 160 -19.417 30.259 51.747 1.00 27.18 C ++ATOM 4322 C PHE m 160 -19.329 31.737 52.117 1.00 27.18 C ++ATOM 4323 O PHE m 160 -20.007 32.137 53.068 1.00 27.18 O ++ATOM 4324 CB PHE m 160 -18.817 29.564 52.968 1.00 27.18 C ++ATOM 4325 CG PHE m 160 -19.302 28.184 53.197 1.00 27.18 C ++ATOM 4326 CD1 PHE m 160 -20.202 27.586 52.350 1.00 27.18 C ++ATOM 4327 CD2 PHE m 160 -18.928 27.520 54.336 1.00 27.18 C ++ATOM 4328 CE1 PHE m 160 -20.617 26.333 52.580 1.00 27.18 C ++ATOM 4329 CE2 PHE m 160 -19.375 26.269 54.571 1.00 27.18 C ++ATOM 4330 CZ PHE m 160 -20.227 25.677 53.701 1.00 27.18 C ++ATOM 4331 N ASP m 161 -18.494 32.537 51.442 1.00 36.50 N ++ATOM 4332 CA ASP m 161 -17.956 33.826 51.908 1.00 36.50 C ++ATOM 4333 C ASP m 161 -17.146 33.728 53.211 1.00 36.50 C ++ATOM 4334 O ASP m 161 -16.789 34.771 53.774 1.00 36.50 O ++ATOM 4335 CB ASP m 161 -19.033 34.919 52.097 1.00 36.50 C ++ATOM 4336 CG ASP m 161 -19.642 35.390 50.802 1.00 36.50 C ++ATOM 4337 OD1 ASP m 161 -18.953 35.368 49.768 1.00 36.50 O ++ATOM 4338 OD2 ASP m 161 -20.819 35.802 50.822 1.00 36.50 O ++ATOM 4339 N SER m 162 -16.867 32.513 53.710 1.00 32.58 N ++ATOM 4340 CA SER m 162 -16.121 32.237 54.953 1.00 32.58 C ++ATOM 4341 C SER m 162 -16.743 32.879 56.193 1.00 32.58 C ++ATOM 4342 O SER m 162 -16.066 33.081 57.200 1.00 32.58 O ++ATOM 4343 CB SER m 162 -14.655 32.646 54.824 1.00 32.58 C ++ATOM 4344 OG SER m 162 -14.023 31.876 53.818 1.00 32.58 O ++ATOM 4345 N GLN m 163 -18.043 33.190 56.141 1.00 35.02 N ++ATOM 4346 CA GLN m 163 -18.777 33.691 57.297 1.00 35.02 C ++ATOM 4347 C GLN m 163 -20.178 33.104 57.374 1.00 35.02 C ++ATOM 4348 O GLN m 163 -21.035 33.667 58.061 1.00 35.02 O ++ATOM 4349 CB GLN m 163 -18.904 35.218 57.283 1.00 35.02 C ++ATOM 4350 CG GLN m 163 -17.650 35.980 57.642 1.00 35.02 C ++ATOM 4351 CD GLN m 163 -17.266 35.805 59.094 1.00 35.02 C ++ATOM 4352 OE1 GLN m 163 -16.284 35.141 59.416 1.00 35.02 O ++ATOM 4353 NE2 GLN m 163 -18.039 36.411 59.983 1.00 35.02 N ++ATOM 4354 N THR m 164 -20.441 32.006 56.678 1.00 32.96 N ++ATOM 4355 CA THR m 164 -21.774 31.428 56.619 1.00 32.96 C ++ATOM 4356 C THR m 164 -21.941 30.425 57.745 1.00 32.96 C ++ATOM 4357 O THR m 164 -21.222 29.426 57.804 1.00 32.96 O ++ATOM 4358 CB THR m 164 -22.026 30.753 55.278 1.00 32.96 C ++ATOM 4359 OG1 THR m 164 -21.960 31.734 54.239 1.00 32.96 O ++ATOM 4360 CG2 THR m 164 -23.391 30.110 55.277 1.00 32.96 C ++ATOM 4361 N ASN m 165 -22.884 30.696 58.634 1.00 37.06 N ++ATOM 4362 CA ASN m 165 -23.196 29.757 59.695 1.00 37.06 C ++ATOM 4363 C ASN m 165 -24.012 28.614 59.114 1.00 37.06 C ++ATOM 4364 O ASN m 165 -25.156 28.814 58.697 1.00 37.06 O ++ATOM 4365 CB ASN m 165 -23.959 30.469 60.807 1.00 37.06 C ++ATOM 4366 CG ASN m 165 -23.111 31.502 61.517 1.00 37.06 C ++ATOM 4367 OD1 ASN m 165 -21.949 31.253 61.830 1.00 37.06 O ++ATOM 4368 ND2 ASN m 165 -23.683 32.676 61.757 1.00 37.06 N ++ATOM 4369 N VAL m 166 -23.428 27.423 59.066 1.00 33.37 N ++ATOM 4370 CA VAL m 166 -24.105 26.241 58.554 1.00 33.37 C ++ATOM 4371 C VAL m 166 -24.653 25.488 59.753 1.00 33.37 C ++ATOM 4372 O VAL m 166 -23.891 24.910 60.536 1.00 33.37 O ++ATOM 4373 CB VAL m 166 -23.172 25.351 57.725 1.00 33.37 C ++ATOM 4374 CG1 VAL m 166 -23.912 24.126 57.254 1.00 33.37 C ++ATOM 4375 CG2 VAL m 166 -22.630 26.109 56.545 1.00 33.37 C ++ATOM 4376 N SER m 167 -25.973 25.492 59.904 1.00 37.29 N ++ATOM 4377 CA SER m 167 -26.603 24.842 61.040 1.00 37.29 C ++ATOM 4378 C SER m 167 -26.798 23.360 60.752 1.00 37.29 C ++ATOM 4379 O SER m 167 -26.457 22.855 59.684 1.00 37.29 O ++ATOM 4380 CB SER m 167 -27.937 25.510 61.363 1.00 37.29 C ++ATOM 4381 OG SER m 167 -27.753 26.852 61.775 1.00 37.29 O ++ATOM 4382 N GLN m 168 -27.372 22.654 61.721 1.00 39.58 N ++ATOM 4383 CA GLN m 168 -27.740 21.256 61.549 1.00 39.58 C ++ATOM 4384 C GLN m 168 -29.067 21.168 60.804 1.00 39.58 C ++ATOM 4385 O GLN m 168 -29.570 22.148 60.251 1.00 39.58 O ++ATOM 4386 CB GLN m 168 -27.803 20.550 62.896 1.00 39.58 C ++ATOM 4387 CG GLN m 168 -26.464 20.409 63.578 1.00 39.58 C ++ATOM 4388 CD GLN m 168 -25.542 19.465 62.841 1.00 39.58 C ++ATOM 4389 OE1 GLN m 168 -25.977 18.439 62.317 1.00 39.58 O ++ATOM 4390 NE2 GLN m 168 -24.259 19.805 62.797 1.00 39.58 N ++ATOM 4391 N SER m 169 -29.658 19.983 60.785 1.00 48.13 N ++ATOM 4392 CA SER m 169 -30.803 19.716 59.935 1.00 48.13 C ++ATOM 4393 C SER m 169 -32.095 19.650 60.737 1.00 48.13 C ++ATOM 4394 O SER m 169 -32.094 19.593 61.969 1.00 48.13 O ++ATOM 4395 CB SER m 169 -30.603 18.411 59.170 1.00 48.13 C ++ATOM 4396 OG SER m 169 -30.530 17.313 60.062 1.00 48.13 O ++ATOM 4397 N LYS m 170 -33.208 19.667 60.003 1.00 59.99 N ++ATOM 4398 CA LYS m 170 -34.523 19.517 60.616 1.00 59.99 C ++ATOM 4399 C LYS m 170 -34.898 18.052 60.783 1.00 59.99 C ++ATOM 4400 O LYS m 170 -35.438 17.661 61.823 1.00 59.99 O ++ATOM 4401 CB LYS m 170 -35.581 20.231 59.773 1.00 59.99 C ++ATOM 4402 CG LYS m 170 -35.425 21.736 59.693 1.00 59.99 C ++ATOM 4403 CD LYS m 170 -35.679 22.394 61.038 1.00 59.99 C ++ATOM 4404 CE LYS m 170 -37.152 22.358 61.402 1.00 59.99 C ++ATOM 4405 NZ LYS m 170 -37.424 23.079 62.675 1.00 59.99 N ++ATOM 4406 N ASP m 171 -34.611 17.229 59.779 1.00 60.28 N ++ATOM 4407 CA ASP m 171 -35.081 15.855 59.758 1.00 60.28 C ++ATOM 4408 C ASP m 171 -34.195 14.957 60.612 1.00 60.28 C ++ATOM 4409 O ASP m 171 -33.354 15.409 61.392 1.00 60.28 O ++ATOM 4410 CB ASP m 171 -35.120 15.329 58.327 1.00 60.28 C ++ATOM 4411 CG ASP m 171 -36.196 15.981 57.499 1.00 60.28 C ++ATOM 4412 OD1 ASP m 171 -37.218 16.400 58.077 1.00 60.28 O ++ATOM 4413 OD2 ASP m 171 -36.026 16.067 56.266 1.00 60.28 O ++ATOM 4414 N SER m 172 -34.409 13.654 60.462 1.00 55.61 N ++ATOM 4415 CA SER m 172 -33.508 12.635 60.972 1.00 55.61 C ++ATOM 4416 C SER m 172 -32.935 11.786 59.848 1.00 55.61 C ++ATOM 4417 O SER m 172 -32.202 10.830 60.112 1.00 55.61 O ++ATOM 4418 CB SER m 172 -34.225 11.755 61.994 1.00 55.61 C ++ATOM 4419 OG SER m 172 -35.285 11.040 61.387 1.00 55.61 O ++ATOM 4420 N ASP m 173 -33.261 12.115 58.605 1.00 55.88 N ++ATOM 4421 CA ASP m 173 -32.707 11.469 57.426 1.00 55.88 C ++ATOM 4422 C ASP m 173 -31.740 12.356 56.666 1.00 55.88 C ++ATOM 4423 O ASP m 173 -30.969 11.859 55.848 1.00 55.88 O ++ATOM 4424 CB ASP m 173 -33.829 11.030 56.482 1.00 55.88 C ++ATOM 4425 CG ASP m 173 -34.623 9.872 57.028 1.00 55.88 C ++ATOM 4426 OD1 ASP m 173 -34.046 9.071 57.792 1.00 55.88 O ++ATOM 4427 OD2 ASP m 173 -35.819 9.762 56.689 1.00 55.88 O ++ATOM 4428 N VAL m 174 -31.774 13.660 56.898 1.00 42.20 N ++ATOM 4429 CA VAL m 174 -30.805 14.564 56.299 1.00 42.20 C ++ATOM 4430 C VAL m 174 -29.720 14.863 57.320 1.00 42.20 C ++ATOM 4431 O VAL m 174 -30.010 15.285 58.442 1.00 42.20 O ++ATOM 4432 CB VAL m 174 -31.491 15.850 55.828 1.00 42.20 C ++ATOM 4433 CG1 VAL m 174 -30.476 16.812 55.255 1.00 42.20 C ++ATOM 4434 CG2 VAL m 174 -32.577 15.523 54.822 1.00 42.20 C ++ATOM 4435 N TYR m 175 -28.472 14.628 56.946 1.00 32.30 N ++ATOM 4436 CA TYR m 175 -27.338 14.944 57.797 1.00 32.30 C ++ATOM 4437 C TYR m 175 -26.647 16.186 57.264 1.00 32.30 C ++ATOM 4438 O TYR m 175 -26.776 16.530 56.095 1.00 32.30 O ++ATOM 4439 CB TYR m 175 -26.357 13.780 57.844 1.00 32.30 C ++ATOM 4440 CG TYR m 175 -26.973 12.513 58.343 1.00 32.30 C ++ATOM 4441 CD1 TYR m 175 -27.116 12.273 59.694 1.00 32.30 C ++ATOM 4442 CD2 TYR m 175 -27.426 11.554 57.455 1.00 32.30 C ++ATOM 4443 CE1 TYR m 175 -27.685 11.107 60.147 1.00 32.30 C ++ATOM 4444 CE2 TYR m 175 -27.996 10.390 57.895 1.00 32.30 C ++ATOM 4445 CZ TYR m 175 -28.124 10.171 59.240 1.00 32.30 C ++ATOM 4446 OH TYR m 175 -28.695 9.009 59.684 1.00 32.30 O ++ATOM 4447 N ILE m 176 -25.939 16.881 58.144 1.00 27.31 N ++ATOM 4448 CA ILE m 176 -25.152 18.052 57.776 1.00 27.31 C ++ATOM 4449 C ILE m 176 -23.859 17.962 58.561 1.00 27.31 C ++ATOM 4450 O ILE m 176 -23.885 17.696 59.765 1.00 27.31 O ++ATOM 4451 CB ILE m 176 -25.862 19.383 58.109 1.00 27.31 C ++ATOM 4452 CG1 ILE m 176 -27.215 19.559 57.414 1.00 27.31 C ++ATOM 4453 CG2 ILE m 176 -24.996 20.565 57.737 1.00 27.31 C ++ATOM 4454 CD1 ILE m 176 -27.148 19.792 55.952 1.00 27.31 C ++ATOM 4455 N THR m 177 -22.732 18.162 57.898 1.00 23.58 N ++ATOM 4456 CA THR m 177 -21.476 18.317 58.608 1.00 23.58 C ++ATOM 4457 C THR m 177 -21.189 19.794 58.823 1.00 23.58 C ++ATOM 4458 O THR m 177 -21.747 20.653 58.144 1.00 23.58 O ++ATOM 4459 CB THR m 177 -20.343 17.676 57.827 1.00 23.58 C ++ATOM 4460 OG1 THR m 177 -20.249 18.309 56.550 1.00 23.58 O ++ATOM 4461 CG2 THR m 177 -20.625 16.211 57.635 1.00 23.58 C ++ATOM 4462 N ASP m 178 -20.310 20.090 59.770 1.00 32.45 N ++ATOM 4463 CA ASP m 178 -19.958 21.483 59.985 1.00 32.45 C ++ATOM 4464 C ASP m 178 -18.967 21.946 58.928 1.00 32.45 C ++ATOM 4465 O ASP m 178 -18.383 21.145 58.197 1.00 32.45 O ++ATOM 4466 CB ASP m 178 -19.378 21.687 61.378 1.00 32.45 C ++ATOM 4467 CG ASP m 178 -20.422 21.552 62.463 1.00 32.45 C ++ATOM 4468 OD1 ASP m 178 -21.608 21.816 62.176 1.00 32.45 O ++ATOM 4469 OD2 ASP m 178 -20.060 21.196 63.604 1.00 32.45 O ++ATOM 4470 N LYS m 179 -18.782 23.260 58.849 1.00 25.53 N ++ATOM 4471 CA LYS m 179 -17.903 23.818 57.832 1.00 25.53 C ++ATOM 4472 C LYS m 179 -16.450 23.505 58.149 1.00 25.53 C ++ATOM 4473 O LYS m 179 -15.972 23.751 59.259 1.00 25.53 O ++ATOM 4474 CB LYS m 179 -18.130 25.325 57.688 1.00 25.53 C ++ATOM 4475 CG LYS m 179 -17.933 26.220 58.888 1.00 25.53 C ++ATOM 4476 CD LYS m 179 -18.249 27.655 58.518 1.00 25.53 C ++ATOM 4477 CE LYS m 179 -18.075 28.585 59.699 1.00 25.53 C ++ATOM 4478 NZ LYS m 179 -18.412 29.990 59.348 1.00 25.53 N ++ATOM 4479 N THR m 180 -15.753 22.896 57.198 1.00 21.49 N ++ATOM 4480 CA THR m 180 -14.335 22.655 57.395 1.00 21.49 C ++ATOM 4481 C THR m 180 -13.541 23.333 56.293 1.00 21.49 C ++ATOM 4482 O THR m 180 -14.038 23.566 55.189 1.00 21.49 O ++ATOM 4483 CB THR m 180 -13.985 21.167 57.431 1.00 21.49 C ++ATOM 4484 OG1 THR m 180 -14.293 20.576 56.167 1.00 21.49 O ++ATOM 4485 CG2 THR m 180 -14.756 20.454 58.525 1.00 21.49 C ++ATOM 4486 N VAL m 181 -12.292 23.639 56.615 1.00 21.84 N ++ATOM 4487 CA VAL m 181 -11.423 24.423 55.754 1.00 21.84 C ++ATOM 4488 C VAL m 181 -10.421 23.457 55.146 1.00 21.84 C ++ATOM 4489 O VAL m 181 -9.449 23.069 55.792 1.00 21.84 O ++ATOM 4490 CB VAL m 181 -10.714 25.533 56.527 1.00 21.84 C ++ATOM 4491 CG1 VAL m 181 -9.879 26.374 55.588 1.00 21.84 C ++ATOM 4492 CG2 VAL m 181 -11.709 26.371 57.282 1.00 21.84 C ++ATOM 4493 N LEU m 182 -10.643 23.073 53.899 1.00 22.51 N ++ATOM 4494 CA LEU m 182 -9.632 22.287 53.219 1.00 22.51 C ++ATOM 4495 C LEU m 182 -8.595 23.218 52.614 1.00 22.51 C ++ATOM 4496 O LEU m 182 -8.907 24.319 52.152 1.00 22.51 O ++ATOM 4497 CB LEU m 182 -10.258 21.377 52.162 1.00 22.51 C ++ATOM 4498 CG LEU m 182 -11.064 21.917 50.989 1.00 22.51 C ++ATOM 4499 CD1 LEU m 182 -10.196 22.184 49.789 1.00 22.51 C ++ATOM 4500 CD2 LEU m 182 -12.157 20.940 50.631 1.00 22.51 C ++ATOM 4501 N ASP m 183 -7.352 22.759 52.607 1.00 24.13 N ++ATOM 4502 CA ASP m 183 -6.195 23.602 52.331 1.00 24.13 C ++ATOM 4503 C ASP m 183 -5.425 23.013 51.159 1.00 24.13 C ++ATOM 4504 O ASP m 183 -4.522 22.200 51.362 1.00 24.13 O ++ATOM 4505 CB ASP m 183 -5.325 23.691 53.568 1.00 24.13 C ++ATOM 4506 CG ASP m 183 -4.172 24.648 53.405 1.00 24.13 C ++ATOM 4507 OD1 ASP m 183 -4.399 25.868 53.491 1.00 24.13 O ++ATOM 4508 OD2 ASP m 183 -3.034 24.181 53.196 1.00 24.13 O ++ATOM 4509 N MET m 184 -5.784 23.404 49.938 1.00 26.97 N ++ATOM 4510 CA MET m 184 -5.002 23.004 48.774 1.00 26.97 C ++ATOM 4511 C MET m 184 -3.662 23.708 48.817 1.00 26.97 C ++ATOM 4512 O MET m 184 -3.605 24.939 48.835 1.00 26.97 O ++ATOM 4513 CB MET m 184 -5.715 23.341 47.476 1.00 26.97 C ++ATOM 4514 CG MET m 184 -6.913 22.528 47.201 1.00 26.97 C ++ATOM 4515 SD MET m 184 -7.511 23.003 45.589 1.00 26.97 S ++ATOM 4516 CE MET m 184 -6.260 22.266 44.564 1.00 26.97 C ++ATOM 4517 N ARG m 185 -2.604 22.905 48.859 1.00 25.48 N ++ATOM 4518 CA ARG m 185 -1.233 23.382 48.822 1.00 25.48 C ++ATOM 4519 C ARG m 185 -0.729 23.625 47.398 1.00 25.48 C ++ATOM 4520 O ARG m 185 0.125 24.477 47.180 1.00 25.48 O ++ATOM 4521 CB ARG m 185 -0.313 22.374 49.505 1.00 25.48 C ++ATOM 4522 CG ARG m 185 -0.080 22.640 50.979 1.00 25.48 C ++ATOM 4523 CD ARG m 185 1.162 21.915 51.467 1.00 25.48 C ++ATOM 4524 NE ARG m 185 2.108 22.829 52.095 1.00 25.48 N ++ATOM 4525 CZ ARG m 185 3.258 23.203 51.548 1.00 25.48 C ++ATOM 4526 NH1 ARG m 185 4.059 24.040 52.190 1.00 25.48 N ++ATOM 4527 NH2 ARG m 185 3.605 22.737 50.357 1.00 25.48 N ++ATOM 4528 N SER m 186 -1.259 22.874 46.433 1.00 25.00 N ++ATOM 4529 CA SER m 186 -0.802 22.972 45.050 1.00 25.00 C ++ATOM 4530 C SER m 186 -1.336 24.232 44.377 1.00 25.00 C ++ATOM 4531 O SER m 186 -0.565 25.113 43.987 1.00 25.00 O ++ATOM 4532 CB SER m 186 -1.210 21.726 44.269 1.00 25.00 C ++ATOM 4533 OG SER m 186 -2.609 21.655 44.106 1.00 25.00 O ++ATOM 4534 N MET m 187 -2.653 24.352 44.248 1.00 29.13 N ++ATOM 4535 CA MET m 187 -3.218 25.561 43.665 1.00 29.13 C ++ATOM 4536 C MET m 187 -3.222 26.745 44.618 1.00 29.13 C ++ATOM 4537 O MET m 187 -3.528 27.855 44.169 1.00 29.13 O ++ATOM 4538 CB MET m 187 -4.644 25.315 43.175 1.00 29.13 C ++ATOM 4539 CG MET m 187 -4.730 24.470 41.934 1.00 29.13 C ++ATOM 4540 SD MET m 187 -3.970 25.330 40.547 1.00 29.13 S ++ATOM 4541 CE MET m 187 -3.968 24.053 39.293 1.00 29.13 C ++ATOM 4542 N ASP m 188 -2.911 26.525 45.901 1.00 30.92 N ++ATOM 4543 CA ASP m 188 -2.845 27.549 46.952 1.00 30.92 C ++ATOM 4544 C ASP m 188 -4.185 28.279 47.096 1.00 30.92 C ++ATOM 4545 O ASP m 188 -4.308 29.473 46.832 1.00 30.92 O ++ATOM 4546 CB ASP m 188 -1.692 28.527 46.698 1.00 30.92 C ++ATOM 4547 CG ASP m 188 -1.316 29.316 47.929 1.00 30.92 C ++ATOM 4548 OD1 ASP m 188 -1.937 29.115 48.994 1.00 30.92 O ++ATOM 4549 OD2 ASP m 188 -0.386 30.138 47.832 1.00 30.92 O ++ATOM 4550 N PHE m 189 -5.196 27.525 47.525 1.00 28.22 N ++ATOM 4551 CA PHE m 189 -6.575 28.005 47.499 1.00 28.22 C ++ATOM 4552 C PHE m 189 -7.321 27.372 48.669 1.00 28.22 C ++ATOM 4553 O PHE m 189 -7.780 26.234 48.565 1.00 28.22 O ++ATOM 4554 CB PHE m 189 -7.219 27.663 46.164 1.00 28.22 C ++ATOM 4555 CG PHE m 189 -8.664 28.014 46.079 1.00 28.22 C ++ATOM 4556 CD1 PHE m 189 -9.065 29.336 45.992 1.00 28.22 C ++ATOM 4557 CD2 PHE m 189 -9.627 27.022 46.070 1.00 28.22 C ++ATOM 4558 CE1 PHE m 189 -10.404 29.667 45.911 1.00 28.22 C ++ATOM 4559 CE2 PHE m 189 -10.965 27.341 45.984 1.00 28.22 C ++ATOM 4560 CZ PHE m 189 -11.355 28.670 45.906 1.00 28.22 C ++ATOM 4561 N LYS m 190 -7.445 28.112 49.768 1.00 28.12 N ++ATOM 4562 CA LYS m 190 -8.136 27.617 50.951 1.00 28.12 C ++ATOM 4563 C LYS m 190 -9.637 27.700 50.739 1.00 28.12 C ++ATOM 4564 O LYS m 190 -10.155 28.755 50.372 1.00 28.12 O ++ATOM 4565 CB LYS m 190 -7.732 28.440 52.166 1.00 28.12 C ++ATOM 4566 CG LYS m 190 -6.259 28.347 52.457 1.00 28.12 C ++ATOM 4567 CD LYS m 190 -5.845 29.196 53.637 1.00 28.12 C ++ATOM 4568 CE LYS m 190 -4.340 29.139 53.828 1.00 28.12 C ++ATOM 4569 NZ LYS m 190 -3.612 29.936 55.036 1.00 28.12 N ++ATOM 4570 N SER m 191 -10.341 26.598 50.970 1.00 23.49 N ++ATOM 4571 CA SER m 191 -11.760 26.534 50.663 1.00 23.49 C ++ATOM 4572 C SER m 191 -12.537 26.017 51.862 1.00 23.49 C ++ATOM 4573 O SER m 191 -11.986 25.371 52.755 1.00 23.49 O ++ATOM 4574 CB SER m 191 -12.021 25.641 49.451 1.00 23.49 C ++ATOM 4575 OG SER m 191 -13.405 25.519 49.216 1.00 23.49 O ++ATOM 4576 N ASN m 192 -13.835 26.296 51.865 1.00 21.86 N ++ATOM 4577 CA ASN m 192 -14.743 25.848 52.909 1.00 21.86 C ++ATOM 4578 C ASN m 192 -15.703 24.814 52.337 1.00 21.86 C ++ATOM 4579 O ASN m 192 -16.016 24.836 51.147 1.00 21.86 O ++ATOM 4580 CB ASN m 192 -15.520 27.019 53.470 1.00 21.86 C ++ATOM 4581 CG ASN m 192 -14.656 27.963 54.249 1.00 21.86 C ++ATOM 4582 OD1 ASN m 192 -13.866 27.547 55.082 1.00 21.86 O ++ATOM 4583 ND2 ASN m 192 -14.775 29.244 53.963 1.00 21.86 N ++ATOM 4584 N SER m 193 -16.162 23.892 53.181 1.00 19.76 N ++ATOM 4585 CA SER m 193 -17.016 22.821 52.683 1.00 19.76 C ++ATOM 4586 C SER m 193 -17.972 22.335 53.760 1.00 19.76 C ++ATOM 4587 O SER m 193 -17.707 22.460 54.962 1.00 19.76 O ++ATOM 4588 CB SER m 193 -16.187 21.643 52.168 1.00 19.76 C ++ATOM 4589 OG SER m 193 -15.421 22.006 51.036 1.00 19.76 O ++ATOM 4590 N ALA m 194 -19.086 21.762 53.300 1.00 16.44 N ++ATOM 4591 CA ALA m 194 -20.049 21.054 54.129 1.00 16.44 C ++ATOM 4592 C ALA m 194 -20.827 20.098 53.237 1.00 16.44 C ++ATOM 4593 O ALA m 194 -21.159 20.448 52.108 1.00 16.44 O ++ATOM 4594 CB ALA m 194 -21.001 22.019 54.829 1.00 16.44 C ++ATOM 4595 N VAL m 195 -21.111 18.898 53.741 1.00 18.58 N ++ATOM 4596 CA VAL m 195 -21.625 17.798 52.930 1.00 18.58 C ++ATOM 4597 C VAL m 195 -22.885 17.240 53.568 1.00 18.58 C ++ATOM 4598 O VAL m 195 -22.882 16.888 54.749 1.00 18.58 O ++ATOM 4599 CB VAL m 195 -20.567 16.694 52.757 1.00 18.58 C ++ATOM 4600 CG1 VAL m 195 -21.172 15.427 52.220 1.00 18.58 C ++ATOM 4601 CG2 VAL m 195 -19.514 17.151 51.800 1.00 18.58 C ++ATOM 4602 N ALA m 196 -23.951 17.133 52.778 1.00 22.73 N ++ATOM 4603 CA ALA m 196 -25.265 16.716 53.248 1.00 22.73 C ++ATOM 4604 C ALA m 196 -25.706 15.466 52.513 1.00 22.73 C ++ATOM 4605 O ALA m 196 -25.934 15.516 51.305 1.00 22.73 O ++ATOM 4606 CB ALA m 196 -26.284 17.819 53.015 1.00 22.73 C ++ATOM 4607 N TRP m 197 -25.872 14.361 53.233 1.00 29.16 N ++ATOM 4608 CA TRP m 197 -26.260 13.113 52.596 1.00 29.16 C ++ATOM 4609 C TRP m 197 -27.535 12.583 53.221 1.00 29.16 C ++ATOM 4610 O TRP m 197 -27.836 12.853 54.383 1.00 29.16 O ++ATOM 4611 CB TRP m 197 -25.164 12.053 52.685 1.00 29.16 C ++ATOM 4612 CG TRP m 197 -24.835 11.534 54.029 1.00 29.16 C ++ATOM 4613 CD1 TRP m 197 -25.373 10.442 54.626 1.00 29.16 C ++ATOM 4614 CD2 TRP m 197 -23.855 12.045 54.931 1.00 29.16 C ++ATOM 4615 NE1 TRP m 197 -24.804 10.248 55.856 1.00 29.16 N ++ATOM 4616 CE2 TRP m 197 -23.868 11.225 56.067 1.00 29.16 C ++ATOM 4617 CE3 TRP m 197 -22.981 13.128 54.899 1.00 29.16 C ++ATOM 4618 CZ2 TRP m 197 -23.040 11.449 57.152 1.00 29.16 C ++ATOM 4619 CZ3 TRP m 197 -22.159 13.347 55.980 1.00 29.16 C ++ATOM 4620 CH2 TRP m 197 -22.198 12.517 57.089 1.00 29.16 C ++ATOM 4621 N SER m 198 -28.283 11.809 52.437 1.00 43.03 N ++ATOM 4622 CA SER m 198 -29.597 11.368 52.874 1.00 43.03 C ++ATOM 4623 C SER m 198 -29.942 10.027 52.260 1.00 43.03 C ++ATOM 4624 O SER m 198 -29.428 9.649 51.207 1.00 43.03 O ++ATOM 4625 CB SER m 198 -30.679 12.372 52.494 1.00 43.03 C ++ATOM 4626 OG SER m 198 -30.476 13.604 53.146 1.00 43.03 O ++ATOM 4627 N ASN m 199 -30.864 9.329 52.917 1.00 57.46 N ++ATOM 4628 CA ASN m 199 -31.433 8.079 52.419 1.00 57.46 C ++ATOM 4629 C ASN m 199 -32.937 8.305 52.338 1.00 57.46 C ++ATOM 4630 O ASN m 199 -33.676 7.830 53.202 1.00 57.46 O ++ATOM 4631 CB ASN m 199 -31.078 6.920 53.355 1.00 57.46 C ++ATOM 4632 CG ASN m 199 -31.227 5.555 52.703 1.00 57.46 C ++ATOM 4633 OD1 ASN m 199 -30.758 4.554 53.245 1.00 57.46 O ++ATOM 4634 ND2 ASN m 199 -31.861 5.504 51.540 1.00 57.46 N ++ATOM 4635 N LYS m 200 -33.378 8.952 51.261 1.00 63.11 N ++ATOM 4636 CA LYS m 200 -34.783 9.279 51.046 1.00 63.11 C ++ATOM 4637 C LYS m 200 -34.948 9.799 49.630 1.00 63.11 C ++ATOM 4638 O LYS m 200 -33.989 10.256 49.001 1.00 63.11 O ++ATOM 4639 CB LYS m 200 -35.299 10.323 52.044 1.00 63.11 C ++ATOM 4640 CG LYS m 200 -34.705 11.699 51.869 1.00 63.11 C ++ATOM 4641 CD LYS m 200 -35.139 12.626 52.987 1.00 63.11 C ++ATOM 4642 CE LYS m 200 -36.599 13.001 52.869 1.00 63.11 C ++ATOM 4643 NZ LYS m 200 -36.979 13.997 53.904 1.00 63.11 N ++ATOM 4644 N SER m 201 -36.178 9.714 49.136 1.00 72.98 N ++ATOM 4645 CA SER m 201 -36.543 10.384 47.900 1.00 72.98 C ++ATOM 4646 C SER m 201 -36.888 11.838 48.188 1.00 72.98 C ++ATOM 4647 O SER m 201 -37.052 12.233 49.348 1.00 72.98 O ++ATOM 4648 CB SER m 201 -37.727 9.684 47.237 1.00 72.98 C ++ATOM 4649 OG SER m 201 -38.897 9.811 48.025 1.00 72.98 O ++ATOM 4650 N ASP m 202 -36.991 12.627 47.113 1.00 76.63 N ++ATOM 4651 CA ASP m 202 -37.264 14.071 47.158 1.00 76.63 C ++ATOM 4652 C ASP m 202 -36.227 14.820 47.996 1.00 76.63 C ++ATOM 4653 O ASP m 202 -36.543 15.760 48.727 1.00 76.63 O ++ATOM 4654 CB ASP m 202 -38.689 14.367 47.647 1.00 76.63 C ++ATOM 4655 CG ASP m 202 -39.749 14.029 46.609 1.00 76.63 C ++ATOM 4656 OD1 ASP m 202 -39.451 14.115 45.399 1.00 76.63 O ++ATOM 4657 OD2 ASP m 202 -40.882 13.683 47.004 1.00 76.63 O ++ATOM 4658 N PHE m 203 -34.973 14.387 47.888 1.00 55.84 N ++ATOM 4659 CA PHE m 203 -33.843 15.107 48.469 1.00 55.84 C ++ATOM 4660 C PHE m 203 -33.058 15.699 47.309 1.00 55.84 C ++ATOM 4661 O PHE m 203 -32.136 15.084 46.778 1.00 55.84 O ++ATOM 4662 CB PHE m 203 -32.969 14.205 49.327 1.00 55.84 C ++ATOM 4663 CG PHE m 203 -31.823 14.924 49.971 1.00 55.84 C ++ATOM 4664 CD1 PHE m 203 -32.042 15.749 51.057 1.00 55.84 C ++ATOM 4665 CD2 PHE m 203 -30.535 14.792 49.486 1.00 55.84 C ++ATOM 4666 CE1 PHE m 203 -30.999 16.424 51.650 1.00 55.84 C ++ATOM 4667 CE2 PHE m 203 -29.491 15.464 50.074 1.00 55.84 C ++ATOM 4668 CZ PHE m 203 -29.723 16.280 51.157 1.00 55.84 C ++ATOM 4669 N ALA m 204 -33.448 16.894 46.897 1.00 60.60 N ++ATOM 4670 CA ALA m 204 -32.688 17.633 45.907 1.00 60.60 C ++ATOM 4671 C ALA m 204 -31.858 18.699 46.601 1.00 60.60 C ++ATOM 4672 O ALA m 204 -32.142 19.103 47.730 1.00 60.60 O ++ATOM 4673 CB ALA m 204 -33.613 18.266 44.869 1.00 60.60 C ++ATOM 4674 N CYS m 205 -30.817 19.157 45.905 1.00 57.92 N ++ATOM 4675 CA CYS m 205 -29.899 20.121 46.494 1.00 57.92 C ++ATOM 4676 C CYS m 205 -30.528 21.495 46.661 1.00 57.92 C ++ATOM 4677 O CYS m 205 -30.024 22.296 47.452 1.00 57.92 O ++ATOM 4678 CB CYS m 205 -28.645 20.245 45.643 1.00 57.92 C ++ATOM 4679 SG CYS m 205 -27.653 18.755 45.486 1.00 57.92 S ++ATOM 4680 N ALA m 206 -31.604 21.789 45.932 1.00 59.18 N ++ATOM 4681 CA ALA m 206 -32.327 23.033 46.163 1.00 59.18 C ++ATOM 4682 C ALA m 206 -33.047 23.004 47.504 1.00 59.18 C ++ATOM 4683 O ALA m 206 -33.214 24.044 48.150 1.00 59.18 O ++ATOM 4684 CB ALA m 206 -33.314 23.284 45.026 1.00 59.18 C ++ATOM 4685 N ASN m 207 -33.471 21.820 47.942 1.00 62.49 N ++ATOM 4686 CA ASN m 207 -34.170 21.659 49.209 1.00 62.49 C ++ATOM 4687 C ASN m 207 -33.316 20.980 50.266 1.00 62.49 C ++ATOM 4688 O ASN m 207 -33.858 20.323 51.163 1.00 62.49 O ++ATOM 4689 CB ASN m 207 -35.461 20.874 48.989 1.00 62.49 C ++ATOM 4690 CG ASN m 207 -36.470 21.636 48.155 1.00 62.49 C ++ATOM 4691 OD1 ASN m 207 -36.653 22.841 48.332 1.00 62.49 O ++ATOM 4692 ND2 ASN m 207 -37.128 20.938 47.235 1.00 62.49 N ++ATOM 4693 N ALA m 208 -31.994 21.115 50.184 1.00 48.70 N ++ATOM 4694 CA ALA m 208 -31.087 20.432 51.098 1.00 48.70 C ++ATOM 4695 C ALA m 208 -30.593 21.329 52.221 1.00 48.70 C ++ATOM 4696 O ALA m 208 -30.657 20.947 53.389 1.00 48.70 O ++ATOM 4697 CB ALA m 208 -29.892 19.867 50.328 1.00 48.70 C ++ATOM 4698 N PHE m 209 -30.103 22.518 51.890 1.00 37.70 N ++ATOM 4699 CA PHE m 209 -29.552 23.445 52.873 1.00 37.70 C ++ATOM 4700 C PHE m 209 -30.558 24.515 53.259 1.00 37.70 C ++ATOM 4701 O PHE m 209 -30.205 25.678 53.461 1.00 37.70 O ++ATOM 4702 CB PHE m 209 -28.266 24.060 52.344 1.00 37.70 C ++ATOM 4703 CG PHE m 209 -27.128 23.090 52.278 1.00 37.70 C ++ATOM 4704 CD1 PHE m 209 -26.312 22.885 53.371 1.00 37.70 C ++ATOM 4705 CD2 PHE m 209 -26.903 22.352 51.139 1.00 37.70 C ++ATOM 4706 CE1 PHE m 209 -25.278 21.984 53.314 1.00 37.70 C ++ATOM 4707 CE2 PHE m 209 -25.877 21.449 51.083 1.00 37.70 C ++ATOM 4708 CZ PHE m 209 -25.064 21.266 52.172 1.00 37.70 C ++ATOM 4709 N ASN m 210 -31.830 24.121 53.356 1.00 47.97 N ++ATOM 4710 CA ASN m 210 -32.905 25.065 53.632 1.00 47.97 C ++ATOM 4711 C ASN m 210 -32.840 25.586 55.061 1.00 47.97 C ++ATOM 4712 O ASN m 210 -33.245 26.723 55.321 1.00 47.97 O ++ATOM 4713 CB ASN m 210 -34.250 24.384 53.377 1.00 47.97 C ++ATOM 4714 CG ASN m 210 -35.392 25.366 53.216 1.00 47.97 C ++ATOM 4715 OD1 ASN m 210 -35.198 26.578 53.238 1.00 47.97 O ++ATOM 4716 ND2 ASN m 210 -36.598 24.839 53.055 1.00 47.97 N ++ATOM 4717 N ASN m 211 -32.327 24.781 55.991 1.00 52.95 N ++ATOM 4718 CA ASN m 211 -32.319 25.171 57.397 1.00 52.95 C ++ATOM 4719 C ASN m 211 -31.306 26.281 57.656 1.00 52.95 C ++ATOM 4720 O ASN m 211 -31.605 27.252 58.358 1.00 52.95 O ++ATOM 4721 CB ASN m 211 -32.010 23.955 58.271 1.00 52.95 C ++ATOM 4722 CG ASN m 211 -32.537 24.089 59.693 1.00 52.95 C ++ATOM 4723 OD1 ASN m 211 -32.528 23.121 60.449 1.00 52.95 O ++ATOM 4724 ND2 ASN m 211 -33.021 25.270 60.055 1.00 52.95 N ++ATOM 4725 N SER m 212 -30.102 26.144 57.116 1.00 52.01 N ++ATOM 4726 CA SER m 212 -29.077 27.154 57.324 1.00 52.01 C ++ATOM 4727 C SER m 212 -29.391 28.393 56.503 1.00 52.01 C ++ATOM 4728 O SER m 212 -30.178 28.351 55.555 1.00 52.01 O ++ATOM 4729 CB SER m 212 -27.703 26.606 56.944 1.00 52.01 C ++ATOM 4730 OG SER m 212 -27.334 25.523 57.780 1.00 52.01 O ++ATOM 4731 N ILE m 213 -28.780 29.515 56.884 1.00 56.93 N ++ATOM 4732 CA ILE m 213 -28.927 30.723 56.086 1.00 56.93 C ++ATOM 4733 C ILE m 213 -28.104 30.567 54.810 1.00 56.93 C ++ATOM 4734 O ILE m 213 -27.095 29.850 54.769 1.00 56.93 O ++ATOM 4735 CB ILE m 213 -28.536 31.977 56.896 1.00 56.93 C ++ATOM 4736 CG1 ILE m 213 -29.096 33.245 56.247 1.00 56.93 C ++ATOM 4737 CG2 ILE m 213 -27.028 32.101 57.076 1.00 56.93 C ++ATOM 4738 CD1 ILE m 213 -30.600 33.296 56.228 1.00 56.93 C ++ATOM 4739 N ILE m 214 -28.583 31.179 53.733 1.00 57.84 N ++ATOM 4740 CA ILE m 214 -28.049 30.975 52.395 1.00 57.84 C ++ATOM 4741 C ILE m 214 -27.733 32.340 51.807 1.00 57.84 C ++ATOM 4742 O ILE m 214 -28.618 33.196 51.748 1.00 57.84 O ++ATOM 4743 CB ILE m 214 -29.035 30.214 51.489 1.00 57.84 C ++ATOM 4744 CG1 ILE m 214 -29.260 28.793 52.006 1.00 57.84 C ++ATOM 4745 CG2 ILE m 214 -28.553 30.182 50.074 1.00 57.84 C ++ATOM 4746 CD1 ILE m 214 -28.012 27.957 52.034 1.00 57.84 C ++ATOM 4747 N PRO m 215 -26.508 32.588 51.353 1.00 57.53 N ++ATOM 4748 CA PRO m 215 -26.189 33.874 50.720 1.00 57.53 C ++ATOM 4749 C PRO m 215 -26.759 34.002 49.317 1.00 57.53 C ++ATOM 4750 O PRO m 215 -27.620 33.219 48.908 1.00 57.53 O ++ATOM 4751 CB PRO m 215 -24.659 33.883 50.706 1.00 57.53 C ++ATOM 4752 CG PRO m 215 -24.288 32.460 50.676 1.00 57.53 C ++ATOM 4753 CD PRO m 215 -25.319 31.735 51.489 1.00 57.53 C ++ATOM 4754 N GLU m 216 -26.334 35.020 48.584 1.00 64.87 N ++ATOM 4755 CA GLU m 216 -26.800 35.208 47.221 1.00 64.87 C ++ATOM 4756 C GLU m 216 -25.865 34.542 46.220 1.00 64.87 C ++ATOM 4757 O GLU m 216 -24.656 34.444 46.444 1.00 64.87 O ++ATOM 4758 CB GLU m 216 -26.929 36.694 46.886 1.00 64.87 C ++ATOM 4759 CG GLU m 216 -28.058 37.411 47.605 1.00 64.87 C ++ATOM 4760 CD GLU m 216 -27.654 37.916 48.971 1.00 64.87 C ++ATOM 4761 OE1 GLU m 216 -26.470 37.772 49.336 1.00 64.87 O ++ATOM 4762 OE2 GLU m 216 -28.521 38.460 49.684 1.00 64.87 O ++ATOM 4763 N ASP m 217 -26.456 34.068 45.128 1.00 60.83 N ++ATOM 4764 CA ASP m 217 -25.914 33.650 43.840 1.00 60.83 C ++ATOM 4765 C ASP m 217 -25.259 32.264 43.806 1.00 60.83 C ++ATOM 4766 O ASP m 217 -24.874 31.842 42.714 1.00 60.83 O ++ATOM 4767 CB ASP m 217 -24.905 34.660 43.256 1.00 60.83 C ++ATOM 4768 CG ASP m 217 -25.560 35.953 42.824 1.00 60.83 C ++ATOM 4769 OD1 ASP m 217 -26.749 35.920 42.442 1.00 60.83 O ++ATOM 4770 OD2 ASP m 217 -24.888 37.004 42.866 1.00 60.83 O ++ATOM 4771 N THR m 218 -24.967 31.615 44.944 1.00 47.66 N ++ATOM 4772 CA THR m 218 -25.332 30.226 45.247 1.00 47.66 C ++ATOM 4773 C THR m 218 -25.656 29.339 44.053 1.00 47.66 C ++ATOM 4774 O THR m 218 -26.808 28.923 43.904 1.00 47.66 O ++ATOM 4775 CB THR m 218 -26.477 30.187 46.239 1.00 47.66 C ++ATOM 4776 OG1 THR m 218 -27.576 30.949 45.732 1.00 47.66 O ++ATOM 4777 CG2 THR m 218 -25.998 30.762 47.527 1.00 47.66 C ++ATOM 4778 N PHE m 219 -24.683 29.079 43.186 1.00 38.79 N ++ATOM 4779 CA PHE m 219 -24.947 28.612 41.825 1.00 38.79 C ++ATOM 4780 C PHE m 219 -25.471 27.181 41.843 1.00 38.79 C ++ATOM 4781 O PHE m 219 -24.708 26.222 41.739 1.00 38.79 O ++ATOM 4782 CB PHE m 219 -23.669 28.729 41.002 1.00 38.79 C ++ATOM 4783 CG PHE m 219 -23.812 28.303 39.572 1.00 38.79 C ++ATOM 4784 CD1 PHE m 219 -24.549 29.063 38.680 1.00 38.79 C ++ATOM 4785 CD2 PHE m 219 -23.166 27.168 39.106 1.00 38.79 C ++ATOM 4786 CE1 PHE m 219 -24.672 28.680 37.358 1.00 38.79 C ++ATOM 4787 CE2 PHE m 219 -23.281 26.782 37.787 1.00 38.79 C ++ATOM 4788 CZ PHE m 219 -24.035 27.539 36.911 1.00 38.79 C ++ATOM 4789 N PHE m 220 -26.790 27.042 41.992 1.00 38.88 N ++ATOM 4790 CA PHE m 220 -27.452 25.759 41.787 1.00 38.88 C ++ATOM 4791 C PHE m 220 -27.370 25.395 40.312 1.00 38.88 C ++ATOM 4792 O PHE m 220 -27.916 26.124 39.477 1.00 38.88 O ++ATOM 4793 CB PHE m 220 -28.912 25.819 42.208 1.00 38.88 C ++ATOM 4794 CG PHE m 220 -29.119 25.958 43.679 1.00 38.88 C ++ATOM 4795 CD1 PHE m 220 -29.046 24.858 44.505 1.00 38.88 C ++ATOM 4796 CD2 PHE m 220 -29.424 27.184 44.233 1.00 38.88 C ++ATOM 4797 CE1 PHE m 220 -29.248 24.984 45.863 1.00 38.88 C ++ATOM 4798 CE2 PHE m 220 -29.624 27.316 45.591 1.00 38.88 C ++ATOM 4799 CZ PHE m 220 -29.538 26.215 46.405 1.00 38.88 C ++ATOM 4800 N PRO m 221 -26.711 24.305 39.948 1.00 42.54 N ++ATOM 4801 CA PRO m 221 -26.454 24.037 38.535 1.00 42.54 C ++ATOM 4802 C PRO m 221 -27.680 23.473 37.839 1.00 42.54 C ++ATOM 4803 O PRO m 221 -28.580 22.905 38.458 1.00 42.54 O ++ATOM 4804 CB PRO m 221 -25.332 22.994 38.578 1.00 42.54 C ++ATOM 4805 CG PRO m 221 -24.798 23.057 39.968 1.00 42.54 C ++ATOM 4806 CD PRO m 221 -25.985 23.365 40.802 1.00 42.54 C ++ATOM 4807 N SER m 222 -27.702 23.648 36.525 1.00 57.85 N ++ATOM 4808 CA SER m 222 -28.700 22.980 35.717 1.00 57.85 C ++ATOM 4809 C SER m 222 -28.345 21.500 35.589 1.00 57.85 C ++ATOM 4810 O SER m 222 -27.168 21.133 35.626 1.00 57.85 O ++ATOM 4811 CB SER m 222 -28.788 23.626 34.339 1.00 57.85 C ++ATOM 4812 OG SER m 222 -27.580 23.454 33.624 1.00 57.85 O ++ATOM 4813 N PRO m 223 -29.346 20.623 35.459 1.00 62.95 N ++ATOM 4814 CA PRO m 223 -29.046 19.190 35.298 1.00 62.95 C ++ATOM 4815 C PRO m 223 -28.417 18.839 33.961 1.00 62.95 C ++ATOM 4816 O PRO m 223 -27.847 17.749 33.835 1.00 62.95 O ++ATOM 4817 CB PRO m 223 -30.419 18.524 35.452 1.00 62.95 C ++ATOM 4818 CG PRO m 223 -31.240 19.514 36.203 1.00 62.95 C ++ATOM 4819 CD PRO m 223 -30.776 20.851 35.720 1.00 62.95 C ++ATOM 4820 N GLU m 224 -28.508 19.713 32.962 1.00 72.30 N ++ATOM 4821 CA GLU m 224 -27.839 19.467 31.695 1.00 72.30 C ++ATOM 4822 C GLU m 224 -26.351 19.757 31.829 1.00 72.30 C ++ATOM 4823 O GLU m 224 -25.950 20.765 32.416 1.00 72.30 O ++ATOM 4824 CB GLU m 224 -28.456 20.324 30.594 1.00 72.30 C ++ATOM 4825 CG GLU m 224 -27.923 20.028 29.208 1.00 72.30 C ++ATOM 4826 CD GLU m 224 -28.644 20.802 28.129 1.00 72.30 C ++ATOM 4827 OE1 GLU m 224 -29.547 21.596 28.466 1.00 72.30 O ++ATOM 4828 OE2 GLU m 224 -28.309 20.611 26.942 1.00 72.30 O ++ATOM 4829 N SER m 225 -25.533 18.861 31.282 1.00 80.52 N ++ATOM 4830 CA SER m 225 -24.093 18.921 31.476 1.00 80.52 C ++ATOM 4831 C SER m 225 -23.474 20.049 30.654 1.00 80.52 C ++ATOM 4832 O SER m 225 -24.095 20.629 29.760 1.00 80.52 O ++ATOM 4833 CB SER m 225 -23.450 17.587 31.105 1.00 80.52 C ++ATOM 4834 OG SER m 225 -23.571 17.329 29.718 1.00 80.52 O ++ATOM 4835 N SER m 226 -22.218 20.352 30.975 1.00 80.23 N ++ATOM 4836 CA SER m 226 -21.476 21.441 30.352 1.00 80.23 C ++ATOM 4837 C SER m 226 -20.537 20.936 29.263 1.00 80.23 C ++ATOM 4838 O SER m 226 -20.579 21.435 28.134 1.00 80.23 O ++ATOM 4839 CB SER m 226 -20.693 22.198 31.426 1.00 80.23 C ++ATOM 4840 OG SER m 226 -19.740 21.337 32.024 1.00 80.23 O ++ATOM 4841 N CYS m 227 -19.684 19.965 29.605 1.00 80.59 N ++ATOM 4842 CA CYS m 227 -18.851 19.190 28.680 1.00 80.59 C ++ATOM 4843 C CYS m 227 -17.872 20.082 27.905 1.00 80.59 C ++ATOM 4844 O CYS m 227 -17.969 20.268 26.693 1.00 80.59 O ++ATOM 4845 CB CYS m 227 -19.731 18.365 27.733 1.00 80.59 C ++ATOM 4846 SG CYS m 227 -18.847 17.170 26.731 1.00 80.59 S ++ATOM 4847 N ASP m 228 -16.931 20.656 28.650 1.00 63.10 N ++ATOM 4848 CA ASP m 228 -15.818 21.370 28.028 1.00 63.10 C ++ATOM 4849 C ASP m 228 -14.837 20.349 27.462 1.00 63.10 C ++ATOM 4850 O ASP m 228 -14.213 19.597 28.215 1.00 63.10 O ++ATOM 4851 CB ASP m 228 -15.136 22.280 29.045 1.00 63.10 C ++ATOM 4852 CG ASP m 228 -14.190 23.289 28.398 1.00 63.10 C ++ATOM 4853 OD1 ASP m 228 -14.069 23.307 27.156 1.00 63.10 O ++ATOM 4854 OD2 ASP m 228 -13.562 24.071 29.140 1.00 63.10 O ++ATOM 4855 N VAL m 229 -14.689 20.325 26.137 1.00 55.03 N ++ATOM 4856 CA VAL m 229 -13.847 19.317 25.503 1.00 55.03 C ++ATOM 4857 C VAL m 229 -12.383 19.737 25.540 1.00 55.03 C ++ATOM 4858 O VAL m 229 -11.491 18.906 25.736 1.00 55.03 O ++ATOM 4859 CB VAL m 229 -14.338 19.055 24.067 1.00 55.03 C ++ATOM 4860 CG1 VAL m 229 -13.478 18.013 23.365 1.00 55.03 C ++ATOM 4861 CG2 VAL m 229 -15.791 18.615 24.084 1.00 55.03 C ++ATOM 4862 N LYS m 230 -12.114 21.034 25.407 1.00 53.06 N ++ATOM 4863 CA LYS m 230 -10.739 21.518 25.370 1.00 53.06 C ++ATOM 4864 C LYS m 230 -10.057 21.452 26.730 1.00 53.06 C ++ATOM 4865 O LYS m 230 -8.835 21.606 26.806 1.00 53.06 O ++ATOM 4866 CB LYS m 230 -10.717 22.951 24.845 1.00 53.06 C ++ATOM 4867 CG LYS m 230 -11.248 23.070 23.428 1.00 53.06 C ++ATOM 4868 CD LYS m 230 -11.208 24.494 22.913 1.00 53.06 C ++ATOM 4869 CE LYS m 230 -11.864 24.582 21.543 1.00 53.06 C ++ATOM 4870 NZ LYS m 230 -11.102 23.835 20.499 1.00 53.06 N ++ATOM 4871 N LEU m 231 -10.823 21.243 27.800 1.00 46.27 N ++ATOM 4872 CA LEU m 231 -10.268 21.037 29.130 1.00 46.27 C ++ATOM 4873 C LEU m 231 -9.974 19.567 29.406 1.00 46.27 C ++ATOM 4874 O LEU m 231 -9.142 19.268 30.265 1.00 46.27 O ++ATOM 4875 CB LEU m 231 -11.240 21.620 30.165 1.00 46.27 C ++ATOM 4876 CG LEU m 231 -10.961 21.781 31.662 1.00 46.27 C ++ATOM 4877 CD1 LEU m 231 -11.303 20.535 32.456 1.00 46.27 C ++ATOM 4878 CD2 LEU m 231 -9.514 22.172 31.895 1.00 46.27 C ++ATOM 4879 N VAL m 232 -10.636 18.652 28.697 1.00 41.07 N ++ATOM 4880 CA VAL m 232 -10.303 17.238 28.800 1.00 41.07 C ++ATOM 4881 C VAL m 232 -8.994 16.954 28.077 1.00 41.07 C ++ATOM 4882 O VAL m 232 -8.209 16.094 28.500 1.00 41.07 O ++ATOM 4883 CB VAL m 232 -11.473 16.406 28.251 1.00 41.07 C ++ATOM 4884 CG1 VAL m 232 -11.157 14.934 28.242 1.00 41.07 C ++ATOM 4885 CG2 VAL m 232 -12.714 16.659 29.074 1.00 41.07 C ++ATOM 4886 N GLU m 233 -8.701 17.713 27.017 1.00 42.50 N ++ATOM 4887 CA GLU m 233 -7.439 17.573 26.299 1.00 42.50 C ++ATOM 4888 C GLU m 233 -6.228 17.970 27.128 1.00 42.50 C ++ATOM 4889 O GLU m 233 -5.117 17.572 26.781 1.00 42.50 O ++ATOM 4890 CB GLU m 233 -7.449 18.415 25.030 1.00 42.50 C ++ATOM 4891 CG GLU m 233 -8.401 17.918 23.977 1.00 42.50 C ++ATOM 4892 CD GLU m 233 -7.969 16.604 23.379 1.00 42.50 C ++ATOM 4893 OE1 GLU m 233 -6.750 16.373 23.253 1.00 42.50 O ++ATOM 4894 OE2 GLU m 233 -8.853 15.799 23.041 1.00 42.50 O ++ATOM 4895 N LYS m 234 -6.408 18.727 28.212 1.00 38.45 N ++ATOM 4896 CA LYS m 234 -5.274 19.099 29.049 1.00 38.45 C ++ATOM 4897 C LYS m 234 -4.728 17.907 29.814 1.00 38.45 C ++ATOM 4898 O LYS m 234 -3.568 17.919 30.234 1.00 38.45 O ++ATOM 4899 CB LYS m 234 -5.685 20.194 30.024 1.00 38.45 C ++ATOM 4900 CG LYS m 234 -6.205 21.447 29.363 1.00 38.45 C ++ATOM 4901 CD LYS m 234 -5.129 22.140 28.568 1.00 38.45 C ++ATOM 4902 CE LYS m 234 -4.117 22.791 29.483 1.00 38.45 C ++ATOM 4903 NZ LYS m 234 -3.112 23.554 28.701 1.00 38.45 N ++ATOM 4904 N SER m 235 -5.542 16.881 30.009 1.00 30.83 N ++ATOM 4905 CA SER m 235 -5.137 15.662 30.694 1.00 30.83 C ++ATOM 4906 C SER m 235 -5.027 14.574 29.638 1.00 30.83 C ++ATOM 4907 O SER m 235 -6.005 13.879 29.353 1.00 30.83 O ++ATOM 4908 CB SER m 235 -6.147 15.272 31.751 1.00 30.83 C ++ATOM 4909 OG SER m 235 -7.311 14.785 31.117 1.00 30.83 O ++ATOM 4910 N PHE m 236 -3.850 14.430 29.041 1.00 33.32 N ++ATOM 4911 CA PHE m 236 -3.624 13.334 28.107 1.00 33.32 C ++ATOM 4912 C PHE m 236 -2.172 12.906 28.277 1.00 33.32 C ++ATOM 4913 O PHE m 236 -1.262 13.614 27.846 1.00 33.32 O ++ATOM 4914 CB PHE m 236 -3.925 13.743 26.675 1.00 33.32 C ++ATOM 4915 CG PHE m 236 -3.867 12.606 25.710 1.00 33.32 C ++ATOM 4916 CD1 PHE m 236 -4.904 11.697 25.642 1.00 33.32 C ++ATOM 4917 CD2 PHE m 236 -2.775 12.429 24.889 1.00 33.32 C ++ATOM 4918 CE1 PHE m 236 -4.853 10.639 24.765 1.00 33.32 C ++ATOM 4919 CE2 PHE m 236 -2.724 11.371 24.015 1.00 33.32 C ++ATOM 4920 CZ PHE m 236 -3.763 10.477 23.955 1.00 33.32 C ++ATOM 4921 N GLU m 237 -1.968 11.777 28.940 1.00 29.27 N ++ATOM 4922 CA GLU m 237 -0.634 11.221 29.046 1.00 29.27 C ++ATOM 4923 C GLU m 237 -0.404 10.223 27.915 1.00 29.27 C ++ATOM 4924 O GLU m 237 -1.288 9.949 27.105 1.00 29.27 O ++ATOM 4925 CB GLU m 237 -0.438 10.552 30.402 1.00 29.27 C ++ATOM 4926 CG GLU m 237 -0.604 11.489 31.585 1.00 29.27 C ++ATOM 4927 CD GLU m 237 -0.275 10.833 32.915 1.00 29.27 C ++ATOM 4928 OE1 GLU m 237 0.041 9.628 32.931 1.00 29.27 O ++ATOM 4929 OE2 GLU m 237 -0.341 11.525 33.951 1.00 29.27 O ++ATOM 4930 N THR m 238 0.801 9.665 27.865 1.00 28.86 N ++ATOM 4931 CA THR m 238 1.158 8.722 26.813 1.00 28.86 C ++ATOM 4932 C THR m 238 2.087 7.663 27.373 1.00 28.86 C ++ATOM 4933 O THR m 238 3.161 7.984 27.883 1.00 28.86 O ++ATOM 4934 CB THR m 238 1.820 9.438 25.647 1.00 28.86 C ++ATOM 4935 OG1 THR m 238 0.890 10.348 25.055 1.00 28.86 O ++ATOM 4936 CG2 THR m 238 2.265 8.466 24.610 1.00 28.86 C ++ATOM 4937 N ASP m 239 1.679 6.410 27.264 1.00 30.53 N ++ATOM 4938 CA ASP m 239 2.485 5.294 27.705 1.00 30.53 C ++ATOM 4939 C ASP m 239 3.529 4.983 26.633 1.00 30.53 C ++ATOM 4940 O ASP m 239 3.560 5.603 25.572 1.00 30.53 O ++ATOM 4941 CB ASP m 239 1.569 4.103 27.986 1.00 30.53 C ++ATOM 4942 CG ASP m 239 2.185 3.086 28.910 1.00 30.53 C ++ATOM 4943 OD1 ASP m 239 3.339 3.293 29.335 1.00 30.53 O ++ATOM 4944 OD2 ASP m 239 1.512 2.078 29.214 1.00 30.53 O ++ATOM 4945 N THR m 240 4.413 4.027 26.909 1.00 33.07 N ++ATOM 4946 CA THR m 240 5.331 3.596 25.860 1.00 33.07 C ++ATOM 4947 C THR m 240 4.639 2.679 24.862 1.00 33.07 C ++ATOM 4948 O THR m 240 5.053 2.600 23.695 1.00 33.07 O ++ATOM 4949 CB THR m 240 6.533 2.893 26.467 1.00 33.07 C ++ATOM 4950 OG1 THR m 240 6.092 1.713 27.142 1.00 33.07 O ++ATOM 4951 CG2 THR m 240 7.219 3.804 27.456 1.00 33.07 C ++ATOM 4952 N ASN m 241 3.580 1.998 25.303 1.00 33.09 N ++ATOM 4953 CA ASN m 241 2.839 1.100 24.426 1.00 33.09 C ++ATOM 4954 C ASN m 241 2.155 1.862 23.307 1.00 33.09 C ++ATOM 4955 O ASN m 241 2.149 1.407 22.160 1.00 33.09 O ++ATOM 4956 CB ASN m 241 1.810 0.323 25.233 1.00 33.09 C ++ATOM 4957 CG ASN m 241 2.444 -0.613 26.225 1.00 33.09 C ++ATOM 4958 OD1 ASN m 241 3.419 -1.296 25.918 1.00 33.09 O ++ATOM 4959 ND2 ASN m 241 1.902 -0.642 27.434 1.00 33.09 N ++ATOM 4960 N LEU m 242 1.605 3.036 23.610 1.00 30.04 N ++ATOM 4961 CA LEU m 242 0.940 3.825 22.581 1.00 30.04 C ++ATOM 4962 C LEU m 242 1.935 4.402 21.588 1.00 30.04 C ++ATOM 4963 O LEU m 242 1.637 4.490 20.392 1.00 30.04 O ++ATOM 4964 CB LEU m 242 0.126 4.936 23.222 1.00 30.04 C ++ATOM 4965 CG LEU m 242 -1.056 4.394 24.000 1.00 30.04 C ++ATOM 4966 CD1 LEU m 242 -1.759 5.499 24.742 1.00 30.04 C ++ATOM 4967 CD2 LEU m 242 -1.979 3.747 23.014 1.00 30.04 C ++ATOM 4968 N ASN m 243 3.125 4.779 22.061 1.00 28.73 N ++ATOM 4969 CA ASN m 243 4.171 5.247 21.160 1.00 28.73 C ++ATOM 4970 C ASN m 243 4.597 4.152 20.195 1.00 28.73 C ++ATOM 4971 O ASN m 243 4.695 4.382 18.982 1.00 28.73 O ++ATOM 4972 CB ASN m 243 5.373 5.723 21.963 1.00 28.73 C ++ATOM 4973 CG ASN m 243 5.104 6.992 22.709 1.00 28.73 C ++ATOM 4974 OD1 ASN m 243 4.506 7.918 22.176 1.00 28.73 O ++ATOM 4975 ND2 ASN m 243 5.540 7.046 23.956 1.00 28.73 N ++ATOM 4976 N PHE m 244 4.814 2.942 20.708 1.00 29.18 N ++ATOM 4977 CA PHE m 244 5.284 1.884 19.824 1.00 29.18 C ++ATOM 4978 C PHE m 244 4.179 1.388 18.901 1.00 29.18 C ++ATOM 4979 O PHE m 244 4.447 1.015 17.754 1.00 29.18 O ++ATOM 4980 CB PHE m 244 5.861 0.738 20.635 1.00 29.18 C ++ATOM 4981 CG PHE m 244 6.445 -0.342 19.795 1.00 29.18 C ++ATOM 4982 CD1 PHE m 244 7.619 -0.126 19.101 1.00 29.18 C ++ATOM 4983 CD2 PHE m 244 5.829 -1.573 19.701 1.00 29.18 C ++ATOM 4984 CE1 PHE m 244 8.169 -1.110 18.324 1.00 29.18 C ++ATOM 4985 CE2 PHE m 244 6.372 -2.566 18.925 1.00 29.18 C ++ATOM 4986 CZ PHE m 244 7.545 -2.334 18.236 1.00 29.18 C ++ATOM 4987 N GLN m 245 2.926 1.415 19.352 1.00 27.81 N ++ATOM 4988 CA GLN m 245 1.856 1.005 18.455 1.00 27.81 C ++ATOM 4989 C GLN m 245 1.577 2.057 17.387 1.00 27.81 C ++ATOM 4990 O GLN m 245 1.245 1.701 16.247 1.00 27.81 O ++ATOM 4991 CB GLN m 245 0.608 0.668 19.255 1.00 27.81 C ++ATOM 4992 CG GLN m 245 0.735 -0.644 19.997 1.00 27.81 C ++ATOM 4993 CD GLN m 245 -0.463 -0.954 20.866 1.00 27.81 C ++ATOM 4994 OE1 GLN m 245 -1.374 -0.143 21.005 1.00 27.81 O ++ATOM 4995 NE2 GLN m 245 -0.469 -2.141 21.456 1.00 27.81 N ++ATOM 4996 N ASN m 246 1.776 3.342 17.696 1.00 25.93 N ++ATOM 4997 CA ASN m 246 1.658 4.354 16.653 1.00 25.93 C ++ATOM 4998 C ASN m 246 2.785 4.233 15.633 1.00 25.93 C ++ATOM 4999 O ASN m 246 2.557 4.401 14.427 1.00 25.93 O ++ATOM 5000 CB ASN m 246 1.660 5.747 17.255 1.00 25.93 C ++ATOM 5001 CG ASN m 246 1.179 6.791 16.285 1.00 25.93 C ++ATOM 5002 OD1 ASN m 246 0.694 6.477 15.204 1.00 25.93 O ++ATOM 5003 ND2 ASN m 246 1.345 8.051 16.650 1.00 25.93 N ++ATOM 5004 N LEU m 247 4.005 3.926 16.090 1.00 24.86 N ++ATOM 5005 CA LEU m 247 5.078 3.710 15.123 1.00 24.86 C ++ATOM 5006 C LEU m 247 4.861 2.456 14.287 1.00 24.86 C ++ATOM 5007 O LEU m 247 5.260 2.425 13.118 1.00 24.86 O ++ATOM 5008 CB LEU m 247 6.433 3.646 15.808 1.00 24.86 C ++ATOM 5009 CG LEU m 247 6.897 4.991 16.331 1.00 24.86 C ++ATOM 5010 CD1 LEU m 247 8.263 4.845 16.930 1.00 24.86 C ++ATOM 5011 CD2 LEU m 247 6.909 6.006 15.213 1.00 24.86 C ++ATOM 5012 N SER m 248 4.213 1.433 14.839 1.00 25.53 N ++ATOM 5013 CA SER m 248 3.895 0.271 14.019 1.00 25.53 C ++ATOM 5014 C SER m 248 2.837 0.607 12.971 1.00 25.53 C ++ATOM 5015 O SER m 248 2.895 0.098 11.844 1.00 25.53 O ++ATOM 5016 CB SER m 248 3.444 -0.890 14.899 1.00 25.53 C ++ATOM 5017 OG SER m 248 2.205 -0.612 15.513 1.00 25.53 O ++ATOM 5018 N VAL m 249 1.894 1.492 13.308 1.00 28.39 N ++ATOM 5019 CA VAL m 249 0.921 1.948 12.312 1.00 28.39 C ++ATOM 5020 C VAL m 249 1.606 2.733 11.195 1.00 28.39 C ++ATOM 5021 O VAL m 249 1.297 2.546 10.007 1.00 28.39 O ++ATOM 5022 CB VAL m 249 -0.188 2.768 12.992 1.00 28.39 C ++ATOM 5023 CG1 VAL m 249 -1.082 3.448 11.980 1.00 28.39 C ++ATOM 5024 CG2 VAL m 249 -1.029 1.871 13.841 1.00 28.39 C ++ATOM 5025 N ILE m 250 2.574 3.587 11.548 1.00 28.72 N ++ATOM 5026 CA ILE m 250 3.297 4.352 10.529 1.00 28.72 C ++ATOM 5027 C ILE m 250 4.116 3.428 9.629 1.00 28.72 C ++ATOM 5028 O ILE m 250 4.135 3.594 8.400 1.00 28.72 O ++ATOM 5029 CB ILE m 250 4.168 5.432 11.194 1.00 28.72 C ++ATOM 5030 CG1 ILE m 250 3.286 6.483 11.849 1.00 28.72 C ++ATOM 5031 CG2 ILE m 250 5.065 6.116 10.198 1.00 28.72 C ++ATOM 5032 CD1 ILE m 250 4.052 7.441 12.709 1.00 28.72 C ++ATOM 5033 N GLY m 251 4.746 2.406 10.216 1.00 27.06 N ++ATOM 5034 CA GLY m 251 5.486 1.438 9.418 1.00 27.06 C ++ATOM 5035 C GLY m 251 4.605 0.652 8.465 1.00 27.06 C ++ATOM 5036 O GLY m 251 4.987 0.400 7.317 1.00 27.06 O ++ATOM 5037 N PHE m 252 3.398 0.296 8.908 1.00 30.67 N ++ATOM 5038 CA PHE m 252 2.482 -0.402 8.010 1.00 30.67 C ++ATOM 5039 C PHE m 252 1.954 0.514 6.910 1.00 30.67 C ++ATOM 5040 O PHE m 252 1.672 0.044 5.804 1.00 30.67 O ++ATOM 5041 CB PHE m 252 1.322 -1.008 8.791 1.00 30.67 C ++ATOM 5042 CG PHE m 252 1.712 -2.154 9.679 1.00 30.67 C ++ATOM 5043 CD1 PHE m 252 2.905 -2.825 9.500 1.00 30.67 C ++ATOM 5044 CD2 PHE m 252 0.879 -2.549 10.708 1.00 30.67 C ++ATOM 5045 CE1 PHE m 252 3.255 -3.867 10.325 1.00 30.67 C ++ATOM 5046 CE2 PHE m 252 1.224 -3.588 11.535 1.00 30.67 C ++ATOM 5047 CZ PHE m 252 2.410 -4.250 11.342 1.00 30.67 C ++ATOM 5048 N ARG m 253 1.851 1.819 7.170 1.00 38.22 N ++ATOM 5049 CA ARG m 253 1.464 2.744 6.101 1.00 38.22 C ++ATOM 5050 C ARG m 253 2.564 2.893 5.051 1.00 38.22 C ++ATOM 5051 O ARG m 253 2.270 2.955 3.847 1.00 38.22 O ++ATOM 5052 CB ARG m 253 1.096 4.102 6.685 1.00 38.22 C ++ATOM 5053 CG ARG m 253 -0.199 4.070 7.453 1.00 38.22 C ++ATOM 5054 CD ARG m 253 -0.489 5.357 8.207 1.00 38.22 C ++ATOM 5055 NE ARG m 253 -0.750 6.496 7.335 1.00 38.22 N ++ATOM 5056 CZ ARG m 253 -1.952 6.815 6.872 1.00 38.22 C ++ATOM 5057 NH1 ARG m 253 -2.103 7.873 6.088 1.00 38.22 N ++ATOM 5058 NH2 ARG m 253 -3.003 6.075 7.191 1.00 38.22 N ++ATOM 5059 N ILE m 254 3.829 2.948 5.483 1.00 32.39 N ++ATOM 5060 CA ILE m 254 4.940 2.961 4.523 1.00 32.39 C ++ATOM 5061 C ILE m 254 4.961 1.681 3.690 1.00 32.39 C ++ATOM 5062 O ILE m 254 5.136 1.728 2.459 1.00 32.39 O ++ATOM 5063 CB ILE m 254 6.289 3.219 5.232 1.00 32.39 C ++ATOM 5064 CG1 ILE m 254 6.569 4.718 5.364 1.00 32.39 C ++ATOM 5065 CG2 ILE m 254 7.460 2.558 4.527 1.00 32.39 C ++ATOM 5066 CD1 ILE m 254 6.227 5.330 6.664 1.00 32.39 C ++ATOM 5067 N LEU m 255 4.737 0.527 4.327 1.00 32.79 N ++ATOM 5068 CA LEU m 255 4.754 -0.721 3.569 1.00 32.79 C ++ATOM 5069 C LEU m 255 3.574 -0.825 2.610 1.00 32.79 C ++ATOM 5070 O LEU m 255 3.721 -1.377 1.513 1.00 32.79 O ++ATOM 5071 CB LEU m 255 4.781 -1.923 4.504 1.00 32.79 C ++ATOM 5072 CG LEU m 255 6.098 -2.110 5.241 1.00 32.79 C ++ATOM 5073 CD1 LEU m 255 6.011 -3.310 6.167 1.00 32.79 C ++ATOM 5074 CD2 LEU m 255 7.234 -2.259 4.249 1.00 32.79 C ++ATOM 5075 N LEU m 256 2.411 -0.280 2.984 1.00 35.62 N ++ATOM 5076 CA LEU m 256 1.297 -0.239 2.043 1.00 35.62 C ++ATOM 5077 C LEU m 256 1.602 0.635 0.844 1.00 35.62 C ++ATOM 5078 O LEU m 256 1.268 0.260 -0.283 1.00 35.62 O ++ATOM 5079 CB LEU m 256 0.017 0.252 2.700 1.00 35.62 C ++ATOM 5080 CG LEU m 256 -0.765 -0.771 3.496 1.00 35.62 C ++ATOM 5081 CD1 LEU m 256 -1.982 -0.098 4.076 1.00 35.62 C ++ATOM 5082 CD2 LEU m 256 -1.160 -1.900 2.572 1.00 35.62 C ++ATOM 5083 N LEU m 257 2.243 1.789 1.058 1.00 38.34 N ++ATOM 5084 CA LEU m 257 2.556 2.659 -0.073 1.00 38.34 C ++ATOM 5085 C LEU m 257 3.563 2.009 -1.015 1.00 38.34 C ++ATOM 5086 O LEU m 257 3.389 2.045 -2.240 1.00 38.34 O ++ATOM 5087 CB LEU m 257 3.066 4.011 0.413 1.00 38.34 C ++ATOM 5088 CG LEU m 257 1.995 4.864 1.083 1.00 38.34 C ++ATOM 5089 CD1 LEU m 257 2.579 6.183 1.564 1.00 38.34 C ++ATOM 5090 CD2 LEU m 257 0.837 5.087 0.133 1.00 38.34 C ++ATOM 5091 N LYS m 258 4.576 1.337 -0.464 1.00 40.70 N ++ATOM 5092 CA LYS m 258 5.589 0.719 -1.320 1.00 40.70 C ++ATOM 5093 C LYS m 258 5.039 -0.492 -2.073 1.00 40.70 C ++ATOM 5094 O LYS m 258 5.262 -0.634 -3.285 1.00 40.70 O ++ATOM 5095 CB LYS m 258 6.810 0.343 -0.490 1.00 40.70 C ++ATOM 5096 CG LYS m 258 7.564 1.550 0.015 1.00 40.70 C ++ATOM 5097 CD LYS m 258 8.765 1.148 0.830 1.00 40.70 C ++ATOM 5098 CE LYS m 258 9.464 2.368 1.381 1.00 40.70 C ++ATOM 5099 NZ LYS m 258 10.636 2.010 2.215 1.00 40.70 N ++ATOM 5100 N VAL m 259 4.295 -1.363 -1.392 1.00 40.37 N ++ATOM 5101 CA VAL m 259 3.780 -2.541 -2.081 1.00 40.37 C ++ATOM 5102 C VAL m 259 2.639 -2.168 -3.040 1.00 40.37 C ++ATOM 5103 O VAL m 259 2.488 -2.788 -4.100 1.00 40.37 O ++ATOM 5104 CB VAL m 259 3.386 -3.606 -1.040 1.00 40.37 C ++ATOM 5105 CG1 VAL m 259 2.797 -4.842 -1.680 1.00 40.37 C ++ATOM 5106 CG2 VAL m 259 4.608 -4.015 -0.253 1.00 40.37 C ++ATOM 5107 N ALA m 260 1.881 -1.103 -2.758 1.00 43.71 N ++ATOM 5108 CA ALA m 260 0.875 -0.661 -3.718 1.00 43.71 C ++ATOM 5109 C ALA m 260 1.517 0.005 -4.927 1.00 43.71 C ++ATOM 5110 O ALA m 260 0.982 -0.075 -6.041 1.00 43.71 O ++ATOM 5111 CB ALA m 260 -0.119 0.283 -3.049 1.00 43.71 C ++ATOM 5112 N GLY m 261 2.675 0.647 -4.736 1.00 47.64 N ++ATOM 5113 CA GLY m 261 3.437 1.120 -5.880 1.00 47.64 C ++ATOM 5114 C GLY m 261 3.927 -0.017 -6.757 1.00 47.64 C ++ATOM 5115 O GLY m 261 3.856 0.060 -7.988 1.00 47.64 O ++ATOM 5116 N PHE m 262 4.400 -1.100 -6.128 1.00 52.16 N ++ATOM 5117 CA PHE m 262 4.777 -2.308 -6.864 1.00 52.16 C ++ATOM 5118 C PHE m 262 3.598 -2.898 -7.631 1.00 52.16 C ++ATOM 5119 O PHE m 262 3.743 -3.306 -8.791 1.00 52.16 O ++ATOM 5120 CB PHE m 262 5.345 -3.342 -5.897 1.00 52.16 C ++ATOM 5121 CG PHE m 262 5.692 -4.648 -6.536 1.00 52.16 C ++ATOM 5122 CD1 PHE m 262 6.819 -4.766 -7.317 1.00 52.16 C ++ATOM 5123 CD2 PHE m 262 4.898 -5.765 -6.336 1.00 52.16 C ++ATOM 5124 CE1 PHE m 262 7.150 -5.971 -7.899 1.00 52.16 C ++ATOM 5125 CE2 PHE m 262 5.221 -6.973 -6.918 1.00 52.16 C ++ATOM 5126 CZ PHE m 262 6.348 -7.075 -7.701 1.00 52.16 C ++ATOM 5127 N ASN m 263 2.420 -2.930 -7.002 1.00 54.34 N ++ATOM 5128 CA ASN m 263 1.228 -3.481 -7.643 1.00 54.34 C ++ATOM 5129 C ASN m 263 0.796 -2.656 -8.846 1.00 54.34 C ++ATOM 5130 O ASN m 263 0.488 -3.218 -9.903 1.00 54.34 O ++ATOM 5131 CB ASN m 263 0.088 -3.562 -6.638 1.00 54.34 C ++ATOM 5132 CG ASN m 263 0.316 -4.619 -5.606 1.00 54.34 C ++ATOM 5133 OD1 ASN m 263 0.756 -5.716 -5.928 1.00 54.34 O ++ATOM 5134 ND2 ASN m 263 0.035 -4.297 -4.349 1.00 54.34 N ++ATOM 5135 N LEU m 264 0.770 -1.327 -8.710 1.00 57.49 N ++ATOM 5136 CA LEU m 264 0.340 -0.499 -9.834 1.00 57.49 C ++ATOM 5137 C LEU m 264 1.369 -0.495 -10.957 1.00 57.49 C ++ATOM 5138 O LEU m 264 0.999 -0.429 -12.135 1.00 57.49 O ++ATOM 5139 CB LEU m 264 0.031 0.921 -9.371 1.00 57.49 C ++ATOM 5140 CG LEU m 264 -1.249 1.005 -8.542 1.00 57.49 C ++ATOM 5141 CD1 LEU m 264 -1.462 2.419 -8.019 1.00 57.49 C ++ATOM 5142 CD2 LEU m 264 -2.449 0.533 -9.355 1.00 57.49 C ++ATOM 5143 N LEU m 265 2.660 -0.615 -10.622 1.00 61.23 N ++ATOM 5144 CA LEU m 265 3.656 -0.759 -11.678 1.00 61.23 C ++ATOM 5145 C LEU m 265 3.528 -2.085 -12.411 1.00 61.23 C ++ATOM 5146 O LEU m 265 3.671 -2.122 -13.636 1.00 61.23 O ++ATOM 5147 CB LEU m 265 5.061 -0.602 -11.113 1.00 61.23 C ++ATOM 5148 CG LEU m 265 5.413 0.840 -10.771 1.00 61.23 C ++ATOM 5149 CD1 LEU m 265 6.714 0.866 -10.025 1.00 61.23 C ++ATOM 5150 CD2 LEU m 265 5.503 1.677 -12.030 1.00 61.23 C ++ATOM 5151 N MET m 266 3.214 -3.172 -11.706 1.00 65.55 N ++ATOM 5152 CA MET m 266 3.065 -4.444 -12.406 1.00 65.55 C ++ATOM 5153 C MET m 266 1.774 -4.500 -13.214 1.00 65.55 C ++ATOM 5154 O MET m 266 1.732 -5.140 -14.270 1.00 65.55 O ++ATOM 5155 CB MET m 266 3.148 -5.603 -11.426 1.00 65.55 C ++ATOM 5156 CG MET m 266 4.548 -5.827 -10.926 1.00 65.55 C ++ATOM 5157 SD MET m 266 5.624 -6.249 -12.303 1.00 65.55 S ++ATOM 5158 CE MET m 266 7.224 -6.184 -11.515 1.00 65.55 C ++ATOM 5159 N THR m 267 0.723 -3.807 -12.771 1.00 64.47 N ++ATOM 5160 CA THR m 267 -0.480 -3.771 -13.599 1.00 64.47 C ++ATOM 5161 C THR m 267 -0.302 -2.884 -14.821 1.00 64.47 C ++ATOM 5162 O THR m 267 -0.809 -3.217 -15.899 1.00 64.47 O ++ATOM 5163 CB THR m 267 -1.686 -3.310 -12.796 1.00 64.47 C ++ATOM 5164 OG1 THR m 267 -1.416 -2.028 -12.223 1.00 64.47 O ++ATOM 5165 CG2 THR m 267 -2.004 -4.304 -11.716 1.00 64.47 C ++ATOM 5166 N LEU m 268 0.434 -1.776 -14.699 1.00 72.00 N ++ATOM 5167 CA LEU m 268 0.736 -0.982 -15.886 1.00 72.00 C ++ATOM 5168 C LEU m 268 1.701 -1.717 -16.809 1.00 72.00 C ++ATOM 5169 O LEU m 268 1.678 -1.518 -18.029 1.00 72.00 O ++ATOM 5170 CB LEU m 268 1.291 0.387 -15.492 1.00 72.00 C ++ATOM 5171 CG LEU m 268 0.276 1.355 -14.885 1.00 72.00 C ++ATOM 5172 CD1 LEU m 268 0.949 2.630 -14.412 1.00 72.00 C ++ATOM 5173 CD2 LEU m 268 -0.813 1.667 -15.892 1.00 72.00 C ++ATOM 5174 N ARG m 269 2.532 -2.602 -16.254 1.00 74.98 N ++ATOM 5175 CA ARG m 269 3.407 -3.406 -17.098 1.00 74.98 C ++ATOM 5176 C ARG m 269 2.616 -4.468 -17.851 1.00 74.98 C ++ATOM 5177 O ARG m 269 2.855 -4.704 -19.039 1.00 74.98 O ++ATOM 5178 CB ARG m 269 4.510 -4.043 -16.252 1.00 74.98 C ++ATOM 5179 CG ARG m 269 5.662 -4.650 -17.045 1.00 74.98 C ++ATOM 5180 CD ARG m 269 5.537 -6.151 -17.245 1.00 74.98 C ++ATOM 5181 NE ARG m 269 6.713 -6.706 -17.903 1.00 74.98 N ++ATOM 5182 CZ ARG m 269 6.772 -7.932 -18.407 1.00 74.98 C ++ATOM 5183 NH1 ARG m 269 7.880 -8.363 -18.988 1.00 74.98 N ++ATOM 5184 NH2 ARG m 269 5.715 -8.725 -18.337 1.00 74.98 N ++ATOM 5185 N LEU m 270 1.674 -5.123 -17.178 1.00 73.85 N ++ATOM 5186 CA LEU m 270 0.893 -6.154 -17.846 1.00 73.85 C ++ATOM 5187 C LEU m 270 -0.238 -5.593 -18.695 1.00 73.85 C ++ATOM 5188 O LEU m 270 -0.853 -6.354 -19.450 1.00 73.85 O ++ATOM 5189 CB LEU m 270 0.338 -7.140 -16.822 1.00 73.85 C ++ATOM 5190 CG LEU m 270 1.431 -7.965 -16.151 1.00 73.85 C ++ATOM 5191 CD1 LEU m 270 0.850 -8.878 -15.094 1.00 73.85 C ++ATOM 5192 CD2 LEU m 270 2.175 -8.763 -17.197 1.00 73.85 C ++ATOM 5193 N TRP m 271 -0.537 -4.300 -18.592 1.00 88.51 N ++ATOM 5194 CA TRP m 271 -1.462 -3.671 -19.523 1.00 88.51 C ++ATOM 5195 C TRP m 271 -0.753 -2.937 -20.653 1.00 88.51 C ++ATOM 5196 O TRP m 271 -1.353 -2.715 -21.709 1.00 88.51 O ++ATOM 5197 CB TRP m 271 -2.399 -2.715 -18.771 1.00 88.51 C ++ATOM 5198 CG TRP m 271 -3.472 -2.094 -19.622 1.00 88.51 C ++ATOM 5199 CD1 TRP m 271 -3.567 -0.787 -19.999 1.00 88.51 C ++ATOM 5200 CD2 TRP m 271 -4.567 -2.772 -20.250 1.00 88.51 C ++ATOM 5201 NE1 TRP m 271 -4.673 -0.599 -20.791 1.00 88.51 N ++ATOM 5202 CE2 TRP m 271 -5.302 -1.804 -20.966 1.00 88.51 C ++ATOM 5203 CE3 TRP m 271 -5.006 -4.101 -20.269 1.00 88.51 C ++ATOM 5204 CZ2 TRP m 271 -6.448 -2.122 -21.692 1.00 88.51 C ++ATOM 5205 CZ3 TRP m 271 -6.146 -4.416 -20.990 1.00 88.51 C ++ATOM 5206 CH2 TRP m 271 -6.855 -3.431 -21.690 1.00 88.51 C ++ATOM 5207 N SER m 272 0.525 -2.593 -20.480 1.00 85.26 N ++ATOM 5208 CA SER m 272 1.295 -2.046 -21.589 1.00 85.26 C ++ATOM 5209 C SER m 272 1.689 -3.106 -22.609 1.00 85.26 C ++ATOM 5210 O SER m 272 2.048 -2.754 -23.736 1.00 85.26 O ++ATOM 5211 CB SER m 272 2.554 -1.348 -21.070 1.00 85.26 C ++ATOM 5212 OG SER m 272 3.471 -2.281 -20.525 1.00 85.26 O ++ATOM 5213 N SER m 273 1.639 -4.383 -22.243 1.00 82.25 N ++ATOM 5214 CA SER m 273 1.955 -5.460 -23.171 1.00 82.25 C ++ATOM 5215 C SER m 273 1.133 -6.707 -22.859 1.00 82.25 C ++ATOM 5216 O SER m 273 0.394 -7.206 -23.708 1.00 82.25 O ++ATOM 5217 CB SER m 273 3.446 -5.785 -23.124 1.00 82.25 C ++ATOM 5218 OG SER m 273 3.807 -6.316 -21.864 1.00 82.25 O ++ATOM 5220 N GLY n 22 10.833 9.663 73.024 1.00 69.64 N ++ATOM 5221 CA GLY n 22 9.749 10.362 73.688 1.00 69.64 C ++ATOM 5222 C GLY n 22 8.934 9.466 74.599 1.00 69.64 C ++ATOM 5223 O GLY n 22 9.486 8.647 75.329 1.00 69.64 O ++ATOM 5224 N VAL n 23 7.614 9.622 74.554 1.00 54.42 N ++ATOM 5225 CA VAL n 23 6.692 8.840 75.368 1.00 54.42 C ++ATOM 5226 C VAL n 23 5.760 8.095 74.431 1.00 54.42 C ++ATOM 5227 O VAL n 23 5.091 8.714 73.595 1.00 54.42 O ++ATOM 5228 CB VAL n 23 5.896 9.727 76.335 1.00 54.42 C ++ATOM 5229 CG1 VAL n 23 4.878 8.902 77.090 1.00 54.42 C ++ATOM 5230 CG2 VAL n 23 6.829 10.420 77.297 1.00 54.42 C ++ATOM 5231 N THR n 24 5.722 6.772 74.556 1.00 52.29 N ++ATOM 5232 CA THR n 24 4.857 5.930 73.747 1.00 52.29 C ++ATOM 5233 C THR n 24 3.890 5.182 74.650 1.00 52.29 C ++ATOM 5234 O THR n 24 4.150 4.992 75.838 1.00 52.29 O ++ATOM 5235 CB THR n 24 5.668 4.920 72.931 1.00 52.29 C ++ATOM 5236 OG1 THR n 24 6.340 4.024 73.823 1.00 52.29 O ++ATOM 5237 CG2 THR n 24 6.702 5.626 72.071 1.00 52.29 C ++ATOM 5238 N GLN n 25 2.769 4.750 74.078 1.00 36.63 N ++ATOM 5239 CA GLN n 25 1.842 3.916 74.828 1.00 36.63 C ++ATOM 5240 C GLN n 25 1.036 3.047 73.880 1.00 36.63 C ++ATOM 5241 O GLN n 25 0.833 3.387 72.714 1.00 36.63 O ++ATOM 5242 CB GLN n 25 0.921 4.750 75.712 1.00 36.63 C ++ATOM 5243 CG GLN n 25 0.005 5.675 75.000 1.00 36.63 C ++ATOM 5244 CD GLN n 25 -0.757 6.515 75.980 1.00 36.63 C ++ATOM 5245 OE1 GLN n 25 -0.588 6.378 77.186 1.00 36.63 O ++ATOM 5246 NE2 GLN n 25 -1.611 7.379 75.479 1.00 36.63 N ++ATOM 5247 N THR n 26 0.570 1.916 74.412 1.00 33.36 N ++ATOM 5248 CA THR n 26 0.052 0.810 73.628 1.00 33.36 C ++ATOM 5249 C THR n 26 -1.097 0.169 74.397 1.00 33.36 C ++ATOM 5250 O THR n 26 -0.943 -0.086 75.601 1.00 33.36 O ++ATOM 5251 CB THR n 26 1.168 -0.210 73.372 1.00 33.36 C ++ATOM 5252 OG1 THR n 26 2.222 0.413 72.626 1.00 33.36 O ++ATOM 5253 CG2 THR n 26 0.678 -1.430 72.611 1.00 33.36 C ++ATOM 5254 N PRO n 27 -2.248 -0.105 73.759 1.00 30.23 N ++ATOM 5255 CA PRO n 27 -2.638 0.076 72.360 1.00 30.23 C ++ATOM 5256 C PRO n 27 -3.059 1.493 72.066 1.00 30.23 C ++ATOM 5257 O PRO n 27 -3.167 2.282 72.996 1.00 30.23 O ++ATOM 5258 CB PRO n 27 -3.826 -0.865 72.213 1.00 30.23 C ++ATOM 5259 CG PRO n 27 -4.439 -0.863 73.548 1.00 30.23 C ++ATOM 5260 CD PRO n 27 -3.316 -0.759 74.531 1.00 30.23 C ++ATOM 5261 N LYS n 28 -3.286 1.818 70.797 1.00 28.17 N ++ATOM 5262 CA LYS n 28 -3.914 3.097 70.498 1.00 28.17 C ++ATOM 5263 C LYS n 28 -5.399 3.046 70.816 1.00 28.17 C ++ATOM 5264 O LYS n 28 -5.885 3.791 71.669 1.00 28.17 O ++ATOM 5265 CB LYS n 28 -3.698 3.487 69.038 1.00 28.17 C ++ATOM 5266 CG LYS n 28 -2.312 3.988 68.710 1.00 28.17 C ++ATOM 5267 CD LYS n 28 -2.258 4.431 67.257 1.00 28.17 C ++ATOM 5268 CE LYS n 28 -0.894 4.966 66.880 1.00 28.17 C ++ATOM 5269 NZ LYS n 28 -0.858 5.392 65.457 1.00 28.17 N ++ATOM 5270 N PHE n 29 -6.147 2.193 70.127 1.00 27.25 N ++ATOM 5271 CA PHE n 29 -7.586 2.124 70.328 1.00 27.25 C ++ATOM 5272 C PHE n 29 -7.933 0.754 70.895 1.00 27.25 C ++ATOM 5273 O PHE n 29 -7.238 -0.227 70.629 1.00 27.25 O ++ATOM 5274 CB PHE n 29 -8.377 2.356 69.030 1.00 27.25 C ++ATOM 5275 CG PHE n 29 -8.229 3.745 68.406 1.00 27.25 C ++ATOM 5276 CD1 PHE n 29 -7.551 4.778 69.023 1.00 27.25 C ++ATOM 5277 CD2 PHE n 29 -8.850 4.020 67.202 1.00 27.25 C ++ATOM 5278 CE1 PHE n 29 -7.431 6.014 68.424 1.00 27.25 C ++ATOM 5279 CE2 PHE n 29 -8.747 5.255 66.605 1.00 27.25 C ++ATOM 5280 CZ PHE n 29 -8.043 6.256 67.222 1.00 27.25 C ++ATOM 5281 N GLN n 30 -9.018 0.679 71.666 1.00 26.01 N ++ATOM 5282 CA GLN n 30 -9.388 -0.579 72.310 1.00 26.01 C ++ATOM 5283 C GLN n 30 -10.879 -0.612 72.615 1.00 26.01 C ++ATOM 5284 O GLN n 30 -11.422 0.353 73.151 1.00 26.01 O ++ATOM 5285 CB GLN n 30 -8.586 -0.781 73.597 1.00 26.01 C ++ATOM 5286 CG GLN n 30 -8.920 -2.054 74.345 1.00 26.01 C ++ATOM 5287 CD GLN n 30 -8.567 -3.297 73.563 1.00 26.01 C ++ATOM 5288 OE1 GLN n 30 -7.505 -3.378 72.951 1.00 26.01 O ++ATOM 5289 NE2 GLN n 30 -9.464 -4.275 73.571 1.00 26.01 N ++ATOM 5290 N VAL n 31 -11.527 -1.726 72.282 1.00 27.70 N ++ATOM 5291 CA VAL n 31 -12.920 -1.994 72.616 1.00 27.70 C ++ATOM 5292 C VAL n 31 -12.930 -3.179 73.565 1.00 27.70 C ++ATOM 5293 O VAL n 31 -12.144 -4.114 73.387 1.00 27.70 O ++ATOM 5294 CB VAL n 31 -13.744 -2.316 71.351 1.00 27.70 C ++ATOM 5295 CG1 VAL n 31 -15.233 -2.463 71.655 1.00 27.70 C ++ATOM 5296 CG2 VAL n 31 -13.489 -1.300 70.283 1.00 27.70 C ++ATOM 5297 N LEU n 32 -13.816 -3.152 74.561 1.00 37.45 N ++ATOM 5298 CA LEU n 32 -13.928 -4.261 75.497 1.00 37.45 C ++ATOM 5299 C LEU n 32 -15.313 -4.284 76.127 1.00 37.45 C ++ATOM 5300 O LEU n 32 -15.909 -3.235 76.372 1.00 37.45 O ++ATOM 5301 CB LEU n 32 -12.823 -4.177 76.555 1.00 37.45 C ++ATOM 5302 CG LEU n 32 -12.652 -2.873 77.319 1.00 37.45 C ++ATOM 5303 CD1 LEU n 32 -13.351 -2.909 78.644 1.00 37.45 C ++ATOM 5304 CD2 LEU n 32 -11.193 -2.558 77.489 1.00 37.45 C ++ATOM 5305 N LYS n 33 -15.814 -5.492 76.374 1.00 52.38 N ++ATOM 5306 CA LYS n 33 -17.131 -5.709 76.956 1.00 52.38 C ++ATOM 5307 C LYS n 33 -17.134 -5.280 78.425 1.00 52.38 C ++ATOM 5308 O LYS n 33 -16.087 -5.210 79.073 1.00 52.38 O ++ATOM 5309 CB LYS n 33 -17.511 -7.186 76.805 1.00 52.38 C ++ATOM 5310 CG LYS n 33 -18.939 -7.587 77.156 1.00 52.38 C ++ATOM 5311 CD LYS n 33 -19.180 -9.046 76.824 1.00 52.38 C ++ATOM 5312 CE LYS n 33 -18.441 -9.954 77.790 1.00 52.38 C ++ATOM 5313 NZ LYS n 33 -18.719 -11.393 77.526 1.00 52.38 N ++ATOM 5314 N THR n 34 -18.324 -4.943 78.930 1.00 54.95 N ++ATOM 5315 CA THR n 34 -18.505 -4.585 80.334 1.00 54.95 C ++ATOM 5316 C THR n 34 -18.097 -5.732 81.252 1.00 54.95 C ++ATOM 5317 O THR n 34 -18.516 -6.876 81.060 1.00 54.95 O ++ATOM 5318 CB THR n 34 -19.969 -4.212 80.584 1.00 54.95 C ++ATOM 5319 OG1 THR n 34 -20.328 -3.104 79.755 1.00 54.95 O ++ATOM 5320 CG2 THR n 34 -20.206 -3.838 82.040 1.00 54.95 C ++ATOM 5321 N GLY n 35 -17.263 -5.424 82.242 1.00 54.24 N ++ATOM 5322 CA GLY n 35 -16.795 -6.430 83.175 1.00 54.24 C ++ATOM 5323 C GLY n 35 -15.677 -7.268 82.597 1.00 54.24 C ++ATOM 5324 O GLY n 35 -15.807 -8.487 82.462 1.00 54.24 O ++ATOM 5325 N GLN n 36 -14.568 -6.617 82.261 1.00 52.60 N ++ATOM 5326 CA GLN n 36 -13.461 -7.276 81.585 1.00 52.60 C ++ATOM 5327 C GLN n 36 -12.198 -6.462 81.806 1.00 52.60 C ++ATOM 5328 O GLN n 36 -12.206 -5.245 81.617 1.00 52.60 O ++ATOM 5329 CB GLN n 36 -13.757 -7.427 80.092 1.00 52.60 C ++ATOM 5330 CG GLN n 36 -12.692 -8.147 79.310 1.00 52.60 C ++ATOM 5331 CD GLN n 36 -13.106 -8.377 77.877 1.00 52.60 C ++ATOM 5332 OE1 GLN n 36 -14.206 -8.008 77.473 1.00 52.60 O ++ATOM 5333 NE2 GLN n 36 -12.223 -8.978 77.095 1.00 52.60 N ++ATOM 5334 N SER n 37 -11.126 -7.135 82.208 1.00 49.61 N ++ATOM 5335 CA SER n 37 -9.882 -6.456 82.527 1.00 49.61 C ++ATOM 5336 C SER n 37 -9.175 -6.000 81.258 1.00 49.61 C ++ATOM 5337 O SER n 37 -9.433 -6.491 80.159 1.00 49.61 O ++ATOM 5338 CB SER n 37 -8.960 -7.370 83.332 1.00 49.61 C ++ATOM 5339 OG SER n 37 -8.516 -8.461 82.546 1.00 49.61 O ++ATOM 5340 N MET n 38 -8.264 -5.049 81.432 1.00 46.29 N ++ATOM 5341 CA MET n 38 -7.492 -4.502 80.325 1.00 46.29 C ++ATOM 5342 C MET n 38 -6.230 -3.869 80.879 1.00 46.29 C ++ATOM 5343 O MET n 38 -6.303 -3.020 81.769 1.00 46.29 O ++ATOM 5344 CB MET n 38 -8.293 -3.462 79.548 1.00 46.29 C ++ATOM 5345 CG MET n 38 -7.557 -2.869 78.367 1.00 46.29 C ++ATOM 5346 SD MET n 38 -7.250 -4.055 77.054 1.00 46.29 S ++ATOM 5347 CE MET n 38 -5.835 -3.304 76.258 1.00 46.29 C ++ATOM 5348 N THR n 39 -5.087 -4.276 80.356 1.00 47.33 N ++ATOM 5349 CA THR n 39 -3.802 -3.739 80.771 1.00 47.33 C ++ATOM 5350 C THR n 39 -3.260 -2.898 79.629 1.00 47.33 C ++ATOM 5351 O THR n 39 -3.044 -3.413 78.529 1.00 47.33 O ++ATOM 5352 CB THR n 39 -2.832 -4.864 81.122 1.00 47.33 C ++ATOM 5353 OG1 THR n 39 -3.393 -5.665 82.167 1.00 47.33 O ++ATOM 5354 CG2 THR n 39 -1.515 -4.296 81.592 1.00 47.33 C ++ATOM 5355 N LEU n 40 -3.048 -1.613 79.884 1.00 43.90 N ++ATOM 5356 CA LEU n 40 -2.561 -0.700 78.863 1.00 43.90 C ++ATOM 5357 C LEU n 40 -1.244 -0.085 79.311 1.00 43.90 C ++ATOM 5358 O LEU n 40 -1.132 0.418 80.433 1.00 43.90 O ++ATOM 5359 CB LEU n 40 -3.630 0.343 78.523 1.00 43.90 C ++ATOM 5360 CG LEU n 40 -4.350 1.179 79.574 1.00 43.90 C ++ATOM 5361 CD1 LEU n 40 -3.667 2.499 79.792 1.00 43.90 C ++ATOM 5362 CD2 LEU n 40 -5.793 1.384 79.157 1.00 43.90 C ++ATOM 5363 N GLN n 41 -0.255 -0.148 78.423 1.00 48.29 N ++ATOM 5364 CA GLN n 41 1.151 0.042 78.746 1.00 48.29 C ++ATOM 5365 C GLN n 41 1.622 1.429 78.337 1.00 48.29 C ++ATOM 5366 O GLN n 41 1.274 1.915 77.258 1.00 48.29 O ++ATOM 5367 CB GLN n 41 2.009 -0.995 78.015 1.00 48.29 C ++ATOM 5368 CG GLN n 41 1.761 -2.449 78.369 1.00 48.29 C ++ATOM 5369 CD GLN n 41 2.281 -2.806 79.735 1.00 48.29 C ++ATOM 5370 OE1 GLN n 41 3.306 -2.286 80.174 1.00 48.29 O ++ATOM 5371 NE2 GLN n 41 1.600 -3.721 80.408 1.00 48.29 N ++ATOM 5372 N CYS n 42 2.442 2.042 79.185 1.00 59.35 N ++ATOM 5373 CA CYS n 42 3.179 3.250 78.850 1.00 59.35 C ++ATOM 5374 C CYS n 42 4.672 2.951 78.863 1.00 59.35 C ++ATOM 5375 O CYS n 42 5.139 2.054 79.567 1.00 59.35 O ++ATOM 5376 CB CYS n 42 2.867 4.390 79.827 1.00 59.35 C ++ATOM 5377 SG CYS n 42 3.724 5.941 79.440 1.00 59.35 S ++ATOM 5378 N ALA n 43 5.426 3.713 78.077 1.00 63.48 N ++ATOM 5379 CA ALA n 43 6.860 3.504 77.977 1.00 63.48 C ++ATOM 5380 C ALA n 43 7.533 4.835 77.694 1.00 63.48 C ++ATOM 5381 O ALA n 43 6.991 5.668 76.961 1.00 63.48 O ++ATOM 5382 CB ALA n 43 7.207 2.489 76.886 1.00 63.48 C ++ATOM 5383 N GLN n 44 8.719 5.021 78.268 1.00 78.14 N ++ATOM 5384 CA GLN n 44 9.387 6.321 78.281 1.00 78.14 C ++ATOM 5385 C GLN n 44 10.893 6.082 78.313 1.00 78.14 C ++ATOM 5386 O GLN n 44 11.435 5.627 79.325 1.00 78.14 O ++ATOM 5387 CB GLN n 44 8.896 7.137 79.471 1.00 78.14 C ++ATOM 5388 CG GLN n 44 9.414 8.556 79.603 1.00 78.14 C ++ATOM 5389 CD GLN n 44 10.685 8.643 80.417 1.00 78.14 C ++ATOM 5390 OE1 GLN n 44 11.669 9.227 79.992 1.00 78.14 O ++ATOM 5391 NE2 GLN n 44 10.663 8.054 81.606 1.00 78.14 N ++ATOM 5392 N ASP n 45 11.563 6.393 77.203 1.00 86.73 N ++ATOM 5393 CA ASP n 45 12.983 6.115 77.036 1.00 86.73 C ++ATOM 5394 C ASP n 45 13.868 7.348 77.148 1.00 86.73 C ++ATOM 5395 O ASP n 45 15.070 7.251 76.890 1.00 86.73 O ++ATOM 5396 CB ASP n 45 13.231 5.419 75.693 1.00 86.73 C ++ATOM 5397 CG ASP n 45 12.691 6.205 74.511 1.00 86.73 C ++ATOM 5398 OD1 ASP n 45 12.007 7.230 74.716 1.00 86.73 O ++ATOM 5399 OD2 ASP n 45 12.960 5.794 73.362 1.00 86.73 O ++ATOM 5400 N MET n 46 13.313 8.497 77.516 1.00 86.09 N ++ATOM 5401 CA MET n 46 14.110 9.671 77.838 1.00 86.09 C ++ATOM 5402 C MET n 46 14.648 9.626 79.260 1.00 86.09 C ++ATOM 5403 O MET n 46 15.359 10.553 79.667 1.00 86.09 O ++ATOM 5404 CB MET n 46 13.283 10.943 77.639 1.00 86.09 C ++ATOM 5405 CG MET n 46 12.892 11.210 76.199 1.00 86.09 C ++ATOM 5406 SD MET n 46 11.887 12.694 76.028 1.00 86.09 S ++ATOM 5407 CE MET n 46 13.105 13.959 76.373 1.00 86.09 C ++ATOM 5408 N ASN n 47 14.287 8.579 80.012 1.00 88.69 N ++ATOM 5409 CA ASN n 47 14.732 8.302 81.379 1.00 88.69 C ++ATOM 5410 C ASN n 47 14.332 9.433 82.330 1.00 88.69 C ++ATOM 5411 O ASN n 47 15.109 9.878 83.178 1.00 88.69 O ++ATOM 5412 CB ASN n 47 16.241 8.023 81.429 1.00 88.69 C ++ATOM 5413 CG ASN n 47 16.635 7.087 82.567 1.00 88.69 C ++ATOM 5414 OD1 ASN n 47 17.747 6.563 82.586 1.00 88.69 O ++ATOM 5415 ND2 ASN n 47 15.720 6.855 83.502 1.00 88.69 N ++ATOM 5416 N HIS n 48 13.097 9.897 82.167 1.00 84.31 N ++ATOM 5417 CA HIS n 48 12.455 10.674 83.210 1.00 84.31 C ++ATOM 5418 C HIS n 48 11.975 9.721 84.297 1.00 84.31 C ++ATOM 5419 O HIS n 48 11.745 8.533 84.060 1.00 84.31 O ++ATOM 5420 CB HIS n 48 11.297 11.504 82.659 1.00 84.31 C ++ATOM 5421 CG HIS n 48 11.722 12.708 81.878 1.00 84.31 C ++ATOM 5422 ND1 HIS n 48 10.832 13.485 81.172 1.00 84.31 N ++ATOM 5423 CD2 HIS n 48 12.938 13.277 81.704 1.00 84.31 C ++ATOM 5424 CE1 HIS n 48 11.481 14.478 80.590 1.00 84.31 C ++ATOM 5425 NE2 HIS n 48 12.760 14.376 80.897 1.00 84.31 N ++ATOM 5426 N GLU n 49 11.807 10.242 85.505 1.00 86.23 N ++ATOM 5427 CA GLU n 49 11.507 9.382 86.651 1.00 86.23 C ++ATOM 5428 C GLU n 49 10.024 9.041 86.716 1.00 86.23 C ++ATOM 5429 O GLU n 49 9.651 7.867 86.630 1.00 86.23 O ++ATOM 5430 CB GLU n 49 11.971 10.038 87.952 1.00 86.23 C ++ATOM 5431 CG GLU n 49 11.651 9.247 89.216 1.00 86.23 C ++ATOM 5432 CD GLU n 49 12.429 7.945 89.334 1.00 86.23 C ++ATOM 5433 OE1 GLU n 49 13.542 7.845 88.778 1.00 86.23 O ++ATOM 5434 OE2 GLU n 49 11.924 7.015 89.996 1.00 86.23 O ++ATOM 5435 N TYR n 50 9.164 10.043 86.858 1.00 82.18 N ++ATOM 5436 CA TYR n 50 7.828 9.715 87.330 1.00 82.18 C ++ATOM 5437 C TYR n 50 6.725 10.059 86.341 1.00 82.18 C ++ATOM 5438 O TYR n 50 6.760 11.077 85.648 1.00 82.18 O ++ATOM 5439 CB TYR n 50 7.552 10.362 88.683 1.00 82.18 C ++ATOM 5440 CG TYR n 50 7.564 11.852 88.789 1.00 82.18 C ++ATOM 5441 CD1 TYR n 50 8.750 12.530 89.022 1.00 82.18 C ++ATOM 5442 CD2 TYR n 50 6.380 12.575 88.767 1.00 82.18 C ++ATOM 5443 CE1 TYR n 50 8.769 13.890 89.167 1.00 82.18 C ++ATOM 5444 CE2 TYR n 50 6.385 13.937 88.916 1.00 82.18 C ++ATOM 5445 CZ TYR n 50 7.587 14.591 89.118 1.00 82.18 C ++ATOM 5446 OH TYR n 50 7.617 15.956 89.262 1.00 82.18 O ++ATOM 5447 N MET n 51 5.726 9.182 86.312 1.00 69.89 N ++ATOM 5448 CA MET n 51 4.667 9.182 85.325 1.00 69.89 C ++ATOM 5449 C MET n 51 3.322 9.316 86.019 1.00 69.89 C ++ATOM 5450 O MET n 51 3.184 9.093 87.231 1.00 69.89 O ++ATOM 5451 CB MET n 51 4.692 7.892 84.502 1.00 69.89 C ++ATOM 5452 CG MET n 51 6.028 7.619 83.863 1.00 69.89 C ++ATOM 5453 SD MET n 51 6.049 6.085 82.940 1.00 69.89 S ++ATOM 5454 CE MET n 51 7.805 5.869 82.721 1.00 69.89 C ++ATOM 5455 N SER n 52 2.324 9.666 85.214 1.00 56.51 N ++ATOM 5456 CA SER n 52 0.969 9.895 85.679 1.00 56.51 C ++ATOM 5457 C SER n 52 0.018 9.418 84.599 1.00 56.51 C ++ATOM 5458 O SER n 52 0.371 9.396 83.418 1.00 56.51 O ++ATOM 5459 CB SER n 52 0.729 11.377 85.961 1.00 56.51 C ++ATOM 5460 OG SER n 52 1.659 11.890 86.893 1.00 56.51 O ++ATOM 5461 N TRP n 53 -1.188 9.038 85.001 1.00 50.00 N ++ATOM 5462 CA TRP n 53 -2.249 8.725 84.048 1.00 50.00 C ++ATOM 5463 C TRP n 53 -3.334 9.784 84.128 1.00 50.00 C ++ATOM 5464 O TRP n 53 -3.983 9.935 85.166 1.00 50.00 O ++ATOM 5465 CB TRP n 53 -2.858 7.344 84.287 1.00 50.00 C ++ATOM 5466 CG TRP n 53 -1.983 6.234 83.854 1.00 50.00 C ++ATOM 5467 CD1 TRP n 53 -1.248 5.424 84.647 1.00 50.00 C ++ATOM 5468 CD2 TRP n 53 -1.720 5.830 82.512 1.00 50.00 C ++ATOM 5469 NE1 TRP n 53 -0.546 4.527 83.888 1.00 50.00 N ++ATOM 5470 CE2 TRP n 53 -0.820 4.759 82.570 1.00 50.00 C ++ATOM 5471 CE3 TRP n 53 -2.164 6.268 81.267 1.00 50.00 C ++ATOM 5472 CZ2 TRP n 53 -0.354 4.122 81.435 1.00 50.00 C ++ATOM 5473 CZ3 TRP n 53 -1.702 5.635 80.143 1.00 50.00 C ++ATOM 5474 CH2 TRP n 53 -0.801 4.576 80.233 1.00 50.00 C ++ATOM 5475 N TYR n 54 -3.535 10.506 83.036 1.00 43.18 N ++ATOM 5476 CA TYR n 54 -4.637 11.443 82.918 1.00 43.18 C ++ATOM 5477 C TYR n 54 -5.733 10.826 82.066 1.00 43.18 C ++ATOM 5478 O TYR n 54 -5.463 10.037 81.162 1.00 43.18 O ++ATOM 5479 CB TYR n 54 -4.180 12.758 82.295 1.00 43.18 C ++ATOM 5480 CG TYR n 54 -3.222 13.528 83.150 1.00 43.18 C ++ATOM 5481 CD1 TYR n 54 -3.675 14.324 84.189 1.00 43.18 C ++ATOM 5482 CD2 TYR n 54 -1.861 13.459 82.920 1.00 43.18 C ++ATOM 5483 CE1 TYR n 54 -2.793 15.035 84.973 1.00 43.18 C ++ATOM 5484 CE2 TYR n 54 -0.972 14.160 83.698 1.00 43.18 C ++ATOM 5485 CZ TYR n 54 -1.441 14.943 84.724 1.00 43.18 C ++ATOM 5486 OH TYR n 54 -0.549 15.640 85.498 1.00 43.18 O ++ATOM 5487 N ARG n 55 -6.975 11.163 82.371 1.00 38.43 N ++ATOM 5488 CA ARG n 55 -8.084 10.809 81.508 1.00 38.43 C ++ATOM 5489 C ARG n 55 -8.785 12.077 81.057 1.00 38.43 C ++ATOM 5490 O ARG n 55 -8.777 13.098 81.743 1.00 38.43 O ++ATOM 5491 CB ARG n 55 -9.070 9.872 82.206 1.00 38.43 C ++ATOM 5492 CG ARG n 55 -9.689 10.425 83.448 1.00 38.43 C ++ATOM 5493 CD ARG n 55 -10.779 9.509 83.962 1.00 38.43 C ++ATOM 5494 NE ARG n 55 -11.932 9.520 83.072 1.00 38.43 N ++ATOM 5495 CZ ARG n 55 -12.974 8.711 83.193 1.00 38.43 C ++ATOM 5496 NH1 ARG n 55 -13.016 7.829 84.177 1.00 38.43 N ++ATOM 5497 NH2 ARG n 55 -13.980 8.795 82.338 1.00 38.43 N ++ATOM 5498 N GLN n 56 -9.396 12.007 79.884 1.00 35.88 N ++ATOM 5499 CA GLN n 56 -10.056 13.171 79.318 1.00 35.88 C ++ATOM 5500 C GLN n 56 -11.424 12.759 78.813 1.00 35.88 C ++ATOM 5501 O GLN n 56 -11.553 11.758 78.099 1.00 35.88 O ++ATOM 5502 CB GLN n 56 -9.223 13.780 78.189 1.00 35.88 C ++ATOM 5503 CG GLN n 56 -9.835 15.010 77.560 1.00 35.88 C ++ATOM 5504 CD GLN n 56 -8.914 15.669 76.558 1.00 35.88 C ++ATOM 5505 OE1 GLN n 56 -7.810 15.196 76.313 1.00 35.88 O ++ATOM 5506 NE2 GLN n 56 -9.363 16.771 75.978 1.00 35.88 N ++ATOM 5507 N ASP n 57 -12.431 13.523 79.210 1.00 46.81 N ++ATOM 5508 CA ASP n 57 -13.814 13.422 78.802 1.00 46.81 C ++ATOM 5509 C ASP n 57 -14.228 14.711 78.113 1.00 46.81 C ++ATOM 5510 O ASP n 57 -13.705 15.782 78.436 1.00 46.81 O ++ATOM 5511 CB ASP n 57 -14.735 13.189 80.003 1.00 46.81 C ++ATOM 5512 CG ASP n 57 -14.568 11.822 80.606 1.00 46.81 C ++ATOM 5513 OD1 ASP n 57 -14.268 10.881 79.851 1.00 46.81 O ++ATOM 5514 OD2 ASP n 57 -14.734 11.685 81.836 1.00 46.81 O ++ATOM 5515 N PRO n 58 -15.150 14.651 77.168 1.00 54.98 N ++ATOM 5516 CA PRO n 58 -15.693 15.895 76.615 1.00 54.98 C ++ATOM 5517 C PRO n 58 -16.602 16.581 77.617 1.00 54.98 C ++ATOM 5518 O PRO n 58 -17.735 16.144 77.839 1.00 54.98 O ++ATOM 5519 CB PRO n 58 -16.464 15.425 75.377 1.00 54.98 C ++ATOM 5520 CG PRO n 58 -15.863 14.097 75.036 1.00 54.98 C ++ATOM 5521 CD PRO n 58 -15.525 13.481 76.359 1.00 54.98 C ++ATOM 5522 N GLY n 59 -16.112 17.649 78.237 1.00 56.65 N ++ATOM 5523 CA GLY n 59 -16.876 18.396 79.217 1.00 56.65 C ++ATOM 5524 C GLY n 59 -16.231 18.514 80.582 1.00 56.65 C ++ATOM 5525 O GLY n 59 -16.763 19.239 81.434 1.00 56.65 O ++ATOM 5526 N MET n 60 -15.109 17.847 80.842 1.00 51.60 N ++ATOM 5527 CA MET n 60 -14.489 17.897 82.160 1.00 51.60 C ++ATOM 5528 C MET n 60 -12.986 18.114 82.144 1.00 51.60 C ++ATOM 5529 O MET n 60 -12.419 18.375 83.211 1.00 51.60 O ++ATOM 5530 CB MET n 60 -14.789 16.611 82.943 1.00 51.60 C ++ATOM 5531 N GLY n 61 -12.322 18.019 80.998 1.00 44.80 N ++ATOM 5532 CA GLY n 61 -10.898 18.272 80.934 1.00 44.80 C ++ATOM 5533 C GLY n 61 -10.078 17.132 81.498 1.00 44.80 C ++ATOM 5534 O GLY n 61 -10.585 16.070 81.857 1.00 44.80 O ++ATOM 5535 N LEU n 62 -8.770 17.366 81.573 1.00 42.21 N ++ATOM 5536 CA LEU n 62 -7.852 16.345 82.056 1.00 42.21 C ++ATOM 5537 C LEU n 62 -8.008 16.146 83.557 1.00 42.21 C ++ATOM 5538 O LEU n 62 -8.014 17.113 84.324 1.00 42.21 O ++ATOM 5539 CB LEU n 62 -6.413 16.728 81.730 1.00 42.21 C ++ATOM 5540 CG LEU n 62 -6.042 16.749 80.253 1.00 42.21 C ++ATOM 5541 CD1 LEU n 62 -4.621 17.212 80.069 1.00 42.21 C ++ATOM 5542 CD2 LEU n 62 -6.215 15.379 79.671 1.00 42.21 C ++ATOM 5543 N ARG n 63 -8.131 14.889 83.976 1.00 48.52 N ++ATOM 5544 CA ARG n 63 -8.241 14.534 85.381 1.00 48.52 C ++ATOM 5545 C ARG n 63 -7.201 13.481 85.723 1.00 48.52 C ++ATOM 5546 O ARG n 63 -7.032 12.506 84.991 1.00 48.52 O ++ATOM 5547 CB ARG n 63 -9.639 14.017 85.715 1.00 48.52 C ++ATOM 5548 CG ARG n 63 -10.698 15.093 85.661 1.00 48.52 C ++ATOM 5549 CD ARG n 63 -12.065 14.565 86.045 1.00 48.52 C ++ATOM 5550 NE ARG n 63 -12.647 13.709 85.021 1.00 48.52 N ++ATOM 5551 CZ ARG n 63 -13.765 13.013 85.187 1.00 48.52 C ++ATOM 5552 NH1 ARG n 63 -14.413 13.060 86.340 1.00 48.52 N ++ATOM 5553 NH2 ARG n 63 -14.230 12.262 84.201 1.00 48.52 N ++ATOM 5554 N LEU n 64 -6.507 13.682 86.835 1.00 55.60 N ++ATOM 5555 CA LEU n 64 -5.443 12.778 87.238 1.00 55.60 C ++ATOM 5556 C LEU n 64 -6.027 11.503 87.834 1.00 55.60 C ++ATOM 5557 O LEU n 64 -7.084 11.521 88.468 1.00 55.60 O ++ATOM 5558 CB LEU n 64 -4.532 13.478 88.244 1.00 55.60 C ++ATOM 5559 CG LEU n 64 -3.259 12.802 88.725 1.00 55.60 C ++ATOM 5560 CD1 LEU n 64 -2.385 12.520 87.548 1.00 55.60 C ++ATOM 5561 CD2 LEU n 64 -2.542 13.711 89.698 1.00 55.60 C ++ATOM 5562 N ILE n 65 -5.340 10.383 87.608 1.00 57.79 N ++ATOM 5563 CA ILE n 65 -5.758 9.078 88.119 1.00 57.79 C ++ATOM 5564 C ILE n 65 -4.749 8.528 89.123 1.00 57.79 C ++ATOM 5565 O ILE n 65 -5.079 8.303 90.287 1.00 57.79 O ++ATOM 5566 CB ILE n 65 -5.999 8.080 86.966 1.00 57.79 C ++ATOM 5567 CG1 ILE n 65 -7.067 8.608 86.020 1.00 57.79 C ++ATOM 5568 CG2 ILE n 65 -6.451 6.755 87.504 1.00 57.79 C ++ATOM 5569 CD1 ILE n 65 -7.154 7.837 84.735 1.00 57.79 C ++ATOM 5570 N HIS n 66 -3.517 8.297 88.686 1.00 64.75 N ++ATOM 5571 CA HIS n 66 -2.444 7.876 89.572 1.00 64.75 C ++ATOM 5572 C HIS n 66 -1.150 8.519 89.110 1.00 64.75 C ++ATOM 5573 O HIS n 66 -1.012 8.918 87.949 1.00 64.75 O ++ATOM 5574 CB HIS n 66 -2.269 6.355 89.604 1.00 64.75 C ++ATOM 5575 CG HIS n 66 -3.331 5.635 90.370 1.00 64.75 C ++ATOM 5576 ND1 HIS n 66 -4.516 5.227 89.800 1.00 64.75 N ++ATOM 5577 CD2 HIS n 66 -3.375 5.227 91.660 1.00 64.75 C ++ATOM 5578 CE1 HIS n 66 -5.252 4.614 90.709 1.00 64.75 C ++ATOM 5579 NE2 HIS n 66 -4.581 4.597 91.845 1.00 64.75 N ++ATOM 5580 N TYR n 67 -0.198 8.610 90.034 1.00 76.27 N ++ATOM 5581 CA TYR n 67 1.143 9.055 89.688 1.00 76.27 C ++ATOM 5582 C TYR n 67 2.141 8.322 90.566 1.00 76.27 C ++ATOM 5583 O TYR n 67 1.898 8.119 91.757 1.00 76.27 O ++ATOM 5584 CB TYR n 67 1.291 10.578 89.825 1.00 76.27 C ++ATOM 5585 CG TYR n 67 1.129 11.150 91.212 1.00 76.27 C ++ATOM 5586 CD1 TYR n 67 -0.126 11.478 91.706 1.00 76.27 C ++ATOM 5587 CD2 TYR n 67 2.235 11.412 92.006 1.00 76.27 C ++ATOM 5588 CE1 TYR n 67 -0.274 12.015 92.965 1.00 76.27 C ++ATOM 5589 CE2 TYR n 67 2.096 11.947 93.264 1.00 76.27 C ++ATOM 5590 CZ TYR n 67 0.839 12.246 93.737 1.00 76.27 C ++ATOM 5591 OH TYR n 67 0.697 12.783 94.995 1.00 76.27 O ++ATOM 5592 N SER n 68 3.260 7.917 89.979 1.00 76.90 N ++ATOM 5593 CA SER n 68 4.207 7.056 90.690 1.00 76.90 C ++ATOM 5594 C SER n 68 5.559 7.743 90.791 1.00 76.90 C ++ATOM 5595 O SER n 68 6.362 7.664 89.862 1.00 76.90 O ++ATOM 5596 CB SER n 68 4.336 5.717 90.013 1.00 76.90 C ++ATOM 5597 OG SER n 68 5.298 4.915 90.674 1.00 76.90 O ++ATOM 5598 N VAL n 69 5.838 8.318 91.963 1.00 83.03 N ++ATOM 5599 CA VAL n 69 6.972 9.223 92.113 1.00 83.03 C ++ATOM 5600 C VAL n 69 8.315 8.507 92.105 1.00 83.03 C ++ATOM 5601 O VAL n 69 9.351 9.153 91.915 1.00 83.03 O ++ATOM 5602 CB VAL n 69 6.841 10.065 93.394 1.00 83.03 C ++ATOM 5603 CG1 VAL n 69 5.610 10.941 93.322 1.00 83.03 C ++ATOM 5604 CG2 VAL n 69 6.790 9.175 94.612 1.00 83.03 C ++ATOM 5605 N GLY n 70 8.334 7.196 92.304 1.00 83.19 N ++ATOM 5606 CA GLY n 70 9.584 6.466 92.273 1.00 83.19 C ++ATOM 5607 C GLY n 70 9.428 5.090 91.667 1.00 83.19 C ++ATOM 5608 O GLY n 70 8.364 4.758 91.136 1.00 83.19 O ++ATOM 5609 N ALA n 71 10.479 4.280 91.732 1.00 82.14 N ++ATOM 5610 CA ALA n 71 10.400 2.897 91.275 1.00 82.14 C ++ATOM 5611 C ALA n 71 9.662 2.099 92.340 1.00 82.14 C ++ATOM 5612 O ALA n 71 10.264 1.479 93.217 1.00 82.14 O ++ATOM 5613 CB ALA n 71 11.788 2.331 91.010 1.00 82.14 C ++ATOM 5614 N GLY n 72 8.333 2.121 92.269 1.00 79.70 N ++ATOM 5615 CA GLY n 72 7.480 1.377 93.166 1.00 79.70 C ++ATOM 5616 C GLY n 72 6.567 2.227 94.023 1.00 79.70 C ++ATOM 5617 O GLY n 72 5.638 1.687 94.635 1.00 79.70 O ++ATOM 5618 N ILE n 73 6.791 3.539 94.080 1.00 81.08 N ++ATOM 5619 CA ILE n 73 6.081 4.402 95.024 1.00 81.08 C ++ATOM 5620 C ILE n 73 4.912 5.023 94.263 1.00 81.08 C ++ATOM 5621 O ILE n 73 5.018 6.106 93.683 1.00 81.08 O ++ATOM 5622 CB ILE n 73 6.998 5.454 95.635 1.00 81.08 C ++ATOM 5623 CG1 ILE n 73 8.244 4.792 96.216 1.00 81.08 C ++ATOM 5624 CG2 ILE n 73 6.280 6.172 96.761 1.00 81.08 C ++ATOM 5625 CD1 ILE n 73 9.340 5.773 96.562 1.00 81.08 C ++ATOM 5626 N THR n 74 3.773 4.338 94.290 1.00 78.51 N ++ATOM 5627 CA THR n 74 2.571 4.781 93.600 1.00 78.51 C ++ATOM 5628 C THR n 74 1.649 5.528 94.554 1.00 78.51 C ++ATOM 5629 O THR n 74 1.466 5.128 95.705 1.00 78.51 O ++ATOM 5630 CB THR n 74 1.822 3.592 92.992 1.00 78.51 C ++ATOM 5631 OG1 THR n 74 1.371 2.726 94.039 1.00 78.51 O ++ATOM 5632 CG2 THR n 74 2.735 2.811 92.068 1.00 78.51 C ++ATOM 5633 N ASP n 75 1.045 6.608 94.055 1.00 78.44 N ++ATOM 5634 CA ASP n 75 0.130 7.434 94.824 1.00 78.44 C ++ATOM 5635 C ASP n 75 -1.119 7.697 93.999 1.00 78.44 C ++ATOM 5636 O ASP n 75 -1.049 7.820 92.769 1.00 78.44 O ++ATOM 5637 CB ASP n 75 0.778 8.766 95.219 1.00 78.44 C ++ATOM 5638 CG ASP n 75 1.865 8.603 96.266 1.00 78.44 C ++ATOM 5639 OD1 ASP n 75 1.765 7.675 97.093 1.00 78.44 O ++ATOM 5640 OD2 ASP n 75 2.820 9.407 96.265 1.00 78.44 O ++ATOM 5641 N GLN n 76 -2.256 7.786 94.684 1.00 84.21 N ++ATOM 5642 CA GLN n 76 -3.520 8.049 94.015 1.00 84.21 C ++ATOM 5643 C GLN n 76 -3.593 9.496 93.543 1.00 84.21 C ++ATOM 5644 O GLN n 76 -2.827 10.363 93.969 1.00 84.21 O ++ATOM 5645 CB GLN n 76 -4.702 7.763 94.938 1.00 84.21 C ++ATOM 5646 CG GLN n 76 -4.899 6.309 95.295 1.00 84.21 C ++ATOM 5647 CD GLN n 76 -6.107 6.105 96.186 1.00 84.21 C ++ATOM 5648 OE1 GLN n 76 -6.762 7.067 96.584 1.00 84.21 O ++ATOM 5649 NE2 GLN n 76 -6.410 4.851 96.501 1.00 84.21 N ++ATOM 5650 N GLY n 77 -4.550 9.750 92.657 1.00 76.62 N ++ATOM 5651 CA GLY n 77 -4.748 11.076 92.114 1.00 76.62 C ++ATOM 5652 C GLY n 77 -6.098 11.646 92.481 1.00 76.62 C ++ATOM 5653 O GLY n 77 -6.476 11.654 93.655 1.00 76.62 O ++ATOM 5654 N GLU n 78 -6.841 12.126 91.487 1.00 73.02 N ++ATOM 5655 CA GLU n 78 -8.126 12.750 91.771 1.00 73.02 C ++ATOM 5656 C GLU n 78 -9.274 11.753 91.638 1.00 73.02 C ++ATOM 5657 O GLU n 78 -10.229 11.792 92.421 1.00 73.02 O ++ATOM 5658 CB GLU n 78 -8.322 13.958 90.855 1.00 73.02 C ++ATOM 5659 CG GLU n 78 -9.572 14.764 91.128 1.00 73.02 C ++ATOM 5660 CD GLU n 78 -9.603 16.056 90.343 1.00 73.02 C ++ATOM 5661 OE1 GLU n 78 -8.622 16.340 89.624 1.00 73.02 O ++ATOM 5662 OE2 GLU n 78 -10.610 16.785 90.440 1.00 73.02 O ++ATOM 5663 N VAL n 79 -9.199 10.849 90.665 1.00 65.81 N ++ATOM 5664 CA VAL n 79 -10.217 9.809 90.504 1.00 65.81 C ++ATOM 5665 C VAL n 79 -9.583 8.421 90.395 1.00 65.81 C ++ATOM 5666 O VAL n 79 -9.483 7.861 89.294 1.00 65.81 O ++ATOM 5667 CB VAL n 79 -11.135 10.127 89.309 1.00 65.81 C ++ATOM 5668 CG1 VAL n 79 -12.166 11.153 89.711 1.00 65.81 C ++ATOM 5669 CG2 VAL n 79 -10.336 10.724 88.158 1.00 65.81 C ++ATOM 5670 N PRO n 80 -9.167 7.809 91.509 1.00 69.45 N ++ATOM 5671 CA PRO n 80 -8.514 6.494 91.423 1.00 69.45 C ++ATOM 5672 C PRO n 80 -9.483 5.323 91.491 1.00 69.45 C ++ATOM 5673 O PRO n 80 -9.066 4.185 91.728 1.00 69.45 O ++ATOM 5674 CB PRO n 80 -7.583 6.502 92.638 1.00 69.45 C ++ATOM 5675 CG PRO n 80 -8.329 7.314 93.638 1.00 69.45 C ++ATOM 5676 CD PRO n 80 -9.075 8.374 92.867 1.00 69.45 C ++ATOM 5677 N ASN n 81 -10.772 5.590 91.287 1.00 67.33 N ++ATOM 5678 CA ASN n 81 -11.839 4.635 91.585 1.00 67.33 C ++ATOM 5679 C ASN n 81 -11.872 3.525 90.536 1.00 67.33 C ++ATOM 5680 O ASN n 81 -12.578 3.595 89.528 1.00 67.33 O ++ATOM 5681 CB ASN n 81 -13.173 5.363 91.655 1.00 67.33 C ++ATOM 5682 CG ASN n 81 -13.252 6.308 92.828 1.00 67.33 C ++ATOM 5683 OD1 ASN n 81 -12.834 5.974 93.935 1.00 67.33 O ++ATOM 5684 ND2 ASN n 81 -13.781 7.503 92.593 1.00 67.33 N ++ATOM 5685 N GLY n 82 -11.099 2.473 90.790 1.00 59.55 N ++ATOM 5686 CA GLY n 82 -11.128 1.298 89.940 1.00 59.55 C ++ATOM 5687 C GLY n 82 -9.950 1.192 88.997 1.00 59.55 C ++ATOM 5688 O GLY n 82 -10.113 0.820 87.832 1.00 59.55 O ++ATOM 5689 N TYR n 83 -8.753 1.513 89.486 1.00 58.62 N ++ATOM 5690 CA TYR n 83 -7.546 1.553 88.656 1.00 58.62 C ++ATOM 5691 C TYR n 83 -6.395 0.954 89.456 1.00 58.62 C ++ATOM 5692 O TYR n 83 -5.844 1.598 90.351 1.00 58.62 O ++ATOM 5693 CB TYR n 83 -7.226 2.972 88.223 1.00 58.62 C ++ATOM 5694 CG TYR n 83 -8.257 3.572 87.315 1.00 58.62 C ++ATOM 5695 CD1 TYR n 83 -8.244 3.312 85.958 1.00 58.62 C ++ATOM 5696 CD2 TYR n 83 -9.254 4.389 87.821 1.00 58.62 C ++ATOM 5697 CE1 TYR n 83 -9.186 3.855 85.130 1.00 58.62 C ++ATOM 5698 CE2 TYR n 83 -10.201 4.935 87.000 1.00 58.62 C ++ATOM 5699 CZ TYR n 83 -10.160 4.665 85.661 1.00 58.62 C ++ATOM 5700 OH TYR n 83 -11.114 5.211 84.843 1.00 58.62 O ++ATOM 5701 N ASN n 84 -6.037 -0.280 89.138 1.00 65.76 N ++ATOM 5702 CA ASN n 84 -4.822 -0.844 89.694 1.00 65.76 C ++ATOM 5703 C ASN n 84 -3.643 -0.456 88.814 1.00 65.76 C ++ATOM 5704 O ASN n 84 -3.649 -0.689 87.604 1.00 65.76 O ++ATOM 5705 CB ASN n 84 -4.940 -2.364 89.798 1.00 65.76 C ++ATOM 5706 CG ASN n 84 -3.870 -2.980 90.681 1.00 65.76 C ++ATOM 5707 OD1 ASN n 84 -3.028 -2.281 91.245 1.00 65.76 O ++ATOM 5708 ND2 ASN n 84 -3.901 -4.301 90.807 1.00 65.76 N ++ATOM 5709 N VAL n 85 -2.639 0.168 89.419 1.00 65.78 N ++ATOM 5710 CA VAL n 85 -1.394 0.478 88.734 1.00 65.78 C ++ATOM 5711 C VAL n 85 -0.309 -0.413 89.315 1.00 65.78 C ++ATOM 5712 O VAL n 85 -0.500 -1.083 90.330 1.00 65.78 O ++ATOM 5713 CB VAL n 85 -1.003 1.959 88.859 1.00 65.78 C ++ATOM 5714 CG1 VAL n 85 -2.079 2.836 88.283 1.00 65.78 C ++ATOM 5715 CG2 VAL n 85 -0.749 2.311 90.308 1.00 65.78 C ++ATOM 5716 N SER n 86 0.843 -0.415 88.657 1.00 69.72 N ++ATOM 5717 CA SER n 86 1.972 -1.207 89.126 1.00 69.72 C ++ATOM 5718 C SER n 86 3.245 -0.589 88.581 1.00 69.72 C ++ATOM 5719 O SER n 86 3.379 -0.425 87.369 1.00 69.72 O ++ATOM 5720 CB SER n 86 1.861 -2.668 88.674 1.00 69.72 C ++ATOM 5721 OG SER n 86 0.742 -3.316 89.258 1.00 69.72 O ++ATOM 5722 N ARG n 87 4.175 -0.256 89.469 1.00 75.56 N ++ATOM 5723 CA ARG n 87 5.446 0.326 89.066 1.00 75.56 C ++ATOM 5724 C ARG n 87 6.557 -0.623 89.485 1.00 75.56 C ++ATOM 5725 O ARG n 87 6.897 -0.697 90.670 1.00 75.56 O ++ATOM 5726 CB ARG n 87 5.651 1.703 89.692 1.00 75.56 C ++ATOM 5727 CG ARG n 87 6.884 2.427 89.194 1.00 75.56 C ++ATOM 5728 CD ARG n 87 6.681 2.913 87.775 1.00 75.56 C ++ATOM 5729 NE ARG n 87 7.831 3.651 87.271 1.00 75.56 N ++ATOM 5730 CZ ARG n 87 8.016 4.953 87.443 1.00 75.56 C ++ATOM 5731 NH1 ARG n 87 7.133 5.667 88.122 1.00 75.56 N ++ATOM 5732 NH2 ARG n 87 9.092 5.540 86.946 1.00 75.56 N ++ATOM 5733 N SER n 88 7.113 -1.349 88.521 1.00 82.17 N ++ATOM 5734 CA SER n 88 8.194 -2.289 88.785 1.00 82.17 C ++ATOM 5735 C SER n 88 9.517 -1.813 88.215 1.00 82.17 C ++ATOM 5736 O SER n 88 10.519 -1.768 88.936 1.00 82.17 O ++ATOM 5737 CB SER n 88 7.842 -3.672 88.215 1.00 82.17 C ++ATOM 5738 OG SER n 88 6.709 -4.218 88.868 1.00 82.17 O ++ATOM 5739 N THR n 89 9.549 -1.459 86.938 1.00 83.44 N ++ATOM 5740 CA THR n 89 10.735 -0.877 86.336 1.00 83.44 C ++ATOM 5741 C THR n 89 10.669 0.637 86.487 1.00 83.44 C ++ATOM 5742 O THR n 89 9.760 1.180 87.120 1.00 83.44 O ++ATOM 5743 CB THR n 89 10.847 -1.293 84.875 1.00 83.44 C ++ATOM 5744 OG1 THR n 89 9.723 -0.774 84.151 1.00 83.44 O ++ATOM 5745 CG2 THR n 89 10.859 -2.808 84.760 1.00 83.44 C ++ATOM 5746 N THR n 90 11.631 1.342 85.898 1.00 84.66 N ++ATOM 5747 CA THR n 90 11.630 2.795 85.908 1.00 84.66 C ++ATOM 5748 C THR n 90 11.386 3.393 84.530 1.00 84.66 C ++ATOM 5749 O THR n 90 11.467 4.616 84.380 1.00 84.66 O ++ATOM 5750 CB THR n 90 12.945 3.332 86.492 1.00 84.66 C ++ATOM 5751 OG1 THR n 90 12.866 4.755 86.631 1.00 84.66 O ++ATOM 5752 CG2 THR n 90 14.119 2.978 85.604 1.00 84.66 C ++ATOM 5753 N GLU n 91 11.084 2.569 83.525 1.00 86.31 N ++ATOM 5754 CA GLU n 91 10.668 3.053 82.218 1.00 86.31 C ++ATOM 5755 C GLU n 91 9.249 2.655 81.848 1.00 86.31 C ++ATOM 5756 O GLU n 91 8.724 3.162 80.851 1.00 86.31 O ++ATOM 5757 CB GLU n 91 11.623 2.555 81.122 1.00 86.31 C ++ATOM 5758 CG GLU n 91 12.998 3.192 81.144 1.00 86.31 C ++ATOM 5759 CD GLU n 91 13.948 2.501 82.099 1.00 86.31 C ++ATOM 5760 OE1 GLU n 91 13.552 1.476 82.695 1.00 86.31 O ++ATOM 5761 OE2 GLU n 91 15.089 2.983 82.260 1.00 86.31 O ++ATOM 5762 N ASP n 92 8.614 1.770 82.610 1.00 78.59 N ++ATOM 5763 CA ASP n 92 7.263 1.324 82.315 1.00 78.59 C ++ATOM 5764 C ASP n 92 6.383 1.506 83.538 1.00 78.59 C ++ATOM 5765 O ASP n 92 6.789 1.189 84.659 1.00 78.59 O ++ATOM 5766 CB ASP n 92 7.246 -0.137 81.873 1.00 78.59 C ++ATOM 5767 CG ASP n 92 7.876 -0.335 80.515 1.00 78.59 C ++ATOM 5768 OD1 ASP n 92 7.840 0.610 79.703 1.00 78.59 O ++ATOM 5769 OD2 ASP n 92 8.404 -1.435 80.252 1.00 78.59 O ++ATOM 5770 N PHE n 93 5.178 2.019 83.314 1.00 65.90 N ++ATOM 5771 CA PHE n 93 4.183 2.210 84.370 1.00 65.90 C ++ATOM 5772 C PHE n 93 2.823 1.865 83.787 1.00 65.90 C ++ATOM 5773 O PHE n 93 2.074 2.741 83.343 1.00 65.90 O ++ATOM 5774 CB PHE n 93 4.248 3.638 84.922 1.00 65.90 C ++ATOM 5775 CG PHE n 93 3.204 3.960 85.956 1.00 65.90 C ++ATOM 5776 CD1 PHE n 93 3.159 3.280 87.160 1.00 65.90 C ++ATOM 5777 CD2 PHE n 93 2.321 5.004 85.753 1.00 65.90 C ++ATOM 5778 CE1 PHE n 93 2.205 3.592 88.113 1.00 65.90 C ++ATOM 5779 CE2 PHE n 93 1.382 5.329 86.709 1.00 65.90 C ++ATOM 5780 CZ PHE n 93 1.320 4.623 87.884 1.00 65.90 C ++ATOM 5781 N PRO n 94 2.480 0.581 83.742 1.00 58.32 N ++ATOM 5782 CA PRO n 94 1.229 0.176 83.103 1.00 58.32 C ++ATOM 5783 C PRO n 94 0.026 0.387 83.997 1.00 58.32 C ++ATOM 5784 O PRO n 94 0.100 0.295 85.223 1.00 58.32 O ++ATOM 5785 CB PRO n 94 1.443 -1.316 82.837 1.00 58.32 C ++ATOM 5786 CG PRO n 94 2.374 -1.739 83.892 1.00 58.32 C ++ATOM 5787 CD PRO n 94 3.295 -0.583 84.122 1.00 58.32 C ++ATOM 5788 N LEU n 95 -1.098 0.672 83.355 1.00 53.77 N ++ATOM 5789 CA LEU n 95 -2.374 0.839 84.028 1.00 53.77 C ++ATOM 5790 C LEU n 95 -3.225 -0.398 83.784 1.00 53.77 C ++ATOM 5791 O LEU n 95 -3.152 -1.009 82.715 1.00 53.77 O ++ATOM 5792 CB LEU n 95 -3.076 2.096 83.514 1.00 53.77 C ++ATOM 5793 CG LEU n 95 -4.468 2.501 83.987 1.00 53.77 C ++ATOM 5794 CD1 LEU n 95 -4.492 2.745 85.466 1.00 53.77 C ++ATOM 5795 CD2 LEU n 95 -4.901 3.746 83.243 1.00 53.77 C ++ATOM 5796 N ARG n 96 -4.011 -0.783 84.785 1.00 59.17 N ++ATOM 5797 CA ARG n 96 -4.875 -1.947 84.668 1.00 59.17 C ++ATOM 5798 C ARG n 96 -6.295 -1.581 85.058 1.00 59.17 C ++ATOM 5799 O ARG n 96 -6.515 -0.770 85.959 1.00 59.17 O ++ATOM 5800 CB ARG n 96 -4.401 -3.100 85.541 1.00 59.17 C ++ATOM 5801 CG ARG n 96 -3.086 -3.706 85.121 1.00 59.17 C ++ATOM 5802 CD ARG n 96 -2.727 -4.849 86.041 1.00 59.17 C ++ATOM 5803 NE ARG n 96 -1.453 -5.458 85.691 1.00 59.17 N ++ATOM 5804 CZ ARG n 96 -0.905 -6.457 86.371 1.00 59.17 C ++ATOM 5805 NH1 ARG n 96 -1.525 -6.954 87.432 1.00 59.17 N ++ATOM 5806 NH2 ARG n 96 0.259 -6.959 85.987 1.00 59.17 N ++ATOM 5807 N LEU n 97 -7.247 -2.191 84.373 1.00 51.56 N ++ATOM 5808 CA LEU n 97 -8.670 -2.010 84.628 1.00 51.56 C ++ATOM 5809 C LEU n 97 -9.208 -3.403 84.917 1.00 51.56 C ++ATOM 5810 O LEU n 97 -9.411 -4.191 83.987 1.00 51.56 O ++ATOM 5811 CB LEU n 97 -9.366 -1.376 83.430 1.00 51.56 C ++ATOM 5812 CG LEU n 97 -9.298 0.120 83.135 1.00 51.56 C ++ATOM 5813 CD1 LEU n 97 -7.936 0.576 82.658 1.00 51.56 C ++ATOM 5814 CD2 LEU n 97 -10.323 0.411 82.079 1.00 51.56 C ++ATOM 5815 N LEU n 98 -9.414 -3.720 86.196 1.00 62.85 N ++ATOM 5816 CA LEU n 98 -9.778 -5.086 86.561 1.00 62.85 C ++ATOM 5817 C LEU n 98 -11.217 -5.396 86.173 1.00 62.85 C ++ATOM 5818 O LEU n 98 -11.499 -6.451 85.595 1.00 62.85 O ++ATOM 5819 CB LEU n 98 -9.560 -5.314 88.056 1.00 62.85 C ++ATOM 5820 CG LEU n 98 -9.857 -6.740 88.531 1.00 62.85 C ++ATOM 5821 CD1 LEU n 98 -8.958 -7.742 87.819 1.00 62.85 C ++ATOM 5822 CD2 LEU n 98 -9.708 -6.860 90.043 1.00 62.85 C ++ATOM 5823 N SER n 99 -12.139 -4.496 86.482 1.00 58.73 N ++ATOM 5824 CA SER n 99 -13.519 -4.613 86.039 1.00 58.73 C ++ATOM 5825 C SER n 99 -13.886 -3.350 85.278 1.00 58.73 C ++ATOM 5826 O SER n 99 -13.387 -2.266 85.593 1.00 58.73 O ++ATOM 5827 CB SER n 99 -14.463 -4.837 87.220 1.00 58.73 C ++ATOM 5828 OG SER n 99 -14.471 -3.722 88.088 1.00 58.73 O ++ATOM 5829 N ALA n 100 -14.738 -3.493 84.271 1.00 55.67 N ++ATOM 5830 CA ALA n 100 -15.100 -2.388 83.399 1.00 55.67 C ++ATOM 5831 C ALA n 100 -16.486 -1.860 83.736 1.00 55.67 C ++ATOM 5832 O ALA n 100 -17.288 -2.530 84.390 1.00 55.67 O ++ATOM 5833 CB ALA n 100 -15.059 -2.817 81.935 1.00 55.67 C ++ATOM 5834 N ALA n 101 -16.758 -0.643 83.276 1.00 55.47 N ++ATOM 5835 CA ALA n 101 -18.022 0.037 83.495 1.00 55.47 C ++ATOM 5836 C ALA n 101 -18.413 0.758 82.216 1.00 55.47 C ++ATOM 5837 O ALA n 101 -17.547 1.079 81.399 1.00 55.47 O ++ATOM 5838 CB ALA n 101 -17.921 1.044 84.651 1.00 55.47 C ++ATOM 5839 N PRO n 102 -19.706 1.008 82.001 1.00 56.99 N ++ATOM 5840 CA PRO n 102 -20.105 1.844 80.858 1.00 56.99 C ++ATOM 5841 C PRO n 102 -19.699 3.305 80.986 1.00 56.99 C ++ATOM 5842 O PRO n 102 -19.720 4.018 79.977 1.00 56.99 O ++ATOM 5843 CB PRO n 102 -21.629 1.694 80.830 1.00 56.99 C ++ATOM 5844 CG PRO n 102 -21.882 0.394 81.492 1.00 56.99 C ++ATOM 5845 CD PRO n 102 -20.854 0.285 82.569 1.00 56.99 C ++ATOM 5846 N SER n 103 -19.340 3.774 82.178 1.00 50.76 N ++ATOM 5847 CA SER n 103 -18.825 5.125 82.357 1.00 50.76 C ++ATOM 5848 C SER n 103 -17.307 5.182 82.304 1.00 50.76 C ++ATOM 5849 O SER n 103 -16.709 6.025 82.979 1.00 50.76 O ++ATOM 5850 CB SER n 103 -19.315 5.710 83.681 1.00 50.76 C ++ATOM 5851 OG SER n 103 -20.724 5.848 83.681 1.00 50.76 O ++ATOM 5852 N GLN n 104 -16.679 4.297 81.540 1.00 44.29 N ++ATOM 5853 CA GLN n 104 -15.234 4.227 81.401 1.00 44.29 C ++ATOM 5854 C GLN n 104 -14.759 4.832 80.084 1.00 44.29 C ++ATOM 5855 O GLN n 104 -13.553 5.019 79.891 1.00 44.29 O ++ATOM 5856 CB GLN n 104 -14.804 2.764 81.517 1.00 44.29 C ++ATOM 5857 CG GLN n 104 -13.358 2.506 81.790 1.00 44.29 C ++ATOM 5858 CD GLN n 104 -12.952 2.980 83.151 1.00 44.29 C ++ATOM 5859 OE1 GLN n 104 -13.661 2.773 84.134 1.00 44.29 O ++ATOM 5860 NE2 GLN n 104 -11.816 3.631 83.221 1.00 44.29 N ++ATOM 5861 N THR n 105 -15.691 5.172 79.196 1.00 36.73 N ++ATOM 5862 CA THR n 105 -15.389 5.684 77.864 1.00 36.73 C ++ATOM 5863 C THR n 105 -14.699 7.038 77.960 1.00 36.73 C ++ATOM 5864 O THR n 105 -15.330 8.042 78.300 1.00 36.73 O ++ATOM 5865 CB THR n 105 -16.679 5.806 77.062 1.00 36.73 C ++ATOM 5866 OG1 THR n 105 -17.354 4.545 77.036 1.00 36.73 O ++ATOM 5867 CG2 THR n 105 -16.373 6.234 75.648 1.00 36.73 C ++ATOM 5868 N SER n 106 -13.410 7.074 77.647 1.00 30.73 N ++ATOM 5869 CA SER n 106 -12.617 8.282 77.815 1.00 30.73 C ++ATOM 5870 C SER n 106 -11.408 8.179 76.904 1.00 30.73 C ++ATOM 5871 O SER n 106 -11.259 7.216 76.153 1.00 30.73 O ++ATOM 5872 CB SER n 106 -12.202 8.460 79.274 1.00 30.73 C ++ATOM 5873 OG SER n 106 -11.477 9.663 79.456 1.00 30.73 O ++ATOM 5874 N VAL n 107 -10.536 9.177 76.971 1.00 28.57 N ++ATOM 5875 CA VAL n 107 -9.274 9.149 76.242 1.00 28.57 C ++ATOM 5876 C VAL n 107 -8.159 9.256 77.266 1.00 28.57 C ++ATOM 5877 O VAL n 107 -8.105 10.231 78.021 1.00 28.57 O ++ATOM 5878 CB VAL n 107 -9.176 10.287 75.218 1.00 28.57 C ++ATOM 5879 CG1 VAL n 107 -7.855 10.226 74.489 1.00 28.57 C ++ATOM 5880 CG2 VAL n 107 -10.327 10.233 74.244 1.00 28.57 C ++ATOM 5881 N TYR n 108 -7.269 8.275 77.296 1.00 29.94 N ++ATOM 5882 CA TYR n 108 -6.271 8.204 78.352 1.00 29.94 C ++ATOM 5883 C TYR n 108 -4.931 8.734 77.861 1.00 29.94 C ++ATOM 5884 O TYR n 108 -4.645 8.748 76.666 1.00 29.94 O ++ATOM 5885 CB TYR n 108 -6.123 6.768 78.850 1.00 29.94 C ++ATOM 5886 CG TYR n 108 -7.346 6.239 79.563 1.00 29.94 C ++ATOM 5887 CD1 TYR n 108 -8.303 7.091 80.070 1.00 29.94 C ++ATOM 5888 CD2 TYR n 108 -7.551 4.886 79.707 1.00 29.94 C ++ATOM 5889 CE1 TYR n 108 -9.422 6.616 80.709 1.00 29.94 C ++ATOM 5890 CE2 TYR n 108 -8.673 4.403 80.346 1.00 29.94 C ++ATOM 5891 CZ TYR n 108 -9.600 5.278 80.846 1.00 29.94 C ++ATOM 5892 OH TYR n 108 -10.722 4.821 81.486 1.00 29.94 O ++ATOM 5893 N PHE n 109 -4.105 9.171 78.806 1.00 35.09 N ++ATOM 5894 CA PHE n 109 -2.836 9.807 78.487 1.00 35.09 C ++ATOM 5895 C PHE n 109 -1.808 9.467 79.547 1.00 35.09 C ++ATOM 5896 O PHE n 109 -2.127 9.421 80.736 1.00 35.09 O ++ATOM 5897 CB PHE n 109 -2.964 11.328 78.404 1.00 35.09 C ++ATOM 5898 CG PHE n 109 -3.722 11.814 77.222 1.00 35.09 C ++ATOM 5899 CD1 PHE n 109 -3.107 11.924 75.996 1.00 35.09 C ++ATOM 5900 CD2 PHE n 109 -5.045 12.175 77.337 1.00 35.09 C ++ATOM 5901 CE1 PHE n 109 -3.800 12.375 74.907 1.00 35.09 C ++ATOM 5902 CE2 PHE n 109 -5.741 12.627 76.249 1.00 35.09 C ++ATOM 5903 CZ PHE n 109 -5.117 12.726 75.032 1.00 35.09 C ++ATOM 5904 N CYS n 110 -0.574 9.268 79.113 1.00 45.69 N ++ATOM 5905 CA CYS n 110 0.550 9.044 80.006 1.00 45.69 C ++ATOM 5906 C CYS n 110 1.336 10.338 80.151 1.00 45.69 C ++ATOM 5907 O CYS n 110 1.348 11.176 79.249 1.00 45.69 O ++ATOM 5908 CB CYS n 110 1.443 7.929 79.459 1.00 45.69 C ++ATOM 5909 SG CYS n 110 2.772 7.366 80.532 1.00 45.69 S ++ATOM 5910 N ALA n 111 1.987 10.506 81.298 1.00 56.99 N ++ATOM 5911 CA ALA n 111 2.778 11.697 81.567 1.00 56.99 C ++ATOM 5912 C ALA n 111 4.214 11.299 81.875 1.00 56.99 C ++ATOM 5913 O ALA n 111 4.532 10.119 82.020 1.00 56.99 O ++ATOM 5914 CB ALA n 111 2.198 12.507 82.727 1.00 56.99 C ++ATOM 5915 N SER n 112 5.082 12.301 81.997 1.00 70.68 N ++ATOM 5916 CA SER n 112 6.513 12.045 82.165 1.00 70.68 C ++ATOM 5917 C SER n 112 7.187 13.281 82.735 1.00 70.68 C ++ATOM 5918 O SER n 112 7.188 14.330 82.087 1.00 70.68 O ++ATOM 5919 CB SER n 112 7.136 11.671 80.824 1.00 70.68 C ++ATOM 5920 OG SER n 112 8.528 11.476 80.944 1.00 70.68 O ++ATOM 5921 N ARG n 113 7.771 13.167 83.929 1.00 80.55 N ++ATOM 5922 CA ARG n 113 8.504 14.268 84.541 1.00 80.55 C ++ATOM 5923 C ARG n 113 9.829 13.773 85.097 1.00 80.55 C ++ATOM 5924 O ARG n 113 9.941 12.634 85.571 1.00 80.55 O ++ATOM 5925 CB ARG n 113 7.712 14.943 85.664 1.00 80.55 C ++ATOM 5926 CG ARG n 113 6.468 15.650 85.199 1.00 80.55 C ++ATOM 5927 CD ARG n 113 5.678 16.298 86.321 1.00 80.55 C ++ATOM 5928 NE ARG n 113 6.322 17.491 86.858 1.00 80.55 N ++ATOM 5929 CZ ARG n 113 5.895 18.138 87.936 1.00 80.55 C ++ATOM 5930 NH1 ARG n 113 4.835 17.690 88.599 1.00 80.55 N ++ATOM 5931 NH2 ARG n 113 6.532 19.219 88.363 1.00 80.55 N ++ATOM 5932 N ARG n 114 10.821 14.665 85.068 1.00 86.67 N ++ATOM 5933 CA ARG n 114 12.200 14.274 85.354 1.00 86.67 C ++ATOM 5934 C ARG n 114 12.479 14.209 86.854 1.00 86.67 C ++ATOM 5935 O ARG n 114 12.731 13.130 87.395 1.00 86.67 O ++ATOM 5936 CB ARG n 114 13.161 15.235 84.642 1.00 86.67 C ++ATOM 5937 CG ARG n 114 14.649 14.937 84.820 1.00 86.67 C ++ATOM 5938 CD ARG n 114 15.310 15.896 85.802 1.00 86.67 C ++ATOM 5939 NE ARG n 114 16.727 15.614 85.997 1.00 86.67 N ++ATOM 5940 CZ ARG n 114 17.698 16.107 85.237 1.00 86.67 C ++ATOM 5941 NH1 ARG n 114 17.405 16.908 84.222 1.00 86.67 N ++ATOM 5942 NH2 ARG n 114 18.963 15.798 85.491 1.00 86.67 N ++ATOM 5943 N ARG n 115 12.452 15.352 87.549 1.00 82.15 N ++ATOM 5944 CA ARG n 115 12.738 15.315 88.988 1.00 82.15 C ++ATOM 5945 C ARG n 115 12.022 16.470 89.689 1.00 82.15 C ++ATOM 5946 O ARG n 115 12.571 17.570 89.788 1.00 82.15 O ++ATOM 5947 CB ARG n 115 14.235 15.358 89.261 1.00 82.15 C ++ATOM 5948 N GLN n 116 10.808 16.182 90.161 1.00 87.75 N ++ATOM 5949 CA GLN n 116 10.100 16.829 91.276 1.00 87.75 C ++ATOM 5950 C GLN n 116 10.115 18.362 91.199 1.00 87.75 C ++ATOM 5951 O GLN n 116 10.670 19.059 92.051 1.00 87.75 O ++ATOM 5952 CB GLN n 116 10.666 16.330 92.610 1.00 87.75 C ++ATOM 5953 CG GLN n 116 9.729 16.518 93.797 1.00 87.75 C ++ATOM 5954 CD GLN n 116 8.440 15.747 93.614 1.00 87.75 C ++ATOM 5955 OE1 GLN n 116 7.390 16.324 93.340 1.00 87.75 O ++ATOM 5956 NE2 GLN n 116 8.516 14.430 93.743 1.00 87.75 N ++ATOM 5957 N GLY n 117 9.523 18.879 90.126 1.00 85.24 N ++ATOM 5958 CA GLY n 117 9.323 20.310 90.007 1.00 85.24 C ++ATOM 5959 C GLY n 117 10.552 21.144 89.729 1.00 85.24 C ++ATOM 5960 O GLY n 117 10.448 22.373 89.715 1.00 85.24 O ++ATOM 5961 N ALA n 118 11.718 20.528 89.517 1.00 85.86 N ++ATOM 5962 CA ALA n 118 12.890 21.300 89.117 1.00 85.86 C ++ATOM 5963 C ALA n 118 12.801 21.683 87.647 1.00 85.86 C ++ATOM 5964 O ALA n 118 13.063 22.832 87.271 1.00 85.86 O ++ATOM 5965 CB ALA n 118 14.169 20.509 89.398 1.00 85.86 C ++ATOM 5966 N SER n 119 12.431 20.725 86.803 1.00 84.93 N ++ATOM 5967 CA SER n 119 12.045 20.974 85.421 1.00 84.93 C ++ATOM 5968 C SER n 119 10.565 20.633 85.316 1.00 84.93 C ++ATOM 5969 O SER n 119 10.201 19.455 85.229 1.00 84.93 O ++ATOM 5970 CB SER n 119 12.882 20.141 84.452 1.00 84.93 C ++ATOM 5971 OG SER n 119 12.479 20.352 83.111 1.00 84.93 O ++ATOM 5972 N GLY n 120 9.712 21.657 85.330 1.00 80.62 N ++ATOM 5973 CA GLY n 120 8.276 21.490 85.394 1.00 80.62 C ++ATOM 5974 C GLY n 120 7.594 21.007 84.137 1.00 80.62 C ++ATOM 5975 O GLY n 120 6.364 20.915 84.114 1.00 80.62 O ++ATOM 5976 N GLU n 121 8.345 20.689 83.088 1.00 73.75 N ++ATOM 5977 CA GLU n 121 7.747 20.275 81.830 1.00 73.75 C ++ATOM 5978 C GLU n 121 7.214 18.851 81.914 1.00 73.75 C ++ATOM 5979 O GLU n 121 7.718 18.024 82.677 1.00 73.75 O ++ATOM 5980 CB GLU n 121 8.773 20.373 80.708 1.00 73.75 C ++ATOM 5981 CG GLU n 121 9.192 21.783 80.383 1.00 73.75 C ++ATOM 5982 CD GLU n 121 10.238 21.826 79.295 1.00 73.75 C ++ATOM 5983 OE1 GLU n 121 10.740 20.748 78.913 1.00 73.75 O ++ATOM 5984 OE2 GLU n 121 10.552 22.934 78.817 1.00 73.75 O ++ATOM 5985 N GLN n 122 6.180 18.575 81.129 1.00 60.99 N ++ATOM 5986 CA GLN n 122 5.692 17.225 80.916 1.00 60.99 C ++ATOM 5987 C GLN n 122 5.760 16.896 79.433 1.00 60.99 C ++ATOM 5988 O GLN n 122 5.978 17.765 78.590 1.00 60.99 O ++ATOM 5989 CB GLN n 122 4.263 17.054 81.428 1.00 60.99 C ++ATOM 5990 CG GLN n 122 4.147 17.180 82.911 1.00 60.99 C ++ATOM 5991 CD GLN n 122 2.765 16.876 83.402 1.00 60.99 C ++ATOM 5992 OE1 GLN n 122 1.844 16.710 82.614 1.00 60.99 O ++ATOM 5993 NE2 GLN n 122 2.615 16.762 84.711 1.00 60.99 N ++ATOM 5994 N TYR n 123 5.576 15.618 79.121 1.00 62.23 N ++ATOM 5995 CA TYR n 123 5.545 15.158 77.737 1.00 62.23 C ++ATOM 5996 C TYR n 123 4.473 14.086 77.627 1.00 62.23 C ++ATOM 5997 O TYR n 123 4.672 12.958 78.082 1.00 62.23 O ++ATOM 5998 CB TYR n 123 6.910 14.638 77.296 1.00 62.23 C ++ATOM 5999 CG TYR n 123 7.946 15.734 77.205 1.00 62.23 C ++ATOM 6000 CD1 TYR n 123 7.982 16.589 76.113 1.00 62.23 C ++ATOM 6001 CD2 TYR n 123 8.874 15.929 78.220 1.00 62.23 C ++ATOM 6002 CE1 TYR n 123 8.917 17.603 76.027 1.00 62.23 C ++ATOM 6003 CE2 TYR n 123 9.817 16.941 78.141 1.00 62.23 C ++ATOM 6004 CZ TYR n 123 9.831 17.773 77.041 1.00 62.23 C ++ATOM 6005 OH TYR n 123 10.761 18.780 76.952 1.00 62.23 O ++ATOM 6006 N PHE n 124 3.338 14.442 77.037 1.00 46.32 N ++ATOM 6007 CA PHE n 124 2.209 13.533 76.939 1.00 46.32 C ++ATOM 6008 C PHE n 124 2.347 12.588 75.757 1.00 46.32 C ++ATOM 6009 O PHE n 124 2.900 12.935 74.713 1.00 46.32 O ++ATOM 6010 CB PHE n 124 0.906 14.315 76.813 1.00 46.32 C ++ATOM 6011 CG PHE n 124 0.391 14.855 78.108 1.00 46.32 C ++ATOM 6012 CD1 PHE n 124 0.850 14.365 79.309 1.00 46.32 C ++ATOM 6013 CD2 PHE n 124 -0.568 15.840 78.121 1.00 46.32 C ++ATOM 6014 CE1 PHE n 124 0.361 14.855 80.493 1.00 46.32 C ++ATOM 6015 CE2 PHE n 124 -1.056 16.333 79.301 1.00 46.32 C ++ATOM 6016 CZ PHE n 124 -0.592 15.840 80.487 1.00 46.32 C ++ATOM 6017 N GLY n 125 1.809 11.384 75.928 1.00 38.00 N ++ATOM 6018 CA GLY n 125 1.800 10.402 74.875 1.00 38.00 C ++ATOM 6019 C GLY n 125 0.750 10.701 73.832 1.00 38.00 C ++ATOM 6020 O GLY n 125 0.018 11.690 73.899 1.00 38.00 O ++ATOM 6021 N PRO n 126 0.655 9.823 72.834 1.00 33.08 N ++ATOM 6022 CA PRO n 126 -0.255 10.064 71.711 1.00 33.08 C ++ATOM 6023 C PRO n 126 -1.706 9.683 71.959 1.00 33.08 C ++ATOM 6024 O PRO n 126 -2.487 9.669 71.004 1.00 33.08 O ++ATOM 6025 CB PRO n 126 0.347 9.191 70.603 1.00 33.08 C ++ATOM 6026 CG PRO n 126 0.994 8.084 71.323 1.00 33.08 C ++ATOM 6027 CD PRO n 126 1.534 8.669 72.589 1.00 33.08 C ++ATOM 6028 N GLY n 127 -2.104 9.372 73.177 1.00 28.26 N ++ATOM 6029 CA GLY n 127 -3.523 9.136 73.385 1.00 28.26 C ++ATOM 6030 C GLY n 127 -3.892 7.670 73.302 1.00 28.26 C ++ATOM 6031 O GLY n 127 -3.371 6.908 72.494 1.00 28.26 O ++ATOM 6032 N THR n 128 -4.816 7.269 74.169 1.00 26.12 N ++ATOM 6033 CA THR n 128 -5.340 5.907 74.177 1.00 26.12 C ++ATOM 6034 C THR n 128 -6.837 5.972 74.410 1.00 26.12 C ++ATOM 6035 O THR n 128 -7.274 6.539 75.412 1.00 26.12 O ++ATOM 6036 CB THR n 128 -4.680 5.077 75.261 1.00 26.12 C ++ATOM 6037 OG1 THR n 128 -3.279 4.994 75.001 1.00 26.12 O ++ATOM 6038 CG2 THR n 128 -5.275 3.689 75.292 1.00 26.12 C ++ATOM 6039 N ARG n 129 -7.620 5.405 73.505 1.00 25.61 N ++ATOM 6040 CA ARG n 129 -9.068 5.493 73.597 1.00 25.61 C ++ATOM 6041 C ARG n 129 -9.647 4.180 74.088 1.00 25.61 C ++ATOM 6042 O ARG n 129 -9.100 3.111 73.816 1.00 25.61 O ++ATOM 6043 CB ARG n 129 -9.683 5.856 72.251 1.00 25.61 C ++ATOM 6044 CG ARG n 129 -9.322 7.238 71.775 1.00 25.61 C ++ATOM 6045 CD ARG n 129 -9.946 7.531 70.435 1.00 25.61 C ++ATOM 6046 NE ARG n 129 -11.397 7.576 70.507 1.00 25.61 N ++ATOM 6047 CZ ARG n 129 -12.088 8.678 70.760 1.00 25.61 C ++ATOM 6048 NH1 ARG n 129 -11.454 9.824 70.952 1.00 25.61 N ++ATOM 6049 NH2 ARG n 129 -13.410 8.639 70.811 1.00 25.61 N ++ATOM 6050 N LEU n 130 -10.743 4.266 74.832 1.00 29.37 N ++ATOM 6051 CA LEU n 130 -11.528 3.103 75.223 1.00 29.37 C ++ATOM 6052 C LEU n 130 -12.998 3.428 75.063 1.00 29.37 C ++ATOM 6053 O LEU n 130 -13.430 4.531 75.404 1.00 29.37 O ++ATOM 6054 CB LEU n 130 -11.285 2.686 76.671 1.00 29.37 C ++ATOM 6055 CG LEU n 130 -10.105 1.808 77.056 1.00 29.37 C ++ATOM 6056 CD1 LEU n 130 -8.820 2.590 77.123 1.00 29.37 C ++ATOM 6057 CD2 LEU n 130 -10.394 1.126 78.370 1.00 29.37 C ++ATOM 6058 N THR n 131 -13.760 2.483 74.537 1.00 32.35 N ++ATOM 6059 CA THR n 131 -15.206 2.497 74.665 1.00 32.35 C ++ATOM 6060 C THR n 131 -15.626 1.151 75.220 1.00 32.35 C ++ATOM 6061 O THR n 131 -15.023 0.125 74.908 1.00 32.35 O ++ATOM 6062 CB THR n 131 -15.924 2.733 73.342 1.00 32.35 C ++ATOM 6063 OG1 THR n 131 -15.633 1.654 72.456 1.00 32.35 O ++ATOM 6064 CG2 THR n 131 -15.490 4.035 72.698 1.00 32.35 C ++ATOM 6065 N VAL n 132 -16.658 1.159 76.054 1.00 43.04 N ++ATOM 6066 CA VAL n 132 -17.105 -0.038 76.749 1.00 43.04 C ++ATOM 6067 C VAL n 132 -18.582 -0.222 76.462 1.00 43.04 C ++ATOM 6068 O VAL n 132 -19.407 0.583 76.907 1.00 43.04 O ++ATOM 6069 CB VAL n 132 -16.864 0.049 78.261 1.00 43.04 C ++ATOM 6070 CG1 VAL n 132 -17.416 -1.176 78.931 1.00 43.04 C ++ATOM 6071 CG2 VAL n 132 -15.393 0.197 78.562 1.00 43.04 C ++ATOM 6072 N THR n 133 -18.919 -1.273 75.729 1.00 53.68 N ++ATOM 6073 CA THR n 133 -20.303 -1.572 75.406 1.00 53.68 C ++ATOM 6074 C THR n 133 -20.865 -2.531 76.443 1.00 53.68 C ++ATOM 6075 O THR n 133 -20.136 -3.330 77.037 1.00 53.68 O ++ATOM 6076 CB THR n 133 -20.430 -2.199 74.020 1.00 53.68 C ++ATOM 6077 OG1 THR n 133 -19.884 -3.519 74.050 1.00 53.68 O ++ATOM 6078 CG2 THR n 133 -19.649 -1.400 73.019 1.00 53.68 C ++ATOM 6079 N GLU n 134 -22.175 -2.459 76.650 1.00 64.37 N ++ATOM 6080 CA GLU n 134 -22.811 -3.377 77.580 1.00 64.37 C ++ATOM 6081 C GLU n 134 -23.092 -4.736 76.961 1.00 64.37 C ++ATOM 6082 O GLU n 134 -23.551 -5.637 77.671 1.00 64.37 O ++ATOM 6083 CB GLU n 134 -24.102 -2.761 78.118 1.00 64.37 C ++ATOM 6084 CG GLU n 134 -23.852 -1.536 78.985 1.00 64.37 C ++ATOM 6085 CD GLU n 134 -25.123 -0.918 79.531 1.00 64.37 C ++ATOM 6086 OE1 GLU n 134 -26.220 -1.366 79.139 1.00 64.37 O ++ATOM 6087 OE2 GLU n 134 -25.023 0.018 80.353 1.00 64.37 O ++ATOM 6088 N ASP n 135 -22.801 -4.900 75.671 1.00 61.54 N ++ATOM 6089 CA ASP n 135 -23.033 -6.118 74.910 1.00 61.54 C ++ATOM 6090 C ASP n 135 -22.285 -5.971 73.594 1.00 61.54 C ++ATOM 6091 O ASP n 135 -22.287 -4.889 73.005 1.00 61.54 O ++ATOM 6092 CB ASP n 135 -24.531 -6.334 74.671 1.00 61.54 C ++ATOM 6093 CG ASP n 135 -24.832 -7.629 73.973 1.00 61.54 C ++ATOM 6094 OD1 ASP n 135 -24.643 -8.703 74.578 1.00 61.54 O ++ATOM 6095 OD2 ASP n 135 -25.302 -7.566 72.828 1.00 61.54 O ++ATOM 6096 N LEU n 136 -21.635 -7.043 73.138 1.00 51.34 N ++ATOM 6097 CA LEU n 136 -20.796 -6.961 71.946 1.00 51.34 C ++ATOM 6098 C LEU n 136 -21.544 -7.260 70.660 1.00 51.34 C ++ATOM 6099 O LEU n 136 -20.922 -7.672 69.682 1.00 51.34 O ++ATOM 6100 CB LEU n 136 -19.584 -7.883 72.061 1.00 51.34 C ++ATOM 6101 CG LEU n 136 -18.480 -7.404 72.991 1.00 51.34 C ++ATOM 6102 CD1 LEU n 136 -17.366 -8.425 73.084 1.00 51.34 C ++ATOM 6103 CD2 LEU n 136 -17.947 -6.090 72.489 1.00 51.34 C ++ATOM 6104 N LYS n 137 -22.852 -7.062 70.621 1.00 53.71 N ++ATOM 6105 CA LYS n 137 -23.578 -7.088 69.362 1.00 53.71 C ++ATOM 6106 C LYS n 137 -23.651 -5.714 68.727 1.00 53.71 C ++ATOM 6107 O LYS n 137 -24.304 -5.557 67.692 1.00 53.71 O ++ATOM 6108 CB LYS n 137 -24.987 -7.636 69.575 1.00 53.71 C ++ATOM 6109 CG LYS n 137 -25.007 -9.087 69.993 1.00 53.71 C ++ATOM 6110 CD LYS n 137 -26.401 -9.534 70.389 1.00 53.71 C ++ATOM 6111 CE LYS n 137 -26.367 -10.943 70.963 1.00 53.71 C ++ATOM 6112 NZ LYS n 137 -27.704 -11.389 71.433 1.00 53.71 N ++ATOM 6113 N ASN n 138 -23.001 -4.720 69.322 1.00 41.41 N ++ATOM 6114 CA ASN n 138 -23.126 -3.343 68.883 1.00 41.41 C ++ATOM 6115 C ASN n 138 -21.989 -2.884 67.987 1.00 41.41 C ++ATOM 6116 O ASN n 138 -22.086 -1.799 67.411 1.00 41.41 O ++ATOM 6117 CB ASN n 138 -23.214 -2.411 70.093 1.00 41.41 C ++ATOM 6118 CG ASN n 138 -24.514 -2.553 70.838 1.00 41.41 C ++ATOM 6119 OD1 ASN n 138 -25.572 -2.702 70.233 1.00 41.41 O ++ATOM 6120 ND2 ASN n 138 -24.448 -2.498 72.158 1.00 41.41 N ++ATOM 6121 N VAL n 139 -20.919 -3.652 67.868 1.00 30.37 N ++ATOM 6122 CA VAL n 139 -19.798 -3.263 67.024 1.00 30.37 C ++ATOM 6123 C VAL n 139 -20.182 -3.490 65.568 1.00 30.37 C ++ATOM 6124 O VAL n 139 -20.859 -4.468 65.241 1.00 30.37 O ++ATOM 6125 CB VAL n 139 -18.544 -4.058 67.429 1.00 30.37 C ++ATOM 6126 CG1 VAL n 139 -17.359 -3.692 66.585 1.00 30.37 C ++ATOM 6127 CG2 VAL n 139 -18.225 -3.802 68.870 1.00 30.37 C ++ATOM 6128 N PHE n 140 -19.795 -2.570 64.690 1.00 27.86 N ++ATOM 6129 CA PHE n 140 -20.051 -2.720 63.267 1.00 27.86 C ++ATOM 6130 C PHE n 140 -18.860 -2.223 62.464 1.00 27.86 C ++ATOM 6131 O PHE n 140 -18.061 -1.428 62.967 1.00 27.86 O ++ATOM 6132 CB PHE n 140 -21.315 -1.963 62.846 1.00 27.86 C ++ATOM 6133 CG PHE n 140 -22.576 -2.605 63.313 1.00 27.86 C ++ATOM 6134 CD1 PHE n 140 -23.135 -3.649 62.606 1.00 27.86 C ++ATOM 6135 CD2 PHE n 140 -23.196 -2.175 64.462 1.00 27.86 C ++ATOM 6136 CE1 PHE n 140 -24.298 -4.246 63.034 1.00 27.86 C ++ATOM 6137 CE2 PHE n 140 -24.355 -2.767 64.900 1.00 27.86 C ++ATOM 6138 CZ PHE n 140 -24.905 -3.806 64.185 1.00 27.86 C ++ATOM 6139 N PRO n 141 -18.693 -2.702 61.238 1.00 16.24 N ++ATOM 6140 CA PRO n 141 -17.647 -2.179 60.379 1.00 16.24 C ++ATOM 6141 C PRO n 141 -18.131 -0.952 59.634 1.00 16.24 C ++ATOM 6142 O PRO n 141 -19.332 -0.820 59.365 1.00 16.24 O ++ATOM 6143 CB PRO n 141 -17.385 -3.331 59.405 1.00 16.24 C ++ATOM 6144 CG PRO n 141 -17.936 -4.520 60.057 1.00 16.24 C ++ATOM 6145 CD PRO n 141 -19.129 -4.028 60.786 1.00 16.24 C ++ATOM 6146 N PRO n 142 -17.235 -0.036 59.281 1.00 15.76 N ++ATOM 6147 CA PRO n 142 -17.652 1.146 58.526 1.00 15.76 C ++ATOM 6148 C PRO n 142 -17.970 0.797 57.082 1.00 15.76 C ++ATOM 6149 O PRO n 142 -17.162 0.184 56.386 1.00 15.76 O ++ATOM 6150 CB PRO n 142 -16.439 2.072 58.628 1.00 15.76 C ++ATOM 6151 CG PRO n 142 -15.308 1.177 58.863 1.00 15.76 C ++ATOM 6152 CD PRO n 142 -15.817 0.028 59.654 1.00 15.76 C ++ATOM 6153 N GLU n 143 -19.156 1.182 56.632 1.00 22.75 N ++ATOM 6154 CA GLU n 143 -19.514 1.056 55.227 1.00 22.75 C ++ATOM 6155 C GLU n 143 -18.990 2.284 54.497 1.00 22.75 C ++ATOM 6156 O GLU n 143 -19.431 3.402 54.776 1.00 22.75 O ++ATOM 6157 CB GLU n 143 -21.024 0.938 55.063 1.00 22.75 C ++ATOM 6158 CG GLU n 143 -21.620 -0.250 55.777 1.00 22.75 C ++ATOM 6159 CD GLU n 143 -23.123 -0.341 55.603 1.00 22.75 C ++ATOM 6160 OE1 GLU n 143 -23.705 0.556 54.959 1.00 22.75 O ++ATOM 6161 OE2 GLU n 143 -23.725 -1.301 56.126 1.00 22.75 O ++ATOM 6162 N VAL n 144 -18.051 2.086 53.577 1.00 15.47 N ++ATOM 6163 CA VAL n 144 -17.286 3.175 52.982 1.00 15.47 C ++ATOM 6164 C VAL n 144 -17.716 3.352 51.535 1.00 15.47 C ++ATOM 6165 O VAL n 144 -17.805 2.374 50.787 1.00 15.47 O ++ATOM 6166 CB VAL n 144 -15.782 2.894 53.078 1.00 15.47 C ++ATOM 6167 CG1 VAL n 144 -15.000 4.002 52.475 1.00 15.47 C ++ATOM 6168 CG2 VAL n 144 -15.401 2.752 54.499 1.00 15.47 C ++ATOM 6169 N ALA n 145 -17.986 4.595 51.138 1.00 16.92 N ++ATOM 6170 CA ALA n 145 -18.322 4.902 49.755 1.00 16.92 C ++ATOM 6171 C ALA n 145 -17.573 6.141 49.293 1.00 16.92 C ++ATOM 6172 O ALA n 145 -17.385 7.084 50.060 1.00 16.92 O ++ATOM 6173 CB ALA n 145 -19.817 5.124 49.591 1.00 16.92 C ++ATOM 6174 N VAL n 146 -17.148 6.142 48.031 1.00 17.52 N ++ATOM 6175 CA VAL n 146 -16.413 7.264 47.449 1.00 17.52 C ++ATOM 6176 C VAL n 146 -17.272 7.893 46.374 1.00 17.52 C ++ATOM 6177 O VAL n 146 -17.500 7.283 45.325 1.00 17.52 O ++ATOM 6178 CB VAL n 146 -15.067 6.837 46.857 1.00 17.52 C ++ATOM 6179 CG1 VAL n 146 -14.407 8.012 46.172 1.00 17.52 C ++ATOM 6180 CG2 VAL n 146 -14.183 6.345 47.930 1.00 17.52 C ++ATOM 6181 N PHE n 147 -17.718 9.120 46.614 1.00 26.54 N ++ATOM 6182 CA PHE n 147 -18.565 9.864 45.701 1.00 26.54 C ++ATOM 6183 C PHE n 147 -17.692 10.748 44.832 1.00 26.54 C ++ATOM 6184 O PHE n 147 -17.011 11.646 45.337 1.00 26.54 O ++ATOM 6185 CB PHE n 147 -19.579 10.699 46.468 1.00 26.54 C ++ATOM 6186 CG PHE n 147 -20.604 9.884 47.159 1.00 26.54 C ++ATOM 6187 CD1 PHE n 147 -21.735 9.479 46.498 1.00 26.54 C ++ATOM 6188 CD2 PHE n 147 -20.420 9.489 48.461 1.00 26.54 C ++ATOM 6189 CE1 PHE n 147 -22.673 8.714 47.130 1.00 26.54 C ++ATOM 6190 CE2 PHE n 147 -21.350 8.716 49.092 1.00 26.54 C ++ATOM 6191 CZ PHE n 147 -22.480 8.337 48.434 1.00 26.54 C ++ATOM 6192 N GLU n 148 -17.706 10.476 43.561 1.00 24.21 N ++ATOM 6193 CA GLU n 148 -17.046 11.189 42.494 1.00 24.21 C ++ATOM 6194 C GLU n 148 -17.687 12.561 42.322 1.00 24.21 C ++ATOM 6195 O GLU n 148 -18.852 12.747 42.669 1.00 24.21 O ++ATOM 6196 CB GLU n 148 -17.176 10.384 41.210 1.00 24.21 C ++ATOM 6197 CG GLU n 148 -16.457 9.064 41.259 1.00 24.21 C ++ATOM 6198 CD GLU n 148 -16.750 8.222 40.051 1.00 24.21 C ++ATOM 6199 OE1 GLU n 148 -17.633 8.615 39.266 1.00 24.21 O ++ATOM 6200 OE2 GLU n 148 -16.108 7.167 39.885 1.00 24.21 O ++ATOM 6201 N PRO n 149 -16.965 13.538 41.795 1.00 24.88 N ++ATOM 6202 CA PRO n 149 -17.529 14.871 41.623 1.00 24.88 C ++ATOM 6203 C PRO n 149 -18.410 14.931 40.387 1.00 24.88 C ++ATOM 6204 O PRO n 149 -18.602 13.949 39.678 1.00 24.88 O ++ATOM 6205 CB PRO n 149 -16.300 15.742 41.442 1.00 24.88 C ++ATOM 6206 CG PRO n 149 -15.354 14.861 40.836 1.00 24.88 C ++ATOM 6207 CD PRO n 149 -15.541 13.540 41.453 1.00 24.88 C ++ATOM 6208 N SER n 150 -18.933 16.117 40.131 1.00 31.13 N ++ATOM 6209 CA SER n 150 -19.806 16.342 38.998 1.00 31.13 C ++ATOM 6210 C SER n 150 -19.170 17.329 38.036 1.00 31.13 C ++ATOM 6211 O SER n 150 -18.215 18.033 38.371 1.00 31.13 O ++ATOM 6212 CB SER n 150 -21.158 16.867 39.455 1.00 31.13 C ++ATOM 6213 OG SER n 150 -20.991 18.118 40.087 1.00 31.13 O ++ATOM 6214 N GLU n 151 -19.726 17.385 36.828 1.00 38.60 N ++ATOM 6215 CA GLU n 151 -19.157 18.244 35.801 1.00 38.60 C ++ATOM 6216 C GLU n 151 -19.473 19.712 36.038 1.00 38.60 C ++ATOM 6217 O GLU n 151 -18.856 20.573 35.402 1.00 38.60 O ++ATOM 6218 CB GLU n 151 -19.657 17.807 34.432 1.00 38.60 C ++ATOM 6219 CG GLU n 151 -19.221 16.407 34.069 1.00 38.60 C ++ATOM 6220 CD GLU n 151 -19.670 15.993 32.687 1.00 38.60 C ++ATOM 6221 OE1 GLU n 151 -20.415 16.759 32.045 1.00 38.60 O ++ATOM 6222 OE2 GLU n 151 -19.274 14.900 32.240 1.00 38.60 O ++ATOM 6223 N ALA n 152 -20.414 20.009 36.939 1.00 32.29 N ++ATOM 6224 CA ALA n 152 -20.693 21.389 37.310 1.00 32.29 C ++ATOM 6225 C ALA n 152 -19.490 22.037 37.979 1.00 32.29 C ++ATOM 6226 O ALA n 152 -19.181 23.202 37.710 1.00 32.29 O ++ATOM 6227 CB ALA n 152 -21.912 21.443 38.224 1.00 32.29 C ++ATOM 6228 N GLU n 153 -18.783 21.292 38.832 1.00 31.05 N ++ATOM 6229 CA GLU n 153 -17.581 21.832 39.453 1.00 31.05 C ++ATOM 6230 C GLU n 153 -16.474 22.011 38.435 1.00 31.05 C ++ATOM 6231 O GLU n 153 -15.782 23.034 38.433 1.00 31.05 O ++ATOM 6232 CB GLU n 153 -17.073 20.917 40.559 1.00 31.05 C ++ATOM 6233 CG GLU n 153 -17.997 20.707 41.710 1.00 31.05 C ++ATOM 6234 CD GLU n 153 -17.328 19.958 42.833 1.00 31.05 C ++ATOM 6235 OE1 GLU n 153 -16.135 19.626 42.699 1.00 31.05 O ++ATOM 6236 OE2 GLU n 153 -17.995 19.681 43.845 1.00 31.05 O ++ATOM 6237 N ILE n 154 -16.293 21.017 37.567 1.00 27.43 N ++ATOM 6238 CA ILE n 154 -15.164 21.004 36.652 1.00 27.43 C ++ATOM 6239 C ILE n 154 -15.341 22.065 35.572 1.00 27.43 C ++ATOM 6240 O ILE n 154 -14.359 22.610 35.054 1.00 27.43 O ++ATOM 6241 CB ILE n 154 -15.014 19.578 36.102 1.00 27.43 C ++ATOM 6242 CG1 ILE n 154 -14.887 18.611 37.273 1.00 27.43 C ++ATOM 6243 CG2 ILE n 154 -13.781 19.440 35.253 1.00 27.43 C ++ATOM 6244 CD1 ILE n 154 -15.002 17.169 36.899 1.00 27.43 C ++ATOM 6245 N SER n 155 -16.583 22.435 35.265 1.00 30.78 N ++ATOM 6246 CA SER n 155 -16.796 23.609 34.430 1.00 30.78 C ++ATOM 6247 C SER n 155 -16.657 24.901 35.217 1.00 30.78 C ++ATOM 6248 O SER n 155 -15.917 25.796 34.800 1.00 30.78 O ++ATOM 6249 CB SER n 155 -18.178 23.568 33.795 1.00 30.78 C ++ATOM 6250 OG SER n 155 -19.181 23.727 34.779 1.00 30.78 O ++ATOM 6251 N HIS n 156 -17.342 25.013 36.354 1.00 30.15 N ++ATOM 6252 CA HIS n 156 -17.472 26.276 37.069 1.00 30.15 C ++ATOM 6253 C HIS n 156 -16.199 26.659 37.819 1.00 30.15 C ++ATOM 6254 O HIS n 156 -15.637 27.730 37.573 1.00 30.15 O ++ATOM 6255 CB HIS n 156 -18.663 26.189 38.024 1.00 30.15 C ++ATOM 6256 CG HIS n 156 -19.047 27.492 38.648 1.00 30.15 C ++ATOM 6257 ND1 HIS n 156 -19.929 27.574 39.703 1.00 30.15 N ++ATOM 6258 CD2 HIS n 156 -18.679 28.763 38.368 1.00 30.15 C ++ATOM 6259 CE1 HIS n 156 -20.084 28.837 40.048 1.00 30.15 C ++ATOM 6260 NE2 HIS n 156 -19.334 29.580 39.256 1.00 30.15 N ++ATOM 6261 N THR n 157 -15.726 25.809 38.728 1.00 27.39 N ++ATOM 6262 CA THR n 157 -14.541 26.111 39.513 1.00 27.39 C ++ATOM 6263 C THR n 157 -13.268 25.512 38.953 1.00 27.39 C ++ATOM 6264 O THR n 157 -12.185 25.926 39.378 1.00 27.39 O ++ATOM 6265 CB THR n 157 -14.700 25.610 40.952 1.00 27.39 C ++ATOM 6266 OG1 THR n 157 -14.912 24.195 40.935 1.00 27.39 O ++ATOM 6267 CG2 THR n 157 -15.865 26.284 41.632 1.00 27.39 C ++ATOM 6268 N GLN n 158 -13.378 24.543 38.037 1.00 29.18 N ++ATOM 6269 CA GLN n 158 -12.252 23.794 37.462 1.00 29.18 C ++ATOM 6270 C GLN n 158 -11.423 23.097 38.536 1.00 29.18 C ++ATOM 6271 O GLN n 158 -10.203 22.980 38.417 1.00 29.18 O ++ATOM 6272 CB GLN n 158 -11.372 24.684 36.581 1.00 29.18 C ++ATOM 6273 CG GLN n 158 -12.091 25.183 35.354 1.00 29.18 C ++ATOM 6274 CD GLN n 158 -11.261 26.146 34.544 1.00 29.18 C ++ATOM 6275 OE1 GLN n 158 -10.165 26.527 34.944 1.00 29.18 O ++ATOM 6276 NE2 GLN n 158 -11.783 26.549 33.393 1.00 29.18 N ++ATOM 6277 N LYS n 159 -12.093 22.627 39.593 1.00 24.91 N ++ATOM 6278 CA LYS n 159 -11.506 21.826 40.663 1.00 24.91 C ++ATOM 6279 C LYS n 159 -12.539 20.801 41.099 1.00 24.91 C ++ATOM 6280 O LYS n 159 -13.729 21.115 41.160 1.00 24.91 O ++ATOM 6281 CB LYS n 159 -11.092 22.698 41.853 1.00 24.91 C ++ATOM 6282 CG LYS n 159 -9.919 23.597 41.573 1.00 24.91 C ++ATOM 6283 CD LYS n 159 -9.671 24.602 42.644 1.00 24.91 C ++ATOM 6284 CE LYS n 159 -8.582 25.531 42.172 1.00 24.91 C ++ATOM 6285 NZ LYS n 159 -8.326 26.636 43.117 1.00 24.91 N ++ATOM 6286 N ALA n 160 -12.095 19.590 41.406 1.00 21.32 N ++ATOM 6287 CA ALA n 160 -12.984 18.472 41.682 1.00 21.32 C ++ATOM 6288 C ALA n 160 -12.832 18.028 43.126 1.00 21.32 C ++ATOM 6289 O ALA n 160 -11.720 17.971 43.646 1.00 21.32 O ++ATOM 6290 CB ALA n 160 -12.672 17.315 40.763 1.00 21.32 C ++ATOM 6291 N THR n 161 -13.946 17.695 43.771 1.00 28.67 N ++ATOM 6292 CA THR n 161 -13.956 17.311 45.182 1.00 28.67 C ++ATOM 6293 C THR n 161 -14.548 15.920 45.348 1.00 28.67 C ++ATOM 6294 O THR n 161 -15.770 15.762 45.381 1.00 28.67 O ++ATOM 6295 CB THR n 161 -14.746 18.303 46.014 1.00 28.67 C ++ATOM 6296 OG1 THR n 161 -16.064 18.412 45.477 1.00 28.67 O ++ATOM 6297 CG2 THR n 161 -14.099 19.641 46.004 1.00 28.67 C ++ATOM 6298 N LEU n 162 -13.685 14.924 45.471 1.00 40.24 N ++ATOM 6299 CA LEU n 162 -14.114 13.604 45.895 1.00 40.24 C ++ATOM 6300 C LEU n 162 -14.617 13.681 47.327 1.00 40.24 C ++ATOM 6301 O LEU n 162 -14.068 14.423 48.141 1.00 40.24 O ++ATOM 6302 CB LEU n 162 -12.935 12.654 45.807 1.00 40.24 C ++ATOM 6303 CG LEU n 162 -12.344 12.526 44.416 1.00 40.24 C ++ATOM 6304 CD1 LEU n 162 -11.004 11.875 44.474 1.00 40.24 C ++ATOM 6305 CD2 LEU n 162 -13.262 11.674 43.630 1.00 40.24 C ++ATOM 6306 N VAL n 163 -15.660 12.924 47.648 1.00 40.24 N ++ATOM 6307 CA VAL n 163 -16.191 12.899 49.008 1.00 40.24 C ++ATOM 6308 C VAL n 163 -16.344 11.458 49.454 1.00 40.24 C ++ATOM 6309 O VAL n 163 -17.104 10.700 48.854 1.00 40.24 O ++ATOM 6310 CB VAL n 163 -17.529 13.638 49.132 1.00 40.24 C ++ATOM 6311 CG1 VAL n 163 -18.170 13.352 50.463 1.00 40.24 C ++ATOM 6312 CG2 VAL n 163 -17.301 15.102 49.036 1.00 40.24 C ++ATOM 6313 N CYS n 164 -15.642 11.086 50.507 1.00 27.44 N ++ATOM 6314 CA CYS n 164 -15.762 9.760 51.089 1.00 27.44 C ++ATOM 6315 C CYS n 164 -16.708 9.814 52.273 1.00 27.44 C ++ATOM 6316 O CYS n 164 -16.657 10.753 53.069 1.00 27.44 O ++ATOM 6317 CB CYS n 164 -14.402 9.249 51.542 1.00 27.44 C ++ATOM 6318 SG CYS n 164 -14.377 7.577 52.121 1.00 27.44 S ++ATOM 6319 N LEU n 165 -17.573 8.812 52.387 1.00 16.77 N ++ATOM 6320 CA LEU n 165 -18.476 8.694 53.526 1.00 16.77 C ++ATOM 6321 C LEU n 165 -18.289 7.330 54.152 1.00 16.77 C ++ATOM 6322 O LEU n 165 -18.532 6.312 53.499 1.00 16.77 O ++ATOM 6323 CB LEU n 165 -19.936 8.863 53.121 1.00 16.77 C ++ATOM 6324 CG LEU n 165 -20.393 10.210 52.595 1.00 16.77 C ++ATOM 6325 CD1 LEU n 165 -21.867 10.138 52.320 1.00 16.77 C ++ATOM 6326 CD2 LEU n 165 -20.107 11.280 53.586 1.00 16.77 C ++ATOM 6327 N ALA n 166 -17.847 7.306 55.397 1.00 16.16 N ++ATOM 6328 CA ALA n 166 -17.767 6.085 56.181 1.00 16.16 C ++ATOM 6329 C ALA n 166 -18.932 6.120 57.152 1.00 16.16 C ++ATOM 6330 O ALA n 166 -18.890 6.836 58.152 1.00 16.16 O ++ATOM 6331 CB ALA n 166 -16.436 5.993 56.914 1.00 16.16 C ++ATOM 6332 N THR n 167 -19.981 5.365 56.859 1.00 16.81 N ++ATOM 6333 CA THR n 167 -21.193 5.410 57.656 1.00 16.81 C ++ATOM 6334 C THR n 167 -21.389 4.110 58.417 1.00 16.81 C ++ATOM 6335 O THR n 167 -20.991 3.039 57.956 1.00 16.81 O ++ATOM 6336 CB THR n 167 -22.411 5.652 56.774 1.00 16.81 C ++ATOM 6337 OG1 THR n 167 -22.555 4.557 55.868 1.00 16.81 O ++ATOM 6338 CG2 THR n 167 -22.233 6.915 55.976 1.00 16.81 C ++ATOM 6339 N GLY n 168 -22.006 4.209 59.591 1.00 20.05 N ++ATOM 6340 CA GLY n 168 -22.536 3.036 60.238 1.00 20.05 C ++ATOM 6341 C GLY n 168 -21.624 2.340 61.217 1.00 20.05 C ++ATOM 6342 O GLY n 168 -22.043 1.344 61.813 1.00 20.05 O ++ATOM 6343 N PHE n 169 -20.401 2.813 61.408 1.00 23.23 N ++ATOM 6344 CA PHE n 169 -19.531 2.115 62.333 1.00 23.23 C ++ATOM 6345 C PHE n 169 -19.860 2.484 63.769 1.00 23.23 C ++ATOM 6346 O PHE n 169 -20.562 3.453 64.050 1.00 23.23 O ++ATOM 6347 CB PHE n 169 -18.059 2.386 62.026 1.00 23.23 C ++ATOM 6348 CG PHE n 169 -17.668 3.832 62.058 1.00 23.23 C ++ATOM 6349 CD1 PHE n 169 -17.742 4.601 60.918 1.00 23.23 C ++ATOM 6350 CD2 PHE n 169 -17.167 4.406 63.201 1.00 23.23 C ++ATOM 6351 CE1 PHE n 169 -17.365 5.918 60.933 1.00 23.23 C ++ATOM 6352 CE2 PHE n 169 -16.792 5.728 63.216 1.00 23.23 C ++ATOM 6353 CZ PHE n 169 -16.891 6.479 62.079 1.00 23.23 C ++ATOM 6354 N TYR n 170 -19.358 1.673 64.673 1.00 26.66 N ++ATOM 6355 CA TYR n 170 -19.367 1.881 66.110 1.00 26.66 C ++ATOM 6356 C TYR n 170 -18.313 0.948 66.673 1.00 26.66 C ++ATOM 6357 O TYR n 170 -18.283 -0.228 66.302 1.00 26.66 O ++ATOM 6358 CB TYR n 170 -20.727 1.578 66.729 1.00 26.66 C ++ATOM 6359 CG TYR n 170 -20.755 1.755 68.224 1.00 26.66 C ++ATOM 6360 CD1 TYR n 170 -20.823 3.014 68.789 1.00 26.66 C ++ATOM 6361 CD2 TYR n 170 -20.715 0.667 69.072 1.00 26.66 C ++ATOM 6362 CE1 TYR n 170 -20.848 3.185 70.155 1.00 26.66 C ++ATOM 6363 CE2 TYR n 170 -20.738 0.826 70.435 1.00 26.66 C ++ATOM 6364 CZ TYR n 170 -20.803 2.085 70.971 1.00 26.66 C ++ATOM 6365 OH TYR n 170 -20.827 2.249 72.332 1.00 26.66 O ++ATOM 6366 N PRO n 171 -17.430 1.413 67.548 1.00 25.66 N ++ATOM 6367 CA PRO n 171 -17.276 2.763 68.078 1.00 25.66 C ++ATOM 6368 C PRO n 171 -16.469 3.683 67.178 1.00 25.66 C ++ATOM 6369 O PRO n 171 -16.042 3.279 66.103 1.00 25.66 O ++ATOM 6370 CB PRO n 171 -16.534 2.527 69.382 1.00 25.66 C ++ATOM 6371 CG PRO n 171 -15.757 1.330 69.120 1.00 25.66 C ++ATOM 6372 CD PRO n 171 -16.555 0.461 68.239 1.00 25.66 C ++ATOM 6373 N ASP n 172 -16.241 4.910 67.641 1.00 28.95 N ++ATOM 6374 CA ASP n 172 -15.541 5.941 66.877 1.00 28.95 C ++ATOM 6375 C ASP n 172 -14.049 5.626 66.855 1.00 28.95 C ++ATOM 6376 O ASP n 172 -13.232 6.290 67.496 1.00 28.95 O ++ATOM 6377 CB ASP n 172 -15.798 7.301 67.506 1.00 28.95 C ++ATOM 6378 CG ASP n 172 -15.249 8.451 66.689 1.00 28.95 C ++ATOM 6379 OD1 ASP n 172 -14.759 8.242 65.561 1.00 28.95 O ++ATOM 6380 OD2 ASP n 172 -15.269 9.576 67.217 1.00 28.95 O ++ATOM 6381 N HIS n 173 -13.674 4.629 66.056 1.00 30.57 N ++ATOM 6382 CA HIS n 173 -12.295 4.163 66.048 1.00 30.57 C ++ATOM 6383 C HIS n 173 -11.726 4.072 64.640 1.00 30.57 C ++ATOM 6384 O HIS n 173 -10.868 3.235 64.375 1.00 30.57 O ++ATOM 6385 CB HIS n 173 -12.179 2.810 66.741 1.00 30.57 C ++ATOM 6386 CG HIS n 173 -12.294 2.869 68.230 1.00 30.57 C ++ATOM 6387 ND1 HIS n 173 -12.447 1.741 69.001 1.00 30.57 N ++ATOM 6388 CD2 HIS n 173 -12.237 3.908 69.094 1.00 30.57 C ++ATOM 6389 CE1 HIS n 173 -12.510 2.084 70.274 1.00 30.57 C ++ATOM 6390 NE2 HIS n 173 -12.389 3.395 70.357 1.00 30.57 N ++ATOM 6391 N VAL n 174 -12.166 4.921 63.738 1.00 40.24 N ++ATOM 6392 CA VAL n 174 -11.641 4.920 62.384 1.00 40.24 C ++ATOM 6393 C VAL n 174 -10.398 5.792 62.326 1.00 40.24 C ++ATOM 6394 O VAL n 174 -10.114 6.574 63.232 1.00 40.24 O ++ATOM 6395 CB VAL n 174 -12.688 5.412 61.384 1.00 40.24 C ++ATOM 6396 CG1 VAL n 174 -13.897 4.532 61.446 1.00 40.24 C ++ATOM 6397 CG2 VAL n 174 -13.055 6.827 61.692 1.00 40.24 C ++ATOM 6398 N GLU n 175 -9.636 5.639 61.245 1.00 29.47 N ++ATOM 6399 CA GLU n 175 -8.560 6.560 60.867 1.00 29.47 C ++ATOM 6400 C GLU n 175 -8.639 6.682 59.351 1.00 29.47 C ++ATOM 6401 O GLU n 175 -8.026 5.894 58.632 1.00 29.47 O ++ATOM 6402 CB GLU n 175 -7.187 6.066 61.286 1.00 29.47 C ++ATOM 6403 CG GLU n 175 -6.931 5.955 62.756 1.00 29.47 C ++ATOM 6404 CD GLU n 175 -5.518 5.512 63.044 1.00 29.47 C ++ATOM 6405 OE1 GLU n 175 -4.774 5.242 62.078 1.00 29.47 O ++ATOM 6406 OE2 GLU n 175 -5.148 5.426 64.232 1.00 29.47 O ++ATOM 6407 N LEU n 176 -9.375 7.669 58.868 1.00 40.24 N ++ATOM 6408 CA LEU n 176 -9.566 7.786 57.438 1.00 40.24 C ++ATOM 6409 C LEU n 176 -8.322 8.383 56.802 1.00 40.24 C ++ATOM 6410 O LEU n 176 -7.667 9.248 57.381 1.00 40.24 O ++ATOM 6411 CB LEU n 176 -10.801 8.629 57.136 1.00 40.24 C ++ATOM 6412 CG LEU n 176 -11.367 8.480 55.729 1.00 40.24 C ++ATOM 6413 CD1 LEU n 176 -12.860 8.552 55.785 1.00 40.24 C ++ATOM 6414 CD2 LEU n 176 -10.851 9.536 54.799 1.00 40.24 C ++ATOM 6415 N SER n 177 -7.997 7.907 55.603 1.00 24.32 N ++ATOM 6416 CA SER n 177 -6.814 8.346 54.884 1.00 24.32 C ++ATOM 6417 C SER n 177 -7.032 8.161 53.394 1.00 24.32 C ++ATOM 6418 O SER n 177 -7.586 7.153 52.955 1.00 24.32 O ++ATOM 6419 CB SER n 177 -5.570 7.568 55.305 1.00 24.32 C ++ATOM 6420 OG SER n 177 -5.261 7.786 56.665 1.00 24.32 O ++ATOM 6421 N TRP n 178 -6.568 9.131 52.620 1.00 34.28 N ++ATOM 6422 CA TRP n 178 -6.681 9.117 51.171 1.00 34.28 C ++ATOM 6423 C TRP n 178 -5.388 8.646 50.534 1.00 34.28 C ++ATOM 6424 O TRP n 178 -4.307 9.109 50.899 1.00 34.28 O ++ATOM 6425 CB TRP n 178 -7.012 10.506 50.653 1.00 34.28 C ++ATOM 6426 CG TRP n 178 -8.398 10.898 50.861 1.00 34.28 C ++ATOM 6427 CD1 TRP n 178 -8.902 11.596 51.898 1.00 34.28 C ++ATOM 6428 CD2 TRP n 178 -9.477 10.653 49.975 1.00 34.28 C ++ATOM 6429 NE1 TRP n 178 -10.245 11.785 51.728 1.00 34.28 N ++ATOM 6430 CE2 TRP n 178 -10.619 11.204 50.551 1.00 34.28 C ++ATOM 6431 CE3 TRP n 178 -9.590 10.002 48.755 1.00 34.28 C ++ATOM 6432 CZ2 TRP n 178 -11.852 11.136 49.946 1.00 34.28 C ++ATOM 6433 CZ3 TRP n 178 -10.814 9.926 48.164 1.00 34.28 C ++ATOM 6434 CH2 TRP n 178 -11.928 10.493 48.752 1.00 34.28 C ++ATOM 6435 N TRP n 179 -5.500 7.743 49.568 1.00 25.26 N ++ATOM 6436 CA TRP n 179 -4.355 7.226 48.832 1.00 25.26 C ++ATOM 6437 C TRP n 179 -4.553 7.531 47.357 1.00 25.26 C ++ATOM 6438 O TRP n 179 -5.533 7.083 46.759 1.00 25.26 O ++ATOM 6439 CB TRP n 179 -4.210 5.724 49.033 1.00 25.26 C ++ATOM 6440 CG TRP n 179 -3.856 5.295 50.400 1.00 25.26 C ++ATOM 6441 CD1 TRP n 179 -4.715 5.026 51.401 1.00 25.26 C ++ATOM 6442 CD2 TRP n 179 -2.553 4.990 50.897 1.00 25.26 C ++ATOM 6443 NE1 TRP n 179 -4.036 4.621 52.512 1.00 25.26 N ++ATOM 6444 CE2 TRP n 179 -2.701 4.588 52.226 1.00 25.26 C ++ATOM 6445 CE3 TRP n 179 -1.275 5.042 50.353 1.00 25.26 C ++ATOM 6446 CZ2 TRP n 179 -1.625 4.235 53.022 1.00 25.26 C ++ATOM 6447 CZ3 TRP n 179 -0.207 4.695 51.141 1.00 25.26 C ++ATOM 6448 CH2 TRP n 179 -0.387 4.296 52.462 1.00 25.26 C ++ATOM 6449 N VAL n 180 -3.621 8.268 46.770 1.00 20.96 N ++ATOM 6450 CA VAL n 180 -3.654 8.611 45.355 1.00 20.96 C ++ATOM 6451 C VAL n 180 -2.463 7.932 44.700 1.00 20.96 C ++ATOM 6452 O VAL n 180 -1.313 8.285 44.990 1.00 20.96 O ++ATOM 6453 CB VAL n 180 -3.626 10.125 45.136 1.00 20.96 C ++ATOM 6454 CG1 VAL n 180 -3.573 10.444 43.675 1.00 20.96 C ++ATOM 6455 CG2 VAL n 180 -4.841 10.743 45.737 1.00 20.96 C ++ATOM 6456 N ASN n 181 -2.747 6.959 43.827 1.00 16.01 N ++ATOM 6457 CA ASN n 181 -1.756 6.110 43.153 1.00 16.01 C ++ATOM 6458 C ASN n 181 -0.849 5.393 44.149 1.00 16.01 C ++ATOM 6459 O ASN n 181 0.374 5.416 44.028 1.00 16.01 O ++ATOM 6460 CB ASN n 181 -0.912 6.899 42.154 1.00 16.01 C ++ATOM 6461 CG ASN n 181 -1.729 7.527 41.089 1.00 16.01 C ++ATOM 6462 OD1 ASN n 181 -2.731 6.973 40.655 1.00 16.01 O ++ATOM 6463 ND2 ASN n 181 -1.299 8.687 40.627 1.00 16.01 N ++ATOM 6464 N GLY n 182 -1.447 4.774 45.155 1.00 15.68 N ++ATOM 6465 CA GLY n 182 -0.674 4.005 46.106 1.00 15.68 C ++ATOM 6466 C GLY n 182 0.115 4.798 47.126 1.00 15.68 C ++ATOM 6467 O GLY n 182 0.760 4.186 47.984 1.00 15.68 O ++ATOM 6468 N LYS n 183 0.101 6.124 47.068 1.00 19.26 N ++ATOM 6469 CA LYS n 183 0.765 6.958 48.056 1.00 19.26 C ++ATOM 6470 C LYS n 183 -0.237 7.923 48.668 1.00 19.26 C ++ATOM 6471 O LYS n 183 -1.163 8.376 47.994 1.00 19.26 O ++ATOM 6472 CB LYS n 183 1.922 7.726 47.437 1.00 19.26 C ++ATOM 6473 CG LYS n 183 3.065 6.828 47.026 1.00 19.26 C ++ATOM 6474 CD LYS n 183 4.224 7.615 46.452 1.00 19.26 C ++ATOM 6475 CE LYS n 183 5.364 6.696 46.060 1.00 19.26 C ++ATOM 6476 NZ LYS n 183 6.509 7.462 45.499 1.00 19.26 N ++ATOM 6477 N GLU n 184 -0.061 8.219 49.954 1.00 24.98 N ++ATOM 6478 CA GLU n 184 -0.997 9.090 50.644 1.00 24.98 C ++ATOM 6479 C GLU n 184 -0.860 10.530 50.184 1.00 24.98 C ++ATOM 6480 O GLU n 184 0.157 10.942 49.626 1.00 24.98 O ++ATOM 6481 CB GLU n 184 -0.794 9.052 52.151 1.00 24.98 C ++ATOM 6482 CG GLU n 184 -1.285 7.806 52.813 1.00 24.98 C ++ATOM 6483 CD GLU n 184 -1.177 7.884 54.314 1.00 24.98 C ++ATOM 6484 OE1 GLU n 184 -0.587 8.867 54.810 1.00 24.98 O ++ATOM 6485 OE2 GLU n 184 -1.694 6.979 54.999 1.00 24.98 O ++ATOM 6486 N VAL n 185 -1.908 11.302 50.434 1.00 24.13 N ++ATOM 6487 CA VAL n 185 -1.883 12.739 50.222 1.00 24.13 C ++ATOM 6488 C VAL n 185 -2.150 13.445 51.540 1.00 24.13 C ++ATOM 6489 O VAL n 185 -2.987 13.014 52.340 1.00 24.13 O ++ATOM 6490 CB VAL n 185 -2.880 13.173 49.135 1.00 24.13 C ++ATOM 6491 CG1 VAL n 185 -2.368 12.744 47.799 1.00 24.13 C ++ATOM 6492 CG2 VAL n 185 -4.206 12.540 49.373 1.00 24.13 C ++ATOM 6493 N HIS n 186 -1.405 14.512 51.781 1.00 27.94 N ++ATOM 6494 CA HIS n 186 -1.597 15.351 52.950 1.00 27.94 C ++ATOM 6495 C HIS n 186 -1.891 16.775 52.515 1.00 27.94 C ++ATOM 6496 O HIS n 186 -1.710 17.719 53.284 1.00 27.94 O ++ATOM 6497 CB HIS n 186 -0.371 15.318 53.857 1.00 27.94 C ++ATOM 6498 CG HIS n 186 -0.061 13.964 54.402 1.00 27.94 C ++ATOM 6499 ND1 HIS n 186 -0.820 13.365 55.382 1.00 27.94 N ++ATOM 6500 CD2 HIS n 186 0.936 13.096 54.114 1.00 27.94 C ++ATOM 6501 CE1 HIS n 186 -0.311 12.181 55.668 1.00 27.94 C ++ATOM 6502 NE2 HIS n 186 0.757 11.995 54.914 1.00 27.94 N ++ATOM 6503 N SER n 187 -2.338 16.942 51.278 1.00 25.76 N ++ATOM 6504 CA SER n 187 -2.486 18.266 50.686 1.00 25.76 C ++ATOM 6505 C SER n 187 -3.776 18.308 49.881 1.00 25.76 C ++ATOM 6506 O SER n 187 -3.817 17.864 48.732 1.00 25.76 O ++ATOM 6507 CB SER n 187 -1.291 18.594 49.819 1.00 25.76 C ++ATOM 6508 OG SER n 187 -1.523 19.788 49.104 1.00 25.76 O ++ATOM 6509 N GLY n 188 -4.811 18.882 50.474 1.00 21.93 N ++ATOM 6510 CA GLY n 188 -6.111 18.928 49.857 1.00 21.93 C ++ATOM 6511 C GLY n 188 -7.127 18.032 50.499 1.00 21.93 C ++ATOM 6512 O GLY n 188 -8.153 17.752 49.878 1.00 21.93 O ++ATOM 6513 N VAL n 189 -6.882 17.570 51.715 1.00 17.06 N ++ATOM 6514 CA VAL n 189 -7.746 16.621 52.394 1.00 17.06 C ++ATOM 6515 C VAL n 189 -8.302 17.291 53.634 1.00 17.06 C ++ATOM 6516 O VAL n 189 -7.542 17.692 54.521 1.00 17.06 O ++ATOM 6517 CB VAL n 189 -6.985 15.342 52.763 1.00 17.06 C ++ATOM 6518 CG1 VAL n 189 -7.836 14.455 53.624 1.00 17.06 C ++ATOM 6519 CG2 VAL n 189 -6.578 14.614 51.533 1.00 17.06 C ++ATOM 6520 N SER n 190 -9.618 17.420 53.701 1.00 20.36 N ++ATOM 6521 CA SER n 190 -10.284 17.770 54.944 1.00 20.36 C ++ATOM 6522 C SER n 190 -11.033 16.553 55.447 1.00 20.36 C ++ATOM 6523 O SER n 190 -11.564 15.769 54.655 1.00 20.36 O ++ATOM 6524 CB SER n 190 -11.255 18.920 54.765 1.00 20.36 C ++ATOM 6525 OG SER n 190 -12.354 18.492 53.996 1.00 20.36 O ++ATOM 6526 N THR n 191 -11.069 16.396 56.759 1.00 19.93 N ++ATOM 6527 CA THR n 191 -11.730 15.275 57.398 1.00 19.93 C ++ATOM 6528 C THR n 191 -12.424 15.839 58.623 1.00 19.93 C ++ATOM 6529 O THR n 191 -11.902 16.767 59.245 1.00 19.93 O ++ATOM 6530 CB THR n 191 -10.713 14.183 57.768 1.00 19.93 C ++ATOM 6531 OG1 THR n 191 -10.003 13.777 56.594 1.00 19.93 O ++ATOM 6532 CG2 THR n 191 -11.384 12.966 58.331 1.00 19.93 C ++ATOM 6533 N ASP n 192 -13.610 15.336 58.937 1.00 23.46 N ++ATOM 6534 CA ASP n 192 -14.309 15.797 60.127 1.00 23.46 C ++ATOM 6535 C ASP n 192 -13.539 15.373 61.369 1.00 23.46 C ++ATOM 6536 O ASP n 192 -13.177 14.199 61.493 1.00 23.46 O ++ATOM 6537 CB ASP n 192 -15.717 15.229 60.184 1.00 23.46 C ++ATOM 6538 CG ASP n 192 -16.584 15.736 59.077 1.00 23.46 C ++ATOM 6539 OD1 ASP n 192 -16.279 16.818 58.541 1.00 23.46 O ++ATOM 6540 OD2 ASP n 192 -17.585 15.066 58.757 1.00 23.46 O ++ATOM 6541 N PRO n 193 -13.228 16.296 62.280 1.00 27.76 N ++ATOM 6542 CA PRO n 193 -12.529 15.882 63.502 1.00 27.76 C ++ATOM 6543 C PRO n 193 -13.405 15.058 64.419 1.00 27.76 C ++ATOM 6544 O PRO n 193 -12.931 14.085 65.015 1.00 27.76 O ++ATOM 6545 CB PRO n 193 -12.134 17.218 64.141 1.00 27.76 C ++ATOM 6546 CG PRO n 193 -12.154 18.196 63.024 1.00 27.76 C ++ATOM 6547 CD PRO n 193 -13.265 17.757 62.139 1.00 27.76 C ++ATOM 6548 N GLN n 194 -14.675 15.414 64.542 1.00 31.80 N ++ATOM 6549 CA GLN n 194 -15.614 14.665 65.340 1.00 31.80 C ++ATOM 6550 C GLN n 194 -16.702 14.095 64.445 1.00 31.80 C ++ATOM 6551 O GLN n 194 -17.351 14.851 63.709 1.00 31.80 O ++ATOM 6552 CB GLN n 194 -16.242 15.546 66.422 1.00 31.80 C ++ATOM 6553 CG GLN n 194 -15.279 15.960 67.504 1.00 31.80 C ++ATOM 6554 CD GLN n 194 -14.757 14.774 68.283 1.00 31.80 C ++ATOM 6555 OE1 GLN n 194 -13.587 14.411 68.174 1.00 31.80 O ++ATOM 6556 NE2 GLN n 194 -15.626 14.159 69.073 1.00 31.80 N ++ATOM 6557 N PRO n 195 -16.921 12.787 64.458 1.00 26.58 N ++ATOM 6558 CA PRO n 195 -18.023 12.215 63.690 1.00 26.58 C ++ATOM 6559 C PRO n 195 -19.377 12.588 64.266 1.00 26.58 C ++ATOM 6560 O PRO n 195 -19.511 12.995 65.419 1.00 26.58 O ++ATOM 6561 CB PRO n 195 -17.781 10.712 63.807 1.00 26.58 C ++ATOM 6562 CG PRO n 195 -16.359 10.595 64.055 1.00 26.58 C ++ATOM 6563 CD PRO n 195 -15.994 11.746 64.914 1.00 26.58 C ++ATOM 6564 N LEU n 196 -20.396 12.419 63.435 1.00 30.16 N ++ATOM 6565 CA LEU n 196 -21.769 12.699 63.828 1.00 30.16 C ++ATOM 6566 C LEU n 196 -22.325 11.522 64.619 1.00 30.16 C ++ATOM 6567 O LEU n 196 -21.597 10.643 65.081 1.00 30.16 O ++ATOM 6568 CB LEU n 196 -22.629 12.970 62.601 1.00 30.16 C ++ATOM 6569 CG LEU n 196 -22.301 14.154 61.703 1.00 30.16 C ++ATOM 6570 CD1 LEU n 196 -23.251 14.133 60.533 1.00 30.16 C ++ATOM 6571 CD2 LEU n 196 -22.400 15.467 62.453 1.00 30.16 C ++ATOM 6572 N LYS n 197 -23.635 11.511 64.809 1.00 39.24 N ++ATOM 6573 CA LYS n 197 -24.366 10.298 65.121 1.00 39.24 C ++ATOM 6574 C LYS n 197 -25.563 10.234 64.191 1.00 39.24 C ++ATOM 6575 O LYS n 197 -26.047 11.263 63.719 1.00 39.24 O ++ATOM 6576 CB LYS n 197 -24.819 10.258 66.573 1.00 39.24 C ++ATOM 6577 CG LYS n 197 -23.703 10.086 67.574 1.00 39.24 C ++ATOM 6578 CD LYS n 197 -24.255 9.992 68.979 1.00 39.24 C ++ATOM 6579 CE LYS n 197 -23.147 9.817 69.993 1.00 39.24 C ++ATOM 6580 NZ LYS n 197 -23.682 9.740 71.376 1.00 39.24 N ++ATOM 6581 N GLU n 198 -26.030 9.023 63.905 1.00 43.90 N ++ATOM 6582 CA GLU n 198 -27.235 8.899 63.093 1.00 43.90 C ++ATOM 6583 C GLU n 198 -28.470 9.243 63.910 1.00 43.90 C ++ATOM 6584 O GLU n 198 -29.377 9.932 63.431 1.00 43.90 O ++ATOM 6585 CB GLU n 198 -27.339 7.496 62.511 1.00 43.90 C ++ATOM 6586 CG GLU n 198 -26.311 7.221 61.452 1.00 43.90 C ++ATOM 6587 CD GLU n 198 -26.415 5.826 60.901 1.00 43.90 C ++ATOM 6588 OE1 GLU n 198 -27.197 5.030 61.456 1.00 43.90 O ++ATOM 6589 OE2 GLU n 198 -25.725 5.524 59.909 1.00 43.90 O ++ATOM 6590 N GLN n 199 -28.521 8.772 65.149 1.00 49.27 N ++ATOM 6591 CA GLN n 199 -29.517 9.211 66.110 1.00 49.27 C ++ATOM 6592 C GLN n 199 -28.819 9.885 67.286 1.00 49.27 C ++ATOM 6593 O GLN n 199 -28.237 9.201 68.145 1.00 49.27 O ++ATOM 6594 CB GLN n 199 -30.421 8.041 66.545 1.00 49.27 C ++ATOM 6595 CG GLN n 199 -29.743 6.715 66.923 1.00 49.27 C ++ATOM 6596 CD GLN n 199 -29.580 5.783 65.739 1.00 49.27 C ++ATOM 6597 OE1 GLN n 199 -29.694 6.202 64.588 1.00 49.27 O ++ATOM 6598 NE2 GLN n 199 -29.318 4.513 66.015 1.00 49.27 N ++ATOM 6599 N PRO n 200 -28.805 11.217 67.352 1.00 51.85 N ++ATOM 6600 CA PRO n 200 -28.035 11.894 68.399 1.00 51.85 C ++ATOM 6601 C PRO n 200 -28.703 11.877 69.756 1.00 51.85 C ++ATOM 6602 O PRO n 200 -28.035 12.168 70.757 1.00 51.85 O ++ATOM 6603 CB PRO n 200 -27.920 13.324 67.869 1.00 51.85 C ++ATOM 6604 CG PRO n 200 -29.129 13.497 67.040 1.00 51.85 C ++ATOM 6605 CD PRO n 200 -29.406 12.168 66.406 1.00 51.85 C ++ATOM 6606 N ALA n 201 -29.989 11.551 69.828 1.00 59.81 N ++ATOM 6607 CA ALA n 201 -30.675 11.530 71.112 1.00 59.81 C ++ATOM 6608 C ALA n 201 -30.402 10.241 71.876 1.00 59.81 C ++ATOM 6609 O ALA n 201 -30.497 10.215 73.107 1.00 59.81 O ++ATOM 6610 CB ALA n 201 -32.177 11.722 70.904 1.00 59.81 C ++ATOM 6611 N LEU n 202 -30.062 9.167 71.171 1.00 60.15 N ++ATOM 6612 CA LEU n 202 -29.907 7.877 71.819 1.00 60.15 C ++ATOM 6613 C LEU n 202 -28.471 7.674 72.293 1.00 60.15 C ++ATOM 6614 O LEU n 202 -27.597 8.525 72.118 1.00 60.15 O ++ATOM 6615 CB LEU n 202 -30.332 6.756 70.876 1.00 60.15 C ++ATOM 6616 CG LEU n 202 -31.810 6.832 70.502 1.00 60.15 C ++ATOM 6617 CD1 LEU n 202 -32.189 5.723 69.539 1.00 60.15 C ++ATOM 6618 CD2 LEU n 202 -32.681 6.800 71.746 1.00 60.15 C ++ATOM 6619 N ASN n 203 -28.236 6.517 72.906 1.00 61.07 N ++ATOM 6620 CA ASN n 203 -26.969 6.205 73.553 1.00 61.07 C ++ATOM 6621 C ASN n 203 -26.085 5.289 72.721 1.00 61.07 C ++ATOM 6622 O ASN n 203 -24.924 5.620 72.471 1.00 61.07 O ++ATOM 6623 CB ASN n 203 -27.231 5.561 74.916 1.00 61.07 C ++ATOM 6624 CG ASN n 203 -27.888 6.515 75.890 1.00 61.07 C ++ATOM 6625 OD1 ASN n 203 -27.510 7.682 75.980 1.00 61.07 O ++ATOM 6626 ND2 ASN n 203 -28.889 6.029 76.613 1.00 61.07 N ++ATOM 6627 N ASP n 204 -26.603 4.139 72.292 1.00 59.25 N ++ATOM 6628 CA ASP n 204 -25.864 3.241 71.403 1.00 59.25 C ++ATOM 6629 C ASP n 204 -26.214 3.569 69.953 1.00 59.25 C ++ATOM 6630 O ASP n 204 -26.883 2.816 69.242 1.00 59.25 O ++ATOM 6631 CB ASP n 204 -26.161 1.786 71.739 1.00 59.25 C ++ATOM 6632 CG ASP n 204 -25.513 1.347 73.032 1.00 59.25 C ++ATOM 6633 OD1 ASP n 204 -24.457 1.909 73.388 1.00 59.25 O ++ATOM 6634 OD2 ASP n 204 -26.056 0.436 73.690 1.00 59.25 O ++ATOM 6635 N SER n 205 -25.741 4.734 69.525 1.00 45.15 N ++ATOM 6636 CA SER n 205 -25.976 5.215 68.173 1.00 45.15 C ++ATOM 6637 C SER n 205 -24.918 4.641 67.241 1.00 45.15 C ++ATOM 6638 O SER n 205 -24.162 3.735 67.598 1.00 45.15 O ++ATOM 6639 CB SER n 205 -25.975 6.736 68.145 1.00 45.15 C ++ATOM 6640 OG SER n 205 -26.134 7.211 66.824 1.00 45.15 O ++ATOM 6641 N ARG n 206 -24.853 5.160 66.025 1.00 36.06 N ++ATOM 6642 CA ARG n 206 -23.818 4.779 65.084 1.00 36.06 C ++ATOM 6643 C ARG n 206 -23.246 6.030 64.447 1.00 36.06 C ++ATOM 6644 O ARG n 206 -23.970 6.981 64.152 1.00 36.06 O ++ATOM 6645 CB ARG n 206 -24.346 3.862 64.006 1.00 36.06 C ++ATOM 6646 CG ARG n 206 -24.744 2.486 64.471 1.00 36.06 C ++ATOM 6647 CD ARG n 206 -25.281 1.743 63.281 1.00 36.06 C ++ATOM 6648 NE ARG n 206 -25.819 0.436 63.607 1.00 36.06 N ++ATOM 6649 CZ ARG n 206 -26.476 -0.309 62.731 1.00 36.06 C ++ATOM 6650 NH1 ARG n 206 -26.665 0.145 61.500 1.00 36.06 N ++ATOM 6651 NH2 ARG n 206 -26.953 -1.493 63.081 1.00 36.06 N ++ATOM 6652 N TYR n 207 -21.947 6.007 64.210 1.00 26.94 N ++ATOM 6653 CA TYR n 207 -21.204 7.185 63.802 1.00 26.94 C ++ATOM 6654 C TYR n 207 -21.092 7.262 62.284 1.00 26.94 C ++ATOM 6655 O TYR n 207 -21.221 6.258 61.578 1.00 26.94 O ++ATOM 6656 CB TYR n 207 -19.820 7.160 64.429 1.00 26.94 C ++ATOM 6657 CG TYR n 207 -19.831 7.285 65.925 1.00 26.94 C ++ATOM 6658 CD1 TYR n 207 -19.922 6.170 66.726 1.00 26.94 C ++ATOM 6659 CD2 TYR n 207 -19.768 8.520 66.533 1.00 26.94 C ++ATOM 6660 CE1 TYR n 207 -19.936 6.277 68.089 1.00 26.94 C ++ATOM 6661 CE2 TYR n 207 -19.777 8.639 67.900 1.00 26.94 C ++ATOM 6662 CZ TYR n 207 -19.866 7.511 68.670 1.00 26.94 C ++ATOM 6663 OH TYR n 207 -19.882 7.611 70.036 1.00 26.94 O ++ATOM 6664 N CYS n 208 -20.844 8.471 61.788 1.00 24.45 N ++ATOM 6665 CA CYS n 208 -20.692 8.723 60.361 1.00 24.45 C ++ATOM 6666 C CYS n 208 -19.633 9.787 60.172 1.00 24.45 C ++ATOM 6667 O CYS n 208 -19.729 10.867 60.753 1.00 24.45 O ++ATOM 6668 CB CYS n 208 -22.001 9.177 59.727 1.00 24.45 C ++ATOM 6669 SG CYS n 208 -23.271 7.929 59.637 1.00 24.45 S ++ATOM 6670 N LEU n 209 -18.641 9.489 59.352 1.00 20.23 N ++ATOM 6671 CA LEU n 209 -17.488 10.351 59.163 1.00 20.23 C ++ATOM 6672 C LEU n 209 -17.377 10.664 57.681 1.00 20.23 C ++ATOM 6673 O LEU n 209 -17.658 9.810 56.840 1.00 20.23 O ++ATOM 6674 CB LEU n 209 -16.239 9.643 59.695 1.00 20.23 C ++ATOM 6675 CG LEU n 209 -14.867 10.239 59.999 1.00 20.23 C ++ATOM 6676 CD1 LEU n 209 -14.064 10.396 58.762 1.00 20.23 C ++ATOM 6677 CD2 LEU n 209 -15.013 11.555 60.686 1.00 20.23 C ++ATOM 6678 N SER n 210 -16.995 11.889 57.350 1.00 25.68 N ++ATOM 6679 CA SER n 210 -16.926 12.301 55.959 1.00 25.68 C ++ATOM 6680 C SER n 210 -15.546 12.847 55.651 1.00 25.68 C ++ATOM 6681 O SER n 210 -14.782 13.184 56.550 1.00 25.68 O ++ATOM 6682 CB SER n 210 -17.942 13.380 55.646 1.00 25.68 C ++ATOM 6683 OG SER n 210 -17.540 14.590 56.247 1.00 25.68 O ++ATOM 6684 N SER n 211 -15.245 12.963 54.366 1.00 40.24 N ++ATOM 6685 CA SER n 211 -13.954 13.500 53.979 1.00 40.24 C ++ATOM 6686 C SER n 211 -14.010 14.063 52.576 1.00 40.24 C ++ATOM 6687 O SER n 211 -14.725 13.548 51.719 1.00 40.24 O ++ATOM 6688 CB SER n 211 -12.869 12.446 54.040 1.00 40.24 C ++ATOM 6689 OG SER n 211 -11.660 12.960 53.528 1.00 40.24 O ++ATOM 6690 N ARG n 212 -13.208 15.093 52.338 1.00 34.79 N ++ATOM 6691 CA ARG n 212 -13.195 15.812 51.075 1.00 34.79 C ++ATOM 6692 C ARG n 212 -11.774 15.879 50.549 1.00 34.79 C ++ATOM 6693 O ARG n 212 -10.890 16.403 51.232 1.00 34.79 O ++ATOM 6694 CB ARG n 212 -13.734 17.234 51.247 1.00 34.79 C ++ATOM 6695 CG ARG n 212 -15.236 17.369 51.206 1.00 34.79 C ++ATOM 6696 CD ARG n 212 -15.923 17.070 52.523 1.00 34.79 C ++ATOM 6697 NE ARG n 212 -15.701 18.068 53.558 1.00 34.79 N ++ATOM 6698 CZ ARG n 212 -16.062 17.897 54.821 1.00 34.79 C ++ATOM 6699 NH1 ARG n 212 -16.661 16.782 55.193 1.00 34.79 N ++ATOM 6700 NH2 ARG n 212 -15.831 18.836 55.713 1.00 34.79 N ++ATOM 6701 N LEU n 213 -11.552 15.361 49.346 1.00 40.24 N ++ATOM 6702 CA LEU n 213 -10.298 15.552 48.625 1.00 40.24 C ++ATOM 6703 C LEU n 213 -10.571 16.477 47.454 1.00 40.24 C ++ATOM 6704 O LEU n 213 -11.216 16.070 46.487 1.00 40.24 O ++ATOM 6705 CB LEU n 213 -9.721 14.231 48.134 1.00 40.24 C ++ATOM 6706 CG LEU n 213 -8.484 14.326 47.244 1.00 40.24 C ++ATOM 6707 CD1 LEU n 213 -7.369 15.014 47.953 1.00 40.24 C ++ATOM 6708 CD2 LEU n 213 -8.021 12.955 46.795 1.00 40.24 C ++ATOM 6709 N ARG n 214 -10.100 17.715 47.533 1.00 27.77 N ++ATOM 6710 CA ARG n 214 -10.186 18.633 46.408 1.00 27.77 C ++ATOM 6711 C ARG n 214 -8.880 18.571 45.636 1.00 27.77 C ++ATOM 6712 O ARG n 214 -7.799 18.573 46.226 1.00 27.77 O ++ATOM 6713 CB ARG n 214 -10.490 20.062 46.853 1.00 27.77 C ++ATOM 6714 CG ARG n 214 -10.683 21.041 45.697 1.00 27.77 C ++ATOM 6715 CD ARG n 214 -10.991 22.463 46.147 1.00 27.77 C ++ATOM 6716 NE ARG n 214 -12.353 22.669 46.605 1.00 27.77 N ++ATOM 6717 CZ ARG n 214 -13.342 23.043 45.808 1.00 27.77 C ++ATOM 6718 NH1 ARG n 214 -13.114 23.236 44.522 1.00 27.77 N ++ATOM 6719 NH2 ARG n 214 -14.559 23.213 46.290 1.00 27.77 N ++ATOM 6720 N VAL n 215 -8.999 18.511 44.317 1.00 20.34 N ++ATOM 6721 CA VAL n 215 -7.935 18.154 43.390 1.00 20.34 C ++ATOM 6722 C VAL n 215 -8.122 19.007 42.148 1.00 20.34 C ++ATOM 6723 O VAL n 215 -9.259 19.207 41.712 1.00 20.34 O ++ATOM 6724 CB VAL n 215 -7.993 16.645 43.070 1.00 20.34 C ++ATOM 6725 CG1 VAL n 215 -7.395 16.328 41.762 1.00 20.34 C ++ATOM 6726 CG2 VAL n 215 -7.209 15.886 44.091 1.00 20.34 C ++ATOM 6727 N SER n 216 -7.029 19.565 41.623 1.00 17.63 N ++ATOM 6728 CA SER n 216 -7.089 20.321 40.379 1.00 17.63 C ++ATOM 6729 C SER n 216 -7.631 19.455 39.257 1.00 17.63 C ++ATOM 6730 O SER n 216 -7.208 18.316 39.073 1.00 17.63 O ++ATOM 6731 CB SER n 216 -5.708 20.833 40.007 1.00 17.63 C ++ATOM 6732 OG SER n 216 -4.844 19.756 39.714 1.00 17.63 O ++ATOM 6733 N ALA n 217 -8.583 19.990 38.512 1.00 17.67 N ++ATOM 6734 CA ALA n 217 -9.413 19.172 37.645 1.00 17.67 C ++ATOM 6735 C ALA n 217 -8.797 18.912 36.298 1.00 17.67 C ++ATOM 6736 O ALA n 217 -9.540 18.733 35.336 1.00 17.67 O ++ATOM 6737 CB ALA n 217 -10.782 19.815 37.456 1.00 17.67 C ++ATOM 6738 N THR n 218 -7.474 18.954 36.175 1.00 17.45 N ++ATOM 6739 CA THR n 218 -6.760 18.303 35.089 1.00 17.45 C ++ATOM 6740 C THR n 218 -5.970 17.116 35.600 1.00 17.45 C ++ATOM 6741 O THR n 218 -5.025 16.671 34.946 1.00 17.45 O ++ATOM 6742 CB THR n 218 -5.836 19.289 34.387 1.00 17.45 C ++ATOM 6743 OG1 THR n 218 -4.806 19.696 35.293 1.00 17.45 O ++ATOM 6744 CG2 THR n 218 -6.614 20.509 33.954 1.00 17.45 C ++ATOM 6745 N PHE n 219 -6.336 16.619 36.778 1.00 20.08 N ++ATOM 6746 CA PHE n 219 -5.732 15.467 37.420 1.00 20.08 C ++ATOM 6747 C PHE n 219 -6.822 14.432 37.596 1.00 20.08 C ++ATOM 6748 O PHE n 219 -6.573 13.230 37.524 1.00 20.08 O ++ATOM 6749 CB PHE n 219 -5.130 15.854 38.764 1.00 20.08 C ++ATOM 6750 CG PHE n 219 -4.397 14.758 39.441 1.00 20.08 C ++ATOM 6751 CD1 PHE n 219 -3.140 14.409 39.025 1.00 20.08 C ++ATOM 6752 CD2 PHE n 219 -4.947 14.087 40.507 1.00 20.08 C ++ATOM 6753 CE1 PHE n 219 -2.454 13.402 39.649 1.00 20.08 C ++ATOM 6754 CE2 PHE n 219 -4.257 13.087 41.142 1.00 20.08 C ++ATOM 6755 CZ PHE n 219 -3.014 12.744 40.712 1.00 20.08 C ++ATOM 6756 N TRP n 220 -8.040 14.899 37.833 1.00 19.90 N ++ATOM 6757 CA TRP n 220 -9.171 13.990 37.874 1.00 19.90 C ++ATOM 6758 C TRP n 220 -9.533 13.494 36.485 1.00 19.90 C ++ATOM 6759 O TRP n 220 -9.997 12.360 36.343 1.00 19.90 O ++ATOM 6760 CB TRP n 220 -10.354 14.676 38.547 1.00 19.90 C ++ATOM 6761 CG TRP n 220 -11.650 13.966 38.427 1.00 19.90 C ++ATOM 6762 CD1 TRP n 220 -12.704 14.358 37.679 1.00 19.90 C ++ATOM 6763 CD2 TRP n 220 -12.036 12.744 39.050 1.00 19.90 C ++ATOM 6764 NE1 TRP n 220 -13.732 13.465 37.796 1.00 19.90 N ++ATOM 6765 CE2 TRP n 220 -13.341 12.459 38.633 1.00 19.90 C ++ATOM 6766 CE3 TRP n 220 -11.408 11.861 39.918 1.00 19.90 C ++ATOM 6767 CZ2 TRP n 220 -14.027 11.330 39.053 1.00 19.90 C ++ATOM 6768 CZ3 TRP n 220 -12.092 10.737 40.327 1.00 19.90 C ++ATOM 6769 CH2 TRP n 220 -13.388 10.488 39.904 1.00 19.90 C ++ATOM 6770 N GLN n 221 -9.288 14.288 35.448 1.00 22.94 N ++ATOM 6771 CA GLN n 221 -9.701 13.906 34.103 1.00 22.94 C ++ATOM 6772 C GLN n 221 -8.792 12.857 33.469 1.00 22.94 C ++ATOM 6773 O GLN n 221 -9.103 12.384 32.375 1.00 22.94 O ++ATOM 6774 CB GLN n 221 -9.759 15.134 33.197 1.00 22.94 C ++ATOM 6775 CG GLN n 221 -10.658 16.233 33.682 1.00 22.94 C ++ATOM 6776 CD GLN n 221 -12.099 15.849 33.736 1.00 22.94 C ++ATOM 6777 OE1 GLN n 221 -12.622 15.553 34.796 1.00 22.94 O ++ATOM 6778 NE2 GLN n 221 -12.772 15.911 32.608 1.00 22.94 N ++ATOM 6779 N ASN n 222 -7.677 12.492 34.101 1.00 19.42 N ++ATOM 6780 CA ASN n 222 -6.950 11.333 33.603 1.00 19.42 C ++ATOM 6781 C ASN n 222 -7.719 10.063 33.941 1.00 19.42 C ++ATOM 6782 O ASN n 222 -8.301 9.965 35.019 1.00 19.42 O ++ATOM 6783 CB ASN n 222 -5.564 11.238 34.222 1.00 19.42 C ++ATOM 6784 CG ASN n 222 -4.604 12.224 33.648 1.00 19.42 C ++ATOM 6785 OD1 ASN n 222 -4.607 12.469 32.451 1.00 19.42 O ++ATOM 6786 ND2 ASN n 222 -3.749 12.778 34.490 1.00 19.42 N ++ATOM 6787 N PRO n 223 -7.754 9.082 33.042 1.00 17.67 N ++ATOM 6788 CA PRO n 223 -8.175 7.737 33.433 1.00 17.67 C ++ATOM 6789 C PRO n 223 -7.057 6.874 33.990 1.00 17.67 C ++ATOM 6790 O PRO n 223 -7.239 5.660 34.109 1.00 17.67 O ++ATOM 6791 CB PRO n 223 -8.700 7.146 32.120 1.00 17.67 C ++ATOM 6792 CG PRO n 223 -8.977 8.308 31.265 1.00 17.67 C ++ATOM 6793 CD PRO n 223 -7.938 9.308 31.607 1.00 17.67 C ++ATOM 6794 N ARG n 224 -5.916 7.471 34.319 1.00 20.39 N ++ATOM 6795 CA ARG n 224 -4.769 6.757 34.842 1.00 20.39 C ++ATOM 6796 C ARG n 224 -4.593 6.908 36.340 1.00 20.39 C ++ATOM 6797 O ARG n 224 -3.966 6.045 36.959 1.00 20.39 O ++ATOM 6798 CB ARG n 224 -3.498 7.246 34.148 1.00 20.39 C ++ATOM 6799 CG ARG n 224 -3.458 6.894 32.690 1.00 20.39 C ++ATOM 6800 CD ARG n 224 -2.258 7.505 32.022 1.00 20.39 C ++ATOM 6801 NE ARG n 224 -2.199 7.169 30.608 1.00 20.39 N ++ATOM 6802 CZ ARG n 224 -1.553 6.113 30.137 1.00 20.39 C ++ATOM 6803 NH1 ARG n 224 -0.908 5.310 30.967 1.00 20.39 N ++ATOM 6804 NH2 ARG n 224 -1.544 5.864 28.839 1.00 20.39 N ++ATOM 6805 N ASN n 225 -5.111 7.978 36.929 1.00 23.37 N ++ATOM 6806 CA ASN n 225 -4.964 8.214 38.351 1.00 23.37 C ++ATOM 6807 C ASN n 225 -6.019 7.437 39.118 1.00 23.37 C ++ATOM 6808 O ASN n 225 -7.137 7.236 38.645 1.00 23.37 O ++ATOM 6809 CB ASN n 225 -5.071 9.702 38.635 1.00 23.37 C ++ATOM 6810 CG ASN n 225 -3.870 10.460 38.146 1.00 23.37 C ++ATOM 6811 OD1 ASN n 225 -2.736 10.047 38.359 1.00 23.37 O ++ATOM 6812 ND2 ASN n 225 -4.109 11.565 37.464 1.00 23.37 N ++ATOM 6813 N HIS n 226 -5.657 7.009 40.320 1.00 32.46 N ++ATOM 6814 CA HIS n 226 -6.437 6.048 41.092 1.00 32.46 C ++ATOM 6815 C HIS n 226 -6.609 6.562 42.510 1.00 32.46 C ++ATOM 6816 O HIS n 226 -5.624 6.709 43.234 1.00 32.46 O ++ATOM 6817 CB HIS n 226 -5.735 4.696 41.074 1.00 32.46 C ++ATOM 6818 CG HIS n 226 -6.384 3.661 41.923 1.00 32.46 C ++ATOM 6819 ND1 HIS n 226 -6.001 3.427 43.221 1.00 32.46 N ++ATOM 6820 CD2 HIS n 226 -7.392 2.798 41.667 1.00 32.46 C ++ATOM 6821 CE1 HIS n 226 -6.734 2.454 43.726 1.00 32.46 C ++ATOM 6822 NE2 HIS n 226 -7.593 2.060 42.805 1.00 32.46 N ++ATOM 6823 N PHE n 227 -7.849 6.832 42.913 1.00 40.24 N ++ATOM 6824 CA PHE n 227 -8.136 7.477 44.185 1.00 40.24 C ++ATOM 6825 C PHE n 227 -8.871 6.509 45.098 1.00 40.24 C ++ATOM 6826 O PHE n 227 -9.877 5.929 44.695 1.00 40.24 O ++ATOM 6827 CB PHE n 227 -9.016 8.703 43.968 1.00 40.24 C ++ATOM 6828 CG PHE n 227 -8.467 9.682 42.985 1.00 40.24 C ++ATOM 6829 CD1 PHE n 227 -7.558 10.636 43.366 1.00 40.24 C ++ATOM 6830 CD2 PHE n 227 -8.868 9.645 41.672 1.00 40.24 C ++ATOM 6831 CE1 PHE n 227 -7.065 11.529 42.455 1.00 40.24 C ++ATOM 6832 CE2 PHE n 227 -8.371 10.526 40.766 1.00 40.24 C ++ATOM 6833 CZ PHE n 227 -7.478 11.472 41.155 1.00 40.24 C ++ATOM 6834 N ARG n 228 -8.414 6.364 46.340 1.00 40.24 N ++ATOM 6835 CA ARG n 228 -9.087 5.416 47.217 1.00 40.24 C ++ATOM 6836 C ARG n 228 -9.101 5.919 48.649 1.00 40.24 C ++ATOM 6837 O ARG n 228 -8.193 6.625 49.084 1.00 40.24 O ++ATOM 6838 CB ARG n 228 -8.452 4.032 47.140 1.00 40.24 C ++ATOM 6839 CG ARG n 228 -7.054 3.924 47.647 1.00 40.24 C ++ATOM 6840 CD ARG n 228 -6.488 2.558 47.332 1.00 40.24 C ++ATOM 6841 NE ARG n 228 -7.180 1.492 48.038 1.00 40.24 N ++ATOM 6842 CZ ARG n 228 -6.834 1.055 49.237 1.00 40.24 C ++ATOM 6843 NH1 ARG n 228 -7.512 0.075 49.805 1.00 40.24 N ++ATOM 6844 NH2 ARG n 228 -5.792 1.581 49.857 1.00 40.24 N ++ATOM 6845 N CYS n 229 -10.148 5.542 49.372 1.00 21.12 N ++ATOM 6846 CA CYS n 229 -10.440 6.071 50.705 1.00 21.12 C ++ATOM 6847 C CYS n 229 -10.277 4.974 51.747 1.00 21.12 C ++ATOM 6848 O CYS n 229 -11.226 4.269 52.070 1.00 21.12 O ++ATOM 6849 CB CYS n 229 -11.848 6.631 50.746 1.00 21.12 C ++ATOM 6850 SG CYS n 229 -12.398 7.216 52.355 1.00 21.12 S ++ATOM 6851 N GLN n 230 -9.084 4.846 52.304 1.00 21.82 N ++ATOM 6852 CA GLN n 230 -8.836 3.800 53.285 1.00 21.82 C ++ATOM 6853 C GLN n 230 -9.415 4.198 54.632 1.00 21.82 C ++ATOM 6854 O GLN n 230 -9.244 5.337 55.064 1.00 21.82 O ++ATOM 6855 CB GLN n 230 -7.340 3.547 53.412 1.00 21.82 C ++ATOM 6856 CG GLN n 230 -7.002 2.455 54.364 1.00 21.82 C ++ATOM 6857 CD GLN n 230 -5.546 2.117 54.365 1.00 21.82 C ++ATOM 6858 OE1 GLN n 230 -4.756 2.766 53.700 1.00 21.82 O ++ATOM 6859 NE2 GLN n 230 -5.178 1.076 55.094 1.00 21.82 N ++ATOM 6860 N VAL n 231 -10.093 3.271 55.303 1.00 16.23 N ++ATOM 6861 CA VAL n 231 -10.589 3.483 56.657 1.00 16.23 C ++ATOM 6862 C VAL n 231 -10.073 2.347 57.521 1.00 16.23 C ++ATOM 6863 O VAL n 231 -10.448 1.184 57.312 1.00 16.23 O ++ATOM 6864 CB VAL n 231 -12.119 3.541 56.703 1.00 16.23 C ++ATOM 6865 CG1 VAL n 231 -12.579 3.580 58.113 1.00 16.23 C ++ATOM 6866 CG2 VAL n 231 -12.618 4.751 55.985 1.00 16.23 C ++ATOM 6867 N GLN n 232 -9.203 2.678 58.473 1.00 16.46 N ++ATOM 6868 CA GLN n 232 -8.564 1.705 59.356 1.00 16.46 C ++ATOM 6869 C GLN n 232 -9.456 1.516 60.569 1.00 16.46 C ++ATOM 6870 O GLN n 232 -9.364 2.255 61.545 1.00 16.46 O ++ATOM 6871 CB GLN n 232 -7.185 2.197 59.770 1.00 16.46 C ++ATOM 6872 CG GLN n 232 -6.402 1.259 60.663 1.00 16.46 C ++ATOM 6873 CD GLN n 232 -5.774 0.121 59.915 1.00 16.46 C ++ATOM 6874 OE1 GLN n 232 -5.170 0.330 58.866 1.00 16.46 O ++ATOM 6875 NE2 GLN n 232 -5.900 -1.087 60.438 1.00 16.46 N ++ATOM 6876 N PHE n 233 -10.335 0.525 60.532 1.00 18.41 N ++ATOM 6877 CA PHE n 233 -11.216 0.297 61.667 1.00 18.41 C ++ATOM 6878 C PHE n 233 -10.488 -0.498 62.740 1.00 18.41 C ++ATOM 6879 O PHE n 233 -9.855 -1.514 62.444 1.00 18.41 O ++ATOM 6880 CB PHE n 233 -12.475 -0.441 61.230 1.00 18.41 C ++ATOM 6881 CG PHE n 233 -13.420 -0.752 62.351 1.00 18.41 C ++ATOM 6882 CD1 PHE n 233 -14.222 0.225 62.887 1.00 18.41 C ++ATOM 6883 CD2 PHE n 233 -13.510 -2.027 62.863 1.00 18.41 C ++ATOM 6884 CE1 PHE n 233 -15.094 -0.071 63.912 1.00 18.41 C ++ATOM 6885 CE2 PHE n 233 -14.372 -2.319 63.889 1.00 18.41 C ++ATOM 6886 CZ PHE n 233 -15.163 -1.343 64.410 1.00 18.41 C ++ATOM 6887 N TYR n 234 -10.598 -0.043 63.984 1.00 21.47 N ++ATOM 6888 CA TYR n 234 -10.012 -0.703 65.146 1.00 21.47 C ++ATOM 6889 C TYR n 234 -11.132 -1.222 66.034 1.00 21.47 C ++ATOM 6890 O TYR n 234 -11.916 -0.436 66.565 1.00 21.47 O ++ATOM 6891 CB TYR n 234 -9.121 0.263 65.920 1.00 21.47 C ++ATOM 6892 CG TYR n 234 -7.773 0.496 65.302 1.00 21.47 C ++ATOM 6893 CD1 TYR n 234 -7.207 -0.440 64.475 1.00 21.47 C ++ATOM 6894 CD2 TYR n 234 -7.081 1.669 65.528 1.00 21.47 C ++ATOM 6895 CE1 TYR n 234 -5.973 -0.230 63.915 1.00 21.47 C ++ATOM 6896 CE2 TYR n 234 -5.858 1.897 64.970 1.00 21.47 C ++ATOM 6897 CZ TYR n 234 -5.305 0.946 64.163 1.00 21.47 C ++ATOM 6898 OH TYR n 234 -4.073 1.178 63.604 1.00 21.47 O ++ATOM 6899 N GLY n 235 -11.199 -2.530 66.210 1.00 21.54 N ++ATOM 6900 CA GLY n 235 -12.321 -3.156 66.899 1.00 21.54 C ++ATOM 6901 C GLY n 235 -11.911 -4.395 67.637 1.00 21.54 C ++ATOM 6902 O GLY n 235 -10.899 -4.394 68.352 1.00 21.54 O ++ATOM 6903 N LEU n 236 -12.697 -5.461 67.483 1.00 35.04 N ++ATOM 6904 CA LEU n 236 -12.465 -6.716 68.182 1.00 35.04 C ++ATOM 6905 C LEU n 236 -11.173 -7.382 67.716 1.00 35.04 C ++ATOM 6906 O LEU n 236 -10.558 -7.000 66.717 1.00 35.04 O ++ATOM 6907 CB LEU n 236 -13.627 -7.680 67.959 1.00 35.04 C ++ATOM 6908 CG LEU n 236 -14.975 -7.384 68.597 1.00 35.04 C ++ATOM 6909 CD1 LEU n 236 -16.016 -8.367 68.111 1.00 35.04 C ++ATOM 6910 CD2 LEU n 236 -14.845 -7.467 70.095 1.00 35.04 C ++ATOM 6911 N SER n 237 -10.770 -8.410 68.455 1.00 51.01 N ++ATOM 6912 CA SER n 237 -9.612 -9.205 68.076 1.00 51.01 C ++ATOM 6913 C SER n 237 -10.010 -10.668 67.947 1.00 51.01 C ++ATOM 6914 O SER n 237 -11.188 -11.009 68.091 1.00 51.01 O ++ATOM 6915 CB SER n 237 -8.487 -9.038 69.093 1.00 51.01 C ++ATOM 6916 OG SER n 237 -8.868 -9.572 70.347 1.00 51.01 O ++ATOM 6917 N GLU n 238 -9.040 -11.541 67.681 1.00 64.53 N ++ATOM 6918 CA GLU n 238 -9.333 -12.953 67.478 1.00 64.53 C ++ATOM 6919 C GLU n 238 -9.598 -13.701 68.775 1.00 64.53 C ++ATOM 6920 O GLU n 238 -10.208 -14.774 68.738 1.00 64.53 O ++ATOM 6921 CB GLU n 238 -8.179 -13.622 66.730 1.00 64.53 C ++ATOM 6922 CG GLU n 238 -7.995 -13.113 65.313 1.00 64.53 C ++ATOM 6923 CD GLU n 238 -6.839 -13.776 64.597 1.00 64.53 C ++ATOM 6924 OE1 GLU n 238 -6.114 -14.565 65.238 1.00 64.53 O ++ATOM 6925 OE2 GLU n 238 -6.652 -13.504 63.394 1.00 64.53 O ++ATOM 6926 N ASN n 239 -9.172 -13.156 69.915 1.00 70.71 N ++ATOM 6927 CA ASN n 239 -9.275 -13.829 71.204 1.00 70.71 C ++ATOM 6928 C ASN n 239 -10.590 -13.548 71.919 1.00 70.71 C ++ATOM 6929 O ASN n 239 -10.668 -13.706 73.142 1.00 70.71 O ++ATOM 6930 CB ASN n 239 -8.099 -13.425 72.091 1.00 70.71 C ++ATOM 6931 CG ASN n 239 -6.782 -13.946 71.572 1.00 70.71 C ++ATOM 6932 OD1 ASN n 239 -6.686 -15.092 71.138 1.00 70.71 O ++ATOM 6933 ND2 ASN n 239 -5.759 -13.106 71.604 1.00 70.71 N ++ATOM 6934 N ASP n 240 -11.628 -13.139 71.196 1.00 66.25 N ++ATOM 6935 CA ASP n 240 -12.888 -12.747 71.806 1.00 66.25 C ++ATOM 6936 C ASP n 240 -14.020 -13.545 71.183 1.00 66.25 C ++ATOM 6937 O ASP n 240 -14.024 -13.786 69.973 1.00 66.25 O ++ATOM 6938 CB ASP n 240 -13.130 -11.255 71.634 1.00 66.25 C ++ATOM 6939 CG ASP n 240 -12.098 -10.419 72.356 1.00 66.25 C ++ATOM 6940 OD1 ASP n 240 -11.564 -10.893 73.380 1.00 66.25 O ++ATOM 6941 OD2 ASP n 240 -11.811 -9.294 71.899 1.00 66.25 O ++ATOM 6942 N GLU n 241 -14.974 -13.951 72.011 1.00 71.26 N ++ATOM 6943 CA GLU n 241 -16.023 -14.840 71.545 1.00 71.26 C ++ATOM 6944 C GLU n 241 -17.059 -14.072 70.730 1.00 71.26 C ++ATOM 6945 O GLU n 241 -17.210 -12.854 70.852 1.00 71.26 O ++ATOM 6946 CB GLU n 241 -16.692 -15.558 72.721 1.00 71.26 C ++ATOM 6947 CG GLU n 241 -17.558 -14.679 73.620 1.00 71.26 C ++ATOM 6948 CD GLU n 241 -16.789 -14.034 74.768 1.00 71.26 C ++ATOM 6949 OE1 GLU n 241 -15.541 -13.995 74.721 1.00 71.26 O ++ATOM 6950 OE2 GLU n 241 -17.442 -13.567 75.725 1.00 71.26 O ++ATOM 6951 N TRP n 242 -17.771 -14.812 69.885 1.00 60.38 N ++ATOM 6952 CA TRP n 242 -18.757 -14.225 68.982 1.00 60.38 C ++ATOM 6953 C TRP n 242 -19.752 -15.316 68.618 1.00 60.38 C ++ATOM 6954 O TRP n 242 -19.377 -16.302 67.978 1.00 60.38 O ++ATOM 6955 CB TRP n 242 -18.086 -13.671 67.737 1.00 60.38 C ++ATOM 6956 CG TRP n 242 -19.038 -13.044 66.777 1.00 60.38 C ++ATOM 6957 CD1 TRP n 242 -19.622 -13.637 65.699 1.00 60.38 C ++ATOM 6958 CD2 TRP n 242 -19.486 -11.690 66.779 1.00 60.38 C ++ATOM 6959 NE1 TRP n 242 -20.427 -12.741 65.044 1.00 60.38 N ++ATOM 6960 CE2 TRP n 242 -20.357 -11.536 65.688 1.00 60.38 C ++ATOM 6961 CE3 TRP n 242 -19.241 -10.592 67.604 1.00 60.38 C ++ATOM 6962 CZ2 TRP n 242 -20.982 -10.330 65.398 1.00 60.38 C ++ATOM 6963 CZ3 TRP n 242 -19.859 -9.401 67.314 1.00 60.38 C ++ATOM 6964 CH2 TRP n 242 -20.729 -9.278 66.228 1.00 60.38 C ++ATOM 6965 N THR n 243 -21.008 -15.140 69.013 1.00 67.29 N ++ATOM 6966 CA THR n 243 -22.053 -16.117 68.738 1.00 67.29 C ++ATOM 6967 C THR n 243 -23.167 -15.518 67.890 1.00 67.29 C ++ATOM 6968 O THR n 243 -24.304 -15.989 67.924 1.00 67.29 O ++ATOM 6969 CB THR n 243 -22.624 -16.682 70.039 1.00 67.29 C ++ATOM 6970 OG1 THR n 243 -23.205 -15.621 70.806 1.00 67.29 O ++ATOM 6971 CG2 THR n 243 -21.537 -17.362 70.864 1.00 67.29 C ++ATOM 6972 N GLN n 244 -22.855 -14.483 67.123 1.00 65.08 N ++ATOM 6973 CA GLN n 244 -23.845 -13.770 66.333 1.00 65.08 C ++ATOM 6974 C GLN n 244 -23.670 -14.135 64.861 1.00 65.08 C ++ATOM 6975 O GLN n 244 -22.583 -14.535 64.432 1.00 65.08 O ++ATOM 6976 CB GLN n 244 -23.723 -12.258 66.588 1.00 65.08 C ++ATOM 6977 CG GLN n 244 -24.805 -11.375 65.984 1.00 65.08 C ++ATOM 6978 CD GLN n 244 -26.195 -11.815 66.387 1.00 65.08 C ++ATOM 6979 OE1 GLN n 244 -26.919 -12.411 65.595 1.00 65.08 O ++ATOM 6980 NE2 GLN n 244 -26.572 -11.528 67.622 1.00 65.08 N ++ATOM 6981 N ASP n 245 -24.761 -14.010 64.096 1.00 66.75 N ++ATOM 6982 CA ASP n 245 -24.860 -14.626 62.777 1.00 66.75 C ++ATOM 6983 C ASP n 245 -23.948 -13.977 61.742 1.00 66.75 C ++ATOM 6984 O ASP n 245 -23.420 -14.678 60.872 1.00 66.75 O ++ATOM 6985 CB ASP n 245 -26.309 -14.578 62.299 1.00 66.75 C ++ATOM 6986 CG ASP n 245 -27.220 -15.468 63.117 1.00 66.75 C ++ATOM 6987 OD1 ASP n 245 -26.739 -16.496 63.636 1.00 66.75 O ++ATOM 6988 OD2 ASP n 245 -28.417 -15.138 63.243 1.00 66.75 O ++ATOM 6989 N ARG n 246 -23.746 -12.663 61.802 1.00 46.82 N ++ATOM 6990 CA ARG n 246 -22.939 -12.004 60.786 1.00 46.82 C ++ATOM 6991 C ARG n 246 -21.452 -12.221 61.066 1.00 46.82 C ++ATOM 6992 O ARG n 246 -21.064 -12.888 62.028 1.00 46.82 O ++ATOM 6993 CB ARG n 246 -23.270 -10.517 60.720 1.00 46.82 C ++ATOM 6994 CG ARG n 246 -22.776 -9.736 61.912 1.00 46.82 C ++ATOM 6995 CD ARG n 246 -23.159 -8.274 61.824 1.00 46.82 C ++ATOM 6996 NE ARG n 246 -22.482 -7.496 62.852 1.00 46.82 N ++ATOM 6997 CZ ARG n 246 -22.935 -7.341 64.087 1.00 46.82 C ++ATOM 6998 NH1 ARG n 246 -22.250 -6.619 64.954 1.00 46.82 N ++ATOM 6999 NH2 ARG n 246 -24.075 -7.905 64.450 1.00 46.82 N ++ATOM 7000 N ALA n 247 -20.607 -11.656 60.208 1.00 41.35 N ++ATOM 7001 CA ALA n 247 -19.168 -11.826 60.345 1.00 41.35 C ++ATOM 7002 C ALA n 247 -18.648 -11.078 61.564 1.00 41.35 C ++ATOM 7003 O ALA n 247 -19.180 -10.039 61.950 1.00 41.35 O ++ATOM 7004 CB ALA n 247 -18.452 -11.334 59.091 1.00 41.35 C ++ATOM 7005 N LYS n 248 -17.601 -11.620 62.173 1.00 43.11 N ++ATOM 7006 CA LYS n 248 -17.059 -11.039 63.393 1.00 43.11 C ++ATOM 7007 C LYS n 248 -16.246 -9.794 63.057 1.00 43.11 C ++ATOM 7008 O LYS n 248 -15.231 -9.902 62.362 1.00 43.11 O ++ATOM 7009 CB LYS n 248 -16.191 -12.043 64.134 1.00 43.11 C ++ATOM 7010 CG LYS n 248 -15.718 -11.522 65.473 1.00 43.11 C ++ATOM 7011 CD LYS n 248 -14.927 -12.536 66.271 1.00 43.11 C ++ATOM 7012 CE LYS n 248 -13.524 -12.678 65.742 1.00 43.11 C ++ATOM 7013 NZ LYS n 248 -12.665 -13.471 66.657 1.00 43.11 N ++ATOM 7014 N PRO n 249 -16.636 -8.612 63.538 1.00 33.13 N ++ATOM 7015 CA PRO n 249 -15.993 -7.345 63.138 1.00 33.13 C ++ATOM 7016 C PRO n 249 -14.631 -7.099 63.780 1.00 33.13 C ++ATOM 7017 O PRO n 249 -14.480 -6.442 64.801 1.00 33.13 O ++ATOM 7018 CB PRO n 249 -17.020 -6.303 63.576 1.00 33.13 C ++ATOM 7019 CG PRO n 249 -17.717 -6.922 64.703 1.00 33.13 C ++ATOM 7020 CD PRO n 249 -17.785 -8.379 64.423 1.00 33.13 C ++ATOM 7021 N VAL n 250 -13.595 -7.650 63.156 1.00 23.94 N ++ATOM 7022 CA VAL n 250 -12.236 -7.496 63.659 1.00 23.94 C ++ATOM 7023 C VAL n 250 -11.608 -6.218 63.126 1.00 23.94 C ++ATOM 7024 O VAL n 250 -12.154 -5.578 62.222 1.00 23.94 O ++ATOM 7025 CB VAL n 250 -11.372 -8.711 63.295 1.00 23.94 C ++ATOM 7026 CG1 VAL n 250 -11.975 -9.954 63.864 1.00 23.94 C ++ATOM 7027 CG2 VAL n 250 -11.248 -8.834 61.800 1.00 23.94 C ++ATOM 7028 N THR n 251 -10.486 -5.827 63.734 1.00 18.43 N ++ATOM 7029 CA THR n 251 -9.596 -4.779 63.246 1.00 18.43 C ++ATOM 7030 C THR n 251 -9.248 -4.996 61.787 1.00 18.43 C ++ATOM 7031 O THR n 251 -8.700 -6.038 61.425 1.00 18.43 O ++ATOM 7032 CB THR n 251 -8.320 -4.788 64.082 1.00 18.43 C ++ATOM 7033 OG1 THR n 251 -8.624 -4.413 65.428 1.00 18.43 O ++ATOM 7034 CG2 THR n 251 -7.278 -3.865 63.494 1.00 18.43 C ++ATOM 7035 N GLN n 252 -9.566 -4.020 60.945 1.00 15.74 N ++ATOM 7036 CA GLN n 252 -9.473 -4.262 59.513 1.00 15.74 C ++ATOM 7037 C GLN n 252 -9.333 -2.947 58.767 1.00 15.74 C ++ATOM 7038 O GLN n 252 -9.194 -1.878 59.366 1.00 15.74 O ++ATOM 7039 CB GLN n 252 -10.696 -5.039 59.026 1.00 15.74 C ++ATOM 7040 CG GLN n 252 -11.986 -4.290 59.171 1.00 15.74 C ++ATOM 7041 CD GLN n 252 -13.164 -5.138 58.794 1.00 15.74 C ++ATOM 7042 OE1 GLN n 252 -13.005 -6.272 58.365 1.00 15.74 O ++ATOM 7043 NE2 GLN n 252 -14.354 -4.598 58.949 1.00 15.74 N ++ATOM 7044 N ILE n 253 -9.374 -3.041 57.443 1.00 15.08 N ++ATOM 7045 CA ILE n 253 -9.278 -1.912 56.532 1.00 15.08 C ++ATOM 7046 C ILE n 253 -10.418 -2.043 55.547 1.00 15.08 C ++ATOM 7047 O ILE n 253 -10.531 -3.065 54.862 1.00 15.08 O ++ATOM 7048 CB ILE n 253 -7.936 -1.887 55.787 1.00 15.08 C ++ATOM 7049 CG1 ILE n 253 -6.805 -1.460 56.707 1.00 15.08 C ++ATOM 7050 CG2 ILE n 253 -8.004 -1.019 54.572 1.00 15.08 C ++ATOM 7051 CD1 ILE n 253 -6.045 -2.595 57.331 1.00 15.08 C ++ATOM 7052 N VAL n 254 -11.273 -1.033 55.477 1.00 6.64 N ++ATOM 7053 CA VAL n 254 -12.332 -1.006 54.480 1.00 6.64 C ++ATOM 7054 C VAL n 254 -12.097 0.212 53.608 1.00 6.64 C ++ATOM 7055 O VAL n 254 -11.862 1.306 54.126 1.00 6.64 O ++ATOM 7056 CB VAL n 254 -13.724 -0.968 55.129 1.00 6.64 C ++ATOM 7057 CG1 VAL n 254 -14.793 -0.952 54.074 1.00 6.64 C ++ATOM 7058 CG2 VAL n 254 -13.910 -2.152 56.037 1.00 6.64 C ++ATOM 7059 N SER n 255 -12.127 0.029 52.295 1.00 20.01 N ++ATOM 7060 CA SER n 255 -11.849 1.142 51.408 1.00 20.01 C ++ATOM 7061 C SER n 255 -12.637 1.003 50.124 1.00 20.01 C ++ATOM 7062 O SER n 255 -13.025 -0.097 49.733 1.00 20.01 O ++ATOM 7063 CB SER n 255 -10.374 1.231 51.076 1.00 20.01 C ++ATOM 7064 OG SER n 255 -9.989 0.141 50.268 1.00 20.01 O ++ATOM 7065 N ALA n 256 -12.864 2.130 49.467 1.00 19.04 N ++ATOM 7066 CA ALA n 256 -13.473 2.142 48.151 1.00 19.04 C ++ATOM 7067 C ALA n 256 -12.597 2.944 47.206 1.00 19.04 C ++ATOM 7068 O ALA n 256 -11.938 3.909 47.610 1.00 19.04 O ++ATOM 7069 CB ALA n 256 -14.879 2.717 48.189 1.00 19.04 C ++ATOM 7070 N GLU n 257 -12.577 2.518 45.946 1.00 23.18 N ++ATOM 7071 CA GLU n 257 -11.685 3.069 44.946 1.00 23.18 C ++ATOM 7072 C GLU n 257 -12.490 3.749 43.853 1.00 23.18 C ++ATOM 7073 O GLU n 257 -13.695 3.533 43.715 1.00 23.18 O ++ATOM 7074 CB GLU n 257 -10.811 1.990 44.296 1.00 23.18 C ++ATOM 7075 CG GLU n 257 -9.856 1.243 45.209 1.00 23.18 C ++ATOM 7076 CD GLU n 257 -10.450 -0.024 45.785 1.00 23.18 C ++ATOM 7077 OE1 GLU n 257 -11.616 -0.331 45.473 1.00 23.18 O ++ATOM 7078 OE2 GLU n 257 -9.742 -0.736 46.521 1.00 23.18 O ++ATOM 7079 N ALA n 258 -11.791 4.553 43.057 1.00 20.96 N ++ATOM 7080 CA ALA n 258 -12.331 5.089 41.817 1.00 20.96 C ++ATOM 7081 C ALA n 258 -11.180 5.476 40.906 1.00 20.96 C ++ATOM 7082 O ALA n 258 -10.238 6.135 41.349 1.00 20.96 O ++ATOM 7083 CB ALA n 258 -13.219 6.305 42.071 1.00 20.96 C ++ATOM 7084 N TRP n 259 -11.252 5.064 39.645 1.00 17.70 N ++ATOM 7085 CA TRP n 259 -10.394 5.666 38.642 1.00 17.70 C ++ATOM 7086 C TRP n 259 -10.865 7.080 38.379 1.00 17.70 C ++ATOM 7087 O TRP n 259 -12.024 7.416 38.608 1.00 17.70 O ++ATOM 7088 CB TRP n 259 -10.423 4.880 37.332 1.00 17.70 C ++ATOM 7089 CG TRP n 259 -9.796 3.539 37.399 1.00 17.70 C ++ATOM 7090 CD1 TRP n 259 -10.431 2.353 37.502 1.00 17.70 C ++ATOM 7091 CD2 TRP n 259 -8.403 3.247 37.368 1.00 17.70 C ++ATOM 7092 NE1 TRP n 259 -9.525 1.332 37.546 1.00 17.70 N ++ATOM 7093 CE2 TRP n 259 -8.268 1.859 37.463 1.00 17.70 C ++ATOM 7094 CE3 TRP n 259 -7.254 4.029 37.272 1.00 17.70 C ++ATOM 7095 CZ2 TRP n 259 -7.039 1.235 37.465 1.00 17.70 C ++ATOM 7096 CZ3 TRP n 259 -6.035 3.410 37.275 1.00 17.70 C ++ATOM 7097 CH2 TRP n 259 -5.933 2.028 37.371 1.00 17.70 C ++ATOM 7098 N GLY n 260 -9.963 7.918 37.891 1.00 18.15 N ++ATOM 7099 CA GLY n 260 -10.392 9.196 37.372 1.00 18.15 C ++ATOM 7100 C GLY n 260 -11.136 8.977 36.071 1.00 18.15 C ++ATOM 7101 O GLY n 260 -10.885 8.016 35.349 1.00 18.15 O ++ATOM 7102 N ARG n 261 -12.087 9.854 35.779 1.00 26.58 N ++ATOM 7103 CA ARG n 261 -12.940 9.634 34.614 1.00 26.58 C ++ATOM 7104 C ARG n 261 -13.334 10.962 33.989 1.00 26.58 C ++ATOM 7105 O ARG n 261 -14.175 11.684 34.526 1.00 26.58 O ++ATOM 7106 CB ARG n 261 -14.177 8.832 34.977 1.00 26.58 C ++ATOM 7107 CG ARG n 261 -15.013 8.474 33.763 1.00 26.58 C ++ATOM 7108 CD ARG n 261 -16.244 7.678 34.133 1.00 26.58 C ++ATOM 7109 NE ARG n 261 -17.195 8.483 34.882 1.00 26.58 N ++ATOM 7110 CZ ARG n 261 -17.447 8.310 36.170 1.00 26.58 C ++ATOM 7111 NH1 ARG n 261 -16.804 7.369 36.846 1.00 26.58 N ++ATOM 7112 NH2 ARG n 261 -18.328 9.080 36.787 1.00 26.58 N ++ATOM 7113 N ALA n 262 -12.729 11.272 32.856 1.00 34.99 N ++ATOM 7114 CA ALA n 262 -13.250 12.313 31.987 1.00 34.99 C ++ATOM 7115 C ALA n 262 -14.341 11.722 31.108 1.00 34.99 C ++ATOM 7116 O ALA n 262 -14.062 10.860 30.270 1.00 34.99 O ++ATOM 7117 CB ALA n 262 -12.134 12.888 31.133 1.00 34.99 C ++ATOM 7118 N ASP n 263 -15.579 12.186 31.291 1.00 44.54 N ++ATOM 7119 CA ASP n 263 -16.718 11.575 30.614 1.00 44.54 C ++ATOM 7120 C ASP n 263 -16.761 11.860 29.125 1.00 44.54 C ++ATOM 7121 O ASP n 263 -16.895 10.921 28.336 1.00 44.54 O ++ATOM 7122 CB ASP n 263 -18.030 12.053 31.226 1.00 44.54 C ++ATOM 7123 CG ASP n 263 -18.295 11.456 32.586 1.00 44.54 C ++ATOM 7124 OD1 ASP n 263 -17.876 10.306 32.834 1.00 44.54 O ++ATOM 7125 OD2 ASP n 263 -18.930 12.143 33.410 1.00 44.54 O ++ATOM 7126 N CYS n 264 -16.648 13.122 28.721 1.00 57.00 N ++ATOM 7127 CA CYS n 264 -16.814 13.478 27.315 1.00 57.00 C ++ATOM 7128 C CYS n 264 -15.570 14.212 26.832 1.00 57.00 C ++ATOM 7129 O CYS n 264 -15.238 15.296 27.315 1.00 57.00 O ++ATOM 7130 CB CYS n 264 -18.086 14.296 27.104 1.00 57.00 C ++ATOM 7131 SG CYS n 264 -18.258 15.789 28.092 1.00 57.00 S ++ATOM 7132 N GLY n 265 -14.878 13.594 25.887 1.00 51.85 N ++ATOM 7133 CA GLY n 265 -13.591 14.093 25.436 1.00 51.85 C ++ATOM 7134 C GLY n 265 -12.797 12.954 24.850 1.00 51.85 C ++ATOM 7135 O GLY n 265 -13.323 11.856 24.640 1.00 51.85 O ++ATOM 7136 N PHE n 266 -11.515 13.210 24.617 1.00 53.70 N ++ATOM 7137 CA PHE n 266 -10.652 12.258 23.928 1.00 53.70 C ++ATOM 7138 C PHE n 266 -9.521 11.859 24.871 1.00 53.70 C ++ATOM 7139 O PHE n 266 -8.434 12.439 24.845 1.00 53.70 O ++ATOM 7140 CB PHE n 266 -10.147 12.866 22.641 1.00 53.70 C ++ATOM 7141 CG PHE n 266 -9.354 11.932 21.798 1.00 53.70 C ++ATOM 7142 CD1 PHE n 266 -9.979 10.896 21.131 1.00 53.70 C ++ATOM 7143 CD2 PHE n 266 -7.989 12.110 21.635 1.00 53.70 C ++ATOM 7144 CE1 PHE n 266 -9.258 10.033 20.341 1.00 53.70 C ++ATOM 7145 CE2 PHE n 266 -7.260 11.252 20.842 1.00 53.70 C ++ATOM 7146 CZ PHE n 266 -7.898 10.213 20.195 1.00 53.70 C ++ATOM 7147 N THR n 267 -9.780 10.847 25.687 1.00 50.21 N ++ATOM 7148 CA THR n 267 -8.817 10.338 26.648 1.00 50.21 C ++ATOM 7149 C THR n 267 -7.881 9.335 25.983 1.00 50.21 C ++ATOM 7150 O THR n 267 -7.815 9.233 24.758 1.00 50.21 O ++ATOM 7151 CB THR n 267 -9.539 9.715 27.836 1.00 50.21 C ++ATOM 7152 OG1 THR n 267 -10.452 8.715 27.368 1.00 50.21 O ++ATOM 7153 CG2 THR n 267 -10.293 10.770 28.608 1.00 50.21 C ++ATOM 7154 N SER n 268 -7.137 8.583 26.789 1.00 43.94 N ++ATOM 7155 CA SER n 268 -6.165 7.618 26.287 1.00 43.94 C ++ATOM 7156 C SER n 268 -6.672 6.192 26.388 1.00 43.94 C ++ATOM 7157 O SER n 268 -5.911 5.278 26.704 1.00 43.94 O ++ATOM 7158 CB SER n 268 -4.843 7.764 27.023 1.00 43.94 C ++ATOM 7159 OG SER n 268 -4.981 7.384 28.377 1.00 43.94 O ++ATOM 7160 N GLU n 269 -7.953 5.975 26.153 1.00 53.49 N ++ATOM 7161 CA GLU n 269 -8.481 4.633 25.954 1.00 53.49 C ++ATOM 7162 C GLU n 269 -9.184 4.486 24.620 1.00 53.49 C ++ATOM 7163 O GLU n 269 -9.019 3.456 23.939 1.00 53.49 O ++ATOM 7164 CB GLU n 269 -9.439 4.267 27.085 1.00 53.49 C ++ATOM 7165 CG GLU n 269 -8.756 4.104 28.421 1.00 53.49 C ++ATOM 7166 CD GLU n 269 -9.721 3.728 29.516 1.00 53.49 C ++ATOM 7167 OE1 GLU n 269 -10.941 3.752 29.262 1.00 53.49 O ++ATOM 7168 OE2 GLU n 269 -9.262 3.400 30.629 1.00 53.49 O ++ATOM 7169 N SER n 270 -9.945 5.508 24.218 1.00 51.23 N ++ATOM 7170 CA SER n 270 -10.433 5.588 22.848 1.00 51.23 C ++ATOM 7171 C SER n 270 -9.278 5.635 21.864 1.00 51.23 C ++ATOM 7172 O SER n 270 -9.367 5.057 20.775 1.00 51.23 O ++ATOM 7173 CB SER n 270 -11.318 6.817 22.670 1.00 51.23 C ++ATOM 7174 OG SER n 270 -10.545 7.999 22.738 1.00 51.23 O ++ATOM 7175 N TYR n 271 -8.172 6.276 22.246 1.00 46.05 N ++ATOM 7176 CA TYR n 271 -6.998 6.284 21.387 1.00 46.05 C ++ATOM 7177 C TYR n 271 -6.349 4.906 21.316 1.00 46.05 C ++ATOM 7178 O TYR n 271 -5.831 4.524 20.258 1.00 46.05 O ++ATOM 7179 CB TYR n 271 -5.997 7.313 21.880 1.00 46.05 C ++ATOM 7180 CG TYR n 271 -4.882 7.518 20.912 1.00 46.05 C ++ATOM 7181 CD1 TYR n 271 -5.039 8.354 19.827 1.00 46.05 C ++ATOM 7182 CD2 TYR n 271 -3.684 6.849 21.055 1.00 46.05 C ++ATOM 7183 CE1 TYR n 271 -4.026 8.546 18.928 1.00 46.05 C ++ATOM 7184 CE2 TYR n 271 -2.681 7.016 20.159 1.00 46.05 C ++ATOM 7185 CZ TYR n 271 -2.851 7.866 19.092 1.00 46.05 C ++ATOM 7186 OH TYR n 271 -1.832 8.050 18.189 1.00 46.05 O ++ATOM 7187 N GLN n 272 -6.339 4.165 22.432 1.00 50.80 N ++ATOM 7188 CA GLN n 272 -5.843 2.789 22.417 1.00 50.80 C ++ATOM 7189 C GLN n 272 -6.623 1.937 21.433 1.00 50.80 C ++ATOM 7190 O GLN n 272 -6.040 1.209 20.619 1.00 50.80 O ++ATOM 7191 CB GLN n 272 -5.936 2.149 23.801 1.00 50.80 C ++ATOM 7192 CG GLN n 272 -4.958 2.642 24.827 1.00 50.80 C ++ATOM 7193 CD GLN n 272 -5.078 1.891 26.139 1.00 50.80 C ++ATOM 7194 OE1 GLN n 272 -5.966 1.054 26.307 1.00 50.80 O ++ATOM 7195 NE2 GLN n 272 -4.174 2.175 27.072 1.00 50.80 N ++ATOM 7196 N GLN n 273 -7.947 2.050 21.456 1.00 52.61 N ++ATOM 7197 CA GLN n 273 -8.721 1.205 20.559 1.00 52.61 C ++ATOM 7198 C GLN n 273 -8.693 1.717 19.125 1.00 52.61 C ++ATOM 7199 O GLN n 273 -8.803 0.914 18.186 1.00 52.61 O ++ATOM 7200 CB GLN n 273 -10.132 1.071 21.095 1.00 52.61 C ++ATOM 7201 CG GLN n 273 -10.128 0.268 22.365 1.00 52.61 C ++ATOM 7202 CD GLN n 273 -11.464 0.239 23.027 1.00 52.61 C ++ATOM 7203 OE1 GLN n 273 -12.399 0.900 22.580 1.00 52.61 O ++ATOM 7204 NE2 GLN n 273 -11.573 -0.520 24.109 1.00 52.61 N ++ATOM 7205 N GLY n 274 -8.482 3.020 18.930 1.00 46.33 N ++ATOM 7206 CA GLY n 274 -8.273 3.534 17.586 1.00 46.33 C ++ATOM 7207 C GLY n 274 -7.000 3.006 16.951 1.00 46.33 C ++ATOM 7208 O GLY n 274 -7.005 2.579 15.794 1.00 46.33 O ++ATOM 7209 N VAL n 275 -5.911 2.966 17.716 1.00 41.14 N ++ATOM 7210 CA VAL n 275 -4.663 2.451 17.167 1.00 41.14 C ++ATOM 7211 C VAL n 275 -4.702 0.925 17.023 1.00 41.14 C ++ATOM 7212 O VAL n 275 -4.104 0.371 16.091 1.00 41.14 O ++ATOM 7213 CB VAL n 275 -3.499 2.963 18.030 1.00 41.14 C ++ATOM 7214 CG1 VAL n 275 -2.181 2.379 17.619 1.00 41.14 C ++ATOM 7215 CG2 VAL n 275 -3.421 4.438 17.863 1.00 41.14 C ++ATOM 7216 N LEU n 276 -5.464 0.222 17.869 1.00 45.15 N ++ATOM 7217 CA LEU n 276 -5.611 -1.221 17.670 1.00 45.15 C ++ATOM 7218 C LEU n 276 -6.408 -1.551 16.410 1.00 45.15 C ++ATOM 7219 O LEU n 276 -6.036 -2.465 15.657 1.00 45.15 O ++ATOM 7220 CB LEU n 276 -6.265 -1.863 18.881 1.00 45.15 C ++ATOM 7221 CG LEU n 276 -5.363 -1.975 20.093 1.00 45.15 C ++ATOM 7222 CD1 LEU n 276 -6.181 -2.476 21.247 1.00 45.15 C ++ATOM 7223 CD2 LEU n 276 -4.224 -2.910 19.793 1.00 45.15 C ++ATOM 7224 N SER n 277 -7.498 -0.819 16.158 1.00 45.89 N ++ATOM 7225 CA SER n 277 -8.220 -1.004 14.905 1.00 45.89 C ++ATOM 7226 C SER n 277 -7.376 -0.596 13.700 1.00 45.89 C ++ATOM 7227 O SER n 277 -7.504 -1.199 12.625 1.00 45.89 O ++ATOM 7228 CB SER n 277 -9.524 -0.217 14.933 1.00 45.89 C ++ATOM 7229 OG SER n 277 -9.267 1.172 14.971 1.00 45.89 O ++ATOM 7230 N ALA n 278 -6.493 0.397 13.867 1.00 43.34 N ++ATOM 7231 CA ALA n 278 -5.558 0.746 12.802 1.00 43.34 C ++ATOM 7232 C ALA n 278 -4.596 -0.394 12.500 1.00 43.34 C ++ATOM 7233 O ALA n 278 -4.316 -0.675 11.329 1.00 43.34 O ++ATOM 7234 CB ALA n 278 -4.770 1.992 13.177 1.00 43.34 C ++ATOM 7235 N THR n 279 -4.081 -1.059 13.538 1.00 44.31 N ++ATOM 7236 CA THR n 279 -3.165 -2.173 13.306 1.00 44.31 C ++ATOM 7237 C THR n 279 -3.872 -3.345 12.642 1.00 44.31 C ++ATOM 7238 O THR n 279 -3.287 -4.007 11.776 1.00 44.31 O ++ATOM 7239 CB THR n 279 -2.499 -2.633 14.601 1.00 44.31 C ++ATOM 7240 OG1 THR n 279 -3.499 -2.962 15.571 1.00 44.31 O ++ATOM 7241 CG2 THR n 279 -1.573 -1.574 15.145 1.00 44.31 C ++ATOM 7242 N ILE n 280 -5.140 -3.591 13.000 1.00 46.74 N ++ATOM 7243 CA ILE n 280 -5.904 -4.641 12.322 1.00 46.74 C ++ATOM 7244 C ILE n 280 -6.092 -4.317 10.846 1.00 46.74 C ++ATOM 7245 O ILE n 280 -5.799 -5.151 9.977 1.00 46.74 O ++ATOM 7246 CB ILE n 280 -7.264 -4.873 12.996 1.00 46.74 C ++ATOM 7247 CG1 ILE n 280 -7.098 -5.546 14.338 1.00 46.74 C ++ATOM 7248 CG2 ILE n 280 -8.158 -5.736 12.127 1.00 46.74 C ++ATOM 7249 CD1 ILE n 280 -8.404 -5.693 15.047 1.00 46.74 C ++ATOM 7250 N LEU n 281 -6.585 -3.107 10.541 1.00 42.45 N ++ATOM 7251 CA LEU n 281 -6.842 -2.742 9.150 1.00 42.45 C ++ATOM 7252 C LEU n 281 -5.576 -2.699 8.318 1.00 42.45 C ++ATOM 7253 O LEU n 281 -5.605 -3.058 7.140 1.00 42.45 O ++ATOM 7254 CB LEU n 281 -7.548 -1.399 9.048 1.00 42.45 C ++ATOM 7255 CG LEU n 281 -9.026 -1.444 9.369 1.00 42.45 C ++ATOM 7256 CD1 LEU n 281 -9.597 -0.051 9.298 1.00 42.45 C ++ATOM 7257 CD2 LEU n 281 -9.696 -2.352 8.372 1.00 42.45 C ++ATOM 7258 N TYR n 282 -4.446 -2.336 8.908 1.00 38.27 N ++ATOM 7259 CA TYR n 282 -3.264 -2.256 8.073 1.00 38.27 C ++ATOM 7260 C TYR n 282 -2.551 -3.590 7.952 1.00 38.27 C ++ATOM 7261 O TYR n 282 -1.910 -3.830 6.928 1.00 38.27 O ++ATOM 7262 CB TYR n 282 -2.358 -1.148 8.581 1.00 38.27 C ++ATOM 7263 CG TYR n 282 -2.925 0.210 8.241 1.00 38.27 C ++ATOM 7264 CD1 TYR n 282 -3.831 0.361 7.197 1.00 38.27 C ++ATOM 7265 CD2 TYR n 282 -2.594 1.329 8.980 1.00 38.27 C ++ATOM 7266 CE1 TYR n 282 -4.362 1.585 6.885 1.00 38.27 C ++ATOM 7267 CE2 TYR n 282 -3.133 2.557 8.680 1.00 38.27 C ++ATOM 7268 CZ TYR n 282 -4.007 2.679 7.626 1.00 38.27 C ++ATOM 7269 OH TYR n 282 -4.539 3.904 7.318 1.00 38.27 O ++ATOM 7270 N GLU n 283 -2.715 -4.508 8.909 1.00 43.79 N ++ATOM 7271 CA GLU n 283 -2.251 -5.868 8.651 1.00 43.79 C ++ATOM 7272 C GLU n 283 -3.123 -6.559 7.611 1.00 43.79 C ++ATOM 7273 O GLU n 283 -2.610 -7.298 6.761 1.00 43.79 O ++ATOM 7274 CB GLU n 283 -2.194 -6.672 9.946 1.00 43.79 C ++ATOM 7275 CG GLU n 283 -1.066 -6.231 10.860 1.00 43.79 C ++ATOM 7276 CD GLU n 283 -0.984 -7.034 12.138 1.00 43.79 C ++ATOM 7277 OE1 GLU n 283 -1.867 -7.880 12.362 1.00 43.79 O ++ATOM 7278 OE2 GLU n 283 -0.033 -6.819 12.917 1.00 43.79 O ++ATOM 7279 N ILE n 284 -4.431 -6.284 7.625 1.00 38.89 N ++ATOM 7280 CA ILE n 284 -5.330 -6.829 6.608 1.00 38.89 C ++ATOM 7281 C ILE n 284 -4.994 -6.278 5.224 1.00 38.89 C ++ATOM 7282 O ILE n 284 -4.853 -7.038 4.259 1.00 38.89 O ++ATOM 7283 CB ILE n 284 -6.793 -6.553 6.993 1.00 38.89 C ++ATOM 7284 CG1 ILE n 284 -7.227 -7.476 8.128 1.00 38.89 C ++ATOM 7285 CG2 ILE n 284 -7.710 -6.678 5.804 1.00 38.89 C ++ATOM 7286 CD1 ILE n 284 -8.583 -7.143 8.686 1.00 38.89 C ++ATOM 7287 N LEU n 285 -4.841 -4.955 5.113 1.00 38.49 N ++ATOM 7288 CA LEU n 285 -4.489 -4.328 3.841 1.00 38.49 C ++ATOM 7289 C LEU n 285 -3.101 -4.736 3.362 1.00 38.49 C ++ATOM 7290 O LEU n 285 -2.878 -4.855 2.150 1.00 38.49 O ++ATOM 7291 CB LEU n 285 -4.582 -2.807 3.967 1.00 38.49 C ++ATOM 7292 CG LEU n 285 -5.868 -2.076 3.574 1.00 38.49 C ++ATOM 7293 CD1 LEU n 285 -6.034 -2.146 2.075 1.00 38.49 C ++ATOM 7294 CD2 LEU n 285 -7.106 -2.634 4.251 1.00 38.49 C ++ATOM 7295 N LEU n 286 -2.169 -4.987 4.284 1.00 39.73 N ++ATOM 7296 CA LEU n 286 -0.849 -5.448 3.883 1.00 39.73 C ++ATOM 7297 C LEU n 286 -0.918 -6.876 3.359 1.00 39.73 C ++ATOM 7298 O LEU n 286 -0.224 -7.218 2.394 1.00 39.73 O ++ATOM 7299 CB LEU n 286 0.110 -5.325 5.068 1.00 39.73 C ++ATOM 7300 CG LEU n 286 1.626 -5.274 4.867 1.00 39.73 C ++ATOM 7301 CD1 LEU n 286 2.271 -6.635 4.642 1.00 39.73 C ++ATOM 7302 CD2 LEU n 286 1.941 -4.330 3.722 1.00 39.73 C ++ATOM 7303 N GLY n 287 -1.768 -7.714 3.963 1.00 42.89 N ++ATOM 7304 CA GLY n 287 -1.989 -9.049 3.424 1.00 42.89 C ++ATOM 7305 C GLY n 287 -2.616 -9.029 2.042 1.00 42.89 C ++ATOM 7306 O GLY n 287 -2.211 -9.793 1.158 1.00 42.89 O ++ATOM 7307 N LYS n 288 -3.609 -8.147 1.843 1.00 44.76 N ++ATOM 7308 CA LYS n 288 -4.203 -7.903 0.525 1.00 44.76 C ++ATOM 7309 C LYS n 288 -3.153 -7.554 -0.514 1.00 44.76 C ++ATOM 7310 O LYS n 288 -3.089 -8.177 -1.581 1.00 44.76 O ++ATOM 7311 CB LYS n 288 -5.192 -6.745 0.597 1.00 44.76 C ++ATOM 7312 CG LYS n 288 -6.415 -6.934 1.431 1.00 44.76 C ++ATOM 7313 CD LYS n 288 -7.428 -7.778 0.741 1.00 44.76 C ++ATOM 7314 CE LYS n 288 -8.744 -7.648 1.463 1.00 44.76 C ++ATOM 7315 NZ LYS n 288 -8.737 -8.361 2.765 1.00 44.76 N ++ATOM 7316 N ALA n 289 -2.320 -6.557 -0.215 1.00 44.68 N ++ATOM 7317 CA ALA n 289 -1.372 -6.067 -1.205 1.00 44.68 C ++ATOM 7318 C ALA n 289 -0.263 -7.077 -1.471 1.00 44.68 C ++ATOM 7319 O ALA n 289 0.195 -7.200 -2.612 1.00 44.68 O ++ATOM 7320 CB ALA n 289 -0.792 -4.730 -0.759 1.00 44.68 C ++ATOM 7321 N THR n 290 0.154 -7.843 -0.456 1.00 44.60 N ++ATOM 7322 CA THR n 290 1.162 -8.868 -0.713 1.00 44.60 C ++ATOM 7323 C THR n 290 0.596 -10.020 -1.530 1.00 44.60 C ++ATOM 7324 O THR n 290 1.296 -10.568 -2.389 1.00 44.60 O ++ATOM 7325 CB THR n 290 1.764 -9.389 0.588 1.00 44.60 C ++ATOM 7326 OG1 THR n 290 0.717 -9.796 1.476 1.00 44.60 O ++ATOM 7327 CG2 THR n 290 2.647 -8.338 1.233 1.00 44.60 C ++ATOM 7328 N LEU n 291 -0.670 -10.385 -1.313 1.00 49.37 N ++ATOM 7329 CA LEU n 291 -1.248 -11.440 -2.143 1.00 49.37 C ++ATOM 7330 C LEU n 291 -1.464 -10.975 -3.574 1.00 49.37 C ++ATOM 7331 O LEU n 291 -1.278 -11.754 -4.518 1.00 49.37 O ++ATOM 7332 CB LEU n 291 -2.551 -11.953 -1.543 1.00 49.37 C ++ATOM 7333 CG LEU n 291 -2.381 -13.281 -0.811 1.00 49.37 C ++ATOM 7334 CD1 LEU n 291 -2.067 -14.367 -1.821 1.00 49.37 C ++ATOM 7335 CD2 LEU n 291 -1.293 -13.233 0.258 1.00 49.37 C ++ATOM 7336 N TYR n 292 -1.809 -9.703 -3.763 1.00 52.24 N ++ATOM 7337 CA TYR n 292 -1.934 -9.197 -5.122 1.00 52.24 C ++ATOM 7338 C TYR n 292 -0.573 -9.087 -5.795 1.00 52.24 C ++ATOM 7339 O TYR n 292 -0.467 -9.283 -7.011 1.00 52.24 O ++ATOM 7340 CB TYR n 292 -2.634 -7.851 -5.110 1.00 52.24 C ++ATOM 7341 CG TYR n 292 -3.050 -7.383 -6.469 1.00 52.24 C ++ATOM 7342 CD1 TYR n 292 -4.112 -7.987 -7.119 1.00 52.24 C ++ATOM 7343 CD2 TYR n 292 -2.410 -6.326 -7.091 1.00 52.24 C ++ATOM 7344 CE1 TYR n 292 -4.518 -7.565 -8.358 1.00 52.24 C ++ATOM 7345 CE2 TYR n 292 -2.809 -5.890 -8.338 1.00 52.24 C ++ATOM 7346 CZ TYR n 292 -3.865 -6.518 -8.964 1.00 52.24 C ++ATOM 7347 OH TYR n 292 -4.284 -6.102 -10.200 1.00 52.24 O ++ATOM 7348 N ALA n 293 0.476 -8.820 -5.013 1.00 48.98 N ++ATOM 7349 CA ALA n 293 1.831 -8.817 -5.554 1.00 48.98 C ++ATOM 7350 C ALA n 293 2.268 -10.214 -5.959 1.00 48.98 C ++ATOM 7351 O ALA n 293 2.935 -10.383 -6.984 1.00 48.98 O ++ATOM 7352 CB ALA n 293 2.802 -8.231 -4.534 1.00 48.98 C ++ATOM 7353 N VAL n 294 1.892 -11.226 -5.172 1.00 49.73 N ++ATOM 7354 CA VAL n 294 2.213 -12.609 -5.520 1.00 49.73 C ++ATOM 7355 C VAL n 294 1.474 -13.030 -6.787 1.00 49.73 C ++ATOM 7356 O VAL n 294 2.052 -13.676 -7.671 1.00 49.73 O ++ATOM 7357 CB VAL n 294 1.913 -13.536 -4.327 1.00 49.73 C ++ATOM 7358 CG1 VAL n 294 1.992 -14.992 -4.724 1.00 49.73 C ++ATOM 7359 CG2 VAL n 294 2.918 -13.286 -3.226 1.00 49.73 C ++ATOM 7360 N LEU n 295 0.213 -12.607 -6.928 1.00 51.78 N ++ATOM 7361 CA LEU n 295 -0.552 -12.899 -8.141 1.00 51.78 C ++ATOM 7362 C LEU n 295 0.056 -12.244 -9.377 1.00 51.78 C ++ATOM 7363 O LEU n 295 0.234 -12.903 -10.411 1.00 51.78 O ++ATOM 7364 CB LEU n 295 -2.003 -12.454 -7.970 1.00 51.78 C ++ATOM 7365 CG LEU n 295 -3.043 -13.482 -7.533 1.00 51.78 C ++ATOM 7366 CD1 LEU n 295 -3.225 -14.489 -8.650 1.00 51.78 C ++ATOM 7367 CD2 LEU n 295 -2.678 -14.187 -6.237 1.00 51.78 C ++ATOM 7368 N VAL n 296 0.401 -10.955 -9.295 1.00 55.94 N ++ATOM 7369 CA VAL n 296 0.930 -10.300 -10.488 1.00 55.94 C ++ATOM 7370 C VAL n 296 2.355 -10.756 -10.775 1.00 55.94 C ++ATOM 7371 O VAL n 296 2.766 -10.803 -11.939 1.00 55.94 O ++ATOM 7372 CB VAL n 296 0.829 -8.766 -10.394 1.00 55.94 C ++ATOM 7373 CG1 VAL n 296 -0.619 -8.349 -10.250 1.00 55.94 C ++ATOM 7374 CG2 VAL n 296 1.666 -8.216 -9.259 1.00 55.94 C ++ATOM 7375 N SER n 297 3.112 -11.164 -9.752 1.00 57.97 N ++ATOM 7376 CA SER n 297 4.449 -11.677 -10.008 1.00 57.97 C ++ATOM 7377 C SER n 297 4.382 -13.058 -10.641 1.00 57.97 C ++ATOM 7378 O SER n 297 5.202 -13.386 -11.505 1.00 57.97 O ++ATOM 7379 CB SER n 297 5.260 -11.710 -8.715 1.00 57.97 C ++ATOM 7380 OG SER n 297 4.730 -12.657 -7.810 1.00 57.97 O ++ATOM 7381 N ALA n 298 3.383 -13.858 -10.260 1.00 59.77 N ++ATOM 7382 CA ALA n 298 3.182 -15.143 -10.917 1.00 59.77 C ++ATOM 7383 C ALA n 298 2.741 -14.961 -12.364 1.00 59.77 C ++ATOM 7384 O ALA n 298 3.185 -15.707 -13.244 1.00 59.77 O ++ATOM 7385 CB ALA n 298 2.161 -15.976 -10.146 1.00 59.77 C ++ATOM 7386 N LEU n 299 1.897 -13.959 -12.634 1.00 62.04 N ++ATOM 7387 CA LEU n 299 1.492 -13.693 -14.015 1.00 62.04 C ++ATOM 7388 C LEU n 299 2.662 -13.203 -14.864 1.00 62.04 C ++ATOM 7389 O LEU n 299 2.806 -13.616 -16.021 1.00 62.04 O ++ATOM 7390 CB LEU n 299 0.339 -12.689 -14.052 1.00 62.04 C ++ATOM 7391 CG LEU n 299 -1.104 -13.212 -14.111 1.00 62.04 C ++ATOM 7392 CD1 LEU n 299 -1.354 -13.909 -15.434 1.00 62.04 C ++ATOM 7393 CD2 LEU n 299 -1.443 -14.145 -12.965 1.00 62.04 C ++ATOM 7394 N VAL n 300 3.531 -12.361 -14.296 1.00 68.27 N ++ATOM 7395 CA VAL n 300 4.713 -11.895 -15.022 1.00 68.27 C ++ATOM 7396 C VAL n 300 5.688 -13.041 -15.278 1.00 68.27 C ++ATOM 7397 O VAL n 300 6.237 -13.162 -16.380 1.00 68.27 O ++ATOM 7398 CB VAL n 300 5.373 -10.729 -14.260 1.00 68.27 C ++ATOM 7399 CG1 VAL n 300 6.755 -10.421 -14.799 1.00 68.27 C ++ATOM 7400 CG2 VAL n 300 4.521 -9.492 -14.389 1.00 68.27 C ++ATOM 7401 N LEU n 301 5.888 -13.924 -14.291 1.00 71.48 N ++ATOM 7402 CA LEU n 301 6.802 -15.048 -14.488 1.00 71.48 C ++ATOM 7403 C LEU n 301 6.261 -16.049 -15.503 1.00 71.48 C ++ATOM 7404 O LEU n 301 7.023 -16.565 -16.330 1.00 71.48 O ++ATOM 7405 CB LEU n 301 7.099 -15.737 -13.157 1.00 71.48 C ++ATOM 7406 CG LEU n 301 8.007 -14.985 -12.181 1.00 71.48 C ++ATOM 7407 CD1 LEU n 301 8.099 -15.717 -10.853 1.00 71.48 C ++ATOM 7408 CD2 LEU n 301 9.389 -14.797 -12.775 1.00 71.48 C ++ATOM 7409 N MET n 302 4.948 -16.306 -15.491 1.00 76.96 N ++ATOM 7410 CA MET n 302 4.376 -17.203 -16.492 1.00 76.96 C ++ATOM 7411 C MET n 302 4.410 -16.581 -17.883 1.00 76.96 C ++ATOM 7412 O MET n 302 4.636 -17.286 -18.872 1.00 76.96 O ++ATOM 7413 CB MET n 302 2.948 -17.593 -16.113 1.00 76.96 C ++ATOM 7414 CG MET n 302 2.827 -18.495 -14.884 1.00 76.96 C ++ATOM 7415 SD MET n 302 3.666 -20.087 -15.018 1.00 76.96 S ++ATOM 7416 CE MET n 302 5.074 -19.837 -13.938 1.00 76.96 C ++ATOM 7417 N ALA n 303 4.235 -15.258 -17.980 1.00 80.27 N ++ATOM 7418 CA ALA n 303 4.318 -14.606 -19.284 1.00 80.27 C ++ATOM 7419 C ALA n 303 5.750 -14.583 -19.808 1.00 80.27 C ++ATOM 7420 O ALA n 303 5.973 -14.687 -21.019 1.00 80.27 O ++ATOM 7421 CB ALA n 303 3.754 -13.189 -19.203 1.00 80.27 C ++ATOM 7422 N MET n 304 6.737 -14.460 -18.916 1.00 87.71 N ++ATOM 7423 CA MET n 304 8.128 -14.513 -19.352 1.00 87.71 C ++ATOM 7424 C MET n 304 8.580 -15.929 -19.674 1.00 87.71 C ++ATOM 7425 O MET n 304 9.529 -16.098 -20.447 1.00 87.71 O ++ATOM 7426 CB MET n 304 9.048 -13.896 -18.301 1.00 87.71 C ++ATOM 7427 CG MET n 304 8.920 -12.387 -18.180 1.00 87.71 C ++ATOM 7428 SD MET n 304 10.008 -11.705 -16.914 1.00 87.71 S ++ATOM 7429 CE MET n 304 11.608 -11.919 -17.696 1.00 87.71 C ++ATOM 7430 N VAL n 305 7.943 -16.944 -19.091 1.00 88.19 N ++ATOM 7431 CA VAL n 305 8.163 -18.309 -19.561 1.00 88.19 C ++ATOM 7432 C VAL n 305 7.551 -18.494 -20.948 1.00 88.19 C ++ATOM 7433 O VAL n 305 8.190 -19.029 -21.862 1.00 88.19 O ++ATOM 7434 CB VAL n 305 7.615 -19.333 -18.547 1.00 88.19 C ++ATOM 7435 CG1 VAL n 305 7.598 -20.732 -19.137 1.00 88.19 C ++ATOM 7436 CG2 VAL n 305 8.475 -19.345 -17.299 1.00 88.19 C ++ATOM 7437 N LYS n 306 6.323 -18.012 -21.141 1.00 88.62 N ++ATOM 7438 CA LYS n 306 5.630 -18.231 -22.405 1.00 88.62 C ++ATOM 7439 C LYS n 306 6.021 -17.245 -23.501 1.00 88.62 C ++ATOM 7440 O LYS n 306 5.486 -17.343 -24.610 1.00 88.62 O ++ATOM 7441 CB LYS n 306 4.115 -18.195 -22.188 1.00 88.62 C ++ATOM 7442 CG LYS n 306 3.548 -19.279 -21.250 1.00 88.62 C ++ATOM 7443 CD LYS n 306 3.528 -20.680 -21.869 1.00 88.62 C ++ATOM 7444 CE LYS n 306 4.663 -21.575 -21.368 1.00 88.62 C ++ATOM 7445 NZ LYS n 306 4.567 -22.958 -21.909 1.00 88.62 N ++ATOM 7446 N ARG n 307 6.916 -16.299 -23.229 1.00 94.26 N ++ATOM 7447 CA ARG n 307 7.565 -15.552 -24.300 1.00 94.26 C ++ATOM 7448 C ARG n 307 8.976 -16.043 -24.591 1.00 94.26 C ++ATOM 7449 O ARG n 307 9.519 -15.725 -25.655 1.00 94.26 O ++ATOM 7450 CB ARG n 307 7.623 -14.053 -23.981 1.00 94.26 C ++ATOM 7451 CG ARG n 307 6.300 -13.313 -24.079 1.00 94.26 C ++ATOM 7452 CD ARG n 307 6.511 -11.824 -23.823 1.00 94.26 C ++ATOM 7453 NE ARG n 307 5.265 -11.064 -23.868 1.00 94.26 N ++ATOM 7454 CZ ARG n 307 5.177 -9.761 -23.620 1.00 94.26 C ++ATOM 7455 NH1 ARG n 307 6.262 -9.064 -23.311 1.00 94.26 N ++ATOM 7456 NH2 ARG n 307 4.003 -9.152 -23.681 1.00 94.26 N ++ATOM 7457 N LYS n 308 9.582 -16.794 -23.676 1.00 99.27 N ++ATOM 7458 CA LYS n 308 10.909 -17.359 -23.894 1.00 99.27 C ++ATOM 7459 C LYS n 308 10.934 -18.836 -23.509 1.00 99.27 C ++ATOM 7460 O LYS n 308 10.130 -19.629 -24.001 1.00 99.27 O ++ATOM 7461 CB LYS n 308 11.971 -16.588 -23.099 1.00 99.27 C ++ATOM 7462 CG LYS n 308 12.255 -15.181 -23.611 1.00 99.27 C ++ATOM 7463 CD LYS n 308 13.365 -14.521 -22.810 1.00 99.27 C ++ATOM 7464 CE LYS n 308 13.655 -13.117 -23.312 1.00 99.27 C ++ATOM 7465 NZ LYS n 308 14.746 -12.465 -22.538 1.00 99.27 N ++ATOM 7467 N GLN e 33 26.470 28.599 36.483 1.00 51.86 N ++ATOM 7468 CA GLN e 33 26.895 27.476 37.311 1.00 51.86 C ++ATOM 7469 C GLN e 33 26.959 26.197 36.483 1.00 51.86 C ++ATOM 7470 O GLN e 33 26.075 25.939 35.671 1.00 51.86 O ++ATOM 7471 CB GLN e 33 25.953 27.301 38.501 1.00 51.86 C ++ATOM 7472 CG GLN e 33 26.360 26.196 39.448 1.00 51.86 C ++ATOM 7473 CD GLN e 33 27.766 26.387 39.967 1.00 51.86 C ++ATOM 7474 OE1 GLN e 33 28.694 25.709 39.533 1.00 51.86 O ++ATOM 7475 NE2 GLN e 33 27.934 27.317 40.897 1.00 51.86 N ++ATOM 7476 N THR e 34 28.010 25.405 36.690 1.00 48.88 N ++ATOM 7477 CA THR e 34 28.234 24.207 35.891 1.00 48.88 C ++ATOM 7478 C THR e 34 27.357 23.072 36.404 1.00 48.88 C ++ATOM 7479 O THR e 34 27.549 22.625 37.538 1.00 48.88 O ++ATOM 7480 CB THR e 34 29.697 23.803 35.950 1.00 48.88 C ++ATOM 7481 OG1 THR e 34 30.510 24.929 35.604 1.00 48.88 O ++ATOM 7482 CG2 THR e 34 29.971 22.707 34.952 1.00 48.88 C ++ATOM 7483 N PRO e 35 26.407 22.579 35.618 1.00 39.85 N ++ATOM 7484 CA PRO e 35 25.436 21.609 36.127 1.00 39.85 C ++ATOM 7485 C PRO e 35 26.054 20.229 36.280 1.00 39.85 C ++ATOM 7486 O PRO e 35 27.113 19.937 35.735 1.00 39.85 O ++ATOM 7487 CB PRO e 35 24.363 21.587 35.036 1.00 39.85 C ++ATOM 7488 CG PRO e 35 24.605 22.804 34.221 1.00 39.85 C ++ATOM 7489 CD PRO e 35 26.074 23.006 34.255 1.00 39.85 C ++ATOM 7490 N TYR e 36 25.359 19.371 37.022 1.00 35.92 N ++ATOM 7491 CA TYR e 36 25.718 17.963 37.015 1.00 35.92 C ++ATOM 7492 C TYR e 36 25.450 17.350 35.654 1.00 35.92 C ++ATOM 7493 O TYR e 36 24.527 17.743 34.940 1.00 35.92 O ++ATOM 7494 CB TYR e 36 24.938 17.166 38.051 1.00 35.92 C ++ATOM 7495 CG TYR e 36 25.422 17.268 39.464 1.00 35.92 C ++ATOM 7496 CD1 TYR e 36 26.582 17.939 39.782 1.00 35.92 C ++ATOM 7497 CD2 TYR e 36 24.758 16.609 40.465 1.00 35.92 C ++ATOM 7498 CE1 TYR e 36 27.020 18.000 41.077 1.00 35.92 C ++ATOM 7499 CE2 TYR e 36 25.170 16.665 41.750 1.00 35.92 C ++ATOM 7500 CZ TYR e 36 26.307 17.354 42.057 1.00 35.92 C ++ATOM 7501 OH TYR e 36 26.724 17.396 43.363 1.00 35.92 O ++ATOM 7502 N LYS e 37 26.267 16.370 35.296 1.00 38.55 N ++ATOM 7503 CA LYS e 37 26.062 15.622 34.069 1.00 38.55 C ++ATOM 7504 C LYS e 37 25.233 14.395 34.414 1.00 38.55 C ++ATOM 7505 O LYS e 37 25.650 13.585 35.248 1.00 38.55 O ++ATOM 7506 CB LYS e 37 27.388 15.200 33.442 1.00 38.55 C ++ATOM 7507 CG LYS e 37 28.409 16.310 33.265 1.00 38.55 C ++ATOM 7508 CD LYS e 37 27.966 17.352 32.269 1.00 38.55 C ++ATOM 7509 CE LYS e 37 29.098 18.322 31.987 1.00 38.55 C ++ATOM 7510 NZ LYS e 37 29.438 19.152 33.171 1.00 38.55 N ++ATOM 7511 N VAL e 38 24.070 14.263 33.787 1.00 29.11 N ++ATOM 7512 CA VAL e 38 23.235 13.076 33.913 1.00 29.11 C ++ATOM 7513 C VAL e 38 23.154 12.422 32.547 1.00 29.11 C ++ATOM 7514 O VAL e 38 22.666 13.038 31.592 1.00 29.11 O ++ATOM 7515 CB VAL e 38 21.830 13.410 34.421 1.00 29.11 C ++ATOM 7516 CG1 VAL e 38 21.020 12.143 34.536 1.00 29.11 C ++ATOM 7517 CG2 VAL e 38 21.907 14.129 35.738 1.00 29.11 C ++ATOM 7518 N SER e 39 23.618 11.181 32.447 1.00 32.88 N ++ATOM 7519 CA SER e 39 23.565 10.441 31.195 1.00 32.88 C ++ATOM 7520 C SER e 39 22.821 9.140 31.439 1.00 32.88 C ++ATOM 7521 O SER e 39 23.274 8.301 32.222 1.00 32.88 O ++ATOM 7522 CB SER e 39 24.969 10.171 30.659 1.00 32.88 C ++ATOM 7523 OG SER e 39 24.908 9.444 29.446 1.00 32.88 O ++ATOM 7524 N ILE e 40 21.688 8.968 30.774 1.00 30.26 N ++ATOM 7525 CA ILE e 40 20.792 7.855 31.043 1.00 30.26 C ++ATOM 7526 C ILE e 40 20.737 6.981 29.803 1.00 30.26 C ++ATOM 7527 O ILE e 40 20.205 7.396 28.767 1.00 30.26 O ++ATOM 7528 CB ILE e 40 19.396 8.336 31.451 1.00 30.26 C ++ATOM 7529 CG1 ILE e 40 19.485 9.092 32.774 1.00 30.26 C ++ATOM 7530 CG2 ILE e 40 18.447 7.173 31.591 1.00 30.26 C ++ATOM 7531 CD1 ILE e 40 18.228 9.816 33.152 1.00 30.26 C ++ATOM 7532 N SER e 41 21.278 5.770 29.908 1.00 37.19 N ++ATOM 7533 CA SER e 41 21.332 4.822 28.801 1.00 37.19 C ++ATOM 7534 C SER e 41 20.641 3.540 29.231 1.00 37.19 C ++ATOM 7535 O SER e 41 21.214 2.750 29.989 1.00 37.19 O ++ATOM 7536 CB SER e 41 22.776 4.542 28.391 1.00 37.19 C ++ATOM 7537 OG SER e 41 22.827 3.544 27.392 1.00 37.19 O ++ATOM 7538 N GLY e 42 19.415 3.336 28.752 1.00 43.42 N ++ATOM 7539 CA GLY e 42 18.657 2.146 29.080 1.00 43.42 C ++ATOM 7540 C GLY e 42 18.303 2.067 30.548 1.00 43.42 C ++ATOM 7541 O GLY e 42 17.428 2.789 31.027 1.00 43.42 O ++ATOM 7542 N THR e 43 18.976 1.177 31.267 1.00 43.91 N ++ATOM 7543 CA THR e 43 18.869 1.069 32.714 1.00 43.91 C ++ATOM 7544 C THR e 43 20.218 1.334 33.364 1.00 43.91 C ++ATOM 7545 O THR e 43 20.639 0.626 34.278 1.00 43.91 O ++ATOM 7546 CB THR e 43 18.348 -0.301 33.131 1.00 43.91 C ++ATOM 7547 OG1 THR e 43 19.261 -1.309 32.685 1.00 43.91 O ++ATOM 7548 CG2 THR e 43 16.994 -0.561 32.527 1.00 43.91 C ++ATOM 7549 N THR e 44 20.920 2.355 32.887 1.00 39.66 N ++ATOM 7550 CA THR e 44 22.208 2.731 33.453 1.00 39.66 C ++ATOM 7551 C THR e 44 22.267 4.244 33.545 1.00 39.66 C ++ATOM 7552 O THR e 44 22.242 4.927 32.518 1.00 39.66 O ++ATOM 7553 CB THR e 44 23.362 2.208 32.598 1.00 39.66 C ++ATOM 7554 OG1 THR e 44 23.327 0.778 32.575 1.00 39.66 O ++ATOM 7555 CG2 THR e 44 24.689 2.678 33.156 1.00 39.66 C ++ATOM 7556 N VAL e 45 22.348 4.766 34.761 1.00 38.62 N ++ATOM 7557 CA VAL e 45 22.423 6.202 34.988 1.00 38.62 C ++ATOM 7558 C VAL e 45 23.845 6.535 35.401 1.00 38.62 C ++ATOM 7559 O VAL e 45 24.372 5.953 36.353 1.00 38.62 O ++ATOM 7560 CB VAL e 45 21.413 6.654 36.048 1.00 38.62 C ++ATOM 7561 CG1 VAL e 45 21.626 8.105 36.398 1.00 38.62 C ++ATOM 7562 CG2 VAL e 45 20.012 6.441 35.533 1.00 38.62 C ++ATOM 7563 N ILE e 46 24.476 7.458 34.687 1.00 39.41 N ++ATOM 7564 CA ILE e 46 25.842 7.867 34.975 1.00 39.41 C ++ATOM 7565 C ILE e 46 25.813 9.330 35.371 1.00 39.41 C ++ATOM 7566 O ILE e 46 25.394 10.187 34.583 1.00 39.41 O ++ATOM 7567 CB ILE e 46 26.766 7.635 33.775 1.00 39.41 C ++ATOM 7568 CG1 ILE e 46 26.801 6.152 33.419 1.00 39.41 C ++ATOM 7569 CG2 ILE e 46 28.159 8.115 34.094 1.00 39.41 C ++ATOM 7570 CD1 ILE e 46 27.462 5.867 32.094 1.00 39.41 C ++ATOM 7571 N LEU e 47 26.238 9.613 36.596 1.00 42.03 N ++ATOM 7572 CA LEU e 47 26.284 10.967 37.123 1.00 42.03 C ++ATOM 7573 C LEU e 47 27.726 11.447 37.147 1.00 42.03 C ++ATOM 7574 O LEU e 47 28.638 10.668 37.436 1.00 42.03 O ++ATOM 7575 CB LEU e 47 25.706 11.031 38.532 1.00 42.03 C ++ATOM 7576 CG LEU e 47 24.256 10.610 38.712 1.00 42.03 C ++ATOM 7577 CD1 LEU e 47 23.883 10.717 40.166 1.00 42.03 C ++ATOM 7578 CD2 LEU e 47 23.348 11.443 37.865 1.00 42.03 C ++ATOM 7579 N THR e 48 27.931 12.728 36.850 1.00 49.74 N ++ATOM 7580 CA THR e 48 29.272 13.298 36.868 1.00 49.74 C ++ATOM 7581 C THR e 48 29.233 14.669 37.517 1.00 49.74 C ++ATOM 7582 O THR e 48 28.530 15.565 37.035 1.00 49.74 O ++ATOM 7583 CB THR e 48 29.859 13.395 35.463 1.00 49.74 C ++ATOM 7584 OG1 THR e 48 29.864 12.098 34.861 1.00 49.74 O ++ATOM 7585 CG2 THR e 48 31.284 13.911 35.527 1.00 49.74 C ++ATOM 7586 N CYS e 49 30.001 14.818 38.599 1.00 60.11 N ++ATOM 7587 CA CYS e 49 30.160 16.025 39.400 1.00 60.11 C ++ATOM 7588 C CYS e 49 31.310 16.880 38.891 1.00 60.11 C ++ATOM 7589 O CYS e 49 32.477 16.514 39.063 1.00 60.11 O ++ATOM 7590 CB CYS e 49 30.409 15.659 40.859 1.00 60.11 C ++ATOM 7591 SG CYS e 49 30.776 17.053 41.913 1.00 60.11 S ++ATOM 7592 N PRO e 50 31.029 18.016 38.282 1.00 66.93 N ++ATOM 7593 CA PRO e 50 32.095 18.790 37.632 1.00 66.93 C ++ATOM 7594 C PRO e 50 32.827 19.760 38.547 1.00 66.93 C ++ATOM 7595 O PRO e 50 33.996 20.075 38.303 1.00 66.93 O ++ATOM 7596 CB PRO e 50 31.337 19.546 36.539 1.00 66.93 C ++ATOM 7597 CG PRO e 50 29.993 19.752 37.142 1.00 66.93 C ++ATOM 7598 CD PRO e 50 29.693 18.556 37.985 1.00 66.93 C ++ATOM 7599 N GLN e 51 32.151 20.228 39.603 1.00 69.03 N ++ATOM 7600 CA GLN e 51 32.546 21.471 40.260 1.00 69.03 C ++ATOM 7601 C GLN e 51 33.803 21.302 41.103 1.00 69.03 C ++ATOM 7602 O GLN e 51 34.492 22.283 41.402 1.00 69.03 O ++ATOM 7603 CB GLN e 51 31.392 22.000 41.112 1.00 69.03 C ++ATOM 7604 CG GLN e 51 30.970 21.066 42.225 1.00 69.03 C ++ATOM 7605 CD GLN e 51 29.824 21.612 43.043 1.00 69.03 C ++ATOM 7606 OE1 GLN e 51 29.370 22.734 42.824 1.00 69.03 O ++ATOM 7607 NE2 GLN e 51 29.348 20.821 43.997 1.00 69.03 N ++ATOM 7608 N TYR e 52 34.115 20.080 41.501 1.00 67.69 N ++ATOM 7609 CA TYR e 52 35.349 19.863 42.230 1.00 67.69 C ++ATOM 7610 C TYR e 52 36.425 19.330 41.288 1.00 67.69 C ++ATOM 7611 O TYR e 52 36.103 18.688 40.283 1.00 67.69 O ++ATOM 7612 CB TYR e 52 35.122 18.897 43.389 1.00 67.69 C ++ATOM 7613 CG TYR e 52 34.271 19.490 44.486 1.00 67.69 C ++ATOM 7614 CD1 TYR e 52 34.812 20.381 45.404 1.00 67.69 C ++ATOM 7615 CD2 TYR e 52 32.932 19.162 44.599 1.00 67.69 C ++ATOM 7616 CE1 TYR e 52 34.037 20.929 46.403 1.00 67.69 C ++ATOM 7617 CE2 TYR e 52 32.148 19.705 45.595 1.00 67.69 C ++ATOM 7618 CZ TYR e 52 32.704 20.587 46.494 1.00 67.69 C ++ATOM 7619 OH TYR e 52 31.918 21.124 47.488 1.00 67.69 O ++ATOM 7620 N PRO e 53 37.705 19.614 41.558 1.00 69.18 N ++ATOM 7621 CA PRO e 53 38.767 18.934 40.799 1.00 69.18 C ++ATOM 7622 C PRO e 53 38.823 17.444 41.083 1.00 69.18 C ++ATOM 7623 O PRO e 53 38.958 16.644 40.148 1.00 69.18 O ++ATOM 7624 CB PRO e 53 40.041 19.663 41.248 1.00 69.18 C ++ATOM 7625 CG PRO e 53 39.701 20.254 42.569 1.00 69.18 C ++ATOM 7626 CD PRO e 53 38.248 20.612 42.496 1.00 69.18 C ++ATOM 7627 N GLY e 54 38.718 17.046 42.348 1.00 69.47 N ++ATOM 7628 CA GLY e 54 38.503 15.652 42.664 1.00 69.47 C ++ATOM 7629 C GLY e 54 39.637 14.942 43.371 1.00 69.47 C ++ATOM 7630 O GLY e 54 40.148 15.417 44.391 1.00 69.47 O ++ATOM 7631 N SER e 55 39.954 13.747 42.849 1.00 78.39 N ++ATOM 7632 CA SER e 55 40.954 12.753 43.263 1.00 78.39 C ++ATOM 7633 C SER e 55 40.553 12.012 44.537 1.00 78.39 C ++ATOM 7634 O SER e 55 41.136 10.970 44.851 1.00 78.39 O ++ATOM 7635 CB SER e 55 42.352 13.368 43.439 1.00 78.39 C ++ATOM 7636 OG SER e 55 42.408 14.225 44.568 1.00 78.39 O ++ATOM 7637 N GLU e 56 39.524 12.508 45.221 1.00 73.83 N ++ATOM 7638 CA GLU e 56 38.843 11.857 46.333 1.00 73.83 C ++ATOM 7639 C GLU e 56 37.451 12.453 46.368 1.00 73.83 C ++ATOM 7640 O GLU e 56 37.278 13.590 46.809 1.00 73.83 O ++ATOM 7641 CB GLU e 56 39.536 12.090 47.683 1.00 73.83 C ++ATOM 7642 CG GLU e 56 40.744 11.225 48.003 1.00 73.83 C ++ATOM 7643 CD GLU e 56 40.372 9.769 48.221 1.00 73.83 C ++ATOM 7644 OE1 GLU e 56 39.268 9.508 48.741 1.00 73.83 O ++ATOM 7645 OE2 GLU e 56 41.181 8.884 47.865 1.00 73.83 O ++ATOM 7646 N ILE e 57 36.465 11.700 45.903 1.00 59.68 N ++ATOM 7647 CA ILE e 57 35.107 12.210 45.782 1.00 59.68 C ++ATOM 7648 C ILE e 57 34.177 11.181 46.409 1.00 59.68 C ++ATOM 7649 O ILE e 57 34.496 9.989 46.445 1.00 59.68 O ++ATOM 7650 CB ILE e 57 34.750 12.514 44.309 1.00 59.68 C ++ATOM 7651 CG1 ILE e 57 33.533 13.420 44.205 1.00 59.68 C ++ATOM 7652 CG2 ILE e 57 34.521 11.256 43.500 1.00 59.68 C ++ATOM 7653 CD1 ILE e 57 33.787 14.798 44.720 1.00 59.68 C ++ATOM 7654 N LEU e 58 33.077 11.646 46.986 1.00 57.93 N ++ATOM 7655 CA LEU e 58 32.119 10.777 47.641 1.00 57.93 C ++ATOM 7656 C LEU e 58 30.715 11.221 47.269 1.00 57.93 C ++ATOM 7657 O LEU e 58 30.445 12.415 47.109 1.00 57.93 O ++ATOM 7658 CB LEU e 58 32.287 10.804 49.160 1.00 57.93 C ++ATOM 7659 CG LEU e 58 33.577 10.214 49.725 1.00 57.93 C ++ATOM 7660 CD1 LEU e 58 33.676 10.490 51.208 1.00 57.93 C ++ATOM 7661 CD2 LEU e 58 33.636 8.725 49.449 1.00 57.93 C ++ATOM 7662 N TRP e 59 29.822 10.252 47.137 1.00 46.34 N ++ATOM 7663 CA TRP e 59 28.467 10.494 46.676 1.00 46.34 C ++ATOM 7664 C TRP e 59 27.490 10.103 47.766 1.00 46.34 C ++ATOM 7665 O TRP e 59 27.634 9.047 48.394 1.00 46.34 O ++ATOM 7666 CB TRP e 59 28.202 9.718 45.396 1.00 46.34 C ++ATOM 7667 CG TRP e 59 28.933 10.293 44.248 1.00 46.34 C ++ATOM 7668 CD1 TRP e 59 30.218 10.038 43.891 1.00 46.34 C ++ATOM 7669 CD2 TRP e 59 28.414 11.190 43.270 1.00 46.34 C ++ATOM 7670 NE1 TRP e 59 30.544 10.744 42.766 1.00 46.34 N ++ATOM 7671 CE2 TRP e 59 29.449 11.457 42.362 1.00 46.34 C ++ATOM 7672 CE3 TRP e 59 27.177 11.801 43.081 1.00 46.34 C ++ATOM 7673 CZ2 TRP e 59 29.284 12.303 41.281 1.00 46.34 C ++ATOM 7674 CZ3 TRP e 59 27.016 12.641 42.009 1.00 46.34 C ++ATOM 7675 CH2 TRP e 59 28.062 12.886 41.123 1.00 46.34 C ++ATOM 7676 N GLN e 60 26.508 10.960 47.999 1.00 40.01 N ++ATOM 7677 CA GLN e 60 25.530 10.745 49.048 1.00 40.01 C ++ATOM 7678 C GLN e 60 24.140 10.874 48.451 1.00 40.01 C ++ATOM 7679 O GLN e 60 23.885 11.769 47.639 1.00 40.01 O ++ATOM 7680 CB GLN e 60 25.735 11.735 50.194 1.00 40.01 C ++ATOM 7681 CG GLN e 60 24.943 11.430 51.449 1.00 40.01 C ++ATOM 7682 CD GLN e 60 25.192 12.448 52.536 1.00 40.01 C ++ATOM 7683 OE1 GLN e 60 25.837 13.462 52.302 1.00 40.01 O ++ATOM 7684 NE2 GLN e 60 24.712 12.169 53.737 1.00 40.01 N ++ATOM 7685 N HIS e 61 23.263 9.958 48.841 1.00 34.79 N ++ATOM 7686 CA HIS e 61 21.885 9.880 48.386 1.00 34.79 C ++ATOM 7687 C HIS e 61 20.966 9.763 49.592 1.00 34.79 C ++ATOM 7688 O HIS e 61 21.095 8.813 50.373 1.00 34.79 O ++ATOM 7689 CB HIS e 61 21.719 8.684 47.447 1.00 34.79 C ++ATOM 7690 CG HIS e 61 20.297 8.311 47.172 1.00 34.79 C ++ATOM 7691 ND1 HIS e 61 19.625 7.373 47.921 1.00 34.79 N ++ATOM 7692 CD2 HIS e 61 19.424 8.733 46.230 1.00 34.79 C ++ATOM 7693 CE1 HIS e 61 18.400 7.233 47.454 1.00 34.79 C ++ATOM 7694 NE2 HIS e 61 18.252 8.049 46.428 1.00 34.79 N ++ATOM 7695 N ASN e 62 20.069 10.748 49.741 1.00 35.93 N ++ATOM 7696 CA ASN e 62 19.041 10.817 50.794 1.00 35.93 C ++ATOM 7697 C ASN e 62 19.616 10.613 52.192 1.00 35.93 C ++ATOM 7698 O ASN e 62 19.096 9.826 52.986 1.00 35.93 O ++ATOM 7699 CB ASN e 62 17.910 9.827 50.530 1.00 35.93 C ++ATOM 7700 CG ASN e 62 16.923 10.334 49.511 1.00 35.93 C ++ATOM 7701 OD1 ASN e 62 16.566 11.510 49.520 1.00 35.93 O ++ATOM 7702 ND2 ASN e 62 16.461 9.454 48.638 1.00 35.93 N ++ATOM 7703 N ASP e 63 20.705 11.337 52.471 1.00 49.07 N ++ATOM 7704 CA ASP e 63 21.508 11.188 53.690 1.00 49.07 C ++ATOM 7705 C ASP e 63 21.992 9.752 53.884 1.00 49.07 C ++ATOM 7706 O ASP e 63 21.765 9.137 54.928 1.00 49.07 O ++ATOM 7707 CB ASP e 63 20.766 11.684 54.937 1.00 49.07 C ++ATOM 7708 CG ASP e 63 20.638 13.191 54.980 1.00 49.07 C ++ATOM 7709 OD1 ASP e 63 21.513 13.880 54.415 1.00 49.07 O ++ATOM 7710 OD2 ASP e 63 19.668 13.685 55.594 1.00 49.07 O ++ATOM 7711 N LYS e 64 22.658 9.208 52.867 1.00 45.04 N ++ATOM 7712 CA LYS e 64 23.324 7.921 52.992 1.00 45.04 C ++ATOM 7713 C LYS e 64 24.487 7.865 52.017 1.00 45.04 C ++ATOM 7714 O LYS e 64 24.323 8.207 50.846 1.00 45.04 O ++ATOM 7715 CB LYS e 64 22.358 6.766 52.716 1.00 45.04 C ++ATOM 7716 CG LYS e 64 22.944 5.398 52.978 1.00 45.04 C ++ATOM 7717 CD LYS e 64 23.167 5.188 54.468 1.00 45.04 C ++ATOM 7718 CE LYS e 64 23.707 3.800 54.758 1.00 45.04 C ++ATOM 7719 NZ LYS e 64 22.695 2.767 54.408 1.00 45.04 N ++ATOM 7720 N ASN e 65 25.656 7.449 52.498 1.00 46.08 N ++ATOM 7721 CA ASN e 65 26.800 7.280 51.613 1.00 46.08 C ++ATOM 7722 C ASN e 65 26.553 6.132 50.645 1.00 46.08 C ++ATOM 7723 O ASN e 65 26.052 5.073 51.026 1.00 46.08 O ++ATOM 7724 CB ASN e 65 28.071 7.012 52.412 1.00 46.08 C ++ATOM 7725 CG ASN e 65 28.566 8.233 53.143 1.00 46.08 C ++ATOM 7726 OD1 ASN e 65 28.599 9.330 52.592 1.00 46.08 O ++ATOM 7727 ND2 ASN e 65 28.950 8.054 54.398 1.00 46.08 N ++ATOM 7728 N ILE e 66 26.899 6.348 49.376 1.00 53.71 N ++ATOM 7729 CA ILE e 66 26.647 5.349 48.348 1.00 53.71 C ++ATOM 7730 C ILE e 66 27.932 5.135 47.556 1.00 53.71 C ++ATOM 7731 O ILE e 66 28.712 6.064 47.327 1.00 53.71 O ++ATOM 7732 CB ILE e 66 25.440 5.754 47.454 1.00 53.71 C ++ATOM 7733 CG1 ILE e 66 24.976 4.595 46.579 1.00 53.71 C ++ATOM 7734 CG2 ILE e 66 25.724 6.982 46.610 1.00 53.71 C ++ATOM 7735 CD1 ILE e 66 23.624 4.824 45.950 1.00 53.71 C ++ATOM 7736 N GLY e 67 28.192 3.878 47.216 1.00 66.00 N ++ATOM 7737 CA GLY e 67 29.403 3.520 46.506 1.00 66.00 C ++ATOM 7738 C GLY e 67 30.621 3.421 47.403 1.00 66.00 C ++ATOM 7739 O GLY e 67 30.862 4.302 48.235 1.00 66.00 O ++ATOM 7740 N GLY e 68 31.403 2.365 47.240 1.00 77.70 N ++ATOM 7741 CA GLY e 68 32.650 2.209 47.949 1.00 77.70 C ++ATOM 7742 C GLY e 68 32.696 1.146 49.031 1.00 77.70 C ++ATOM 7743 O GLY e 68 33.433 1.324 50.009 1.00 77.70 O ++ATOM 7744 N ASP e 69 31.945 0.056 48.891 1.00 85.49 N ++ATOM 7745 CA ASP e 69 31.945 -1.028 49.867 1.00 85.49 C ++ATOM 7746 C ASP e 69 32.584 -2.310 49.347 1.00 85.49 C ++ATOM 7747 O ASP e 69 32.638 -3.299 50.086 1.00 85.49 O ++ATOM 7748 CB ASP e 69 30.512 -1.316 50.335 1.00 85.49 C ++ATOM 7749 CG ASP e 69 29.566 -1.642 49.188 1.00 85.49 C ++ATOM 7750 OD1 ASP e 69 29.954 -1.502 48.010 1.00 85.49 O ++ATOM 7751 OD2 ASP e 69 28.424 -2.052 49.468 1.00 85.49 O ++ATOM 7752 N GLU e 70 33.029 -2.317 48.084 1.00 86.41 N ++ATOM 7753 CA GLU e 70 33.534 -3.475 47.337 1.00 86.41 C ++ATOM 7754 C GLU e 70 32.503 -4.602 47.222 1.00 86.41 C ++ATOM 7755 O GLU e 70 32.866 -5.762 47.009 1.00 86.41 O ++ATOM 7756 CB GLU e 70 34.853 -4.002 47.918 1.00 86.41 C ++ATOM 7757 CG GLU e 70 35.999 -2.997 47.846 1.00 86.41 C ++ATOM 7758 CD GLU e 70 36.424 -2.683 46.424 1.00 86.41 C ++ATOM 7759 OE1 GLU e 70 36.347 -3.585 45.562 1.00 86.41 O ++ATOM 7760 OE2 GLU e 70 36.835 -1.532 46.170 1.00 86.41 O ++ATOM 7761 N ASP e 71 31.222 -4.266 47.363 1.00 85.46 N ++ATOM 7762 CA ASP e 71 30.099 -5.109 46.972 1.00 85.46 C ++ATOM 7763 C ASP e 71 29.223 -4.265 46.060 1.00 85.46 C ++ATOM 7764 O ASP e 71 29.662 -3.191 45.630 1.00 85.46 O ++ATOM 7765 CB ASP e 71 29.303 -5.611 48.183 1.00 85.46 C ++ATOM 7766 CG ASP e 71 30.031 -6.693 48.964 1.00 85.46 C ++ATOM 7767 OD1 ASP e 71 30.853 -7.416 48.364 1.00 85.46 O ++ATOM 7768 OD2 ASP e 71 29.762 -6.833 50.176 1.00 85.46 O ++ATOM 7769 N ASP e 72 28.006 -4.742 45.763 1.00 73.27 N ++ATOM 7770 CA ASP e 72 26.981 -4.004 45.017 1.00 73.27 C ++ATOM 7771 C ASP e 72 27.488 -3.602 43.629 1.00 73.27 C ++ATOM 7772 O ASP e 72 27.834 -2.445 43.376 1.00 73.27 O ++ATOM 7773 CB ASP e 72 26.479 -2.782 45.799 1.00 73.27 C ++ATOM 7774 CG ASP e 72 25.623 -3.160 46.981 1.00 73.27 C ++ATOM 7775 OD1 ASP e 72 24.994 -4.234 46.934 1.00 73.27 O ++ATOM 7776 OD2 ASP e 72 25.565 -2.376 47.949 1.00 73.27 O ++ATOM 7777 N LYS e 73 27.617 -4.627 42.774 1.00 68.96 N ++ATOM 7778 CA LYS e 73 28.024 -4.449 41.379 1.00 68.96 C ++ATOM 7779 C LYS e 73 27.184 -3.407 40.638 1.00 68.96 C ++ATOM 7780 O LYS e 73 27.708 -2.681 39.784 1.00 68.96 O ++ATOM 7781 CB LYS e 73 27.944 -5.794 40.647 1.00 68.96 C ++ATOM 7782 CG LYS e 73 28.457 -5.751 39.212 1.00 68.96 C ++ATOM 7783 CD LYS e 73 28.306 -7.073 38.484 1.00 68.96 C ++ATOM 7784 CE LYS e 73 28.877 -6.968 37.075 1.00 68.96 C ++ATOM 7785 NZ LYS e 73 28.101 -6.009 36.235 1.00 68.96 N ++ATOM 7786 N ASN e 74 25.897 -3.290 40.981 1.00 55.91 N ++ATOM 7787 CA ASN e 74 25.025 -2.299 40.362 1.00 55.91 C ++ATOM 7788 C ASN e 74 25.428 -0.860 40.671 1.00 55.91 C ++ATOM 7789 O ASN e 74 25.098 0.039 39.892 1.00 55.91 O ++ATOM 7790 CB ASN e 74 23.588 -2.531 40.813 1.00 55.91 C ++ATOM 7791 CG ASN e 74 23.023 -3.820 40.289 1.00 55.91 C ++ATOM 7792 OD1 ASN e 74 23.249 -4.189 39.139 1.00 55.91 O ++ATOM 7793 ND2 ASN e 74 22.280 -4.521 41.131 1.00 55.91 N ++ATOM 7794 N ILE e 75 26.124 -0.613 41.775 1.00 54.38 N ++ATOM 7795 CA ILE e 75 26.529 0.734 42.162 1.00 54.38 C ++ATOM 7796 C ILE e 75 28.035 0.827 41.988 1.00 54.38 C ++ATOM 7797 O ILE e 75 28.793 0.299 42.809 1.00 54.38 O ++ATOM 7798 CB ILE e 75 26.143 1.055 43.608 1.00 54.38 C ++ATOM 7799 CG1 ILE e 75 24.671 0.730 43.868 1.00 54.38 C ++ATOM 7800 CG2 ILE e 75 26.448 2.500 43.904 1.00 54.38 C ++ATOM 7801 CD1 ILE e 75 23.701 1.470 43.003 1.00 54.38 C ++ATOM 7802 N GLY e 76 28.482 1.507 40.945 1.00 58.22 N ++ATOM 7803 CA GLY e 76 29.904 1.637 40.660 1.00 58.22 C ++ATOM 7804 C GLY e 76 30.374 3.062 40.865 1.00 58.22 C ++ATOM 7805 O GLY e 76 29.650 4.006 40.559 1.00 58.22 O ++ATOM 7806 N SER e 77 31.588 3.209 41.379 1.00 68.81 N ++ATOM 7807 CA SER e 77 32.169 4.520 41.618 1.00 68.81 C ++ATOM 7808 C SER e 77 33.471 4.640 40.840 1.00 68.81 C ++ATOM 7809 O SER e 77 34.261 3.693 40.783 1.00 68.81 O ++ATOM 7810 CB SER e 77 32.407 4.753 43.114 1.00 68.81 C ++ATOM 7811 OG SER e 77 32.957 6.034 43.352 1.00 68.81 O ++ATOM 7812 N ASP e 78 33.690 5.809 40.242 1.00 73.29 N ++ATOM 7813 CA ASP e 78 34.820 6.036 39.350 1.00 73.29 C ++ATOM 7814 C ASP e 78 35.592 7.266 39.807 1.00 73.29 C ++ATOM 7815 O ASP e 78 35.473 7.667 40.971 1.00 73.29 O ++ATOM 7816 CB ASP e 78 34.341 6.193 37.910 1.00 73.29 C ++ATOM 7817 CG ASP e 78 33.695 4.935 37.374 1.00 73.29 C ++ATOM 7818 OD1 ASP e 78 34.072 3.838 37.829 1.00 73.29 O ++ATOM 7819 OD2 ASP e 78 32.808 5.043 36.502 1.00 73.29 O ++ATOM 7820 N GLU e 79 36.446 7.804 38.926 1.00 74.51 N ++ATOM 7821 CA GLU e 79 37.149 9.057 39.206 1.00 74.51 C ++ATOM 7822 C GLU e 79 36.180 10.182 39.542 1.00 74.51 C ++ATOM 7823 O GLU e 79 36.249 10.767 40.628 1.00 74.51 O ++ATOM 7824 CB GLU e 79 38.026 9.453 38.017 1.00 74.51 C ++ATOM 7825 CG GLU e 79 39.266 8.596 37.836 1.00 74.51 C ++ATOM 7826 CD GLU e 79 40.139 9.074 36.694 1.00 74.51 C ++ATOM 7827 OE1 GLU e 79 39.690 9.952 35.927 1.00 74.51 O ++ATOM 7828 OE2 GLU e 79 41.284 8.590 36.576 1.00 74.51 O ++ATOM 7829 N ASP e 80 35.263 10.496 38.633 1.00 66.15 N ++ATOM 7830 CA ASP e 80 34.177 11.399 38.982 1.00 66.15 C ++ATOM 7831 C ASP e 80 32.855 10.937 38.389 1.00 66.15 C ++ATOM 7832 O ASP e 80 32.003 11.762 38.046 1.00 66.15 O ++ATOM 7833 CB ASP e 80 34.478 12.840 38.560 1.00 66.15 C ++ATOM 7834 CG ASP e 80 34.768 12.979 37.079 1.00 66.15 C ++ATOM 7835 OD1 ASP e 80 34.915 11.953 36.384 1.00 66.15 O ++ATOM 7836 OD2 ASP e 80 34.832 14.132 36.606 1.00 66.15 O ++ATOM 7837 N HIS e 81 32.669 9.633 38.249 1.00 58.85 N ++ATOM 7838 CA HIS e 81 31.434 9.089 37.714 1.00 58.85 C ++ATOM 7839 C HIS e 81 30.780 8.204 38.759 1.00 58.85 C ++ATOM 7840 O HIS e 81 31.462 7.544 39.547 1.00 58.85 O ++ATOM 7841 CB HIS e 81 31.674 8.276 36.441 1.00 58.85 C ++ATOM 7842 CG HIS e 81 32.241 9.071 35.308 1.00 58.85 C ++ATOM 7843 ND1 HIS e 81 31.480 9.929 34.545 1.00 58.85 N ++ATOM 7844 CD2 HIS e 81 33.495 9.131 34.804 1.00 58.85 C ++ATOM 7845 CE1 HIS e 81 32.242 10.484 33.620 1.00 58.85 C ++ATOM 7846 NE2 HIS e 81 33.470 10.018 33.756 1.00 58.85 N ++ATOM 7847 N LEU e 82 29.455 8.201 38.762 1.00 51.26 N ++ATOM 7848 CA LEU e 82 28.673 7.278 39.567 1.00 51.26 C ++ATOM 7849 C LEU e 82 27.763 6.509 38.629 1.00 51.26 C ++ATOM 7850 O LEU e 82 26.986 7.114 37.885 1.00 51.26 O ++ATOM 7851 CB LEU e 82 27.858 8.013 40.629 1.00 51.26 C ++ATOM 7852 CG LEU e 82 27.104 7.129 41.614 1.00 51.26 C ++ATOM 7853 CD1 LEU e 82 28.089 6.309 42.396 1.00 51.26 C ++ATOM 7854 CD2 LEU e 82 26.277 7.977 42.549 1.00 51.26 C ++ATOM 7855 N SER e 83 27.872 5.186 38.649 1.00 50.39 N ++ATOM 7856 CA SER e 83 27.173 4.312 37.714 1.00 50.39 C ++ATOM 7857 C SER e 83 26.111 3.557 38.493 1.00 50.39 C ++ATOM 7858 O SER e 83 26.414 2.575 39.178 1.00 50.39 O ++ATOM 7859 CB SER e 83 28.138 3.354 37.030 1.00 50.39 C ++ATOM 7860 OG SER e 83 29.071 4.055 36.233 1.00 50.39 O ++ATOM 7861 N LEU e 84 24.882 4.041 38.411 1.00 42.97 N ++ATOM 7862 CA LEU e 84 23.732 3.375 38.997 1.00 42.97 C ++ATOM 7863 C LEU e 84 23.203 2.429 37.933 1.00 42.97 C ++ATOM 7864 O LEU e 84 22.541 2.856 36.984 1.00 42.97 O ++ATOM 7865 CB LEU e 84 22.682 4.398 39.408 1.00 42.97 C ++ATOM 7866 CG LEU e 84 23.125 5.496 40.370 1.00 42.97 C ++ATOM 7867 CD1 LEU e 84 22.019 6.514 40.537 1.00 42.97 C ++ATOM 7868 CD2 LEU e 84 23.527 4.935 41.703 1.00 42.97 C ++ATOM 7869 N LYS e 85 23.538 1.151 38.051 1.00 48.29 N ++ATOM 7870 CA LYS e 85 23.016 0.145 37.141 1.00 48.29 C ++ATOM 7871 C LYS e 85 21.706 -0.385 37.692 1.00 48.29 C ++ATOM 7872 O LYS e 85 21.556 -0.526 38.909 1.00 48.29 O ++ATOM 7873 CB LYS e 85 23.999 -1.008 36.953 1.00 48.29 C ++ATOM 7874 CG LYS e 85 25.255 -0.667 36.187 1.00 48.29 C ++ATOM 7875 CD LYS e 85 26.090 -1.915 35.995 1.00 48.29 C ++ATOM 7876 CE LYS e 85 27.359 -1.631 35.225 1.00 48.29 C ++ATOM 7877 NZ LYS e 85 28.150 -2.878 35.043 1.00 48.29 N ++ATOM 7878 N GLU e 86 20.784 -0.697 36.779 1.00 44.81 N ++ATOM 7879 CA GLU e 86 19.404 -1.080 37.081 1.00 44.81 C ++ATOM 7880 C GLU e 86 18.747 -0.046 37.991 1.00 44.81 C ++ATOM 7881 O GLU e 86 18.270 -0.353 39.084 1.00 44.81 O ++ATOM 7882 CB GLU e 86 19.330 -2.480 37.694 1.00 44.81 C ++ATOM 7883 CG GLU e 86 19.738 -3.592 36.763 1.00 44.81 C ++ATOM 7884 CD GLU e 86 19.721 -4.939 37.448 1.00 44.81 C ++ATOM 7885 OE1 GLU e 86 19.526 -4.971 38.680 1.00 44.81 O ++ATOM 7886 OE2 GLU e 86 19.901 -5.965 36.759 1.00 44.81 O ++ATOM 7887 N PHE e 87 18.800 1.203 37.532 1.00 35.10 N ++ATOM 7888 CA PHE e 87 18.193 2.325 38.233 1.00 35.10 C ++ATOM 7889 C PHE e 87 16.698 2.092 38.379 1.00 35.10 C ++ATOM 7890 O PHE e 87 16.062 1.480 37.524 1.00 35.10 O ++ATOM 7891 CB PHE e 87 18.469 3.608 37.459 1.00 35.10 C ++ATOM 7892 CG PHE e 87 18.041 4.857 38.155 1.00 35.10 C ++ATOM 7893 CD1 PHE e 87 18.787 5.369 39.192 1.00 35.10 C ++ATOM 7894 CD2 PHE e 87 16.923 5.551 37.739 1.00 35.10 C ++ATOM 7895 CE1 PHE e 87 18.407 6.531 39.816 1.00 35.10 C ++ATOM 7896 CE2 PHE e 87 16.536 6.706 38.358 1.00 35.10 C ++ATOM 7897 CZ PHE e 87 17.280 7.198 39.399 1.00 35.10 C ++ATOM 7898 N SER e 88 16.143 2.525 39.503 1.00 36.21 N ++ATOM 7899 CA SER e 88 14.742 2.263 39.789 1.00 36.21 C ++ATOM 7900 C SER e 88 14.064 3.568 40.153 1.00 36.21 C ++ATOM 7901 O SER e 88 14.523 4.270 41.060 1.00 36.21 O ++ATOM 7902 CB SER e 88 14.586 1.242 40.919 1.00 36.21 C ++ATOM 7903 OG SER e 88 13.222 0.944 41.154 1.00 36.21 O ++ATOM 7904 N GLU e 89 12.977 3.873 39.433 1.00 33.30 N ++ATOM 7905 CA GLU e 89 12.262 5.139 39.577 1.00 33.30 C ++ATOM 7906 C GLU e 89 11.750 5.349 40.993 1.00 33.30 C ++ATOM 7907 O GLU e 89 11.779 6.470 41.514 1.00 33.30 O ++ATOM 7908 CB GLU e 89 11.098 5.174 38.591 1.00 33.30 C ++ATOM 7909 CG GLU e 89 10.211 6.390 38.690 1.00 33.30 C ++ATOM 7910 CD GLU e 89 9.072 6.356 37.694 1.00 33.30 C ++ATOM 7911 OE1 GLU e 89 9.010 5.402 36.893 1.00 33.30 O ++ATOM 7912 OE2 GLU e 89 8.221 7.269 37.727 1.00 33.30 O ++ATOM 7913 N LEU e 90 11.321 4.278 41.645 1.00 37.51 N ++ATOM 7914 CA LEU e 90 10.680 4.386 42.941 1.00 37.51 C ++ATOM 7915 C LEU e 90 11.661 4.337 44.103 1.00 37.51 C ++ATOM 7916 O LEU e 90 11.342 4.837 45.185 1.00 37.51 O ++ATOM 7917 CB LEU e 90 9.633 3.277 43.069 1.00 37.51 C ++ATOM 7918 CG LEU e 90 8.608 3.304 44.190 1.00 37.51 C ++ATOM 7919 CD1 LEU e 90 7.318 2.802 43.618 1.00 37.51 C ++ATOM 7920 CD2 LEU e 90 9.026 2.423 45.358 1.00 37.51 C ++ATOM 7921 N GLU e 91 12.853 3.781 43.909 1.00 43.45 N ++ATOM 7922 CA GLU e 91 13.754 3.553 45.024 1.00 43.45 C ++ATOM 7923 C GLU e 91 15.084 4.274 44.941 1.00 43.45 C ++ATOM 7924 O GLU e 91 15.774 4.349 45.961 1.00 43.45 O ++ATOM 7925 CB GLU e 91 14.026 2.054 45.188 1.00 43.45 C ++ATOM 7926 CG GLU e 91 12.826 1.289 45.677 1.00 43.45 C ++ATOM 7927 CD GLU e 91 13.081 -0.191 45.749 1.00 43.45 C ++ATOM 7928 OE1 GLU e 91 14.135 -0.632 45.253 1.00 43.45 O ++ATOM 7929 OE2 GLU e 91 12.234 -0.914 46.309 1.00 43.45 O ++ATOM 7930 N GLN e 92 15.434 4.793 43.769 1.00 36.72 N ++ATOM 7931 CA GLN e 92 16.707 5.484 43.599 1.00 36.72 C ++ATOM 7932 C GLN e 92 16.581 6.977 43.302 1.00 36.72 C ++ATOM 7933 O GLN e 92 17.586 7.655 43.109 1.00 36.72 O ++ATOM 7934 CB GLN e 92 17.540 4.804 42.514 1.00 36.72 C ++ATOM 7935 CG GLN e 92 18.891 4.311 42.997 1.00 36.72 C ++ATOM 7936 CD GLN e 92 19.058 2.821 42.810 1.00 36.72 C ++ATOM 7937 OE1 GLN e 92 18.088 2.104 42.580 1.00 36.72 O ++ATOM 7938 NE2 GLN e 92 20.292 2.346 42.907 1.00 36.72 N ++ATOM 7939 N SER e 93 15.356 7.487 43.253 1.00 27.50 N ++ATOM 7940 CA SER e 93 15.151 8.899 43.007 1.00 27.50 C ++ATOM 7941 C SER e 93 15.516 9.693 44.257 1.00 27.50 C ++ATOM 7942 O SER e 93 15.655 9.142 45.350 1.00 27.50 O ++ATOM 7943 CB SER e 93 13.703 9.146 42.620 1.00 27.50 C ++ATOM 7944 OG SER e 93 13.385 8.398 41.470 1.00 27.50 O ++ATOM 7945 N GLY e 94 15.682 11.008 44.103 1.00 22.38 N ++ATOM 7946 CA GLY e 94 15.898 11.886 45.238 1.00 22.38 C ++ATOM 7947 C GLY e 94 17.139 12.751 45.060 1.00 22.38 C ++ATOM 7948 O GLY e 94 17.483 13.142 43.946 1.00 22.38 O ++ATOM 7949 N TYR e 95 17.803 13.035 46.180 1.00 25.25 N ++ATOM 7950 CA TYR e 95 18.829 14.066 46.260 1.00 25.25 C ++ATOM 7951 C TYR e 95 20.213 13.439 46.263 1.00 25.25 C ++ATOM 7952 O TYR e 95 20.625 12.851 47.264 1.00 25.25 O ++ATOM 7953 CB TYR e 95 18.660 14.896 47.527 1.00 25.25 C ++ATOM 7954 CG TYR e 95 17.390 15.692 47.618 1.00 25.25 C ++ATOM 7955 CD1 TYR e 95 17.303 16.966 47.088 1.00 25.25 C ++ATOM 7956 CD2 TYR e 95 16.276 15.164 48.244 1.00 25.25 C ++ATOM 7957 CE1 TYR e 95 16.151 17.686 47.180 1.00 25.25 C ++ATOM 7958 CE2 TYR e 95 15.118 15.879 48.341 1.00 25.25 C ++ATOM 7959 CZ TYR e 95 15.060 17.136 47.808 1.00 25.25 C ++ATOM 7960 OH TYR e 95 13.890 17.845 47.905 1.00 25.25 O ++ATOM 7961 N TYR e 96 20.941 13.603 45.169 1.00 28.84 N ++ATOM 7962 CA TYR e 96 22.323 13.163 45.065 1.00 28.84 C ++ATOM 7963 C TYR e 96 23.254 14.344 45.292 1.00 28.84 C ++ATOM 7964 O TYR e 96 22.917 15.479 44.949 1.00 28.84 O ++ATOM 7965 CB TYR e 96 22.593 12.540 43.698 1.00 28.84 C ++ATOM 7966 CG TYR e 96 21.870 11.240 43.484 1.00 28.84 C ++ATOM 7967 CD1 TYR e 96 22.405 10.045 43.924 1.00 28.84 C ++ATOM 7968 CD2 TYR e 96 20.641 11.215 42.864 1.00 28.84 C ++ATOM 7969 CE1 TYR e 96 21.742 8.862 43.731 1.00 28.84 C ++ATOM 7970 CE2 TYR e 96 19.969 10.040 42.673 1.00 28.84 C ++ATOM 7971 CZ TYR e 96 20.524 8.869 43.108 1.00 28.84 C ++ATOM 7972 OH TYR e 96 19.851 7.690 42.922 1.00 28.84 O ++ATOM 7973 N VAL e 97 24.418 14.079 45.880 1.00 33.31 N ++ATOM 7974 CA VAL e 97 25.397 15.125 46.164 1.00 33.31 C ++ATOM 7975 C VAL e 97 26.808 14.553 46.145 1.00 33.31 C ++ATOM 7976 O VAL e 97 27.078 13.513 46.751 1.00 33.31 O ++ATOM 7977 CB VAL e 97 25.087 15.834 47.498 1.00 33.31 C ++ATOM 7978 CG1 VAL e 97 24.768 14.852 48.571 1.00 33.31 C ++ATOM 7979 CG2 VAL e 97 26.254 16.683 47.954 1.00 33.31 C ++ATOM 7980 N CYS e 98 27.698 15.215 45.409 1.00 46.91 N ++ATOM 7981 CA CYS e 98 29.125 14.941 45.463 1.00 46.91 C ++ATOM 7982 C CYS e 98 29.789 15.842 46.493 1.00 46.91 C ++ATOM 7983 O CYS e 98 29.378 16.986 46.690 1.00 46.91 O ++ATOM 7984 CB CYS e 98 29.756 15.167 44.090 1.00 46.91 C ++ATOM 7985 SG CYS e 98 29.504 16.845 43.478 1.00 46.91 S ++ATOM 7986 N TYR e 99 30.813 15.314 47.163 1.00 56.47 N ++ATOM 7987 CA TYR e 99 31.603 16.119 48.086 1.00 56.47 C ++ATOM 7988 C TYR e 99 32.986 15.504 48.224 1.00 56.47 C ++ATOM 7989 O TYR e 99 33.106 14.273 48.213 1.00 56.47 O ++ATOM 7990 CB TYR e 99 30.941 16.252 49.465 1.00 56.47 C ++ATOM 7991 CG TYR e 99 30.708 14.960 50.212 1.00 56.47 C ++ATOM 7992 CD1 TYR e 99 29.547 14.231 50.017 1.00 56.47 C ++ATOM 7993 CD2 TYR e 99 31.621 14.494 51.151 1.00 56.47 C ++ATOM 7994 CE1 TYR e 99 29.313 13.057 50.705 1.00 56.47 C ++ATOM 7995 CE2 TYR e 99 31.398 13.316 51.843 1.00 56.47 C ++ATOM 7996 CZ TYR e 99 30.240 12.606 51.617 1.00 56.47 C ++ATOM 7997 OH TYR e 99 30.005 11.437 52.302 1.00 56.47 O ++ATOM 7998 N PRO e 100 34.037 16.310 48.341 1.00 62.74 N ++ATOM 7999 CA PRO e 100 35.382 15.746 48.467 1.00 62.74 C ++ATOM 8000 C PRO e 100 35.639 15.235 49.874 1.00 62.74 C ++ATOM 8001 O PRO e 100 34.997 15.637 50.845 1.00 62.74 O ++ATOM 8002 CB PRO e 100 36.297 16.923 48.127 1.00 62.74 C ++ATOM 8003 CG PRO e 100 35.510 18.107 48.499 1.00 62.74 C ++ATOM 8004 CD PRO e 100 34.075 17.774 48.199 1.00 62.74 C ++ATOM 8005 N ARG e 101 36.599 14.312 49.958 1.00 71.03 N ++ATOM 8006 CA ARG e 101 37.042 13.771 51.235 1.00 71.03 C ++ATOM 8007 C ARG e 101 37.683 14.869 52.071 1.00 71.03 C ++ATOM 8008 O ARG e 101 38.561 15.596 51.596 1.00 71.03 O ++ATOM 8009 CB ARG e 101 38.036 12.634 51.004 1.00 71.03 C ++ATOM 8010 CG ARG e 101 38.682 12.083 52.263 1.00 71.03 C ++ATOM 8011 CD ARG e 101 37.763 11.194 53.083 1.00 71.03 C ++ATOM 8012 NE ARG e 101 37.534 9.902 52.439 1.00 71.03 N ++ATOM 8013 CZ ARG e 101 36.674 8.987 52.877 1.00 71.03 C ++ATOM 8014 NH1 ARG e 101 35.962 9.212 53.972 1.00 71.03 N ++ATOM 8015 NH2 ARG e 101 36.534 7.840 52.227 1.00 71.03 N ++ATOM 8016 N GLY e 102 37.239 14.993 53.316 1.00 68.55 N ++ATOM 8017 CA GLY e 102 37.683 16.082 54.162 1.00 68.55 C ++ATOM 8018 C GLY e 102 36.554 17.046 54.455 1.00 68.55 C ++ATOM 8019 O GLY e 102 36.441 17.565 55.569 1.00 68.55 O ++ATOM 8020 N SER e 103 35.715 17.295 53.458 1.00 68.15 N ++ATOM 8021 CA SER e 103 34.525 18.097 53.673 1.00 68.15 C ++ATOM 8022 C SER e 103 33.461 17.270 54.375 1.00 68.15 C ++ATOM 8023 O SER e 103 33.203 16.120 54.014 1.00 68.15 O ++ATOM 8024 CB SER e 103 33.976 18.624 52.348 1.00 68.15 C ++ATOM 8025 OG SER e 103 34.882 19.523 51.738 1.00 68.15 O ++ATOM 8026 N LYS e 104 32.861 17.859 55.403 1.00 70.29 N ++ATOM 8027 CA LYS e 104 31.717 17.231 56.035 1.00 70.29 C ++ATOM 8028 C LYS e 104 30.530 17.243 55.071 1.00 70.29 C ++ATOM 8029 O LYS e 104 30.375 18.174 54.276 1.00 70.29 O ++ATOM 8030 CB LYS e 104 31.373 17.933 57.348 1.00 70.29 C ++ATOM 8031 CG LYS e 104 31.047 19.408 57.229 1.00 70.29 C ++ATOM 8032 CD LYS e 104 30.658 19.997 58.568 1.00 70.29 C ++ATOM 8033 CE LYS e 104 31.855 20.095 59.494 1.00 70.29 C ++ATOM 8034 NZ LYS e 104 32.859 21.070 59.002 1.00 70.29 N ++ATOM 8035 N PRO e 105 29.710 16.190 55.081 1.00 67.41 N ++ATOM 8036 CA PRO e 105 28.723 16.030 54.003 1.00 67.41 C ++ATOM 8037 C PRO e 105 27.543 16.979 54.080 1.00 67.41 C ++ATOM 8038 O PRO e 105 26.901 17.214 53.051 1.00 67.41 O ++ATOM 8039 CB PRO e 105 28.276 14.573 54.159 1.00 67.41 C ++ATOM 8040 CG PRO e 105 29.390 13.910 54.889 1.00 67.41 C ++ATOM 8041 CD PRO e 105 29.892 14.943 55.839 1.00 67.41 C ++ATOM 8042 N GLU e 106 27.223 17.533 55.246 1.00 71.63 N ++ATOM 8043 CA GLU e 106 26.138 18.507 55.296 1.00 71.63 C ++ATOM 8044 C GLU e 106 26.604 19.933 55.027 1.00 71.63 C ++ATOM 8045 O GLU e 106 25.820 20.867 55.217 1.00 71.63 O ++ATOM 8046 CB GLU e 106 25.407 18.449 56.643 1.00 71.63 C ++ATOM 8047 CG GLU e 106 26.227 18.870 57.847 1.00 71.63 C ++ATOM 8048 CD GLU e 106 26.899 17.701 58.529 1.00 71.63 C ++ATOM 8049 OE1 GLU e 106 26.952 16.606 57.929 1.00 71.63 O ++ATOM 8050 OE2 GLU e 106 27.366 17.877 59.674 1.00 71.63 O ++ATOM 8051 N ASP e 107 27.846 20.125 54.587 1.00 69.62 N ++ATOM 8052 CA ASP e 107 28.310 21.452 54.219 1.00 69.62 C ++ATOM 8053 C ASP e 107 28.126 21.723 52.732 1.00 69.62 C ++ATOM 8054 O ASP e 107 28.179 22.884 52.312 1.00 69.62 O ++ATOM 8055 CB ASP e 107 29.782 21.608 54.601 1.00 69.62 C ++ATOM 8056 CG ASP e 107 30.208 23.059 54.751 1.00 69.62 C ++ATOM 8057 OD1 ASP e 107 29.357 23.963 54.629 1.00 69.62 O ++ATOM 8058 OD2 ASP e 107 31.410 23.295 54.999 1.00 69.62 O ++ATOM 8059 N ALA e 108 27.904 20.685 51.929 1.00 52.56 N ++ATOM 8060 CA ALA e 108 27.796 20.854 50.487 1.00 52.56 C ++ATOM 8061 C ALA e 108 26.475 21.514 50.106 1.00 52.56 C ++ATOM 8062 O ALA e 108 25.439 21.293 50.735 1.00 52.56 O ++ATOM 8063 CB ALA e 108 27.925 19.505 49.786 1.00 52.56 C ++ATOM 8064 N ASN e 109 26.520 22.333 49.057 1.00 40.93 N ++ATOM 8065 CA ASN e 109 25.378 23.156 48.685 1.00 40.93 C ++ATOM 8066 C ASN e 109 25.115 23.122 47.182 1.00 40.93 C ++ATOM 8067 O ASN e 109 24.924 24.165 46.549 1.00 40.93 O ++ATOM 8068 CB ASN e 109 25.560 24.589 49.181 1.00 40.93 C ++ATOM 8069 CG ASN e 109 26.869 25.211 48.734 1.00 40.93 C ++ATOM 8070 OD1 ASN e 109 27.637 24.617 47.983 1.00 40.93 O ++ATOM 8071 ND2 ASN e 109 27.128 26.421 49.203 1.00 40.93 N ++ATOM 8072 N PHE e 110 25.107 21.931 46.581 1.00 32.63 N ++ATOM 8073 CA PHE e 110 24.665 21.792 45.192 1.00 32.63 C ++ATOM 8074 C PHE e 110 24.099 20.385 45.046 1.00 32.63 C ++ATOM 8075 O PHE e 110 24.859 19.429 44.884 1.00 32.63 O ++ATOM 8076 CB PHE e 110 25.802 22.026 44.211 1.00 32.63 C ++ATOM 8077 CG PHE e 110 25.352 22.154 42.787 1.00 32.63 C ++ATOM 8078 CD1 PHE e 110 24.825 23.340 42.328 1.00 32.63 C ++ATOM 8079 CD2 PHE e 110 25.446 21.091 41.912 1.00 32.63 C ++ATOM 8080 CE1 PHE e 110 24.414 23.467 41.027 1.00 32.63 C ++ATOM 8081 CE2 PHE e 110 25.031 21.218 40.607 1.00 32.63 C ++ATOM 8082 CZ PHE e 110 24.514 22.409 40.172 1.00 32.63 C ++ATOM 8083 N TYR e 111 22.778 20.270 45.088 1.00 29.54 N ++ATOM 8084 CA TYR e 111 22.107 18.983 45.152 1.00 29.54 C ++ATOM 8085 C TYR e 111 21.357 18.703 43.857 1.00 29.54 C ++ATOM 8086 O TYR e 111 20.770 19.606 43.258 1.00 29.54 O ++ATOM 8087 CB TYR e 111 21.121 18.945 46.321 1.00 29.54 C ++ATOM 8088 CG TYR e 111 21.746 18.984 47.696 1.00 29.54 C ++ATOM 8089 CD1 TYR e 111 23.090 18.748 47.883 1.00 29.54 C ++ATOM 8090 CD2 TYR e 111 20.983 19.248 48.812 1.00 29.54 C ++ATOM 8091 CE1 TYR e 111 23.658 18.784 49.137 1.00 29.54 C ++ATOM 8092 CE2 TYR e 111 21.550 19.289 50.067 1.00 29.54 C ++ATOM 8093 CZ TYR e 111 22.883 19.046 50.222 1.00 29.54 C ++ATOM 8094 OH TYR e 111 23.455 19.082 51.471 1.00 29.54 O ++ATOM 8095 N LEU e 112 21.379 17.449 43.422 1.00 21.04 N ++ATOM 8096 CA LEU e 112 20.641 17.011 42.247 1.00 21.04 C ++ATOM 8097 C LEU e 112 19.371 16.322 42.691 1.00 21.04 C ++ATOM 8098 O LEU e 112 19.421 15.421 43.527 1.00 21.04 O ++ATOM 8099 CB LEU e 112 21.466 16.040 41.409 1.00 21.04 C ++ATOM 8100 CG LEU e 112 20.955 15.482 40.080 1.00 21.04 C ++ATOM 8101 CD1 LEU e 112 20.739 16.572 39.071 1.00 21.04 C ++ATOM 8102 CD2 LEU e 112 21.947 14.500 39.536 1.00 21.04 C ++ATOM 8103 N TYR e 113 18.246 16.722 42.129 1.00 17.74 N ++ATOM 8104 CA TYR e 113 17.005 15.995 42.333 1.00 17.74 C ++ATOM 8105 C TYR e 113 16.744 15.177 41.082 1.00 17.74 C ++ATOM 8106 O TYR e 113 16.369 15.722 40.043 1.00 17.74 O ++ATOM 8107 CB TYR e 113 15.841 16.922 42.639 1.00 17.74 C ++ATOM 8108 CG TYR e 113 14.616 16.151 43.047 1.00 17.74 C ++ATOM 8109 CD1 TYR e 113 14.543 15.553 44.290 1.00 17.74 C ++ATOM 8110 CD2 TYR e 113 13.538 16.014 42.198 1.00 17.74 C ++ATOM 8111 CE1 TYR e 113 13.432 14.844 44.677 1.00 17.74 C ++ATOM 8112 CE2 TYR e 113 12.420 15.307 42.581 1.00 17.74 C ++ATOM 8113 CZ TYR e 113 12.378 14.722 43.819 1.00 17.74 C ++ATOM 8114 OH TYR e 113 11.275 14.012 44.210 1.00 17.74 O ++ATOM 8115 N LEU e 114 16.955 13.872 41.184 1.00 19.48 N ++ATOM 8116 CA LEU e 114 16.884 12.961 40.054 1.00 19.48 C ++ATOM 8117 C LEU e 114 15.626 12.123 40.171 1.00 19.48 C ++ATOM 8118 O LEU e 114 15.334 11.583 41.240 1.00 19.48 O ++ATOM 8119 CB LEU e 114 18.114 12.059 40.008 1.00 19.48 C ++ATOM 8120 CG LEU e 114 18.191 11.056 38.873 1.00 19.48 C ++ATOM 8121 CD1 LEU e 114 18.183 11.781 37.565 1.00 19.48 C ++ATOM 8122 CD2 LEU e 114 19.449 10.245 39.015 1.00 19.48 C ++ATOM 8123 N ARG e 115 14.901 12.024 39.069 1.00 20.45 N ++ATOM 8124 CA ARG e 115 13.706 11.213 38.964 1.00 20.45 C ++ATOM 8125 C ARG e 115 13.762 10.817 37.513 1.00 20.45 C ++ATOM 8126 O ARG e 115 13.906 11.670 36.650 1.00 20.45 O ++ATOM 8127 CB ARG e 115 12.452 12.017 39.246 1.00 20.45 C ++ATOM 8128 CG ARG e 115 11.176 11.246 38.964 1.00 20.45 C ++ATOM 8129 CD ARG e 115 10.046 11.710 39.863 1.00 20.45 C ++ATOM 8130 NE ARG e 115 9.000 10.702 39.982 1.00 20.45 N ++ATOM 8131 CZ ARG e 115 8.825 9.939 41.054 1.00 20.45 C ++ATOM 8132 NH1 ARG e 115 7.847 9.046 41.079 1.00 20.45 N ++ATOM 8133 NH2 ARG e 115 9.629 10.067 42.099 1.00 20.45 N ++ATOM 8134 N ALA e 116 13.664 9.532 37.223 1.00 23.05 N ++ATOM 8135 CA ALA e 116 13.794 9.106 35.841 1.00 23.05 C ++ATOM 8136 C ALA e 116 13.144 7.747 35.660 1.00 23.05 C ++ATOM 8137 O ALA e 116 13.080 6.945 36.591 1.00 23.05 O ++ATOM 8138 CB ALA e 116 15.266 9.056 35.433 1.00 23.05 C ++ATOM 8139 N ARG e 117 12.658 7.491 34.449 1.00 29.55 N ++ATOM 8140 CA ARG e 117 12.090 6.201 34.098 1.00 29.55 C ++ATOM 8141 C ARG e 117 13.118 5.344 33.375 1.00 29.55 C ++ATOM 8142 O ARG e 117 14.009 5.846 32.686 1.00 29.55 O ++ATOM 8143 CB ARG e 117 10.847 6.338 33.231 1.00 29.55 C ++ATOM 8144 CG ARG e 117 9.693 6.958 33.942 1.00 29.55 C ++ATOM 8145 CD ARG e 117 8.437 6.875 33.108 1.00 29.55 C ++ATOM 8146 NE ARG e 117 7.368 7.680 33.682 1.00 29.55 N ++ATOM 8147 CZ ARG e 117 6.551 7.267 34.640 1.00 29.55 C ++ATOM 8148 NH1 ARG e 117 6.687 6.057 35.154 1.00 29.55 N ++ATOM 8149 NH2 ARG e 117 5.611 8.078 35.097 1.00 29.55 N ++ATOM 8150 N VAL e 118 12.993 4.036 33.569 1.00 43.69 N ++ATOM 8151 CA VAL e 118 14.042 3.070 33.270 1.00 43.69 C ++ATOM 8152 C VAL e 118 13.569 1.870 32.461 1.00 43.69 C ++ATOM 8153 O VAL e 118 13.961 0.738 32.765 1.00 43.69 O ++ATOM 8154 CB VAL e 118 14.700 2.602 34.569 1.00 43.69 C ++ATOM 8155 CG1 VAL e 118 15.632 3.659 35.054 1.00 43.69 C ++ATOM 8156 CG2 VAL e 118 13.612 2.347 35.599 1.00 43.69 C ++ATOM 8157 N CYS e 119 12.645 2.083 31.526 1.00 63.50 N ++ATOM 8158 CA CYS e 119 12.306 1.051 30.548 1.00 63.50 C ++ATOM 8159 C CYS e 119 13.553 0.519 29.847 1.00 63.50 C ++ATOM 8160 O CYS e 119 14.401 1.287 29.386 1.00 63.50 O ++ATOM 8161 CB CYS e 119 11.304 1.613 29.532 1.00 63.50 C ++ATOM 8162 SG CYS e 119 11.795 3.175 28.730 1.00 63.50 S ++ATOM 8163 N GLU e 120 13.691 -0.806 29.836 1.00 75.06 N ++ATOM 8164 CA GLU e 120 14.869 -1.472 29.295 1.00 75.06 C ++ATOM 8165 C GLU e 120 14.635 -1.814 27.831 1.00 75.06 C ++ATOM 8166 O GLU e 120 13.527 -2.211 27.456 1.00 75.06 O ++ATOM 8167 CB GLU e 120 15.175 -2.739 30.095 1.00 75.06 C ++ATOM 8168 CG GLU e 120 16.483 -3.423 29.734 1.00 75.06 C ++ATOM 8169 CD GLU e 120 16.771 -4.636 30.596 1.00 75.06 C ++ATOM 8170 OE1 GLU e 120 15.940 -4.969 31.468 1.00 75.06 O ++ATOM 8171 OE2 GLU e 120 17.834 -5.260 30.399 1.00 75.06 O ++ATOM 8172 N ASN e 121 15.693 -1.677 27.021 1.00 72.25 N ++ATOM 8173 CA ASN e 121 15.634 -1.697 25.555 1.00 72.25 C ++ATOM 8174 C ASN e 121 14.605 -0.684 25.060 1.00 72.25 C ++ATOM 8175 O ASN e 121 13.636 -1.010 24.376 1.00 72.25 O ++ATOM 8176 CB ASN e 121 15.340 -3.100 25.009 1.00 72.25 C ++ATOM 8177 CG ASN e 121 16.510 -4.044 25.160 1.00 72.25 C ++ATOM 8178 OD1 ASN e 121 17.658 -3.672 24.922 1.00 72.25 O ++ATOM 8179 ND2 ASN e 121 16.224 -5.281 25.548 1.00 72.25 N ++ATOM 8180 N CYS e 122 14.841 0.570 25.434 1.00 64.21 N ++ATOM 8181 CA CYS e 122 13.827 1.614 25.341 1.00 64.21 C ++ATOM 8182 C CYS e 122 14.544 2.955 25.315 1.00 64.21 C ++ATOM 8183 O CYS e 122 15.129 3.357 26.323 1.00 64.21 O ++ATOM 8184 CB CYS e 122 12.870 1.509 26.518 1.00 64.21 C ++ATOM 8185 SG CYS e 122 11.689 2.824 26.733 1.00 64.21 S ++ATOM 8186 N MET e 123 14.497 3.641 24.178 1.00 61.15 N ++ATOM 8187 CA MET e 123 15.350 4.794 23.940 1.00 61.15 C ++ATOM 8188 C MET e 123 14.535 6.055 23.688 1.00 61.15 C ++ATOM 8189 O MET e 123 13.375 6.006 23.274 1.00 61.15 O ++ATOM 8190 CB MET e 123 16.287 4.538 22.758 1.00 61.15 C ++ATOM 8191 CG MET e 123 15.584 4.375 21.430 1.00 61.15 C ++ATOM 8192 SD MET e 123 16.738 4.065 20.077 1.00 61.15 S ++ATOM 8193 CE MET e 123 17.517 5.670 19.904 1.00 61.15 C ++ATOM 8194 N GLU e 124 15.173 7.193 23.955 1.00 57.78 N ++ATOM 8195 CA GLU e 124 14.578 8.505 23.737 1.00 57.78 C ++ATOM 8196 C GLU e 124 14.511 8.773 22.240 1.00 57.78 C ++ATOM 8197 O GLU e 124 15.516 8.637 21.537 1.00 57.78 O ++ATOM 8198 CB GLU e 124 15.411 9.575 24.436 1.00 57.78 C ++ATOM 8199 CG GLU e 124 14.837 10.982 24.392 1.00 57.78 C ++ATOM 8200 CD GLU e 124 13.672 11.176 25.341 1.00 57.78 C ++ATOM 8201 OE1 GLU e 124 13.614 10.463 26.364 1.00 57.78 O ++ATOM 8202 OE2 GLU e 124 12.821 12.052 25.077 1.00 57.78 O ++ATOM 8203 N MET e 125 13.334 9.153 21.749 1.00 56.71 N ++ATOM 8204 CA MET e 125 13.104 9.299 20.310 1.00 56.71 C ++ATOM 8205 C MET e 125 12.032 10.367 20.100 1.00 56.71 C ++ATOM 8206 O MET e 125 10.838 10.066 20.119 1.00 56.71 O ++ATOM 8207 CB MET e 125 12.693 7.962 19.716 1.00 56.71 C ++ATOM 8208 CG MET e 125 12.551 7.937 18.220 1.00 56.71 C ++ATOM 8209 SD MET e 125 12.036 6.305 17.658 1.00 56.71 S ++ATOM 8210 CE MET e 125 13.527 5.362 17.950 1.00 56.71 C ++ATOM 8211 N ASP e 126 12.459 11.606 19.873 1.00 57.24 N ++ATOM 8212 CA ASP e 126 11.508 12.701 19.747 1.00 57.24 C ++ATOM 8213 C ASP e 126 10.866 12.706 18.359 1.00 57.24 C ++ATOM 8214 O ASP e 126 11.171 11.876 17.501 1.00 57.24 O ++ATOM 8215 CB ASP e 126 12.182 14.029 20.080 1.00 57.24 C ++ATOM 8216 CG ASP e 126 13.441 14.263 19.281 1.00 57.24 C ++ATOM 8217 OD1 ASP e 126 13.863 13.354 18.538 1.00 57.24 O ++ATOM 8218 OD2 ASP e 126 14.016 15.365 19.399 1.00 57.24 O ++ATOM 8219 N VAL e 127 9.963 13.660 18.130 1.00 49.56 N ++ATOM 8220 CA VAL e 127 9.084 13.581 16.968 1.00 49.56 C ++ATOM 8221 C VAL e 127 9.796 14.037 15.702 1.00 49.56 C ++ATOM 8222 O VAL e 127 9.599 13.461 14.622 1.00 49.56 O ++ATOM 8223 CB VAL e 127 7.810 14.397 17.231 1.00 49.56 C ++ATOM 8224 CG1 VAL e 127 6.821 14.263 16.088 1.00 49.56 C ++ATOM 8225 CG2 VAL e 127 7.190 13.957 18.517 1.00 49.56 C ++ATOM 8226 N MET e 128 10.643 15.065 15.813 1.00 55.05 N ++ATOM 8227 CA MET e 128 11.317 15.607 14.639 1.00 55.05 C ++ATOM 8228 C MET e 128 12.311 14.611 14.058 1.00 55.05 C ++ATOM 8229 O MET e 128 12.486 14.556 12.835 1.00 55.05 O ++ATOM 8230 CB MET e 128 12.015 16.913 15.003 1.00 55.05 C ++ATOM 8231 CG MET e 128 12.488 17.712 13.814 1.00 55.05 C ++ATOM 8232 SD MET e 128 11.101 18.242 12.794 1.00 55.05 S ++ATOM 8233 CE MET e 128 10.354 19.481 13.846 1.00 55.05 C ++ATOM 8234 N SER e 129 12.914 13.774 14.904 1.00 48.49 N ++ATOM 8235 CA SER e 129 13.791 12.724 14.402 1.00 48.49 C ++ATOM 8236 C SER e 129 13.011 11.669 13.627 1.00 48.49 C ++ATOM 8237 O SER e 129 13.496 11.164 12.613 1.00 48.49 O ++ATOM 8238 CB SER e 129 14.558 12.081 15.551 1.00 48.49 C ++ATOM 8239 OG SER e 129 13.682 11.369 16.399 1.00 48.49 O ++ATOM 8240 N VAL e 130 11.792 11.350 14.067 1.00 45.59 N ++ATOM 8241 CA VAL e 130 10.978 10.373 13.348 1.00 45.59 C ++ATOM 8242 C VAL e 130 10.501 10.950 12.020 1.00 45.59 C ++ATOM 8243 O VAL e 130 10.448 10.244 10.998 1.00 45.59 O ++ATOM 8244 CB VAL e 130 9.814 9.911 14.244 1.00 45.59 C ++ATOM 8245 CG1 VAL e 130 8.829 9.036 13.495 1.00 45.59 C ++ATOM 8246 CG2 VAL e 130 10.361 9.142 15.416 1.00 45.59 C ++ATOM 8247 N ALA e 131 10.211 12.254 11.997 1.00 44.91 N ++ATOM 8248 CA ALA e 131 9.869 12.924 10.743 1.00 44.91 C ++ATOM 8249 C ALA e 131 11.036 12.902 9.761 1.00 44.91 C ++ATOM 8250 O ALA e 131 10.847 12.632 8.565 1.00 44.91 O ++ATOM 8251 CB ALA e 131 9.431 14.358 11.024 1.00 44.91 C ++ATOM 8252 N THR e 132 12.254 13.148 10.252 1.00 45.42 N ++ATOM 8253 CA THR e 132 13.416 13.071 9.375 1.00 45.42 C ++ATOM 8254 C THR e 132 13.713 11.644 8.934 1.00 45.42 C ++ATOM 8255 O THR e 132 14.181 11.452 7.814 1.00 45.42 O ++ATOM 8256 CB THR e 132 14.649 13.676 10.037 1.00 45.42 C ++ATOM 8257 OG1 THR e 132 14.917 13.000 11.269 1.00 45.42 O ++ATOM 8258 CG2 THR e 132 14.454 15.160 10.283 1.00 45.42 C ++ATOM 8259 N ILE e 133 13.433 10.638 9.769 1.00 46.06 N ++ATOM 8260 CA ILE e 133 13.623 9.247 9.349 1.00 46.06 C ++ATOM 8261 C ILE e 133 12.671 8.887 8.212 1.00 46.06 C ++ATOM 8262 O ILE e 133 13.082 8.270 7.219 1.00 46.06 O ++ATOM 8263 CB ILE e 133 13.479 8.289 10.547 1.00 46.06 C ++ATOM 8264 CG1 ILE e 133 14.709 8.376 11.447 1.00 46.06 C ++ATOM 8265 CG2 ILE e 133 13.277 6.854 10.106 1.00 46.06 C ++ATOM 8266 CD1 ILE e 133 14.573 7.616 12.746 1.00 46.06 C ++ATOM 8267 N VAL e 134 11.409 9.317 8.306 1.00 48.52 N ++ATOM 8268 CA VAL e 134 10.453 9.027 7.236 1.00 48.52 C ++ATOM 8269 C VAL e 134 10.824 9.767 5.948 1.00 48.52 C ++ATOM 8270 O VAL e 134 10.798 9.181 4.854 1.00 48.52 O ++ATOM 8271 CB VAL e 134 9.024 9.353 7.699 1.00 48.52 C ++ATOM 8272 CG1 VAL e 134 8.034 9.170 6.569 1.00 48.52 C ++ATOM 8273 CG2 VAL e 134 8.646 8.460 8.852 1.00 48.52 C ++ATOM 8274 N ILE e 135 11.231 11.037 6.054 1.00 49.24 N ++ATOM 8275 CA ILE e 135 11.602 11.788 4.854 1.00 49.24 C ++ATOM 8276 C ILE e 135 12.897 11.256 4.229 1.00 49.24 C ++ATOM 8277 O ILE e 135 13.012 11.189 2.998 1.00 49.24 O ++ATOM 8278 CB ILE e 135 11.669 13.293 5.188 1.00 49.24 C ++ATOM 8279 CG1 ILE e 135 10.266 13.822 5.477 1.00 49.24 C ++ATOM 8280 CG2 ILE e 135 12.277 14.115 4.066 1.00 49.24 C ++ATOM 8281 CD1 ILE e 135 10.244 15.250 5.963 1.00 49.24 C ++ATOM 8282 N VAL e 136 13.857 10.809 5.045 1.00 50.34 N ++ATOM 8283 CA VAL e 136 15.082 10.209 4.517 1.00 50.34 C ++ATOM 8284 C VAL e 136 14.782 8.872 3.842 1.00 50.34 C ++ATOM 8285 O VAL e 136 15.375 8.543 2.806 1.00 50.34 O ++ATOM 8286 CB VAL e 136 16.132 10.094 5.642 1.00 50.34 C ++ATOM 8287 CG1 VAL e 136 17.250 9.130 5.302 1.00 50.34 C ++ATOM 8288 CG2 VAL e 136 16.766 11.453 5.884 1.00 50.34 C ++ATOM 8289 N ASP e 137 13.813 8.116 4.370 1.00 54.29 N ++ATOM 8290 CA ASP e 137 13.385 6.888 3.702 1.00 54.29 C ++ATOM 8291 C ASP e 137 12.761 7.187 2.339 1.00 54.29 C ++ATOM 8292 O ASP e 137 13.039 6.483 1.359 1.00 54.29 O ++ATOM 8293 CB ASP e 137 12.399 6.134 4.592 1.00 54.29 C ++ATOM 8294 CG ASP e 137 12.210 4.686 4.177 1.00 54.29 C ++ATOM 8295 OD1 ASP e 137 12.840 4.235 3.200 1.00 54.29 O ++ATOM 8296 OD2 ASP e 137 11.427 3.986 4.848 1.00 54.29 O ++ATOM 8297 N ILE e 138 11.957 8.251 2.256 1.00 58.91 N ++ATOM 8298 CA ILE e 138 11.370 8.663 0.976 1.00 58.91 C ++ATOM 8299 C ILE e 138 12.453 9.094 -0.007 1.00 58.91 C ++ATOM 8300 O ILE e 138 12.402 8.760 -1.196 1.00 58.91 O ++ATOM 8301 CB ILE e 138 10.346 9.786 1.197 1.00 58.91 C ++ATOM 8302 CG1 ILE e 138 9.192 9.278 2.030 1.00 58.91 C ++ATOM 8303 CG2 ILE e 138 9.794 10.314 -0.118 1.00 58.91 C ++ATOM 8304 CD1 ILE e 138 8.439 10.393 2.591 1.00 58.91 C ++ATOM 8305 N CYS e 139 13.448 9.842 0.479 1.00 66.29 N ++ATOM 8306 CA CYS e 139 14.531 10.307 -0.385 1.00 66.29 C ++ATOM 8307 C CYS e 139 15.376 9.150 -0.897 1.00 66.29 C ++ATOM 8308 O CYS e 139 15.797 9.157 -2.058 1.00 66.29 O ++ATOM 8309 CB CYS e 139 15.407 11.319 0.352 1.00 66.29 C ++ATOM 8310 SG CYS e 139 14.609 12.910 0.685 1.00 66.29 S ++ATOM 8311 N ILE e 140 15.599 8.129 -0.065 1.00 63.99 N ++ATOM 8312 CA ILE e 140 16.361 6.964 -0.507 1.00 63.99 C ++ATOM 8313 C ILE e 140 15.569 6.157 -1.533 1.00 63.99 C ++ATOM 8314 O ILE e 140 16.130 5.710 -2.546 1.00 63.99 O ++ATOM 8315 CB ILE e 140 16.788 6.114 0.705 1.00 63.99 C ++ATOM 8316 CG1 ILE e 140 17.852 6.859 1.513 1.00 63.99 C ++ATOM 8317 CG2 ILE e 140 17.324 4.756 0.285 1.00 63.99 C ++ATOM 8318 CD1 ILE e 140 18.170 6.224 2.853 1.00 63.99 C ++ATOM 8319 N THR e 141 14.251 6.006 -1.326 1.00 64.03 N ++ATOM 8320 CA THR e 141 13.431 5.310 -2.321 1.00 64.03 C ++ATOM 8321 C THR e 141 13.375 6.064 -3.641 1.00 64.03 C ++ATOM 8322 O THR e 141 13.542 5.457 -4.705 1.00 64.03 O ++ATOM 8323 CB THR e 141 12.015 5.087 -1.810 1.00 64.03 C ++ATOM 8324 OG1 THR e 141 11.440 6.344 -1.434 1.00 64.03 O ++ATOM 8325 CG2 THR e 141 12.014 4.128 -0.650 1.00 64.03 C ++ATOM 8326 N GLY e 142 13.163 7.381 -3.593 1.00 65.21 N ++ATOM 8327 CA GLY e 142 13.130 8.168 -4.817 1.00 65.21 C ++ATOM 8328 C GLY e 142 14.462 8.194 -5.542 1.00 65.21 C ++ATOM 8329 O GLY e 142 14.505 8.117 -6.772 1.00 65.21 O ++ATOM 8330 N GLY e 143 15.565 8.245 -4.788 1.00 63.85 N ++ATOM 8331 CA GLY e 143 16.879 8.219 -5.405 1.00 63.85 C ++ATOM 8332 C GLY e 143 17.195 6.892 -6.063 1.00 63.85 C ++ATOM 8333 O GLY e 143 17.684 6.859 -7.196 1.00 63.85 O ++ATOM 8334 N LEU e 144 16.897 5.779 -5.381 1.00 65.18 N ++ATOM 8335 CA LEU e 144 17.140 4.473 -5.985 1.00 65.18 C ++ATOM 8336 C LEU e 144 16.229 4.219 -7.177 1.00 65.18 C ++ATOM 8337 O LEU e 144 16.668 3.626 -8.172 1.00 65.18 O ++ATOM 8338 CB LEU e 144 16.981 3.359 -4.952 1.00 65.18 C ++ATOM 8339 CG LEU e 144 18.078 3.263 -3.890 1.00 65.18 C ++ATOM 8340 CD1 LEU e 144 17.763 2.166 -2.886 1.00 65.18 C ++ATOM 8341 CD2 LEU e 144 19.431 3.025 -4.539 1.00 65.18 C ++ATOM 8342 N LEU e 145 14.987 4.705 -7.135 1.00 64.08 N ++ATOM 8343 CA LEU e 145 14.117 4.486 -8.282 1.00 64.08 C ++ATOM 8344 C LEU e 145 14.511 5.367 -9.460 1.00 64.08 C ++ATOM 8345 O LEU e 145 14.409 4.930 -10.607 1.00 64.08 O ++ATOM 8346 CB LEU e 145 12.654 4.693 -7.911 1.00 64.08 C ++ATOM 8347 CG LEU e 145 12.122 3.614 -6.968 1.00 64.08 C ++ATOM 8348 CD1 LEU e 145 10.638 3.817 -6.704 1.00 64.08 C ++ATOM 8349 CD2 LEU e 145 12.431 2.208 -7.460 1.00 64.08 C ++ATOM 8350 N LEU e 146 15.007 6.586 -9.209 1.00 67.20 N ++ATOM 8351 CA LEU e 146 15.532 7.381 -10.318 1.00 67.20 C ++ATOM 8352 C LEU e 146 16.820 6.791 -10.881 1.00 67.20 C ++ATOM 8353 O LEU e 146 17.081 6.928 -12.083 1.00 67.20 O ++ATOM 8354 CB LEU e 146 15.764 8.830 -9.896 1.00 67.20 C ++ATOM 8355 CG LEU e 146 14.525 9.703 -9.693 1.00 67.20 C ++ATOM 8356 CD1 LEU e 146 14.927 11.073 -9.171 1.00 67.20 C ++ATOM 8357 CD2 LEU e 146 13.739 9.832 -10.984 1.00 67.20 C ++ATOM 8358 N LEU e 147 17.624 6.131 -10.039 1.00 67.85 N ++ATOM 8359 CA LEU e 147 18.755 5.363 -10.553 1.00 67.85 C ++ATOM 8360 C LEU e 147 18.287 4.248 -11.478 1.00 67.85 C ++ATOM 8361 O LEU e 147 18.875 4.032 -12.542 1.00 67.85 O ++ATOM 8362 CB LEU e 147 19.584 4.783 -9.408 1.00 67.85 C ++ATOM 8363 CG LEU e 147 20.442 5.748 -8.591 1.00 67.85 C ++ATOM 8364 CD1 LEU e 147 21.086 5.022 -7.420 1.00 67.85 C ++ATOM 8365 CD2 LEU e 147 21.494 6.403 -9.469 1.00 67.85 C ++ATOM 8366 N VAL e 148 17.209 3.554 -11.104 1.00 68.16 N ++ATOM 8367 CA VAL e 148 16.677 2.503 -11.970 1.00 68.16 C ++ATOM 8368 C VAL e 148 16.090 3.100 -13.251 1.00 68.16 C ++ATOM 8369 O VAL e 148 16.255 2.530 -14.340 1.00 68.16 O ++ATOM 8370 CB VAL e 148 15.660 1.643 -11.196 1.00 68.16 C ++ATOM 8371 CG1 VAL e 148 15.014 0.596 -12.088 1.00 68.16 C ++ATOM 8372 CG2 VAL e 148 16.355 0.945 -10.045 1.00 68.16 C ++ATOM 8373 N TYR e 149 15.474 4.289 -13.157 1.00 72.37 N ++ATOM 8374 CA TYR e 149 14.958 4.972 -14.347 1.00 72.37 C ++ATOM 8375 C TYR e 149 16.072 5.312 -15.331 1.00 72.37 C ++ATOM 8376 O TYR e 149 15.970 4.989 -16.515 1.00 72.37 O ++ATOM 8377 CB TYR e 149 14.198 6.258 -14.003 1.00 72.37 C ++ATOM 8378 CG TYR e 149 12.790 6.109 -13.464 1.00 72.37 C ++ATOM 8379 CD1 TYR e 149 11.781 5.554 -14.243 1.00 72.37 C ++ATOM 8380 CD2 TYR e 149 12.436 6.659 -12.237 1.00 72.37 C ++ATOM 8381 CE1 TYR e 149 10.479 5.452 -13.759 1.00 72.37 C ++ATOM 8382 CE2 TYR e 149 11.146 6.564 -11.745 1.00 72.37 C ++ATOM 8383 CZ TYR e 149 10.171 5.967 -12.509 1.00 72.37 C ++ATOM 8384 OH TYR e 149 8.888 5.886 -12.019 1.00 72.37 O ++ATOM 8385 N TYR e 150 17.153 5.943 -14.859 1.00 76.88 N ++ATOM 8386 CA TYR e 150 18.217 6.336 -15.786 1.00 76.88 C ++ATOM 8387 C TYR e 150 19.008 5.133 -16.297 1.00 76.88 C ++ATOM 8388 O TYR e 150 19.366 5.082 -17.481 1.00 76.88 O ++ATOM 8389 CB TYR e 150 19.155 7.361 -15.144 1.00 76.88 C ++ATOM 8390 CG TYR e 150 18.590 8.768 -15.033 1.00 76.88 C ++ATOM 8391 CD1 TYR e 150 18.464 9.576 -16.159 1.00 76.88 C ++ATOM 8392 CD2 TYR e 150 18.234 9.307 -13.802 1.00 76.88 C ++ATOM 8393 CE1 TYR e 150 17.960 10.865 -16.062 1.00 76.88 C ++ATOM 8394 CE2 TYR e 150 17.730 10.593 -13.697 1.00 76.88 C ++ATOM 8395 CZ TYR e 150 17.597 11.367 -14.830 1.00 76.88 C ++ATOM 8396 OH TYR e 150 17.102 12.646 -14.731 1.00 76.88 O ++ATOM 8397 N TRP e 151 19.272 4.141 -15.443 1.00 79.80 N ++ATOM 8398 CA TRP e 151 19.983 2.952 -15.898 1.00 79.80 C ++ATOM 8399 C TRP e 151 19.093 1.981 -16.670 1.00 79.80 C ++ATOM 8400 O TRP e 151 19.587 0.937 -17.109 1.00 79.80 O ++ATOM 8401 CB TRP e 151 20.639 2.232 -14.714 1.00 79.80 C ++ATOM 8402 CG TRP e 151 21.847 2.939 -14.130 1.00 79.80 C ++ATOM 8403 CD1 TRP e 151 21.862 3.795 -13.067 1.00 79.80 C ++ATOM 8404 CD2 TRP e 151 23.209 2.819 -14.558 1.00 79.80 C ++ATOM 8405 NE1 TRP e 151 23.139 4.229 -12.819 1.00 79.80 N ++ATOM 8406 CE2 TRP e 151 23.987 3.644 -13.718 1.00 79.80 C ++ATOM 8407 CE3 TRP e 151 23.847 2.102 -15.575 1.00 79.80 C ++ATOM 8408 CZ2 TRP e 151 25.365 3.771 -13.864 1.00 79.80 C ++ATOM 8409 CZ3 TRP e 151 25.221 2.231 -15.717 1.00 79.80 C ++ATOM 8410 CH2 TRP e 151 25.963 3.058 -14.865 1.00 79.80 C ++ATOM 8411 N SER e 152 17.801 2.274 -16.826 1.00 75.46 N ++ATOM 8412 CA SER e 152 16.996 1.624 -17.851 1.00 75.46 C ++ATOM 8413 C SER e 152 16.783 2.495 -19.084 1.00 75.46 C ++ATOM 8414 O SER e 152 16.480 1.962 -20.157 1.00 75.46 O ++ATOM 8415 CB SER e 152 15.636 1.222 -17.282 1.00 75.46 C ++ATOM 8416 OG SER e 152 14.893 2.374 -16.937 1.00 75.46 O ++ATOM 8417 N LYS e 153 16.913 3.819 -18.946 1.00 78.92 N ++ATOM 8418 CA LYS e 153 16.975 4.709 -20.103 1.00 78.92 C ++ATOM 8419 C LYS e 153 18.228 4.461 -20.929 1.00 78.92 C ++ATOM 8420 O LYS e 153 18.197 4.610 -22.157 1.00 78.92 O ++ATOM 8421 CB LYS e 153 16.953 6.171 -19.653 1.00 78.92 C ++ATOM 8422 CG LYS e 153 15.619 6.707 -19.167 1.00 78.92 C ++ATOM 8423 CD LYS e 153 15.817 8.080 -18.529 1.00 78.92 C ++ATOM 8424 CE LYS e 153 14.528 8.627 -17.935 1.00 78.92 C ++ATOM 8425 NZ LYS e 153 14.747 9.943 -17.264 1.00 78.92 N ++ATOM 8426 N ASN e 154 19.337 4.096 -20.274 1.00 81.03 N ++ATOM 8427 CA ASN e 154 20.576 3.841 -21.002 1.00 81.03 C ++ATOM 8428 C ASN e 154 20.494 2.575 -21.847 1.00 81.03 C ++ATOM 8429 O ASN e 154 21.298 2.394 -22.766 1.00 81.03 O ++ATOM 8430 CB ASN e 154 21.755 3.758 -20.033 1.00 81.03 C ++ATOM 8431 CG ASN e 154 22.144 5.114 -19.469 1.00 81.03 C ++ATOM 8432 OD1 ASN e 154 22.167 6.114 -20.187 1.00 81.03 O ++ATOM 8433 ND2 ASN e 154 22.460 5.153 -18.179 1.00 81.03 N ++ATOM 8434 N ARG e 155 19.546 1.691 -21.553 1.00 82.03 N ++ATOM 8435 CA ARG e 155 19.236 0.584 -22.453 1.00 82.03 C ++ATOM 8436 C ARG e 155 18.089 0.962 -23.382 1.00 82.03 C ++ATOM 8437 O ARG e 155 17.300 1.857 -23.076 1.00 82.03 O ++ATOM 8438 CB ARG e 155 18.878 -0.680 -21.674 1.00 82.03 C ++ATOM 8439 CG ARG e 155 20.047 -1.311 -20.958 1.00 82.03 C ++ATOM 8440 CD ARG e 155 19.624 -2.592 -20.278 1.00 82.03 C ++ATOM 8441 NE ARG e 155 20.736 -3.223 -19.580 1.00 82.03 N ++ATOM 8442 CZ ARG e 155 20.635 -4.355 -18.894 1.00 82.03 C ++ATOM 8443 NH1 ARG e 155 19.470 -4.984 -18.820 1.00 82.03 N ++ATOM 8444 NH2 ARG e 155 21.700 -4.861 -18.286 1.00 82.03 N ++MASTER 766 0 0 15 70 0 0 6 8437 8 28 129 ++HETATM 8445 N DUM 8445 -26.000 -8.000 -15.900 ++HETATM 8446 O DUM 8446 -26.000 -8.000 15.900 ++HETATM 8447 N DUM 8447 -26.000 -6.000 -15.900 ++HETATM 8448 O DUM 8448 -26.000 -6.000 15.900 ++HETATM 8449 N DUM 8449 -26.000 -4.000 -15.900 ++HETATM 8450 O DUM 8450 -26.000 -4.000 15.900 ++HETATM 8451 N DUM 8451 -26.000 -2.000 -15.900 ++HETATM 8452 O DUM 8452 -26.000 -2.000 15.900 ++HETATM 8453 N DUM 8453 -26.000 0.000 -15.900 ++HETATM 8454 O DUM 8454 -26.000 0.000 15.900 ++HETATM 8455 N DUM 8455 -26.000 2.000 -15.900 ++HETATM 8456 O DUM 8456 -26.000 2.000 15.900 ++HETATM 8457 N DUM 8457 -26.000 4.000 -15.900 ++HETATM 8458 O DUM 8458 -26.000 4.000 15.900 ++HETATM 8459 N DUM 8459 -26.000 6.000 -15.900 ++HETATM 8460 O DUM 8460 -26.000 6.000 15.900 ++HETATM 8461 N DUM 8461 -26.000 8.000 -15.900 ++HETATM 8462 O DUM 8462 -26.000 8.000 15.900 ++HETATM 8463 N DUM 8463 -24.000 -12.000 -15.900 ++HETATM 8464 O DUM 8464 -24.000 -12.000 15.900 ++HETATM 8465 N DUM 8465 -24.000 -10.000 -15.900 ++HETATM 8466 O DUM 8466 -24.000 -10.000 15.900 ++HETATM 8467 N DUM 8467 -24.000 -8.000 -15.900 ++HETATM 8468 O DUM 8468 -24.000 -8.000 15.900 ++HETATM 8469 N DUM 8469 -24.000 -6.000 -15.900 ++HETATM 8470 O DUM 8470 -24.000 -6.000 15.900 ++HETATM 8471 N DUM 8471 -24.000 -4.000 -15.900 ++HETATM 8472 O DUM 8472 -24.000 -4.000 15.900 ++HETATM 8473 N DUM 8473 -24.000 -2.000 -15.900 ++HETATM 8474 O DUM 8474 -24.000 -2.000 15.900 ++HETATM 8475 N DUM 8475 -24.000 0.000 -15.900 ++HETATM 8476 O DUM 8476 -24.000 0.000 15.900 ++HETATM 8477 N DUM 8477 -24.000 2.000 -15.900 ++HETATM 8478 O DUM 8478 -24.000 2.000 15.900 ++HETATM 8479 N DUM 8479 -24.000 4.000 -15.900 ++HETATM 8480 O DUM 8480 -24.000 4.000 15.900 ++HETATM 8481 N DUM 8481 -24.000 6.000 -15.900 ++HETATM 8482 O DUM 8482 -24.000 6.000 15.900 ++HETATM 8483 N DUM 8483 -24.000 8.000 -15.900 ++HETATM 8484 O DUM 8484 -24.000 8.000 15.900 ++HETATM 8485 N DUM 8485 -24.000 10.000 -15.900 ++HETATM 8486 O DUM 8486 -24.000 10.000 15.900 ++HETATM 8487 N DUM 8487 -24.000 12.000 -15.900 ++HETATM 8488 O DUM 8488 -24.000 12.000 15.900 ++HETATM 8489 N DUM 8489 -22.000 -16.000 -15.900 ++HETATM 8490 O DUM 8490 -22.000 -16.000 15.900 ++HETATM 8491 N DUM 8491 -22.000 -14.000 -15.900 ++HETATM 8492 O DUM 8492 -22.000 -14.000 15.900 ++HETATM 8493 N DUM 8493 -22.000 -12.000 -15.900 ++HETATM 8494 O DUM 8494 -22.000 -12.000 15.900 ++HETATM 8495 N DUM 8495 -22.000 -10.000 -15.900 ++HETATM 8496 O DUM 8496 -22.000 -10.000 15.900 ++HETATM 8497 N DUM 8497 -22.000 -8.000 -15.900 ++HETATM 8498 O DUM 8498 -22.000 -8.000 15.900 ++HETATM 8499 N DUM 8499 -22.000 -6.000 -15.900 ++HETATM 8500 O DUM 8500 -22.000 -6.000 15.900 ++HETATM 8501 N DUM 8501 -22.000 -4.000 -15.900 ++HETATM 8502 O DUM 8502 -22.000 -4.000 15.900 ++HETATM 8503 N DUM 8503 -22.000 -2.000 -15.900 ++HETATM 8504 O DUM 8504 -22.000 -2.000 15.900 ++HETATM 8505 N DUM 8505 -22.000 0.000 -15.900 ++HETATM 8506 O DUM 8506 -22.000 0.000 15.900 ++HETATM 8507 N DUM 8507 -22.000 2.000 -15.900 ++HETATM 8508 O DUM 8508 -22.000 2.000 15.900 ++HETATM 8509 N DUM 8509 -22.000 4.000 -15.900 ++HETATM 8510 O DUM 8510 -22.000 4.000 15.900 ++HETATM 8511 N DUM 8511 -22.000 6.000 -15.900 ++HETATM 8512 O DUM 8512 -22.000 6.000 15.900 ++HETATM 8513 N DUM 8513 -22.000 8.000 -15.900 ++HETATM 8514 O DUM 8514 -22.000 8.000 15.900 ++HETATM 8515 N DUM 8515 -22.000 10.000 -15.900 ++HETATM 8516 O DUM 8516 -22.000 10.000 15.900 ++HETATM 8517 N DUM 8517 -22.000 12.000 -15.900 ++HETATM 8518 O DUM 8518 -22.000 12.000 15.900 ++HETATM 8519 N DUM 8519 -22.000 14.000 -15.900 ++HETATM 8520 O DUM 8520 -22.000 14.000 15.900 ++HETATM 8521 N DUM 8521 -22.000 16.000 -15.900 ++HETATM 8522 O DUM 8522 -22.000 16.000 15.900 ++HETATM 8523 N DUM 8523 -20.000 -18.000 -15.900 ++HETATM 8524 O DUM 8524 -20.000 -18.000 15.900 ++HETATM 8525 N DUM 8525 -20.000 -16.000 -15.900 ++HETATM 8526 O DUM 8526 -20.000 -16.000 15.900 ++HETATM 8527 N DUM 8527 -20.000 -14.000 -15.900 ++HETATM 8528 O DUM 8528 -20.000 -14.000 15.900 ++HETATM 8529 N DUM 8529 -20.000 -12.000 -15.900 ++HETATM 8530 O DUM 8530 -20.000 -12.000 15.900 ++HETATM 8531 N DUM 8531 -20.000 -10.000 -15.900 ++HETATM 8532 O DUM 8532 -20.000 -10.000 15.900 ++HETATM 8533 N DUM 8533 -20.000 -8.000 -15.900 ++HETATM 8534 O DUM 8534 -20.000 -8.000 15.900 ++HETATM 8535 N DUM 8535 -20.000 -6.000 -15.900 ++HETATM 8536 O DUM 8536 -20.000 -6.000 15.900 ++HETATM 8537 N DUM 8537 -20.000 -4.000 -15.900 ++HETATM 8538 O DUM 8538 -20.000 -4.000 15.900 ++HETATM 8539 N DUM 8539 -20.000 -2.000 -15.900 ++HETATM 8540 O DUM 8540 -20.000 -2.000 15.900 ++HETATM 8541 N DUM 8541 -20.000 0.000 -15.900 ++HETATM 8542 O DUM 8542 -20.000 0.000 15.900 ++HETATM 8543 N DUM 8543 -20.000 2.000 -15.900 ++HETATM 8544 O DUM 8544 -20.000 2.000 15.900 ++HETATM 8545 N DUM 8545 -20.000 4.000 -15.900 ++HETATM 8546 O DUM 8546 -20.000 4.000 15.900 ++HETATM 8547 N DUM 8547 -20.000 6.000 -15.900 ++HETATM 8548 O DUM 8548 -20.000 6.000 15.900 ++HETATM 8549 N DUM 8549 -20.000 8.000 -15.900 ++HETATM 8550 O DUM 8550 -20.000 8.000 15.900 ++HETATM 8551 N DUM 8551 -20.000 10.000 -15.900 ++HETATM 8552 O DUM 8552 -20.000 10.000 15.900 ++HETATM 8553 N DUM 8553 -20.000 12.000 -15.900 ++HETATM 8554 O DUM 8554 -20.000 12.000 15.900 ++HETATM 8555 N DUM 8555 -20.000 14.000 -15.900 ++HETATM 8556 O DUM 8556 -20.000 14.000 15.900 ++HETATM 8557 N DUM 8557 -20.000 16.000 -15.900 ++HETATM 8558 O DUM 8558 -20.000 16.000 15.900 ++HETATM 8559 N DUM 8559 -20.000 18.000 -15.900 ++HETATM 8560 O DUM 8560 -20.000 18.000 15.900 ++HETATM 8561 N DUM 8561 -18.000 -20.000 -15.900 ++HETATM 8562 O DUM 8562 -18.000 -20.000 15.900 ++HETATM 8563 N DUM 8563 -18.000 -18.000 -15.900 ++HETATM 8564 O DUM 8564 -18.000 -18.000 15.900 ++HETATM 8565 N DUM 8565 -18.000 -16.000 -15.900 ++HETATM 8566 O DUM 8566 -18.000 -16.000 15.900 ++HETATM 8567 N DUM 8567 -18.000 -14.000 -15.900 ++HETATM 8568 O DUM 8568 -18.000 -14.000 15.900 ++HETATM 8569 N DUM 8569 -18.000 -12.000 -15.900 ++HETATM 8570 O DUM 8570 -18.000 -12.000 15.900 ++HETATM 8571 N DUM 8571 -18.000 -10.000 -15.900 ++HETATM 8572 O DUM 8572 -18.000 -10.000 15.900 ++HETATM 8573 N DUM 8573 -18.000 -8.000 -15.900 ++HETATM 8574 O DUM 8574 -18.000 -8.000 15.900 ++HETATM 8575 N DUM 8575 -18.000 -6.000 -15.900 ++HETATM 8576 O DUM 8576 -18.000 -6.000 15.900 ++HETATM 8577 N DUM 8577 -18.000 -4.000 -15.900 ++HETATM 8578 O DUM 8578 -18.000 -4.000 15.900 ++HETATM 8579 N DUM 8579 -18.000 -2.000 -15.900 ++HETATM 8580 O DUM 8580 -18.000 -2.000 15.900 ++HETATM 8581 N DUM 8581 -18.000 0.000 -15.900 ++HETATM 8582 O DUM 8582 -18.000 0.000 15.900 ++HETATM 8583 N DUM 8583 -18.000 2.000 -15.900 ++HETATM 8584 O DUM 8584 -18.000 2.000 15.900 ++HETATM 8585 N DUM 8585 -18.000 4.000 -15.900 ++HETATM 8586 O DUM 8586 -18.000 4.000 15.900 ++HETATM 8587 N DUM 8587 -18.000 6.000 -15.900 ++HETATM 8588 O DUM 8588 -18.000 6.000 15.900 ++HETATM 8589 N DUM 8589 -18.000 8.000 -15.900 ++HETATM 8590 O DUM 8590 -18.000 8.000 15.900 ++HETATM 8591 N DUM 8591 -18.000 10.000 -15.900 ++HETATM 8592 O DUM 8592 -18.000 10.000 15.900 ++HETATM 8593 N DUM 8593 -18.000 12.000 -15.900 ++HETATM 8594 O DUM 8594 -18.000 12.000 15.900 ++HETATM 8595 N DUM 8595 -18.000 14.000 -15.900 ++HETATM 8596 O DUM 8596 -18.000 14.000 15.900 ++HETATM 8597 N DUM 8597 -18.000 16.000 -15.900 ++HETATM 8598 O DUM 8598 -18.000 16.000 15.900 ++HETATM 8599 N DUM 8599 -18.000 18.000 -15.900 ++HETATM 8600 O DUM 8600 -18.000 18.000 15.900 ++HETATM 8601 N DUM 8601 -18.000 20.000 -15.900 ++HETATM 8602 O DUM 8602 -18.000 20.000 15.900 ++HETATM 8603 N DUM 8603 -16.000 -22.000 -15.900 ++HETATM 8604 O DUM 8604 -16.000 -22.000 15.900 ++HETATM 8605 N DUM 8605 -16.000 -20.000 -15.900 ++HETATM 8606 O DUM 8606 -16.000 -20.000 15.900 ++HETATM 8607 N DUM 8607 -16.000 -18.000 -15.900 ++HETATM 8608 O DUM 8608 -16.000 -18.000 15.900 ++HETATM 8609 N DUM 8609 -16.000 -16.000 -15.900 ++HETATM 8610 O DUM 8610 -16.000 -16.000 15.900 ++HETATM 8611 N DUM 8611 -16.000 -14.000 -15.900 ++HETATM 8612 O DUM 8612 -16.000 -14.000 15.900 ++HETATM 8613 N DUM 8613 -16.000 -12.000 -15.900 ++HETATM 8614 O DUM 8614 -16.000 -12.000 15.900 ++HETATM 8615 N DUM 8615 -16.000 -10.000 -15.900 ++HETATM 8616 O DUM 8616 -16.000 -10.000 15.900 ++HETATM 8617 N DUM 8617 -16.000 -8.000 -15.900 ++HETATM 8618 O DUM 8618 -16.000 -8.000 15.900 ++HETATM 8619 N DUM 8619 -16.000 -6.000 -15.900 ++HETATM 8620 O DUM 8620 -16.000 -6.000 15.900 ++HETATM 8621 N DUM 8621 -16.000 -4.000 -15.900 ++HETATM 8622 O DUM 8622 -16.000 -4.000 15.900 ++HETATM 8623 N DUM 8623 -16.000 -2.000 -15.900 ++HETATM 8624 O DUM 8624 -16.000 -2.000 15.900 ++HETATM 8625 N DUM 8625 -16.000 0.000 -15.900 ++HETATM 8626 O DUM 8626 -16.000 0.000 15.900 ++HETATM 8627 N DUM 8627 -16.000 2.000 -15.900 ++HETATM 8628 O DUM 8628 -16.000 2.000 15.900 ++HETATM 8629 N DUM 8629 -16.000 4.000 -15.900 ++HETATM 8630 O DUM 8630 -16.000 4.000 15.900 ++HETATM 8631 N DUM 8631 -16.000 6.000 -15.900 ++HETATM 8632 O DUM 8632 -16.000 6.000 15.900 ++HETATM 8633 N DUM 8633 -16.000 8.000 -15.900 ++HETATM 8634 O DUM 8634 -16.000 8.000 15.900 ++HETATM 8635 N DUM 8635 -16.000 10.000 -15.900 ++HETATM 8636 O DUM 8636 -16.000 10.000 15.900 ++HETATM 8637 N DUM 8637 -16.000 12.000 -15.900 ++HETATM 8638 O DUM 8638 -16.000 12.000 15.900 ++HETATM 8639 N DUM 8639 -16.000 14.000 -15.900 ++HETATM 8640 O DUM 8640 -16.000 14.000 15.900 ++HETATM 8641 N DUM 8641 -16.000 16.000 -15.900 ++HETATM 8642 O DUM 8642 -16.000 16.000 15.900 ++HETATM 8643 N DUM 8643 -16.000 18.000 -15.900 ++HETATM 8644 O DUM 8644 -16.000 18.000 15.900 ++HETATM 8645 N DUM 8645 -16.000 20.000 -15.900 ++HETATM 8646 O DUM 8646 -16.000 20.000 15.900 ++HETATM 8647 N DUM 8647 -16.000 22.000 -15.900 ++HETATM 8648 O DUM 8648 -16.000 22.000 15.900 ++HETATM 8649 N DUM 8649 -14.000 -22.000 -15.900 ++HETATM 8650 O DUM 8650 -14.000 -22.000 15.900 ++HETATM 8651 N DUM 8651 -14.000 -20.000 -15.900 ++HETATM 8652 O DUM 8652 -14.000 -20.000 15.900 ++HETATM 8653 N DUM 8653 -14.000 -18.000 -15.900 ++HETATM 8654 O DUM 8654 -14.000 -18.000 15.900 ++HETATM 8655 N DUM 8655 -14.000 -16.000 -15.900 ++HETATM 8656 O DUM 8656 -14.000 -16.000 15.900 ++HETATM 8657 N DUM 8657 -14.000 -14.000 -15.900 ++HETATM 8658 O DUM 8658 -14.000 -14.000 15.900 ++HETATM 8659 N DUM 8659 -14.000 -12.000 -15.900 ++HETATM 8660 O DUM 8660 -14.000 -12.000 15.900 ++HETATM 8661 N DUM 8661 -14.000 -10.000 -15.900 ++HETATM 8662 O DUM 8662 -14.000 -10.000 15.900 ++HETATM 8663 N DUM 8663 -14.000 -8.000 -15.900 ++HETATM 8664 O DUM 8664 -14.000 -8.000 15.900 ++HETATM 8665 N DUM 8665 -14.000 -6.000 -15.900 ++HETATM 8666 O DUM 8666 -14.000 -6.000 15.900 ++HETATM 8667 N DUM 8667 -14.000 -4.000 -15.900 ++HETATM 8668 O DUM 8668 -14.000 -4.000 15.900 ++HETATM 8669 N DUM 8669 -14.000 -2.000 -15.900 ++HETATM 8670 O DUM 8670 -14.000 -2.000 15.900 ++HETATM 8671 N DUM 8671 -14.000 0.000 -15.900 ++HETATM 8672 O DUM 8672 -14.000 0.000 15.900 ++HETATM 8673 N DUM 8673 -14.000 2.000 -15.900 ++HETATM 8674 O DUM 8674 -14.000 2.000 15.900 ++HETATM 8675 N DUM 8675 -14.000 4.000 -15.900 ++HETATM 8676 O DUM 8676 -14.000 4.000 15.900 ++HETATM 8677 N DUM 8677 -14.000 6.000 -15.900 ++HETATM 8678 O DUM 8678 -14.000 6.000 15.900 ++HETATM 8679 N DUM 8679 -14.000 8.000 -15.900 ++HETATM 8680 O DUM 8680 -14.000 8.000 15.900 ++HETATM 8681 N DUM 8681 -14.000 10.000 -15.900 ++HETATM 8682 O DUM 8682 -14.000 10.000 15.900 ++HETATM 8683 N DUM 8683 -14.000 12.000 -15.900 ++HETATM 8684 O DUM 8684 -14.000 12.000 15.900 ++HETATM 8685 N DUM 8685 -14.000 14.000 -15.900 ++HETATM 8686 O DUM 8686 -14.000 14.000 15.900 ++HETATM 8687 N DUM 8687 -14.000 16.000 -15.900 ++HETATM 8688 O DUM 8688 -14.000 16.000 15.900 ++HETATM 8689 N DUM 8689 -14.000 18.000 -15.900 ++HETATM 8690 O DUM 8690 -14.000 18.000 15.900 ++HETATM 8691 N DUM 8691 -14.000 20.000 -15.900 ++HETATM 8692 O DUM 8692 -14.000 20.000 15.900 ++HETATM 8693 N DUM 8693 -14.000 22.000 -15.900 ++HETATM 8694 O DUM 8694 -14.000 22.000 15.900 ++HETATM 8695 N DUM 8695 -12.000 -24.000 -15.900 ++HETATM 8696 O DUM 8696 -12.000 -24.000 15.900 ++HETATM 8697 N DUM 8697 -12.000 -22.000 -15.900 ++HETATM 8698 O DUM 8698 -12.000 -22.000 15.900 ++HETATM 8699 N DUM 8699 -12.000 -20.000 -15.900 ++HETATM 8700 O DUM 8700 -12.000 -20.000 15.900 ++HETATM 8701 N DUM 8701 -12.000 -18.000 -15.900 ++HETATM 8702 O DUM 8702 -12.000 -18.000 15.900 ++HETATM 8703 N DUM 8703 -12.000 -16.000 -15.900 ++HETATM 8704 O DUM 8704 -12.000 -16.000 15.900 ++HETATM 8705 N DUM 8705 -12.000 -14.000 -15.900 ++HETATM 8706 O DUM 8706 -12.000 -14.000 15.900 ++HETATM 8707 N DUM 8707 -12.000 -12.000 -15.900 ++HETATM 8708 O DUM 8708 -12.000 -12.000 15.900 ++HETATM 8709 N DUM 8709 -12.000 -10.000 -15.900 ++HETATM 8710 O DUM 8710 -12.000 -10.000 15.900 ++HETATM 8711 N DUM 8711 -12.000 -8.000 -15.900 ++HETATM 8712 O DUM 8712 -12.000 -8.000 15.900 ++HETATM 8713 N DUM 8713 -12.000 -6.000 -15.900 ++HETATM 8714 O DUM 8714 -12.000 -6.000 15.900 ++HETATM 8715 N DUM 8715 -12.000 -4.000 -15.900 ++HETATM 8716 O DUM 8716 -12.000 -4.000 15.900 ++HETATM 8717 N DUM 8717 -12.000 -2.000 -15.900 ++HETATM 8718 O DUM 8718 -12.000 -2.000 15.900 ++HETATM 8719 N DUM 8719 -12.000 0.000 -15.900 ++HETATM 8720 O DUM 8720 -12.000 0.000 15.900 ++HETATM 8721 N DUM 8721 -12.000 2.000 -15.900 ++HETATM 8722 O DUM 8722 -12.000 2.000 15.900 ++HETATM 8723 N DUM 8723 -12.000 4.000 -15.900 ++HETATM 8724 O DUM 8724 -12.000 4.000 15.900 ++HETATM 8725 N DUM 8725 -12.000 6.000 -15.900 ++HETATM 8726 O DUM 8726 -12.000 6.000 15.900 ++HETATM 8727 N DUM 8727 -12.000 8.000 -15.900 ++HETATM 8728 O DUM 8728 -12.000 8.000 15.900 ++HETATM 8729 N DUM 8729 -12.000 10.000 -15.900 ++HETATM 8730 O DUM 8730 -12.000 10.000 15.900 ++HETATM 8731 N DUM 8731 -12.000 12.000 -15.900 ++HETATM 8732 O DUM 8732 -12.000 12.000 15.900 ++HETATM 8733 N DUM 8733 -12.000 14.000 -15.900 ++HETATM 8734 O DUM 8734 -12.000 14.000 15.900 ++HETATM 8735 N DUM 8735 -12.000 16.000 -15.900 ++HETATM 8736 O DUM 8736 -12.000 16.000 15.900 ++HETATM 8737 N DUM 8737 -12.000 18.000 -15.900 ++HETATM 8738 O DUM 8738 -12.000 18.000 15.900 ++HETATM 8739 N DUM 8739 -12.000 20.000 -15.900 ++HETATM 8740 O DUM 8740 -12.000 20.000 15.900 ++HETATM 8741 N DUM 8741 -12.000 22.000 -15.900 ++HETATM 8742 O DUM 8742 -12.000 22.000 15.900 ++HETATM 8743 N DUM 8743 -12.000 24.000 -15.900 ++HETATM 8744 O DUM 8744 -12.000 24.000 15.900 ++HETATM 8745 N DUM 8745 -10.000 -24.000 -15.900 ++HETATM 8746 O DUM 8746 -10.000 -24.000 15.900 ++HETATM 8747 N DUM 8747 -10.000 -22.000 -15.900 ++HETATM 8748 O DUM 8748 -10.000 -22.000 15.900 ++HETATM 8749 N DUM 8749 -10.000 -20.000 -15.900 ++HETATM 8750 O DUM 8750 -10.000 -20.000 15.900 ++HETATM 8751 N DUM 8751 -10.000 -18.000 -15.900 ++HETATM 8752 O DUM 8752 -10.000 -18.000 15.900 ++HETATM 8753 N DUM 8753 -10.000 -16.000 -15.900 ++HETATM 8754 O DUM 8754 -10.000 -16.000 15.900 ++HETATM 8755 N DUM 8755 -10.000 -14.000 -15.900 ++HETATM 8756 O DUM 8756 -10.000 -14.000 15.900 ++HETATM 8757 N DUM 8757 -10.000 -12.000 -15.900 ++HETATM 8758 O DUM 8758 -10.000 -12.000 15.900 ++HETATM 8759 N DUM 8759 -10.000 -10.000 -15.900 ++HETATM 8760 O DUM 8760 -10.000 -10.000 15.900 ++HETATM 8761 N DUM 8761 -10.000 -8.000 -15.900 ++HETATM 8762 O DUM 8762 -10.000 -8.000 15.900 ++HETATM 8763 N DUM 8763 -10.000 -6.000 -15.900 ++HETATM 8764 O DUM 8764 -10.000 -6.000 15.900 ++HETATM 8765 N DUM 8765 -10.000 -4.000 -15.900 ++HETATM 8766 O DUM 8766 -10.000 -4.000 15.900 ++HETATM 8767 N DUM 8767 -10.000 -2.000 -15.900 ++HETATM 8768 O DUM 8768 -10.000 -2.000 15.900 ++HETATM 8769 N DUM 8769 -10.000 0.000 -15.900 ++HETATM 8770 O DUM 8770 -10.000 0.000 15.900 ++HETATM 8771 N DUM 8771 -10.000 2.000 -15.900 ++HETATM 8772 O DUM 8772 -10.000 2.000 15.900 ++HETATM 8773 N DUM 8773 -10.000 4.000 -15.900 ++HETATM 8774 O DUM 8774 -10.000 4.000 15.900 ++HETATM 8775 N DUM 8775 -10.000 6.000 -15.900 ++HETATM 8776 O DUM 8776 -10.000 6.000 15.900 ++HETATM 8777 N DUM 8777 -10.000 8.000 -15.900 ++HETATM 8778 O DUM 8778 -10.000 8.000 15.900 ++HETATM 8779 N DUM 8779 -10.000 10.000 -15.900 ++HETATM 8780 O DUM 8780 -10.000 10.000 15.900 ++HETATM 8781 N DUM 8781 -10.000 12.000 -15.900 ++HETATM 8782 O DUM 8782 -10.000 12.000 15.900 ++HETATM 8783 N DUM 8783 -10.000 14.000 -15.900 ++HETATM 8784 O DUM 8784 -10.000 14.000 15.900 ++HETATM 8785 N DUM 8785 -10.000 16.000 -15.900 ++HETATM 8786 O DUM 8786 -10.000 16.000 15.900 ++HETATM 8787 N DUM 8787 -10.000 18.000 -15.900 ++HETATM 8788 O DUM 8788 -10.000 18.000 15.900 ++HETATM 8789 N DUM 8789 -10.000 20.000 -15.900 ++HETATM 8790 O DUM 8790 -10.000 20.000 15.900 ++HETATM 8791 N DUM 8791 -10.000 22.000 -15.900 ++HETATM 8792 O DUM 8792 -10.000 22.000 15.900 ++HETATM 8793 N DUM 8793 -10.000 24.000 -15.900 ++HETATM 8794 O DUM 8794 -10.000 24.000 15.900 ++HETATM 8795 N DUM 8795 -8.000 -26.000 -15.900 ++HETATM 8796 O DUM 8796 -8.000 -26.000 15.900 ++HETATM 8797 N DUM 8797 -8.000 -24.000 -15.900 ++HETATM 8798 O DUM 8798 -8.000 -24.000 15.900 ++HETATM 8799 N DUM 8799 -8.000 -22.000 -15.900 ++HETATM 8800 O DUM 8800 -8.000 -22.000 15.900 ++HETATM 8801 N DUM 8801 -8.000 -20.000 -15.900 ++HETATM 8802 O DUM 8802 -8.000 -20.000 15.900 ++HETATM 8803 N DUM 8803 -8.000 -18.000 -15.900 ++HETATM 8804 O DUM 8804 -8.000 -18.000 15.900 ++HETATM 8805 N DUM 8805 -8.000 -16.000 -15.900 ++HETATM 8806 O DUM 8806 -8.000 -16.000 15.900 ++HETATM 8807 N DUM 8807 -8.000 -14.000 -15.900 ++HETATM 8808 O DUM 8808 -8.000 -14.000 15.900 ++HETATM 8809 N DUM 8809 -8.000 -12.000 -15.900 ++HETATM 8810 O DUM 8810 -8.000 -12.000 15.900 ++HETATM 8811 N DUM 8811 -8.000 -10.000 -15.900 ++HETATM 8812 O DUM 8812 -8.000 -10.000 15.900 ++HETATM 8813 N DUM 8813 -8.000 -8.000 -15.900 ++HETATM 8814 O DUM 8814 -8.000 -8.000 15.900 ++HETATM 8815 N DUM 8815 -8.000 -6.000 -15.900 ++HETATM 8816 O DUM 8816 -8.000 -6.000 15.900 ++HETATM 8817 N DUM 8817 -8.000 -4.000 -15.900 ++HETATM 8818 O DUM 8818 -8.000 -4.000 15.900 ++HETATM 8819 N DUM 8819 -8.000 -2.000 -15.900 ++HETATM 8820 O DUM 8820 -8.000 -2.000 15.900 ++HETATM 8821 N DUM 8821 -8.000 0.000 -15.900 ++HETATM 8822 O DUM 8822 -8.000 0.000 15.900 ++HETATM 8823 N DUM 8823 -8.000 2.000 -15.900 ++HETATM 8824 O DUM 8824 -8.000 2.000 15.900 ++HETATM 8825 N DUM 8825 -8.000 4.000 -15.900 ++HETATM 8826 O DUM 8826 -8.000 4.000 15.900 ++HETATM 8827 N DUM 8827 -8.000 6.000 -15.900 ++HETATM 8828 O DUM 8828 -8.000 6.000 15.900 ++HETATM 8829 N DUM 8829 -8.000 8.000 -15.900 ++HETATM 8830 O DUM 8830 -8.000 8.000 15.900 ++HETATM 8831 N DUM 8831 -8.000 10.000 -15.900 ++HETATM 8832 O DUM 8832 -8.000 10.000 15.900 ++HETATM 8833 N DUM 8833 -8.000 12.000 -15.900 ++HETATM 8834 O DUM 8834 -8.000 12.000 15.900 ++HETATM 8835 N DUM 8835 -8.000 14.000 -15.900 ++HETATM 8836 O DUM 8836 -8.000 14.000 15.900 ++HETATM 8837 N DUM 8837 -8.000 16.000 -15.900 ++HETATM 8838 O DUM 8838 -8.000 16.000 15.900 ++HETATM 8839 N DUM 8839 -8.000 18.000 -15.900 ++HETATM 8840 O DUM 8840 -8.000 18.000 15.900 ++HETATM 8841 N DUM 8841 -8.000 20.000 -15.900 ++HETATM 8842 O DUM 8842 -8.000 20.000 15.900 ++HETATM 8843 N DUM 8843 -8.000 22.000 -15.900 ++HETATM 8844 O DUM 8844 -8.000 22.000 15.900 ++HETATM 8845 N DUM 8845 -8.000 24.000 -15.900 ++HETATM 8846 O DUM 8846 -8.000 24.000 15.900 ++HETATM 8847 N DUM 8847 -8.000 26.000 -15.900 ++HETATM 8848 O DUM 8848 -8.000 26.000 15.900 ++HETATM 8849 N DUM 8849 -6.000 -26.000 -15.900 ++HETATM 8850 O DUM 8850 -6.000 -26.000 15.900 ++HETATM 8851 N DUM 8851 -6.000 -24.000 -15.900 ++HETATM 8852 O DUM 8852 -6.000 -24.000 15.900 ++HETATM 8853 N DUM 8853 -6.000 -22.000 -15.900 ++HETATM 8854 O DUM 8854 -6.000 -22.000 15.900 ++HETATM 8855 N DUM 8855 -6.000 -20.000 -15.900 ++HETATM 8856 O DUM 8856 -6.000 -20.000 15.900 ++HETATM 8857 N DUM 8857 -6.000 -18.000 -15.900 ++HETATM 8858 O DUM 8858 -6.000 -18.000 15.900 ++HETATM 8859 N DUM 8859 -6.000 -16.000 -15.900 ++HETATM 8860 O DUM 8860 -6.000 -16.000 15.900 ++HETATM 8861 N DUM 8861 -6.000 -14.000 -15.900 ++HETATM 8862 O DUM 8862 -6.000 -14.000 15.900 ++HETATM 8863 N DUM 8863 -6.000 -12.000 -15.900 ++HETATM 8864 O DUM 8864 -6.000 -12.000 15.900 ++HETATM 8865 N DUM 8865 -6.000 -10.000 -15.900 ++HETATM 8866 O DUM 8866 -6.000 -10.000 15.900 ++HETATM 8867 N DUM 8867 -6.000 -8.000 -15.900 ++HETATM 8868 O DUM 8868 -6.000 -8.000 15.900 ++HETATM 8869 N DUM 8869 -6.000 -6.000 -15.900 ++HETATM 8870 O DUM 8870 -6.000 -6.000 15.900 ++HETATM 8871 N DUM 8871 -6.000 -4.000 -15.900 ++HETATM 8872 O DUM 8872 -6.000 -4.000 15.900 ++HETATM 8873 N DUM 8873 -6.000 -2.000 -15.900 ++HETATM 8874 O DUM 8874 -6.000 -2.000 15.900 ++HETATM 8875 N DUM 8875 -6.000 0.000 -15.900 ++HETATM 8876 O DUM 8876 -6.000 0.000 15.900 ++HETATM 8877 N DUM 8877 -6.000 2.000 -15.900 ++HETATM 8878 O DUM 8878 -6.000 2.000 15.900 ++HETATM 8879 N DUM 8879 -6.000 4.000 -15.900 ++HETATM 8880 O DUM 8880 -6.000 4.000 15.900 ++HETATM 8881 N DUM 8881 -6.000 6.000 -15.900 ++HETATM 8882 O DUM 8882 -6.000 6.000 15.900 ++HETATM 8883 N DUM 8883 -6.000 8.000 -15.900 ++HETATM 8884 O DUM 8884 -6.000 8.000 15.900 ++HETATM 8885 N DUM 8885 -6.000 10.000 -15.900 ++HETATM 8886 O DUM 8886 -6.000 10.000 15.900 ++HETATM 8887 N DUM 8887 -6.000 12.000 -15.900 ++HETATM 8888 O DUM 8888 -6.000 12.000 15.900 ++HETATM 8889 N DUM 8889 -6.000 14.000 -15.900 ++HETATM 8890 O DUM 8890 -6.000 14.000 15.900 ++HETATM 8891 N DUM 8891 -6.000 16.000 -15.900 ++HETATM 8892 O DUM 8892 -6.000 16.000 15.900 ++HETATM 8893 N DUM 8893 -6.000 18.000 -15.900 ++HETATM 8894 O DUM 8894 -6.000 18.000 15.900 ++HETATM 8895 N DUM 8895 -6.000 20.000 -15.900 ++HETATM 8896 O DUM 8896 -6.000 20.000 15.900 ++HETATM 8897 N DUM 8897 -6.000 22.000 -15.900 ++HETATM 8898 O DUM 8898 -6.000 22.000 15.900 ++HETATM 8899 N DUM 8899 -6.000 24.000 -15.900 ++HETATM 8900 O DUM 8900 -6.000 24.000 15.900 ++HETATM 8901 N DUM 8901 -6.000 26.000 -15.900 ++HETATM 8902 O DUM 8902 -6.000 26.000 15.900 ++HETATM 8903 N DUM 8903 -4.000 -26.000 -15.900 ++HETATM 8904 O DUM 8904 -4.000 -26.000 15.900 ++HETATM 8905 N DUM 8905 -4.000 -24.000 -15.900 ++HETATM 8906 O DUM 8906 -4.000 -24.000 15.900 ++HETATM 8907 N DUM 8907 -4.000 -22.000 -15.900 ++HETATM 8908 O DUM 8908 -4.000 -22.000 15.900 ++HETATM 8909 N DUM 8909 -4.000 -20.000 -15.900 ++HETATM 8910 O DUM 8910 -4.000 -20.000 15.900 ++HETATM 8911 N DUM 8911 -4.000 -18.000 -15.900 ++HETATM 8912 O DUM 8912 -4.000 -18.000 15.900 ++HETATM 8913 N DUM 8913 -4.000 -16.000 -15.900 ++HETATM 8914 O DUM 8914 -4.000 -16.000 15.900 ++HETATM 8915 N DUM 8915 -4.000 -14.000 -15.900 ++HETATM 8916 O DUM 8916 -4.000 -14.000 15.900 ++HETATM 8917 N DUM 8917 -4.000 -12.000 -15.900 ++HETATM 8918 O DUM 8918 -4.000 -12.000 15.900 ++HETATM 8919 N DUM 8919 -4.000 -10.000 -15.900 ++HETATM 8920 O DUM 8920 -4.000 -10.000 15.900 ++HETATM 8921 N DUM 8921 -4.000 -8.000 -15.900 ++HETATM 8922 O DUM 8922 -4.000 -8.000 15.900 ++HETATM 8923 N DUM 8923 -4.000 -6.000 -15.900 ++HETATM 8924 O DUM 8924 -4.000 -6.000 15.900 ++HETATM 8925 N DUM 8925 -4.000 -4.000 -15.900 ++HETATM 8926 O DUM 8926 -4.000 -4.000 15.900 ++HETATM 8927 N DUM 8927 -4.000 -2.000 -15.900 ++HETATM 8928 O DUM 8928 -4.000 -2.000 15.900 ++HETATM 8929 N DUM 8929 -4.000 0.000 -15.900 ++HETATM 8930 O DUM 8930 -4.000 0.000 15.900 ++HETATM 8931 N DUM 8931 -4.000 2.000 -15.900 ++HETATM 8932 O DUM 8932 -4.000 2.000 15.900 ++HETATM 8933 N DUM 8933 -4.000 4.000 -15.900 ++HETATM 8934 O DUM 8934 -4.000 4.000 15.900 ++HETATM 8935 N DUM 8935 -4.000 6.000 -15.900 ++HETATM 8936 O DUM 8936 -4.000 6.000 15.900 ++HETATM 8937 N DUM 8937 -4.000 8.000 -15.900 ++HETATM 8938 O DUM 8938 -4.000 8.000 15.900 ++HETATM 8939 N DUM 8939 -4.000 10.000 -15.900 ++HETATM 8940 O DUM 8940 -4.000 10.000 15.900 ++HETATM 8941 N DUM 8941 -4.000 12.000 -15.900 ++HETATM 8942 O DUM 8942 -4.000 12.000 15.900 ++HETATM 8943 N DUM 8943 -4.000 14.000 -15.900 ++HETATM 8944 O DUM 8944 -4.000 14.000 15.900 ++HETATM 8945 N DUM 8945 -4.000 16.000 -15.900 ++HETATM 8946 O DUM 8946 -4.000 16.000 15.900 ++HETATM 8947 N DUM 8947 -4.000 18.000 -15.900 ++HETATM 8948 O DUM 8948 -4.000 18.000 15.900 ++HETATM 8949 N DUM 8949 -4.000 20.000 -15.900 ++HETATM 8950 O DUM 8950 -4.000 20.000 15.900 ++HETATM 8951 N DUM 8951 -4.000 22.000 -15.900 ++HETATM 8952 O DUM 8952 -4.000 22.000 15.900 ++HETATM 8953 N DUM 8953 -4.000 24.000 -15.900 ++HETATM 8954 O DUM 8954 -4.000 24.000 15.900 ++HETATM 8955 N DUM 8955 -4.000 26.000 -15.900 ++HETATM 8956 O DUM 8956 -4.000 26.000 15.900 ++HETATM 8957 N DUM 8957 -2.000 -26.000 -15.900 ++HETATM 8958 O DUM 8958 -2.000 -26.000 15.900 ++HETATM 8959 N DUM 8959 -2.000 -24.000 -15.900 ++HETATM 8960 O DUM 8960 -2.000 -24.000 15.900 ++HETATM 8961 N DUM 8961 -2.000 -22.000 -15.900 ++HETATM 8962 O DUM 8962 -2.000 -22.000 15.900 ++HETATM 8963 N DUM 8963 -2.000 -20.000 -15.900 ++HETATM 8964 O DUM 8964 -2.000 -20.000 15.900 ++HETATM 8965 N DUM 8965 -2.000 -18.000 -15.900 ++HETATM 8966 O DUM 8966 -2.000 -18.000 15.900 ++HETATM 8967 N DUM 8967 -2.000 -16.000 -15.900 ++HETATM 8968 O DUM 8968 -2.000 -16.000 15.900 ++HETATM 8969 N DUM 8969 -2.000 -14.000 -15.900 ++HETATM 8970 O DUM 8970 -2.000 -14.000 15.900 ++HETATM 8971 N DUM 8971 -2.000 -12.000 -15.900 ++HETATM 8972 O DUM 8972 -2.000 -12.000 15.900 ++HETATM 8973 N DUM 8973 -2.000 -10.000 -15.900 ++HETATM 8974 O DUM 8974 -2.000 -10.000 15.900 ++HETATM 8975 N DUM 8975 -2.000 -8.000 -15.900 ++HETATM 8976 O DUM 8976 -2.000 -8.000 15.900 ++HETATM 8977 N DUM 8977 -2.000 -6.000 -15.900 ++HETATM 8978 O DUM 8978 -2.000 -6.000 15.900 ++HETATM 8979 N DUM 8979 -2.000 -4.000 -15.900 ++HETATM 8980 O DUM 8980 -2.000 -4.000 15.900 ++HETATM 8981 N DUM 8981 -2.000 -2.000 -15.900 ++HETATM 8982 O DUM 8982 -2.000 -2.000 15.900 ++HETATM 8983 N DUM 8983 -2.000 0.000 -15.900 ++HETATM 8984 O DUM 8984 -2.000 0.000 15.900 ++HETATM 8985 N DUM 8985 -2.000 2.000 -15.900 ++HETATM 8986 O DUM 8986 -2.000 2.000 15.900 ++HETATM 8987 N DUM 8987 -2.000 4.000 -15.900 ++HETATM 8988 O DUM 8988 -2.000 4.000 15.900 ++HETATM 8989 N DUM 8989 -2.000 6.000 -15.900 ++HETATM 8990 O DUM 8990 -2.000 6.000 15.900 ++HETATM 8991 N DUM 8991 -2.000 8.000 -15.900 ++HETATM 8992 O DUM 8992 -2.000 8.000 15.900 ++HETATM 8993 N DUM 8993 -2.000 10.000 -15.900 ++HETATM 8994 O DUM 8994 -2.000 10.000 15.900 ++HETATM 8995 N DUM 8995 -2.000 12.000 -15.900 ++HETATM 8996 O DUM 8996 -2.000 12.000 15.900 ++HETATM 8997 N DUM 8997 -2.000 14.000 -15.900 ++HETATM 8998 O DUM 8998 -2.000 14.000 15.900 ++HETATM 8999 N DUM 8999 -2.000 16.000 -15.900 ++HETATM 9000 O DUM 9000 -2.000 16.000 15.900 ++HETATM 9001 N DUM 9001 -2.000 18.000 -15.900 ++HETATM 9002 O DUM 9002 -2.000 18.000 15.900 ++HETATM 9003 N DUM 9003 -2.000 20.000 -15.900 ++HETATM 9004 O DUM 9004 -2.000 20.000 15.900 ++HETATM 9005 N DUM 9005 -2.000 22.000 -15.900 ++HETATM 9006 O DUM 9006 -2.000 22.000 15.900 ++HETATM 9007 N DUM 9007 -2.000 24.000 -15.900 ++HETATM 9008 O DUM 9008 -2.000 24.000 15.900 ++HETATM 9009 N DUM 9009 -2.000 26.000 -15.900 ++HETATM 9010 O DUM 9010 -2.000 26.000 15.900 ++HETATM 9011 N DUM 9011 0.000 -26.000 -15.900 ++HETATM 9012 O DUM 9012 0.000 -26.000 15.900 ++HETATM 9013 N DUM 9013 0.000 -24.000 -15.900 ++HETATM 9014 O DUM 9014 0.000 -24.000 15.900 ++HETATM 9015 N DUM 9015 0.000 -22.000 -15.900 ++HETATM 9016 O DUM 9016 0.000 -22.000 15.900 ++HETATM 9017 N DUM 9017 0.000 -20.000 -15.900 ++HETATM 9018 O DUM 9018 0.000 -20.000 15.900 ++HETATM 9019 N DUM 9019 0.000 -18.000 -15.900 ++HETATM 9020 O DUM 9020 0.000 -18.000 15.900 ++HETATM 9021 N DUM 9021 0.000 -16.000 -15.900 ++HETATM 9022 O DUM 9022 0.000 -16.000 15.900 ++HETATM 9023 N DUM 9023 0.000 -14.000 -15.900 ++HETATM 9024 O DUM 9024 0.000 -14.000 15.900 ++HETATM 9025 N DUM 9025 0.000 -12.000 -15.900 ++HETATM 9026 O DUM 9026 0.000 -12.000 15.900 ++HETATM 9027 N DUM 9027 0.000 -10.000 -15.900 ++HETATM 9028 O DUM 9028 0.000 -10.000 15.900 ++HETATM 9029 N DUM 9029 0.000 -8.000 -15.900 ++HETATM 9030 O DUM 9030 0.000 -8.000 15.900 ++HETATM 9031 N DUM 9031 0.000 -6.000 -15.900 ++HETATM 9032 O DUM 9032 0.000 -6.000 15.900 ++HETATM 9033 N DUM 9033 0.000 -4.000 -15.900 ++HETATM 9034 O DUM 9034 0.000 -4.000 15.900 ++HETATM 9035 N DUM 9035 0.000 -2.000 -15.900 ++HETATM 9036 O DUM 9036 0.000 -2.000 15.900 ++HETATM 9037 N DUM 9037 0.000 0.000 -15.900 ++HETATM 9038 O DUM 9038 0.000 0.000 15.900 ++HETATM 9039 N DUM 9039 0.000 2.000 -15.900 ++HETATM 9040 O DUM 9040 0.000 2.000 15.900 ++HETATM 9041 N DUM 9041 0.000 4.000 -15.900 ++HETATM 9042 O DUM 9042 0.000 4.000 15.900 ++HETATM 9043 N DUM 9043 0.000 6.000 -15.900 ++HETATM 9044 O DUM 9044 0.000 6.000 15.900 ++HETATM 9045 N DUM 9045 0.000 8.000 -15.900 ++HETATM 9046 O DUM 9046 0.000 8.000 15.900 ++HETATM 9047 N DUM 9047 0.000 10.000 -15.900 ++HETATM 9048 O DUM 9048 0.000 10.000 15.900 ++HETATM 9049 N DUM 9049 0.000 12.000 -15.900 ++HETATM 9050 O DUM 9050 0.000 12.000 15.900 ++HETATM 9051 N DUM 9051 0.000 14.000 -15.900 ++HETATM 9052 O DUM 9052 0.000 14.000 15.900 ++HETATM 9053 N DUM 9053 0.000 16.000 -15.900 ++HETATM 9054 O DUM 9054 0.000 16.000 15.900 ++HETATM 9055 N DUM 9055 0.000 18.000 -15.900 ++HETATM 9056 O DUM 9056 0.000 18.000 15.900 ++HETATM 9057 N DUM 9057 0.000 20.000 -15.900 ++HETATM 9058 O DUM 9058 0.000 20.000 15.900 ++HETATM 9059 N DUM 9059 0.000 22.000 -15.900 ++HETATM 9060 O DUM 9060 0.000 22.000 15.900 ++HETATM 9061 N DUM 9061 0.000 24.000 -15.900 ++HETATM 9062 O DUM 9062 0.000 24.000 15.900 ++HETATM 9063 N DUM 9063 0.000 26.000 -15.900 ++HETATM 9064 O DUM 9064 0.000 26.000 15.900 ++HETATM 9065 N DUM 9065 2.000 -26.000 -15.900 ++HETATM 9066 O DUM 9066 2.000 -26.000 15.900 ++HETATM 9067 N DUM 9067 2.000 -24.000 -15.900 ++HETATM 9068 O DUM 9068 2.000 -24.000 15.900 ++HETATM 9069 N DUM 9069 2.000 -22.000 -15.900 ++HETATM 9070 O DUM 9070 2.000 -22.000 15.900 ++HETATM 9071 N DUM 9071 2.000 -20.000 -15.900 ++HETATM 9072 O DUM 9072 2.000 -20.000 15.900 ++HETATM 9073 N DUM 9073 2.000 -18.000 -15.900 ++HETATM 9074 O DUM 9074 2.000 -18.000 15.900 ++HETATM 9075 N DUM 9075 2.000 -16.000 -15.900 ++HETATM 9076 O DUM 9076 2.000 -16.000 15.900 ++HETATM 9077 N DUM 9077 2.000 -14.000 -15.900 ++HETATM 9078 O DUM 9078 2.000 -14.000 15.900 ++HETATM 9079 N DUM 9079 2.000 -12.000 -15.900 ++HETATM 9080 O DUM 9080 2.000 -12.000 15.900 ++HETATM 9081 N DUM 9081 2.000 -10.000 -15.900 ++HETATM 9082 O DUM 9082 2.000 -10.000 15.900 ++HETATM 9083 N DUM 9083 2.000 -8.000 -15.900 ++HETATM 9084 O DUM 9084 2.000 -8.000 15.900 ++HETATM 9085 N DUM 9085 2.000 -6.000 -15.900 ++HETATM 9086 O DUM 9086 2.000 -6.000 15.900 ++HETATM 9087 N DUM 9087 2.000 -4.000 -15.900 ++HETATM 9088 O DUM 9088 2.000 -4.000 15.900 ++HETATM 9089 N DUM 9089 2.000 -2.000 -15.900 ++HETATM 9090 O DUM 9090 2.000 -2.000 15.900 ++HETATM 9091 N DUM 9091 2.000 0.000 -15.900 ++HETATM 9092 O DUM 9092 2.000 0.000 15.900 ++HETATM 9093 N DUM 9093 2.000 2.000 -15.900 ++HETATM 9094 O DUM 9094 2.000 2.000 15.900 ++HETATM 9095 N DUM 9095 2.000 4.000 -15.900 ++HETATM 9096 O DUM 9096 2.000 4.000 15.900 ++HETATM 9097 N DUM 9097 2.000 6.000 -15.900 ++HETATM 9098 O DUM 9098 2.000 6.000 15.900 ++HETATM 9099 N DUM 9099 2.000 8.000 -15.900 ++HETATM 9100 O DUM 9100 2.000 8.000 15.900 ++HETATM 9101 N DUM 9101 2.000 10.000 -15.900 ++HETATM 9102 O DUM 9102 2.000 10.000 15.900 ++HETATM 9103 N DUM 9103 2.000 12.000 -15.900 ++HETATM 9104 O DUM 9104 2.000 12.000 15.900 ++HETATM 9105 N DUM 9105 2.000 14.000 -15.900 ++HETATM 9106 O DUM 9106 2.000 14.000 15.900 ++HETATM 9107 N DUM 9107 2.000 16.000 -15.900 ++HETATM 9108 O DUM 9108 2.000 16.000 15.900 ++HETATM 9109 N DUM 9109 2.000 18.000 -15.900 ++HETATM 9110 O DUM 9110 2.000 18.000 15.900 ++HETATM 9111 N DUM 9111 2.000 20.000 -15.900 ++HETATM 9112 O DUM 9112 2.000 20.000 15.900 ++HETATM 9113 N DUM 9113 2.000 22.000 -15.900 ++HETATM 9114 O DUM 9114 2.000 22.000 15.900 ++HETATM 9115 N DUM 9115 2.000 24.000 -15.900 ++HETATM 9116 O DUM 9116 2.000 24.000 15.900 ++HETATM 9117 N DUM 9117 2.000 26.000 -15.900 ++HETATM 9118 O DUM 9118 2.000 26.000 15.900 ++HETATM 9119 N DUM 9119 4.000 -26.000 -15.900 ++HETATM 9120 O DUM 9120 4.000 -26.000 15.900 ++HETATM 9121 N DUM 9121 4.000 -24.000 -15.900 ++HETATM 9122 O DUM 9122 4.000 -24.000 15.900 ++HETATM 9123 N DUM 9123 4.000 -22.000 -15.900 ++HETATM 9124 O DUM 9124 4.000 -22.000 15.900 ++HETATM 9125 N DUM 9125 4.000 -20.000 -15.900 ++HETATM 9126 O DUM 9126 4.000 -20.000 15.900 ++HETATM 9127 N DUM 9127 4.000 -18.000 -15.900 ++HETATM 9128 O DUM 9128 4.000 -18.000 15.900 ++HETATM 9129 N DUM 9129 4.000 -16.000 -15.900 ++HETATM 9130 O DUM 9130 4.000 -16.000 15.900 ++HETATM 9131 N DUM 9131 4.000 -14.000 -15.900 ++HETATM 9132 O DUM 9132 4.000 -14.000 15.900 ++HETATM 9133 N DUM 9133 4.000 -12.000 -15.900 ++HETATM 9134 O DUM 9134 4.000 -12.000 15.900 ++HETATM 9135 N DUM 9135 4.000 -10.000 -15.900 ++HETATM 9136 O DUM 9136 4.000 -10.000 15.900 ++HETATM 9137 N DUM 9137 4.000 -8.000 -15.900 ++HETATM 9138 O DUM 9138 4.000 -8.000 15.900 ++HETATM 9139 N DUM 9139 4.000 -6.000 -15.900 ++HETATM 9140 O DUM 9140 4.000 -6.000 15.900 ++HETATM 9141 N DUM 9141 4.000 -4.000 -15.900 ++HETATM 9142 O DUM 9142 4.000 -4.000 15.900 ++HETATM 9143 N DUM 9143 4.000 -2.000 -15.900 ++HETATM 9144 O DUM 9144 4.000 -2.000 15.900 ++HETATM 9145 N DUM 9145 4.000 0.000 -15.900 ++HETATM 9146 O DUM 9146 4.000 0.000 15.900 ++HETATM 9147 N DUM 9147 4.000 2.000 -15.900 ++HETATM 9148 O DUM 9148 4.000 2.000 15.900 ++HETATM 9149 N DUM 9149 4.000 4.000 -15.900 ++HETATM 9150 O DUM 9150 4.000 4.000 15.900 ++HETATM 9151 N DUM 9151 4.000 6.000 -15.900 ++HETATM 9152 O DUM 9152 4.000 6.000 15.900 ++HETATM 9153 N DUM 9153 4.000 8.000 -15.900 ++HETATM 9154 O DUM 9154 4.000 8.000 15.900 ++HETATM 9155 N DUM 9155 4.000 10.000 -15.900 ++HETATM 9156 O DUM 9156 4.000 10.000 15.900 ++HETATM 9157 N DUM 9157 4.000 12.000 -15.900 ++HETATM 9158 O DUM 9158 4.000 12.000 15.900 ++HETATM 9159 N DUM 9159 4.000 14.000 -15.900 ++HETATM 9160 O DUM 9160 4.000 14.000 15.900 ++HETATM 9161 N DUM 9161 4.000 16.000 -15.900 ++HETATM 9162 O DUM 9162 4.000 16.000 15.900 ++HETATM 9163 N DUM 9163 4.000 18.000 -15.900 ++HETATM 9164 O DUM 9164 4.000 18.000 15.900 ++HETATM 9165 N DUM 9165 4.000 20.000 -15.900 ++HETATM 9166 O DUM 9166 4.000 20.000 15.900 ++HETATM 9167 N DUM 9167 4.000 22.000 -15.900 ++HETATM 9168 O DUM 9168 4.000 22.000 15.900 ++HETATM 9169 N DUM 9169 4.000 24.000 -15.900 ++HETATM 9170 O DUM 9170 4.000 24.000 15.900 ++HETATM 9171 N DUM 9171 4.000 26.000 -15.900 ++HETATM 9172 O DUM 9172 4.000 26.000 15.900 ++HETATM 9173 N DUM 9173 6.000 -26.000 -15.900 ++HETATM 9174 O DUM 9174 6.000 -26.000 15.900 ++HETATM 9175 N DUM 9175 6.000 -24.000 -15.900 ++HETATM 9176 O DUM 9176 6.000 -24.000 15.900 ++HETATM 9177 N DUM 9177 6.000 -22.000 -15.900 ++HETATM 9178 O DUM 9178 6.000 -22.000 15.900 ++HETATM 9179 N DUM 9179 6.000 -20.000 -15.900 ++HETATM 9180 O DUM 9180 6.000 -20.000 15.900 ++HETATM 9181 N DUM 9181 6.000 -18.000 -15.900 ++HETATM 9182 O DUM 9182 6.000 -18.000 15.900 ++HETATM 9183 N DUM 9183 6.000 -16.000 -15.900 ++HETATM 9184 O DUM 9184 6.000 -16.000 15.900 ++HETATM 9185 N DUM 9185 6.000 -14.000 -15.900 ++HETATM 9186 O DUM 9186 6.000 -14.000 15.900 ++HETATM 9187 N DUM 9187 6.000 -12.000 -15.900 ++HETATM 9188 O DUM 9188 6.000 -12.000 15.900 ++HETATM 9189 N DUM 9189 6.000 -10.000 -15.900 ++HETATM 9190 O DUM 9190 6.000 -10.000 15.900 ++HETATM 9191 N DUM 9191 6.000 -8.000 -15.900 ++HETATM 9192 O DUM 9192 6.000 -8.000 15.900 ++HETATM 9193 N DUM 9193 6.000 -6.000 -15.900 ++HETATM 9194 O DUM 9194 6.000 -6.000 15.900 ++HETATM 9195 N DUM 9195 6.000 -4.000 -15.900 ++HETATM 9196 O DUM 9196 6.000 -4.000 15.900 ++HETATM 9197 N DUM 9197 6.000 -2.000 -15.900 ++HETATM 9198 O DUM 9198 6.000 -2.000 15.900 ++HETATM 9199 N DUM 9199 6.000 0.000 -15.900 ++HETATM 9200 O DUM 9200 6.000 0.000 15.900 ++HETATM 9201 N DUM 9201 6.000 2.000 -15.900 ++HETATM 9202 O DUM 9202 6.000 2.000 15.900 ++HETATM 9203 N DUM 9203 6.000 4.000 -15.900 ++HETATM 9204 O DUM 9204 6.000 4.000 15.900 ++HETATM 9205 N DUM 9205 6.000 6.000 -15.900 ++HETATM 9206 O DUM 9206 6.000 6.000 15.900 ++HETATM 9207 N DUM 9207 6.000 8.000 -15.900 ++HETATM 9208 O DUM 9208 6.000 8.000 15.900 ++HETATM 9209 N DUM 9209 6.000 10.000 -15.900 ++HETATM 9210 O DUM 9210 6.000 10.000 15.900 ++HETATM 9211 N DUM 9211 6.000 12.000 -15.900 ++HETATM 9212 O DUM 9212 6.000 12.000 15.900 ++HETATM 9213 N DUM 9213 6.000 14.000 -15.900 ++HETATM 9214 O DUM 9214 6.000 14.000 15.900 ++HETATM 9215 N DUM 9215 6.000 16.000 -15.900 ++HETATM 9216 O DUM 9216 6.000 16.000 15.900 ++HETATM 9217 N DUM 9217 6.000 18.000 -15.900 ++HETATM 9218 O DUM 9218 6.000 18.000 15.900 ++HETATM 9219 N DUM 9219 6.000 20.000 -15.900 ++HETATM 9220 O DUM 9220 6.000 20.000 15.900 ++HETATM 9221 N DUM 9221 6.000 22.000 -15.900 ++HETATM 9222 O DUM 9222 6.000 22.000 15.900 ++HETATM 9223 N DUM 9223 6.000 24.000 -15.900 ++HETATM 9224 O DUM 9224 6.000 24.000 15.900 ++HETATM 9225 N DUM 9225 6.000 26.000 -15.900 ++HETATM 9226 O DUM 9226 6.000 26.000 15.900 ++HETATM 9227 N DUM 9227 8.000 -26.000 -15.900 ++HETATM 9228 O DUM 9228 8.000 -26.000 15.900 ++HETATM 9229 N DUM 9229 8.000 -24.000 -15.900 ++HETATM 9230 O DUM 9230 8.000 -24.000 15.900 ++HETATM 9231 N DUM 9231 8.000 -22.000 -15.900 ++HETATM 9232 O DUM 9232 8.000 -22.000 15.900 ++HETATM 9233 N DUM 9233 8.000 -20.000 -15.900 ++HETATM 9234 O DUM 9234 8.000 -20.000 15.900 ++HETATM 9235 N DUM 9235 8.000 -18.000 -15.900 ++HETATM 9236 O DUM 9236 8.000 -18.000 15.900 ++HETATM 9237 N DUM 9237 8.000 -16.000 -15.900 ++HETATM 9238 O DUM 9238 8.000 -16.000 15.900 ++HETATM 9239 N DUM 9239 8.000 -14.000 -15.900 ++HETATM 9240 O DUM 9240 8.000 -14.000 15.900 ++HETATM 9241 N DUM 9241 8.000 -12.000 -15.900 ++HETATM 9242 O DUM 9242 8.000 -12.000 15.900 ++HETATM 9243 N DUM 9243 8.000 -10.000 -15.900 ++HETATM 9244 O DUM 9244 8.000 -10.000 15.900 ++HETATM 9245 N DUM 9245 8.000 -8.000 -15.900 ++HETATM 9246 O DUM 9246 8.000 -8.000 15.900 ++HETATM 9247 N DUM 9247 8.000 -6.000 -15.900 ++HETATM 9248 O DUM 9248 8.000 -6.000 15.900 ++HETATM 9249 N DUM 9249 8.000 -4.000 -15.900 ++HETATM 9250 O DUM 9250 8.000 -4.000 15.900 ++HETATM 9251 N DUM 9251 8.000 -2.000 -15.900 ++HETATM 9252 O DUM 9252 8.000 -2.000 15.900 ++HETATM 9253 N DUM 9253 8.000 0.000 -15.900 ++HETATM 9254 O DUM 9254 8.000 0.000 15.900 ++HETATM 9255 N DUM 9255 8.000 2.000 -15.900 ++HETATM 9256 O DUM 9256 8.000 2.000 15.900 ++HETATM 9257 N DUM 9257 8.000 4.000 -15.900 ++HETATM 9258 O DUM 9258 8.000 4.000 15.900 ++HETATM 9259 N DUM 9259 8.000 6.000 -15.900 ++HETATM 9260 O DUM 9260 8.000 6.000 15.900 ++HETATM 9261 N DUM 9261 8.000 8.000 -15.900 ++HETATM 9262 O DUM 9262 8.000 8.000 15.900 ++HETATM 9263 N DUM 9263 8.000 10.000 -15.900 ++HETATM 9264 O DUM 9264 8.000 10.000 15.900 ++HETATM 9265 N DUM 9265 8.000 12.000 -15.900 ++HETATM 9266 O DUM 9266 8.000 12.000 15.900 ++HETATM 9267 N DUM 9267 8.000 14.000 -15.900 ++HETATM 9268 O DUM 9268 8.000 14.000 15.900 ++HETATM 9269 N DUM 9269 8.000 16.000 -15.900 ++HETATM 9270 O DUM 9270 8.000 16.000 15.900 ++HETATM 9271 N DUM 9271 8.000 18.000 -15.900 ++HETATM 9272 O DUM 9272 8.000 18.000 15.900 ++HETATM 9273 N DUM 9273 8.000 20.000 -15.900 ++HETATM 9274 O DUM 9274 8.000 20.000 15.900 ++HETATM 9275 N DUM 9275 8.000 22.000 -15.900 ++HETATM 9276 O DUM 9276 8.000 22.000 15.900 ++HETATM 9277 N DUM 9277 8.000 24.000 -15.900 ++HETATM 9278 O DUM 9278 8.000 24.000 15.900 ++HETATM 9279 N DUM 9279 8.000 26.000 -15.900 ++HETATM 9280 O DUM 9280 8.000 26.000 15.900 ++HETATM 9281 N DUM 9281 10.000 -24.000 -15.900 ++HETATM 9282 O DUM 9282 10.000 -24.000 15.900 ++HETATM 9283 N DUM 9283 10.000 -22.000 -15.900 ++HETATM 9284 O DUM 9284 10.000 -22.000 15.900 ++HETATM 9285 N DUM 9285 10.000 -20.000 -15.900 ++HETATM 9286 O DUM 9286 10.000 -20.000 15.900 ++HETATM 9287 N DUM 9287 10.000 -18.000 -15.900 ++HETATM 9288 O DUM 9288 10.000 -18.000 15.900 ++HETATM 9289 N DUM 9289 10.000 -16.000 -15.900 ++HETATM 9290 O DUM 9290 10.000 -16.000 15.900 ++HETATM 9291 N DUM 9291 10.000 -14.000 -15.900 ++HETATM 9292 O DUM 9292 10.000 -14.000 15.900 ++HETATM 9293 N DUM 9293 10.000 -12.000 -15.900 ++HETATM 9294 O DUM 9294 10.000 -12.000 15.900 ++HETATM 9295 N DUM 9295 10.000 -10.000 -15.900 ++HETATM 9296 O DUM 9296 10.000 -10.000 15.900 ++HETATM 9297 N DUM 9297 10.000 -8.000 -15.900 ++HETATM 9298 O DUM 9298 10.000 -8.000 15.900 ++HETATM 9299 N DUM 9299 10.000 -6.000 -15.900 ++HETATM 9300 O DUM 9300 10.000 -6.000 15.900 ++HETATM 9301 N DUM 9301 10.000 -4.000 -15.900 ++HETATM 9302 O DUM 9302 10.000 -4.000 15.900 ++HETATM 9303 N DUM 9303 10.000 -2.000 -15.900 ++HETATM 9304 O DUM 9304 10.000 -2.000 15.900 ++HETATM 9305 N DUM 9305 10.000 0.000 -15.900 ++HETATM 9306 O DUM 9306 10.000 0.000 15.900 ++HETATM 9307 N DUM 9307 10.000 2.000 -15.900 ++HETATM 9308 O DUM 9308 10.000 2.000 15.900 ++HETATM 9309 N DUM 9309 10.000 4.000 -15.900 ++HETATM 9310 O DUM 9310 10.000 4.000 15.900 ++HETATM 9311 N DUM 9311 10.000 6.000 -15.900 ++HETATM 9312 O DUM 9312 10.000 6.000 15.900 ++HETATM 9313 N DUM 9313 10.000 8.000 -15.900 ++HETATM 9314 O DUM 9314 10.000 8.000 15.900 ++HETATM 9315 N DUM 9315 10.000 10.000 -15.900 ++HETATM 9316 O DUM 9316 10.000 10.000 15.900 ++HETATM 9317 N DUM 9317 10.000 12.000 -15.900 ++HETATM 9318 O DUM 9318 10.000 12.000 15.900 ++HETATM 9319 N DUM 9319 10.000 14.000 -15.900 ++HETATM 9320 O DUM 9320 10.000 14.000 15.900 ++HETATM 9321 N DUM 9321 10.000 16.000 -15.900 ++HETATM 9322 O DUM 9322 10.000 16.000 15.900 ++HETATM 9323 N DUM 9323 10.000 18.000 -15.900 ++HETATM 9324 O DUM 9324 10.000 18.000 15.900 ++HETATM 9325 N DUM 9325 10.000 20.000 -15.900 ++HETATM 9326 O DUM 9326 10.000 20.000 15.900 ++HETATM 9327 N DUM 9327 10.000 22.000 -15.900 ++HETATM 9328 O DUM 9328 10.000 22.000 15.900 ++HETATM 9329 N DUM 9329 10.000 24.000 -15.900 ++HETATM 9330 O DUM 9330 10.000 24.000 15.900 ++HETATM 9331 N DUM 9331 12.000 -24.000 -15.900 ++HETATM 9332 O DUM 9332 12.000 -24.000 15.900 ++HETATM 9333 N DUM 9333 12.000 -22.000 -15.900 ++HETATM 9334 O DUM 9334 12.000 -22.000 15.900 ++HETATM 9335 N DUM 9335 12.000 -20.000 -15.900 ++HETATM 9336 O DUM 9336 12.000 -20.000 15.900 ++HETATM 9337 N DUM 9337 12.000 -18.000 -15.900 ++HETATM 9338 O DUM 9338 12.000 -18.000 15.900 ++HETATM 9339 N DUM 9339 12.000 -16.000 -15.900 ++HETATM 9340 O DUM 9340 12.000 -16.000 15.900 ++HETATM 9341 N DUM 9341 12.000 -14.000 -15.900 ++HETATM 9342 O DUM 9342 12.000 -14.000 15.900 ++HETATM 9343 N DUM 9343 12.000 -12.000 -15.900 ++HETATM 9344 O DUM 9344 12.000 -12.000 15.900 ++HETATM 9345 N DUM 9345 12.000 -10.000 -15.900 ++HETATM 9346 O DUM 9346 12.000 -10.000 15.900 ++HETATM 9347 N DUM 9347 12.000 -8.000 -15.900 ++HETATM 9348 O DUM 9348 12.000 -8.000 15.900 ++HETATM 9349 N DUM 9349 12.000 -6.000 -15.900 ++HETATM 9350 O DUM 9350 12.000 -6.000 15.900 ++HETATM 9351 N DUM 9351 12.000 -4.000 -15.900 ++HETATM 9352 O DUM 9352 12.000 -4.000 15.900 ++HETATM 9353 N DUM 9353 12.000 -2.000 -15.900 ++HETATM 9354 O DUM 9354 12.000 -2.000 15.900 ++HETATM 9355 N DUM 9355 12.000 0.000 -15.900 ++HETATM 9356 O DUM 9356 12.000 0.000 15.900 ++HETATM 9357 N DUM 9357 12.000 2.000 -15.900 ++HETATM 9358 O DUM 9358 12.000 2.000 15.900 ++HETATM 9359 N DUM 9359 12.000 4.000 -15.900 ++HETATM 9360 O DUM 9360 12.000 4.000 15.900 ++HETATM 9361 N DUM 9361 12.000 6.000 -15.900 ++HETATM 9362 O DUM 9362 12.000 6.000 15.900 ++HETATM 9363 N DUM 9363 12.000 8.000 -15.900 ++HETATM 9364 O DUM 9364 12.000 8.000 15.900 ++HETATM 9365 N DUM 9365 12.000 10.000 -15.900 ++HETATM 9366 O DUM 9366 12.000 10.000 15.900 ++HETATM 9367 N DUM 9367 12.000 12.000 -15.900 ++HETATM 9368 O DUM 9368 12.000 12.000 15.900 ++HETATM 9369 N DUM 9369 12.000 14.000 -15.900 ++HETATM 9370 O DUM 9370 12.000 14.000 15.900 ++HETATM 9371 N DUM 9371 12.000 16.000 -15.900 ++HETATM 9372 O DUM 9372 12.000 16.000 15.900 ++HETATM 9373 N DUM 9373 12.000 18.000 -15.900 ++HETATM 9374 O DUM 9374 12.000 18.000 15.900 ++HETATM 9375 N DUM 9375 12.000 20.000 -15.900 ++HETATM 9376 O DUM 9376 12.000 20.000 15.900 ++HETATM 9377 N DUM 9377 12.000 22.000 -15.900 ++HETATM 9378 O DUM 9378 12.000 22.000 15.900 ++HETATM 9379 N DUM 9379 12.000 24.000 -15.900 ++HETATM 9380 O DUM 9380 12.000 24.000 15.900 ++HETATM 9381 N DUM 9381 14.000 -22.000 -15.900 ++HETATM 9382 O DUM 9382 14.000 -22.000 15.900 ++HETATM 9383 N DUM 9383 14.000 -20.000 -15.900 ++HETATM 9384 O DUM 9384 14.000 -20.000 15.900 ++HETATM 9385 N DUM 9385 14.000 -18.000 -15.900 ++HETATM 9386 O DUM 9386 14.000 -18.000 15.900 ++HETATM 9387 N DUM 9387 14.000 -16.000 -15.900 ++HETATM 9388 O DUM 9388 14.000 -16.000 15.900 ++HETATM 9389 N DUM 9389 14.000 -14.000 -15.900 ++HETATM 9390 O DUM 9390 14.000 -14.000 15.900 ++HETATM 9391 N DUM 9391 14.000 -12.000 -15.900 ++HETATM 9392 O DUM 9392 14.000 -12.000 15.900 ++HETATM 9393 N DUM 9393 14.000 -10.000 -15.900 ++HETATM 9394 O DUM 9394 14.000 -10.000 15.900 ++HETATM 9395 N DUM 9395 14.000 -8.000 -15.900 ++HETATM 9396 O DUM 9396 14.000 -8.000 15.900 ++HETATM 9397 N DUM 9397 14.000 -6.000 -15.900 ++HETATM 9398 O DUM 9398 14.000 -6.000 15.900 ++HETATM 9399 N DUM 9399 14.000 -4.000 -15.900 ++HETATM 9400 O DUM 9400 14.000 -4.000 15.900 ++HETATM 9401 N DUM 9401 14.000 -2.000 -15.900 ++HETATM 9402 O DUM 9402 14.000 -2.000 15.900 ++HETATM 9403 N DUM 9403 14.000 0.000 -15.900 ++HETATM 9404 O DUM 9404 14.000 0.000 15.900 ++HETATM 9405 N DUM 9405 14.000 2.000 -15.900 ++HETATM 9406 O DUM 9406 14.000 2.000 15.900 ++HETATM 9407 N DUM 9407 14.000 4.000 -15.900 ++HETATM 9408 O DUM 9408 14.000 4.000 15.900 ++HETATM 9409 N DUM 9409 14.000 6.000 -15.900 ++HETATM 9410 O DUM 9410 14.000 6.000 15.900 ++HETATM 9411 N DUM 9411 14.000 8.000 -15.900 ++HETATM 9412 O DUM 9412 14.000 8.000 15.900 ++HETATM 9413 N DUM 9413 14.000 10.000 -15.900 ++HETATM 9414 O DUM 9414 14.000 10.000 15.900 ++HETATM 9415 N DUM 9415 14.000 12.000 -15.900 ++HETATM 9416 O DUM 9416 14.000 12.000 15.900 ++HETATM 9417 N DUM 9417 14.000 14.000 -15.900 ++HETATM 9418 O DUM 9418 14.000 14.000 15.900 ++HETATM 9419 N DUM 9419 14.000 16.000 -15.900 ++HETATM 9420 O DUM 9420 14.000 16.000 15.900 ++HETATM 9421 N DUM 9421 14.000 18.000 -15.900 ++HETATM 9422 O DUM 9422 14.000 18.000 15.900 ++HETATM 9423 N DUM 9423 14.000 20.000 -15.900 ++HETATM 9424 O DUM 9424 14.000 20.000 15.900 ++HETATM 9425 N DUM 9425 14.000 22.000 -15.900 ++HETATM 9426 O DUM 9426 14.000 22.000 15.900 ++HETATM 9427 N DUM 9427 16.000 -22.000 -15.900 ++HETATM 9428 O DUM 9428 16.000 -22.000 15.900 ++HETATM 9429 N DUM 9429 16.000 -20.000 -15.900 ++HETATM 9430 O DUM 9430 16.000 -20.000 15.900 ++HETATM 9431 N DUM 9431 16.000 -18.000 -15.900 ++HETATM 9432 O DUM 9432 16.000 -18.000 15.900 ++HETATM 9433 N DUM 9433 16.000 -16.000 -15.900 ++HETATM 9434 O DUM 9434 16.000 -16.000 15.900 ++HETATM 9435 N DUM 9435 16.000 -14.000 -15.900 ++HETATM 9436 O DUM 9436 16.000 -14.000 15.900 ++HETATM 9437 N DUM 9437 16.000 -12.000 -15.900 ++HETATM 9438 O DUM 9438 16.000 -12.000 15.900 ++HETATM 9439 N DUM 9439 16.000 -10.000 -15.900 ++HETATM 9440 O DUM 9440 16.000 -10.000 15.900 ++HETATM 9441 N DUM 9441 16.000 -8.000 -15.900 ++HETATM 9442 O DUM 9442 16.000 -8.000 15.900 ++HETATM 9443 N DUM 9443 16.000 -6.000 -15.900 ++HETATM 9444 O DUM 9444 16.000 -6.000 15.900 ++HETATM 9445 N DUM 9445 16.000 -4.000 -15.900 ++HETATM 9446 O DUM 9446 16.000 -4.000 15.900 ++HETATM 9447 N DUM 9447 16.000 -2.000 -15.900 ++HETATM 9448 O DUM 9448 16.000 -2.000 15.900 ++HETATM 9449 N DUM 9449 16.000 0.000 -15.900 ++HETATM 9450 O DUM 9450 16.000 0.000 15.900 ++HETATM 9451 N DUM 9451 16.000 2.000 -15.900 ++HETATM 9452 O DUM 9452 16.000 2.000 15.900 ++HETATM 9453 N DUM 9453 16.000 4.000 -15.900 ++HETATM 9454 O DUM 9454 16.000 4.000 15.900 ++HETATM 9455 N DUM 9455 16.000 6.000 -15.900 ++HETATM 9456 O DUM 9456 16.000 6.000 15.900 ++HETATM 9457 N DUM 9457 16.000 8.000 -15.900 ++HETATM 9458 O DUM 9458 16.000 8.000 15.900 ++HETATM 9459 N DUM 9459 16.000 10.000 -15.900 ++HETATM 9460 O DUM 9460 16.000 10.000 15.900 ++HETATM 9461 N DUM 9461 16.000 12.000 -15.900 ++HETATM 9462 O DUM 9462 16.000 12.000 15.900 ++HETATM 9463 N DUM 9463 16.000 14.000 -15.900 ++HETATM 9464 O DUM 9464 16.000 14.000 15.900 ++HETATM 9465 N DUM 9465 16.000 16.000 -15.900 ++HETATM 9466 O DUM 9466 16.000 16.000 15.900 ++HETATM 9467 N DUM 9467 16.000 18.000 -15.900 ++HETATM 9468 O DUM 9468 16.000 18.000 15.900 ++HETATM 9469 N DUM 9469 16.000 20.000 -15.900 ++HETATM 9470 O DUM 9470 16.000 20.000 15.900 ++HETATM 9471 N DUM 9471 16.000 22.000 -15.900 ++HETATM 9472 O DUM 9472 16.000 22.000 15.900 ++HETATM 9473 N DUM 9473 18.000 -20.000 -15.900 ++HETATM 9474 O DUM 9474 18.000 -20.000 15.900 ++HETATM 9475 N DUM 9475 18.000 -18.000 -15.900 ++HETATM 9476 O DUM 9476 18.000 -18.000 15.900 ++HETATM 9477 N DUM 9477 18.000 -16.000 -15.900 ++HETATM 9478 O DUM 9478 18.000 -16.000 15.900 ++HETATM 9479 N DUM 9479 18.000 -14.000 -15.900 ++HETATM 9480 O DUM 9480 18.000 -14.000 15.900 ++HETATM 9481 N DUM 9481 18.000 -12.000 -15.900 ++HETATM 9482 O DUM 9482 18.000 -12.000 15.900 ++HETATM 9483 N DUM 9483 18.000 -10.000 -15.900 ++HETATM 9484 O DUM 9484 18.000 -10.000 15.900 ++HETATM 9485 N DUM 9485 18.000 -8.000 -15.900 ++HETATM 9486 O DUM 9486 18.000 -8.000 15.900 ++HETATM 9487 N DUM 9487 18.000 -6.000 -15.900 ++HETATM 9488 O DUM 9488 18.000 -6.000 15.900 ++HETATM 9489 N DUM 9489 18.000 -4.000 -15.900 ++HETATM 9490 O DUM 9490 18.000 -4.000 15.900 ++HETATM 9491 N DUM 9491 18.000 -2.000 -15.900 ++HETATM 9492 O DUM 9492 18.000 -2.000 15.900 ++HETATM 9493 N DUM 9493 18.000 0.000 -15.900 ++HETATM 9494 O DUM 9494 18.000 0.000 15.900 ++HETATM 9495 N DUM 9495 18.000 2.000 -15.900 ++HETATM 9496 O DUM 9496 18.000 2.000 15.900 ++HETATM 9497 N DUM 9497 18.000 4.000 -15.900 ++HETATM 9498 O DUM 9498 18.000 4.000 15.900 ++HETATM 9499 N DUM 9499 18.000 6.000 -15.900 ++HETATM 9500 O DUM 9500 18.000 6.000 15.900 ++HETATM 9501 N DUM 9501 18.000 8.000 -15.900 ++HETATM 9502 O DUM 9502 18.000 8.000 15.900 ++HETATM 9503 N DUM 9503 18.000 10.000 -15.900 ++HETATM 9504 O DUM 9504 18.000 10.000 15.900 ++HETATM 9505 N DUM 9505 18.000 12.000 -15.900 ++HETATM 9506 O DUM 9506 18.000 12.000 15.900 ++HETATM 9507 N DUM 9507 18.000 14.000 -15.900 ++HETATM 9508 O DUM 9508 18.000 14.000 15.900 ++HETATM 9509 N DUM 9509 18.000 16.000 -15.900 ++HETATM 9510 O DUM 9510 18.000 16.000 15.900 ++HETATM 9511 N DUM 9511 18.000 18.000 -15.900 ++HETATM 9512 O DUM 9512 18.000 18.000 15.900 ++HETATM 9513 N DUM 9513 18.000 20.000 -15.900 ++HETATM 9514 O DUM 9514 18.000 20.000 15.900 ++HETATM 9515 N DUM 9515 20.000 -18.000 -15.900 ++HETATM 9516 O DUM 9516 20.000 -18.000 15.900 ++HETATM 9517 N DUM 9517 20.000 -16.000 -15.900 ++HETATM 9518 O DUM 9518 20.000 -16.000 15.900 ++HETATM 9519 N DUM 9519 20.000 -14.000 -15.900 ++HETATM 9520 O DUM 9520 20.000 -14.000 15.900 ++HETATM 9521 N DUM 9521 20.000 -12.000 -15.900 ++HETATM 9522 O DUM 9522 20.000 -12.000 15.900 ++HETATM 9523 N DUM 9523 20.000 -10.000 -15.900 ++HETATM 9524 O DUM 9524 20.000 -10.000 15.900 ++HETATM 9525 N DUM 9525 20.000 -8.000 -15.900 ++HETATM 9526 O DUM 9526 20.000 -8.000 15.900 ++HETATM 9527 N DUM 9527 20.000 -6.000 -15.900 ++HETATM 9528 O DUM 9528 20.000 -6.000 15.900 ++HETATM 9529 N DUM 9529 20.000 -4.000 -15.900 ++HETATM 9530 O DUM 9530 20.000 -4.000 15.900 ++HETATM 9531 N DUM 9531 20.000 -2.000 -15.900 ++HETATM 9532 O DUM 9532 20.000 -2.000 15.900 ++HETATM 9533 N DUM 9533 20.000 0.000 -15.900 ++HETATM 9534 O DUM 9534 20.000 0.000 15.900 ++HETATM 9535 N DUM 9535 20.000 2.000 -15.900 ++HETATM 9536 O DUM 9536 20.000 2.000 15.900 ++HETATM 9537 N DUM 9537 20.000 4.000 -15.900 ++HETATM 9538 O DUM 9538 20.000 4.000 15.900 ++HETATM 9539 N DUM 9539 20.000 6.000 -15.900 ++HETATM 9540 O DUM 9540 20.000 6.000 15.900 ++HETATM 9541 N DUM 9541 20.000 8.000 -15.900 ++HETATM 9542 O DUM 9542 20.000 8.000 15.900 ++HETATM 9543 N DUM 9543 20.000 10.000 -15.900 ++HETATM 9544 O DUM 9544 20.000 10.000 15.900 ++HETATM 9545 N DUM 9545 20.000 12.000 -15.900 ++HETATM 9546 O DUM 9546 20.000 12.000 15.900 ++HETATM 9547 N DUM 9547 20.000 14.000 -15.900 ++HETATM 9548 O DUM 9548 20.000 14.000 15.900 ++HETATM 9549 N DUM 9549 20.000 16.000 -15.900 ++HETATM 9550 O DUM 9550 20.000 16.000 15.900 ++HETATM 9551 N DUM 9551 20.000 18.000 -15.900 ++HETATM 9552 O DUM 9552 20.000 18.000 15.900 ++HETATM 9553 N DUM 9553 22.000 -16.000 -15.900 ++HETATM 9554 O DUM 9554 22.000 -16.000 15.900 ++HETATM 9555 N DUM 9555 22.000 -14.000 -15.900 ++HETATM 9556 O DUM 9556 22.000 -14.000 15.900 ++HETATM 9557 N DUM 9557 22.000 -12.000 -15.900 ++HETATM 9558 O DUM 9558 22.000 -12.000 15.900 ++HETATM 9559 N DUM 9559 22.000 -10.000 -15.900 ++HETATM 9560 O DUM 9560 22.000 -10.000 15.900 ++HETATM 9561 N DUM 9561 22.000 -8.000 -15.900 ++HETATM 9562 O DUM 9562 22.000 -8.000 15.900 ++HETATM 9563 N DUM 9563 22.000 -6.000 -15.900 ++HETATM 9564 O DUM 9564 22.000 -6.000 15.900 ++HETATM 9565 N DUM 9565 22.000 -4.000 -15.900 ++HETATM 9566 O DUM 9566 22.000 -4.000 15.900 ++HETATM 9567 N DUM 9567 22.000 -2.000 -15.900 ++HETATM 9568 O DUM 9568 22.000 -2.000 15.900 ++HETATM 9569 N DUM 9569 22.000 0.000 -15.900 ++HETATM 9570 O DUM 9570 22.000 0.000 15.900 ++HETATM 9571 N DUM 9571 22.000 2.000 -15.900 ++HETATM 9572 O DUM 9572 22.000 2.000 15.900 ++HETATM 9573 N DUM 9573 22.000 4.000 -15.900 ++HETATM 9574 O DUM 9574 22.000 4.000 15.900 ++HETATM 9575 N DUM 9575 22.000 6.000 -15.900 ++HETATM 9576 O DUM 9576 22.000 6.000 15.900 ++HETATM 9577 N DUM 9577 22.000 8.000 -15.900 ++HETATM 9578 O DUM 9578 22.000 8.000 15.900 ++HETATM 9579 N DUM 9579 22.000 10.000 -15.900 ++HETATM 9580 O DUM 9580 22.000 10.000 15.900 ++HETATM 9581 N DUM 9581 22.000 12.000 -15.900 ++HETATM 9582 O DUM 9582 22.000 12.000 15.900 ++HETATM 9583 N DUM 9583 22.000 14.000 -15.900 ++HETATM 9584 O DUM 9584 22.000 14.000 15.900 ++HETATM 9585 N DUM 9585 22.000 16.000 -15.900 ++HETATM 9586 O DUM 9586 22.000 16.000 15.900 ++HETATM 9587 N DUM 9587 24.000 -12.000 -15.900 ++HETATM 9588 O DUM 9588 24.000 -12.000 15.900 ++HETATM 9589 N DUM 9589 24.000 -10.000 -15.900 ++HETATM 9590 O DUM 9590 24.000 -10.000 15.900 ++HETATM 9591 N DUM 9591 24.000 -8.000 -15.900 ++HETATM 9592 O DUM 9592 24.000 -8.000 15.900 ++HETATM 9593 N DUM 9593 24.000 -6.000 -15.900 ++HETATM 9594 O DUM 9594 24.000 -6.000 15.900 ++HETATM 9595 N DUM 9595 24.000 -4.000 -15.900 ++HETATM 9596 O DUM 9596 24.000 -4.000 15.900 ++HETATM 9597 N DUM 9597 24.000 -2.000 -15.900 ++HETATM 9598 O DUM 9598 24.000 -2.000 15.900 ++HETATM 9599 N DUM 9599 24.000 0.000 -15.900 ++HETATM 9600 O DUM 9600 24.000 0.000 15.900 ++HETATM 9601 N DUM 9601 24.000 2.000 -15.900 ++HETATM 9602 O DUM 9602 24.000 2.000 15.900 ++HETATM 9603 N DUM 9603 24.000 4.000 -15.900 ++HETATM 9604 O DUM 9604 24.000 4.000 15.900 ++HETATM 9605 N DUM 9605 24.000 6.000 -15.900 ++HETATM 9606 O DUM 9606 24.000 6.000 15.900 ++HETATM 9607 N DUM 9607 24.000 8.000 -15.900 ++HETATM 9608 O DUM 9608 24.000 8.000 15.900 ++HETATM 9609 N DUM 9609 24.000 10.000 -15.900 ++HETATM 9610 O DUM 9610 24.000 10.000 15.900 ++HETATM 9611 N DUM 9611 24.000 12.000 -15.900 ++HETATM 9612 O DUM 9612 24.000 12.000 15.900 ++HETATM 9613 N DUM 9613 26.000 -8.000 -15.900 ++HETATM 9614 O DUM 9614 26.000 -8.000 15.900 ++HETATM 9615 N DUM 9615 26.000 -6.000 -15.900 ++HETATM 9616 O DUM 9616 26.000 -6.000 15.900 ++HETATM 9617 N DUM 9617 26.000 -4.000 -15.900 ++HETATM 9618 O DUM 9618 26.000 -4.000 15.900 ++HETATM 9619 N DUM 9619 26.000 -2.000 -15.900 ++HETATM 9620 O DUM 9620 26.000 -2.000 15.900 ++HETATM 9621 N DUM 9621 26.000 0.000 -15.900 ++HETATM 9622 O DUM 9622 26.000 0.000 15.900 ++HETATM 9623 N DUM 9623 26.000 2.000 -15.900 ++HETATM 9624 O DUM 9624 26.000 2.000 15.900 ++HETATM 9625 N DUM 9625 26.000 4.000 -15.900 ++HETATM 9626 O DUM 9626 26.000 4.000 15.900 ++HETATM 9627 N DUM 9627 26.000 6.000 -15.900 ++HETATM 9628 O DUM 9628 26.000 6.000 15.900 ++HETATM 9629 N DUM 9629 26.000 8.000 -15.900 ++HETATM 9630 O DUM 9630 26.000 8.000 15.900 +diff --git a/usercase-test-coderl/offline_network_guard.mjs b/usercase-test-coderl/offline_network_guard.mjs +new file mode 100644 +--- /dev/null ++++ b/usercase-test-coderl/offline_network_guard.mjs +@@ -0,0 +1,43 @@ ++ ++import childProcess from 'node:child_process'; ++import dgram from 'node:dgram'; ++import http from 'node:http'; ++import https from 'node:https'; ++import net from 'node:net'; ++ ++function blocked(name) { ++ return function offlineBlocked() { ++ throw new Error(`local offline network blocked: ${name}`); ++ }; ++} ++ ++for (const mod of [http, https]) { ++ mod.request = blocked(`${mod === http ? 'http' : 'https'}.request`); ++ mod.get = blocked(`${mod === http ? 'http' : 'https'}.get`); ++} ++ ++net.connect = blocked('net.connect'); ++net.createConnection = blocked('net.createConnection'); ++net.Socket.prototype.connect = blocked('net.Socket.connect'); ++dgram.createSocket = blocked('dgram.createSocket'); ++ ++if ('fetch' in globalThis) { ++ globalThis.fetch = blocked('fetch'); ++} ++ ++globalThis.XMLHttpRequest = class OfflineXMLHttpRequest { ++ constructor() { ++ throw new Error('local offline network blocked: XMLHttpRequest'); ++ } ++}; ++ ++for (const name of ['exec', 'execFile', 'fork', 'spawn']) { ++ const original = childProcess[name]; ++ childProcess[name] = function guardedChildProcess(command, ...args) { ++ const commandName = Array.isArray(command) ? command[0] : String(command); ++ if (/\b(?:curl|wget|npm|npx|pnpm|yarn|git|ssh|scp)\b/.test(commandName)) { ++ throw new Error(`local offline network blocked: child_process.${name} ${commandName}`); ++ } ++ return original.call(this, command, ...args); ++ }; ++} +diff --git a/usercase-test-coderl/opm_viewer.test.js b/usercase-test-coderl/opm_viewer.test.js +new file mode 100644 +--- /dev/null ++++ b/usercase-test-coderl/opm_viewer.test.js +@@ -0,0 +1,383 @@ ++import assert from 'node:assert/strict'; ++import fs from 'node:fs'; ++import test from 'node:test'; ++ ++const FIXTURES = '/workspace/repo/usercase-test-coderl/fixtures'; ++const OPM_6JXR_URL = 'https://opm-assets.storage.googleapis.com/pdb/6jxr.pdb'; ++const MISSING_OPM_MESSAGE = ++ 'This is probably not a transmembrane protein. It has no data in Orientations of Proteins in Membranes(OPM) database.'; ++const OPM_PDB = fs.readFileSync(`${FIXTURES}/6jxr.pdb`, 'utf8'); ++const HALF_BILAYER_SIZE = parseHalfBilayerSize(OPM_PDB); ++ ++const alerts = []; ++const ajaxRequests = []; ++const loggedCommands = []; ++ ++function makeElement() { ++ return { ++ style: {}, ++ addEventListener() {}, ++ removeEventListener() {}, ++ getContext() { ++ return null; ++ }, ++ remove() {}, ++ setAttribute() {}, ++ getAttribute() { ++ return null; ++ }, ++ appendChild() {}, ++ blur() {}, ++ focus() {}, ++ innerHTML: '', ++ }; ++} ++ ++globalThis.window = { navigator: {}, __THREE__: '177' }; ++Object.defineProperty(globalThis, 'navigator', { ++ value: globalThis.window.navigator, ++ configurable: true, ++}); ++globalThis.document = { ++ createElement: makeElement, ++ getElementById: makeElement, ++ addEventListener() {}, ++ removeEventListener() {}, ++}; ++globalThis.localStorage = { ++ getItem() { ++ return null; ++ }, ++ setItem() {}, ++ removeItem() {}, ++}; ++globalThis.sessionStorage = globalThis.localStorage; ++globalThis.alert = (message) => { ++ alerts.push(message); ++}; ++ ++function $(selector) { ++ const element = $.elements[selector] || ($.elements[selector] = makeElement()); ++ const api = { ++ 0: element, ++ length: 1, ++ selector, ++ width(value) { ++ return value === undefined ? '640px' : api; ++ }, ++ height(value) { ++ return value === undefined ? '480px' : api; ++ }, ++ css(name, value) { ++ if (value === undefined && typeof name === 'string') { ++ if (name === 'width') return '640px'; ++ if (name === 'height') return '480px'; ++ return ''; ++ } ++ return api; ++ }, ++ val(value) { ++ if (value === undefined) return $.values[selector]; ++ $.values[selector] = value; ++ return api; ++ }, ++ html(value) { ++ if (value === undefined) return $.htmls[selector] || ''; ++ $.htmls[selector] = value; ++ return api; ++ }, ++ text() { ++ return api; ++ }, ++ get(index) { ++ return index === undefined ? [element] : element; ++ }, ++ }; ++ ++ for (const name of [ ++ 'resizable', ++ 'hide', ++ 'show', ++ 'append', ++ 'prepend', ++ 'empty', ++ 'attr', ++ 'prop', ++ 'on', ++ 'off', ++ 'click', ++ 'change', ++ 'dialog', ++ 'accordion', ++ 'tabs', ++ 'menu', ++ 'button', ++ 'selectmenu', ++ 'checkboxradio', ++ 'each', ++ 'find', ++ 'addClass', ++ 'removeClass', ++ 'parent', ++ 'children', ++ 'scroll', ++ 'scrollTop', ++ 'blur', ++ 'keyup', ++ 'keydown', ++ 'mouseup', ++ 'mousedown', ++ 'mousemove', ++ 'bind', ++ 'unbind', ++ ]) { ++ api[name] = () => api; ++ } ++ ++ api.ready = (fn) => { ++ if (fn) fn(); ++ return api; ++ }; ++ api.is = () => false; ++ return api; ++} ++ ++$.values = {}; ++$.htmls = {}; ++$.elements = {}; ++$.inArray = (item, array) => array.indexOf(item); ++$.extend = Object.assign; ++$.ajaxTransport = () => {}; ++$.ui = { dialog: { prototype: {} } }; ++$.ajax = ({ url, dataType, beforeSend, success, error }) => { ++ ajaxRequests.push({ url, dataType, beforeSend: Boolean(beforeSend) }); ++ if (url === OPM_6JXR_URL && dataType === 'text') { ++ success(OPM_PDB); ++ } else { ++ error(); ++ } ++}; ++globalThis.$ = $; ++ ++ ++globalThis.fetch = async (input) => { ++ const url = typeof input === 'string' ? input : input?.url ?? String(input); ++ ajaxRequests.push({ url, dataType: 'text', beforeSend: false }); ++ ++ if (url === OPM_6JXR_URL) { ++ return { ++ ok: true, ++ status: 200, ++ text: async () => OPM_PDB, ++ }; ++ } ++ ++ return { ++ ok: false, ++ status: 404, ++ text: async () => '', ++ }; ++}; ++ ++const { iCn3DUI } = await import('/workspace/repo/src/icn3dui.js'); ++const originalSetIcn3d = iCn3DUI.prototype.setIcn3d; ++iCn3DUI.prototype.setIcn3d = function patchedSetIcn3d() { ++ originalSetIcn3d.call(this); ++ const ic = this.icn3d; ++ ic.renderer = { setSize() {}, render() {}, domElement: makeElement() }; ++ ic.cam = {}; ++ ic.controls = { update() {} }; ++ ic.ParserUtilsCls.renderStructure = async () => {}; ++ ic.setStyleCls.setAtomStyleByOptions = () => {}; ++ ic.setColorCls.setColorByOptions = () => {}; ++ ic.resizeCanvasCls.rotStruc = () => {}; ++ ic.applyCenterCls.setWidthHeight = (width, height) => { ++ ic.WIDTH = width; ++ ic.HEIGHT = height; ++ }; ++ ic.hlUpdateCls.updateHlAll = () => {}; ++ this.htmlCls.clickMenuCls.getHiddenMenusFromCache = () => {}; ++ this.htmlCls.clickMenuCls.applyShownMenus = () => {}; ++ this.htmlCls.clickMenuCls.setLogCmd = (command) => { ++ loggedCommands.push(command); ++ }; ++}; ++ ++function resetHarnessState() { ++ alerts.length = 0; ++ ajaxRequests.length = 0; ++ loggedCommands.length = 0; ++ $.values = {}; ++ $.htmls = {}; ++ $.elements = {}; ++} ++ ++function makeUi(divid, cfg) { ++ return new iCn3DUI({ ++ divid, ++ width: '640px', ++ height: '480px', ++ showmenu: false, ++ showtitle: false, ++ showcommand: false, ++ rotate: 'right', ++ ...cfg, ++ }); ++} ++ ++function parseHalfBilayerSize(pdbText) { ++ const match = pdbText.match(/1\/2 of bilayer thickness:\s*([+-]?\d+(?:\.\d+)?)/i); ++ assert.ok(match, 'fixture must include an OPM half-bilayer size remark'); ++ return Number(match[1]); ++} ++ ++function snapshot(ui) { ++ const ic = ui.icn3d; ++ return { ++ inputid: ic.inputid, ++ bOpm: ic.bOpm, ++ bStopRotate: ic.bStopRotate, ++ atoms: Object.keys(ic.atoms || {}).length, ++ chains: Object.keys(ic.chains || {}).length, ++ residues: Object.keys(ic.residues || {}).length, ++ structures: Object.keys(ic.structures || {}), ++ selectplane_z1: $.values[`#${ui.cfg.divid}_selectplane_z1`], ++ selectplane_z2: $.values[`#${ui.cfg.divid}_selectplane_z2`], ++ extra_mem_z: $.values[`#${ui.cfg.divid}_extra_mem_z`], ++ intra_mem_z: $.values[`#${ui.cfg.divid}_intra_mem_z`], ++ }; ++} ++ ++function assertRequestedOpmUrl(url) { ++ ++ assert.equal(ajaxRequests.some((request) => request.url === url), true); ++} ++ ++function assertLoggedLoadOpmCommand() { ++ ++ assert.equal(loggedCommands.includes('load opm 6JXR'), true); ++} ++ ++function assertLoadedOpmState(ui) { ++ const state = snapshot(ui); ++ ++ assert.equal(state.inputid, '6JXR'); ++ assert.equal(state.bOpm, true); ++ assert.equal(state.bStopRotate, true); ++ ++ ++ assert.equal(state.atoms > 0, true); ++ assert.equal(state.chains > 0, true); ++ assert.equal(state.residues > 0, true); ++ ++ ++ assert.equal(Number(state.selectplane_z1), HALF_BILAYER_SIZE); ++ assert.equal(Number(state.selectplane_z2), -HALF_BILAYER_SIZE); ++ assert.equal(Number(state.extra_mem_z), HALF_BILAYER_SIZE); ++ assert.equal(Number(state.intra_mem_z), -HALF_BILAYER_SIZE); ++} ++ ++async function assertMissingOpmRejects(promise) { ++ let rejected = false; ++ let rejectionMessage = ''; ++ ++ try { ++ await promise; ++ } catch (error) { ++ rejected = true; ++ rejectionMessage = error?.message ?? String(error); ++ } ++ ++ assert.equal(rejected, true); ++ ++ assert.equal(rejectionMessage === MISSING_OPM_MESSAGE || alerts.includes(MISSING_OPM_MESSAGE), true); ++} ++ ++function assertNoLoadedStructure(ui) { ++ const state = snapshot(ui); ++ ++ ++ assert.notEqual(state.bOpm, true); ++ assert.equal(state.atoms, 0); ++ assert.equal(state.chains, 0); ++ assert.equal(state.residues, 0); ++ assert.equal(state.structures.length, 0); ++} ++ ++test('startup cfg.opmid loads OPM PDB into viewer state', async () => { ++ ++ ++ resetHarnessState(); ++ const ui = makeUi('startupdiv', { opmid: '6JXR' }); ++ ++ await ui.show3DStructure(); ++ ++ assertRequestedOpmUrl(OPM_6JXR_URL); ++ assertLoggedLoadOpmCommand(); ++ assertLoadedOpmState(ui); ++}); ++ ++test('command script load opm reaches the same loaded OPM state', async () => { ++ ++ ++ resetHarnessState(); ++ const ui = makeUi('commanddiv', { command: 'load opm 6JXR' }); ++ ++ await ui.show3DStructure(); ++ ++ assertRequestedOpmUrl(OPM_6JXR_URL); ++ assertLoadedOpmState(ui); ++}); ++ ++test('unavailable OPM ID rejects with the OPM-specific message and no empty structure', async () => { ++ ++ ++ resetHarnessState(); ++ const ui = makeUi('missingdiv', { opmid: 'ZZZZ' }); ++ ++ await assertMissingOpmRejects(ui.show3DStructure()); ++ ++ assertRequestedOpmUrl('https://opm-assets.storage.googleapis.com/pdb/zzzz.pdb'); ++ assertNoLoadedStructure(ui); ++}); ++ ++test('command script load opm is accepted through the public viewer path', async () => { ++ ++ ++ ++ resetHarnessState(); ++ const ui = makeUi('orderdiv', { command: 'load opm 6JXR' }); ++ ++ await ui.show3DStructure(); ++ ++ assertRequestedOpmUrl(OPM_6JXR_URL); ++ assertLoadedOpmState(ui); ++}); ++ ++test('separate viewer instances keep successful and failed OPM loads independent', async () => { ++ ++ ++ resetHarnessState(); ++ const a = makeUi('instancediva', { opmid: '6JXR' }); ++ const b = makeUi('instancedivb', { opmid: 'ZZZZ' }); ++ ++ await a.show3DStructure(); ++ await assertMissingOpmRejects(b.show3DStructure()); ++ ++ assertLoadedOpmState(a); ++ assertNoLoadedStructure(b); ++}); ++ ++test('repeated construct load cycles keep OPM loading functional', async () => { ++ ++ ++ ++ resetHarnessState(); ++ ++ for (let i = 0; i < 3; i += 1) { ++ resetHarnessState(); ++ const ui = makeUi(`leakdiv${i}`, { opmid: '6JXR' }); ++ await ui.show3DStructure(); ++ assertLoadedOpmState(ui); ++ } ++}); +diff --git a/mimo_test_command.sh b/mimo_test_command.sh +new file mode 100755 +--- /dev/null ++++ b/mimo_test_command.sh +@@ -0,0 +1,20 @@ ++#!/usr/bin/env bash ++ ++ ++ ++ ++export NODE_OPTIONS="${NODE_OPTIONS:-} --max-old-space-size=4096" ++export MAVEN_OPTS="${MAVEN_OPTS:-} -Xmx3g -XX:+UseG1GC" ++export GRADLE_OPTS="${GRADLE_OPTS:-} -Xmx3g -XX:+UseG1GC" ++export TEST_JVM_OPTS="${TEST_JVM_OPTS:-} -Xmx3g" ++set -e ++cd /workspace/repo ++set -euo pipefail ++cd /workspace/repo ++ ++if [ ! -d node_modules ]; then ++ echo "node_modules is required for the offline test image" >&2 ++ exit 1 ++fi ++ ++exec node --expose-gc --import /workspace/repo/usercase-test-coderl/offline_network_guard.mjs --test /workspace/repo/usercase-test-coderl/opm_viewer.test.js diff --git a/tasks/format-code-task-002026/tests/test.sh b/tasks/format-code-task-002026/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..b9d2c76ed5f1d995766c650a3a680b5b5ecb1084 --- /dev/null +++ b/tasks/format-code-task-002026/tests/test.sh @@ -0,0 +1,40 @@ +#!/bin/bash +# Code grading, mimoagent opensource_code.py: reset the files the hidden test patch touches, apply it, run the +# task's test command; reward 1 when it exits 0. A testbed failure (reset or apply) writes no reward: not scored. +M=/var/lib/mimo +CWD=/workspace/repo +V=/logs/verifier +mkdir -p "$V" +BASE=$(cat "$M/base" 2>/dev/null) || { echo "setup never ran (no $M/base)" >&2; exit 1; } +cd "$CWD" || exit 1 +if [ -d "$M/git-hidden" ]; then rm -rf "$CWD/.git"; mv "$M/git-hidden" "$CWD/.git"; fi +# the agent's change against the base, so its own commits count too +git add -A >/dev/null 2>&1 && git -c core.fileMode=false diff --cached "$BASE" > "$V/agent.diff" +git reset -q +if ! ( +while IFS= read -r tf; do + [ -z "$tf" ] && continue + if git cat-file -e $BASE:"$tf" 2>/dev/null; then + git checkout $BASE -- "$tf" 2>/dev/null || true + else + git rm -f --cached "$tf" >/dev/null 2>&1 || true + rm -f "$tf" + fi +done <<'EOF_RESET_TEST_FILES' +usercase-test-coderl/fixtures/6jxr.pdb +usercase-test-coderl/offline_network_guard.mjs +usercase-test-coderl/opm_viewer.test.js +mimo_test_command.sh +EOF_RESET_TEST_FILES + +); then echo "could not reset the test files (testbed problem, not scored)" >&2; exit 1; fi +if ! git apply --verbose /tests/test.patch > "$V/apply.log" 2>&1; then + cat "$V/apply.log" >&2 + echo "the hidden tests could not be applied (testbed problem, not scored)" >&2 + exit 1 +fi +timeout 1800 sh -c "$(cat /tests/test_command.sh)" > "$V/test_output.log" 2>&1 +RC=$? +tail -c 12000 "$V/test_output.log" +if [ $RC -eq 0 ]; then echo 1 > "$V/reward.txt"; else echo 0 > "$V/reward.txt"; fi +echo "test command exited $RC" diff --git a/tasks/format-code-task-002026/tests/test_command.sh b/tasks/format-code-task-002026/tests/test_command.sh new file mode 100644 index 0000000000000000000000000000000000000000..88cb7810b836396c4869db31aeac7d4d4b189685 --- /dev/null +++ b/tasks/format-code-task-002026/tests/test_command.sh @@ -0,0 +1 @@ +bash /workspace/repo/mimo_test_command.sh \ No newline at end of file diff --git a/tasks/format-code-task-002028/environment/Dockerfile b/tasks/format-code-task-002028/environment/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..6858c7b70c63bd6042fa9f57c570e1856345c453 --- /dev/null +++ b/tasks/format-code-task-002028/environment/Dockerfile @@ -0,0 +1,3 @@ +# The task's image, pinned by digest (the same as [environment].docker_image). +# Setup runs at start from [environment.healthcheck]; environment/setup/ is its readable copy. +FROM docker.io/xiaomimimo/mimo-v2.6-rl-oss@sha256:a7aa0920120886a0eb0124b0c9fb12e57e1c2c29f9d412ea6ae5dda6bbad4d6b diff --git a/tasks/format-code-task-002028/environment/setup/files/blocklist b/tasks/format-code-task-002028/environment/setup/files/blocklist new file mode 100644 index 0000000000000000000000000000000000000000..a8e4bdc4c7d9b739c047a3cb58ea72a1bb05bcbc --- /dev/null +++ b/tasks/format-code-task-002028/environment/setup/files/blocklist @@ -0,0 +1,33 @@ +# mimo answer-leak blocklist (mimoagent) +0.0.0.0 github.com +0.0.0.0 www.github.com +0.0.0.0 api.github.com +0.0.0.0 raw.githubusercontent.com +0.0.0.0 codeload.github.com +0.0.0.0 objects.githubusercontent.com +0.0.0.0 gist.github.com +0.0.0.0 gist.githubusercontent.com +0.0.0.0 gitlab.com +0.0.0.0 bitbucket.org +0.0.0.0 sourceforge.net +0.0.0.0 git.kernel.org +0.0.0.0 chromium.googlesource.com +0.0.0.0 android.googlesource.com +0.0.0.0 sourcegraph.com +0.0.0.0 bugs.chromium.org +0.0.0.0 issues.oss-fuzz.com +0.0.0.0 oss-fuzz.com +0.0.0.0 osv.dev +0.0.0.0 api.osv.dev +0.0.0.0 bugzilla.mozilla.org +0.0.0.0 proxy.golang.org +0.0.0.0 sum.golang.org +0.0.0.0 pkg.go.dev +0.0.0.0 google.com +0.0.0.0 www.google.com +0.0.0.0 bing.com +0.0.0.0 www.bing.com +0.0.0.0 duckduckgo.com +0.0.0.0 html.duckduckgo.com +0.0.0.0 search.brave.com +0.0.0.0 stackoverflow.com diff --git a/tasks/format-code-task-002028/environment/setup/setup.sh b/tasks/format-code-task-002028/environment/setup/setup.sh new file mode 100644 index 0000000000000000000000000000000000000000..e9eb7daf39f9542bd095367feee457f3da77e492 --- /dev/null +++ b/tasks/format-code-task-002028/environment/setup/setup.sh @@ -0,0 +1,34 @@ +#!/bin/bash +# Runs once, as root, before the agent starts: Harbor's [environment.healthcheck] unpacks this folder into +# /var/lib/mimo and runs it. Generated by mimo_harbor; see its README for how each step maps to Xiaomi's harness. +M=/var/lib/mimo +[ -f "$M/ready" ] && exit 0 +chmod 700 "$M" +fail() { echo "setup: $*" >&2; exit 1; } +# the answer-leak blocklist (mimoagent), applied to /etc/hosts by the agent right after it installs +write_blocklist() { cp "$M/files/blocklist" "$M/blocklist"; } + +# Code: mimoagent environments/datasets/opensource_code.py + base.py, as the explorer runs it (app/runner/domains.py Code). +CWD=/workspace/repo +git config --global --add safe.directory "$CWD" +cd "$CWD" || fail "no working directory $CWD" +if ! git rev-parse --git-dir >/dev/null 2>&1; then # a bare source tree: give it a baseline commit + git init -q && git add -A && git -c user.name=mimo -c user.email=mimo@localhost commit -q -m baseline --allow-empty +fi +BASE=$(git rev-parse HEAD 2>/dev/null) +[ ${#BASE} -eq 40 ] || fail "could not resolve the base commit in $CWD" +echo "$BASE" > "$M/base" +# Images are built with history truncated at the base. If one is not, the fix could be read out of git log, +# so .git is hidden while the agent works and put back for grading. +LATER=$(git rev-list --all --not "$BASE" 2>/dev/null | head -n 5 | grep -c . || true) +rm -f /tmp/fail.log /tmp/pass.log /tmp/patch.diff /tmp/test_patch.diff /tmp/*.log 2>/dev/null; rm -rf /tmp/claude-0 /tmp/claude-* /tmp/testem-* /tmp/puppeteer_dev_chrome_profile-* 2>/dev/null; rm -f /tmp/test_files.json 2>/dev/null; rm -rf /tmp/jest_* /tmp/jest-* /tmp/build /tmp/build_env 2>/dev/null; rm -rf /tmp/pytest-of-root /tmp/pytest-* /tmp/.pytest_cache /tmp/__pycache__ 2>/dev/null; rm -rf /tmp/go-build* /tmp/standards /tmp/wordpress /tmp/zig-* /tmp/testbase /tmp/testbed 2>/dev/null; rm -f /tmp/tmp*.tmp /tmp/*.bak /tmp/expect* /tmp/butwas* 2>/dev/null; rm -rf /root/.cache/go-build 2>/dev/null; rm -rf /tests 2>/dev/null; find /logs -mindepth 1 -delete 2>/dev/null; mkdir -p /logs/agent /logs/verifier /logs/artifacts; chmod 777 /logs/agent /logs/verifier /logs/artifacts; find /var/log -type f -delete 2>/dev/null || true; rm -rf /var/lib/postgresql/*/*/log /var/lib/postgresql/*/*/pg_log 2>/dev/null || true; find /var/lib/mysql /var/lib/mongodb -type f -name '*.log' -delete 2>/dev/null || true; rm -rf /root/.npm/_logs /root/.babel.json /root/.pytest_cache 2>/dev/null || true; find / -maxdepth 4 -xdev -name task_description.md -path '*/.build_env/*' -delete 2>/dev/null || true; true +git clean -fdx --exclude=node_modules --exclude=bower_components --exclude=.husky --exclude=vendor --exclude=third_party --exclude=_deps --exclude=vcpkg_installed --exclude=.venv --exclude=venv --exclude=.gradle --exclude=target --exclude=.build --exclude=lib --exclude=.bundle --exclude=Manifest.toml --exclude=_build --exclude=.stack-work --exclude=dist-newstyle >/dev/null 2>&1 +find /root/.m2 -type f \( -name '*-SNAPSHOT.jar' -o -name '*-SNAPSHOT-sources.jar' -o -name '*-SNAPSHOT-tests.jar' -o -name '*-SNAPSHOT-test-sources.jar' \) -delete 2>/dev/null; rm -rf /root/.julia/compiled 2>/dev/null; rm -rf /root/.gradle/caches/build-cache-* /root/.gradle/daemon 2>/dev/null; rm -rf /root/.gradle/caches/*/scripts /root/.gradle/caches/jars-* 2>/dev/null; rm -rf /root/.cache/bazel 2>/dev/null; true +if [ "$LATER" -gt 0 ]; then + mv "$CWD/.git" "$M/git-hidden" + echo "history not truncated at ${BASE:0:12}: .git hidden while the agent works" +fi +write_blocklist + +touch "$M/ready" +echo "setup done" diff --git a/tasks/format-code-task-002028/tests/test.patch b/tasks/format-code-task-002028/tests/test.patch new file mode 100644 index 0000000000000000000000000000000000000000..65b47b1b626bf0f6ca59f092012acae23c4d2004 --- /dev/null +++ b/tasks/format-code-task-002028/tests/test.patch @@ -0,0 +1,251 @@ +diff --git a/usercase-test-coderl/fixtures/sitecustomize.py b/usercase-test-coderl/fixtures/sitecustomize.py +new file mode 100644 +--- /dev/null ++++ b/usercase-test-coderl/fixtures/sitecustomize.py +@@ -0,0 +1,64 @@ ++import hashlib ++import json ++import os ++ ++ ++class FakeTelegramManagerClient: ++ def __init__(self, config, proxy=None): ++ self.config = config ++ self.proxy = proxy ++ self.max_file_size = int(os.environ.get("FAKE_TG_MAX_FILE_SIZE", "4096")) ++ self.max_caption_length = 1024 ++ ++ def start(self): ++ pass ++ ++ def send_files(self, entity, files, delete_on_success=False, print_file_id=False, forward=(), ++ send_as_media=False): ++ rows = [] ++ concat = bytearray() ++ for index, file in enumerate(files): ++ head = file.read(257) ++ rest = file.readall() if hasattr(file, "readall") else file.read() ++ data = head + rest ++ concat.extend(data) ++ rows.append({ ++ "declared_size": file.file_size, ++ "first16": data[:16].hex(), ++ "force_file": bool(file.force_file), ++ "index": index, ++ "last16": data[-16:].hex(), ++ "name": file.file_name, ++ "payload_len": len(data), ++ "sha256": hashlib.sha256(data).hexdigest(), ++ "short": file.short_name, ++ }) ++ try: ++ file.close() ++ except Exception: ++ pass ++ ++ for row in rows: ++ print("PART " + json.dumps(row, sort_keys=True, separators=(",", ":"))) ++ print("SUMMARY " + json.dumps({ ++ "concat_len": len(concat), ++ "concat_sha256": hashlib.sha256(concat).hexdigest(), ++ "count": len(rows), ++ "delete_on_success": bool(delete_on_success), ++ "entity": entity, ++ "forward": list(forward), ++ "print_file_id": bool(print_file_id), ++ "send_as_media": bool(send_as_media), ++ }, sort_keys=True, separators=(",", ":"))) ++ return [] ++ ++ def send_files_as_album(self, entity, files, delete_on_success=False, print_file_id=False, forward=()): ++ return self.send_files(entity, files, delete_on_success, print_file_id, forward, send_as_media=True) ++ ++ ++def _patch(): ++ import telegram_upload.management as management ++ management.TelegramManagerClient = FakeTelegramManagerClient ++ ++ ++_patch() +diff --git a/usercase-test-coderl/usecase.sh b/usercase-test-coderl/usecase.sh +new file mode 100755 +--- /dev/null ++++ b/usercase-test-coderl/usecase.sh +@@ -0,0 +1,160 @@ ++#!/usr/bin/env bash ++ ++set -u ++export LANG=C.UTF-8 LC_ALL=C.UTF-8 TZ=UTC ++ ++ ++( cd /workspace/repo && python - <<'PY' >/dev/null ++import telegram_upload ++assert telegram_upload.__file__.startswith("/workspace/repo/") ++PY ++) || { echo "FAIL: build" >&2; exit 1; } ++ ++BIN="$(command -v telegram-upload || true)" ++[ -n "$BIN" ] || { echo "FAIL: telegram-upload entry point not found" >&2; exit 1; } ++ ++TMP=$(mktemp -d) ++trap 'rm -rf "$TMP"' EXIT ++cd "$TMP" || exit 1 ++fail() { echo "FAIL: $*" >&2; exit 1; } ++ ++export PYTHONPATH="/workspace/repo/usercase-test-coderl/fixtures:/workspace/repo${PYTHONPATH:+:$PYTHONPATH}" ++export FAKE_TG_MAX_FILE_SIZE=4096 ++ ++python - <<'PY' ++from pathlib import Path ++import hashlib ++import json ++ ++root = Path(".") ++max_size = 4096 ++ ++def stream(label, n): ++ out = bytearray() ++ counter = 0 ++ while len(out) < n: ++ out.extend(hashlib.sha256(f"{label}:{counter}".encode("ascii")).digest()) ++ counter += 1 ++ return bytes(out[:n]) ++ ++(root / "nested").mkdir() ++(root / "nested" / "large-video.mkv").write_bytes(stream("large-video", max_size + 1000)) ++(root / "triple.bin").write_bytes(stream("triple", max_size * 2 + 17)) ++(root / "exact.bin").write_bytes(stream("exact", max_size)) ++(root / "config.json").write_text(json.dumps({"api_id": 1, "api_hash": "x"})) ++PY ++ ++ ++ ++ ++"$BIN" --help >out 2>err; ec=$? ++[ "$ec" -eq 0 ] || fail "F_help exit $ec; want 0" ++ ++grep -Fq -- "--large-files" out || fail "F_help missing --large-files option: $(cat out)" ++python - <<'PY' || fail "F_help missing fail/split choices in --large-files help: $(cat out)" ++from pathlib import Path ++ ++lines = Path("out").read_text().splitlines() ++for i, line in enumerate(lines): ++ if "--large-files" in line: ++ block = "\n".join(lines[i:i + 3]) ++ assert "split" in block, block ++ assert "fail" in block, block ++ break ++else: ++ raise AssertionError("--large-files option not found") ++PY ++[ ! -s err ] || fail "F_help unexpected stderr: $(cat err)" ++ ++ ++ ++ ++"$BIN" --config config.json --large-files split nested/large-video.mkv >out 2>err; ec=$? ++[ "$ec" -eq 0 ] || fail "F1 exit $ec; want 0; stderr=$(cat err)" ++ ++python - <<'PY' || fail "F1 split validation failed: $(cat out)" ++from pathlib import Path ++import hashlib ++import json ++ ++max_size = 4096 ++source = Path("nested/large-video.mkv").read_bytes() ++parts = [] ++summary = None ++for line in Path("out").read_text().splitlines(): ++ if line.startswith("PART "): ++ parts.append(json.loads(line[5:])) ++ elif line.startswith("SUMMARY "): ++ summary = json.loads(line[8:]) ++ else: ++ raise AssertionError(f"unexpected output line: {line!r}") ++ ++expected_chunks = [source[:max_size], source[max_size:]] ++expected_names = ["large-video.mkv.00", "large-video.mkv.01"] ++assert len(parts) == 2, parts ++for index, (row, chunk, name) in enumerate(zip(parts, expected_chunks, expected_names)): ++ assert row["index"] == index, row ++ assert row["name"] == name, row ++ assert row["declared_size"] == len(chunk), row ++ assert row["payload_len"] == len(chunk), row ++ assert row["force_file"] is True, row ++ assert row["sha256"] == hashlib.sha256(chunk).hexdigest(), row ++ ++assert summary is not None ++assert summary["count"] == 2, summary ++assert summary["concat_len"] == len(source), summary ++assert summary["concat_sha256"] == hashlib.sha256(source).hexdigest(), summary ++PY ++[ ! -s err ] || fail "F1 unexpected stderr: $(cat err)" ++ ++ ++ ++ ++"$BIN" --config config.json --large-files split triple.bin exact.bin >out 2>err; ec=$? ++[ "$ec" -eq 0 ] || fail "F2 exit $ec; want 0; stderr=$(cat err)" ++ ++python - <<'PY' || fail "F2 split validation failed: $(cat out)" ++from pathlib import Path ++import hashlib ++import json ++ ++max_size = 4096 ++triple = Path("triple.bin").read_bytes() ++exact = Path("exact.bin").read_bytes() ++parts = [] ++for line in Path("out").read_text().splitlines(): ++ if line.startswith("PART "): ++ parts.append(json.loads(line[5:])) ++ elif not line.startswith("SUMMARY "): ++ raise AssertionError(f"unexpected output line: {line!r}") ++ ++expected = [ ++ ("triple.bin.00", triple[:max_size], True), ++ ("triple.bin.01", triple[max_size:max_size * 2], True), ++ ("triple.bin.02", triple[max_size * 2:], True), ++ ("exact.bin", exact, None), ++] ++assert len(parts) == len(expected), parts ++for index, (row, (name, chunk, force_file)) in enumerate(zip(parts, expected)): ++ assert row["index"] == index, row ++ assert row["name"] == name, row ++ assert row["declared_size"] == len(chunk), row ++ assert row["payload_len"] == len(chunk), row ++ if force_file is not None: ++ assert row["force_file"] is force_file, row ++ assert row["sha256"] == hashlib.sha256(chunk).hexdigest(), row ++PY ++[ ! -s err ] || fail "F2 unexpected stderr: $(cat err)" ++ ++ ++ ++ ++"$BIN" --config config.json nested/large-video.mkv >out 2>err; ec=$? ++ ++[ "$ec" -ne 0 ] || fail "F_err exit $ec; want non-zero" ++[ ! -s out ] || fail "F_err unexpected stdout: $(cat out)" ++ ++[ -s err ] || fail "F_err expected stderr explanation" ++ ++echo "PASS" ++exit 0 +diff --git a/mimo_test_command.sh b/mimo_test_command.sh +new file mode 100755 +--- /dev/null ++++ b/mimo_test_command.sh +@@ -0,0 +1,12 @@ ++#!/usr/bin/env bash ++ ++ ++ ++ ++export NODE_OPTIONS="${NODE_OPTIONS:-} --max-old-space-size=4096" ++export MAVEN_OPTS="${MAVEN_OPTS:-} -Xmx3g -XX:+UseG1GC" ++export GRADLE_OPTS="${GRADLE_OPTS:-} -Xmx3g -XX:+UseG1GC" ++export TEST_JVM_OPTS="${TEST_JVM_OPTS:-} -Xmx3g" ++set -e ++cd /workspace/repo ++exec bash /workspace/repo/usercase-test-coderl/usecase.sh diff --git a/tasks/format-code-task-002028/tests/test.sh b/tasks/format-code-task-002028/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..03cfdde5d8e99d2a4f66a8860fcab25900cd8df1 --- /dev/null +++ b/tasks/format-code-task-002028/tests/test.sh @@ -0,0 +1,39 @@ +#!/bin/bash +# Code grading, mimoagent opensource_code.py: reset the files the hidden test patch touches, apply it, run the +# task's test command; reward 1 when it exits 0. A testbed failure (reset or apply) writes no reward: not scored. +M=/var/lib/mimo +CWD=/workspace/repo +V=/logs/verifier +mkdir -p "$V" +BASE=$(cat "$M/base" 2>/dev/null) || { echo "setup never ran (no $M/base)" >&2; exit 1; } +cd "$CWD" || exit 1 +if [ -d "$M/git-hidden" ]; then rm -rf "$CWD/.git"; mv "$M/git-hidden" "$CWD/.git"; fi +# the agent's change against the base, so its own commits count too +git add -A >/dev/null 2>&1 && git -c core.fileMode=false diff --cached "$BASE" > "$V/agent.diff" +git reset -q +if ! ( +while IFS= read -r tf; do + [ -z "$tf" ] && continue + if git cat-file -e $BASE:"$tf" 2>/dev/null; then + git checkout $BASE -- "$tf" 2>/dev/null || true + else + git rm -f --cached "$tf" >/dev/null 2>&1 || true + rm -f "$tf" + fi +done <<'EOF_RESET_TEST_FILES' +usercase-test-coderl/fixtures/sitecustomize.py +usercase-test-coderl/usecase.sh +mimo_test_command.sh +EOF_RESET_TEST_FILES + +); then echo "could not reset the test files (testbed problem, not scored)" >&2; exit 1; fi +if ! git apply --verbose /tests/test.patch > "$V/apply.log" 2>&1; then + cat "$V/apply.log" >&2 + echo "the hidden tests could not be applied (testbed problem, not scored)" >&2 + exit 1 +fi +timeout 1800 sh -c "$(cat /tests/test_command.sh)" > "$V/test_output.log" 2>&1 +RC=$? +tail -c 12000 "$V/test_output.log" +if [ $RC -eq 0 ]; then echo 1 > "$V/reward.txt"; else echo 0 > "$V/reward.txt"; fi +echo "test command exited $RC" diff --git a/tasks/format-code-task-002028/tests/test_command.sh b/tasks/format-code-task-002028/tests/test_command.sh new file mode 100644 index 0000000000000000000000000000000000000000..88cb7810b836396c4869db31aeac7d4d4b189685 --- /dev/null +++ b/tasks/format-code-task-002028/tests/test_command.sh @@ -0,0 +1 @@ +bash /workspace/repo/mimo_test_command.sh \ No newline at end of file diff --git a/tasks/format-code-task-002032/environment/Dockerfile b/tasks/format-code-task-002032/environment/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..4c59086dc3d3bda4399f5840db8d3a471aabef60 --- /dev/null +++ b/tasks/format-code-task-002032/environment/Dockerfile @@ -0,0 +1,3 @@ +# The task's image, pinned by digest (the same as [environment].docker_image). +# Setup runs at start from [environment.healthcheck]; environment/setup/ is its readable copy. +FROM docker.io/xiaomimimo/mimo-v2.6-rl-oss@sha256:829ad507319914fc1f674f494e1748aab8ba48cb09986fc5b7a712197406ca9d diff --git a/tasks/format-code-task-002032/environment/setup/files/blocklist b/tasks/format-code-task-002032/environment/setup/files/blocklist new file mode 100644 index 0000000000000000000000000000000000000000..a8e4bdc4c7d9b739c047a3cb58ea72a1bb05bcbc --- /dev/null +++ b/tasks/format-code-task-002032/environment/setup/files/blocklist @@ -0,0 +1,33 @@ +# mimo answer-leak blocklist (mimoagent) +0.0.0.0 github.com +0.0.0.0 www.github.com +0.0.0.0 api.github.com +0.0.0.0 raw.githubusercontent.com +0.0.0.0 codeload.github.com +0.0.0.0 objects.githubusercontent.com +0.0.0.0 gist.github.com +0.0.0.0 gist.githubusercontent.com +0.0.0.0 gitlab.com +0.0.0.0 bitbucket.org +0.0.0.0 sourceforge.net +0.0.0.0 git.kernel.org +0.0.0.0 chromium.googlesource.com +0.0.0.0 android.googlesource.com +0.0.0.0 sourcegraph.com +0.0.0.0 bugs.chromium.org +0.0.0.0 issues.oss-fuzz.com +0.0.0.0 oss-fuzz.com +0.0.0.0 osv.dev +0.0.0.0 api.osv.dev +0.0.0.0 bugzilla.mozilla.org +0.0.0.0 proxy.golang.org +0.0.0.0 sum.golang.org +0.0.0.0 pkg.go.dev +0.0.0.0 google.com +0.0.0.0 www.google.com +0.0.0.0 bing.com +0.0.0.0 www.bing.com +0.0.0.0 duckduckgo.com +0.0.0.0 html.duckduckgo.com +0.0.0.0 search.brave.com +0.0.0.0 stackoverflow.com diff --git a/tasks/format-code-task-002032/environment/setup/setup.sh b/tasks/format-code-task-002032/environment/setup/setup.sh new file mode 100644 index 0000000000000000000000000000000000000000..d883db90cfcfb48f7a139861bbe9f6b5d95cad6f --- /dev/null +++ b/tasks/format-code-task-002032/environment/setup/setup.sh @@ -0,0 +1,34 @@ +#!/bin/bash +# Runs once, as root, before the agent starts: Harbor's [environment.healthcheck] unpacks this folder into +# /var/lib/mimo and runs it. Generated by mimo_harbor; see its README for how each step maps to Xiaomi's harness. +M=/var/lib/mimo +[ -f "$M/ready" ] && exit 0 +chmod 700 "$M" +fail() { echo "setup: $*" >&2; exit 1; } +# the answer-leak blocklist (mimoagent), applied to /etc/hosts by the agent right after it installs +write_blocklist() { cp "$M/files/blocklist" "$M/blocklist"; } + +# Code: mimoagent environments/datasets/opensource_code.py + base.py, as the explorer runs it (app/runner/domains.py Code). +CWD=/testbed +git config --global --add safe.directory "$CWD" +cd "$CWD" || fail "no working directory $CWD" +if ! git rev-parse --git-dir >/dev/null 2>&1; then # a bare source tree: give it a baseline commit + git init -q && git add -A && git -c user.name=mimo -c user.email=mimo@localhost commit -q -m baseline --allow-empty +fi +BASE=$(git rev-parse HEAD 2>/dev/null) +[ ${#BASE} -eq 40 ] || fail "could not resolve the base commit in $CWD" +echo "$BASE" > "$M/base" +# Images are built with history truncated at the base. If one is not, the fix could be read out of git log, +# so .git is hidden while the agent works and put back for grading. +LATER=$(git rev-list --all --not "$BASE" 2>/dev/null | head -n 5 | grep -c . || true) +rm -f /tmp/fail.log /tmp/pass.log /tmp/patch.diff /tmp/test_patch.diff /tmp/*.log 2>/dev/null; rm -rf /tmp/claude-0 /tmp/claude-* /tmp/testem-* /tmp/puppeteer_dev_chrome_profile-* 2>/dev/null; rm -f /tmp/test_files.json 2>/dev/null; rm -rf /tmp/jest_* /tmp/jest-* /tmp/build /tmp/build_env 2>/dev/null; rm -rf /tmp/pytest-of-root /tmp/pytest-* /tmp/.pytest_cache /tmp/__pycache__ 2>/dev/null; rm -rf /tmp/go-build* /tmp/standards /tmp/wordpress /tmp/zig-* /tmp/testbase /tmp/testbed 2>/dev/null; rm -f /tmp/tmp*.tmp /tmp/*.bak /tmp/expect* /tmp/butwas* 2>/dev/null; rm -rf /root/.cache/go-build 2>/dev/null; rm -rf /tests 2>/dev/null; find /logs -mindepth 1 -delete 2>/dev/null; mkdir -p /logs/agent /logs/verifier /logs/artifacts; chmod 777 /logs/agent /logs/verifier /logs/artifacts; find /var/log -type f -delete 2>/dev/null || true; rm -rf /var/lib/postgresql/*/*/log /var/lib/postgresql/*/*/pg_log 2>/dev/null || true; find /var/lib/mysql /var/lib/mongodb -type f -name '*.log' -delete 2>/dev/null || true; rm -rf /root/.npm/_logs /root/.babel.json /root/.pytest_cache 2>/dev/null || true; find / -maxdepth 4 -xdev -name task_description.md -path '*/.build_env/*' -delete 2>/dev/null || true; true +git clean -fdx --exclude=node_modules --exclude=bower_components --exclude=.husky --exclude=vendor --exclude=third_party --exclude=_deps --exclude=vcpkg_installed --exclude=.venv --exclude=venv --exclude=.gradle --exclude=target --exclude=.build --exclude=lib --exclude=.bundle --exclude=Manifest.toml --exclude=_build --exclude=.stack-work --exclude=dist-newstyle >/dev/null 2>&1 +find /root/.m2 -type f \( -name '*-SNAPSHOT.jar' -o -name '*-SNAPSHOT-sources.jar' -o -name '*-SNAPSHOT-tests.jar' -o -name '*-SNAPSHOT-test-sources.jar' \) -delete 2>/dev/null; rm -rf /root/.julia/compiled 2>/dev/null; rm -rf /root/.gradle/caches/build-cache-* /root/.gradle/daemon 2>/dev/null; rm -rf /root/.gradle/caches/*/scripts /root/.gradle/caches/jars-* 2>/dev/null; rm -rf /root/.cache/bazel 2>/dev/null; true +if [ "$LATER" -gt 0 ]; then + mv "$CWD/.git" "$M/git-hidden" + echo "history not truncated at ${BASE:0:12}: .git hidden while the agent works" +fi +write_blocklist + +touch "$M/ready" +echo "setup done" diff --git a/tasks/format-code-task-002032/tests/test.patch b/tasks/format-code-task-002032/tests/test.patch new file mode 100644 index 0000000000000000000000000000000000000000..2479dd2ca066867cab190b38b777fd86e13f936c --- /dev/null +++ b/tasks/format-code-task-002032/tests/test.patch @@ -0,0 +1,110 @@ +diff --git a/test/ignorecase_contract_test.py b/test/ignorecase_contract_test.py +new file mode 100644 +index 00000000..196f7d2f +--- /dev/null ++++ b/test/ignorecase_contract_test.py +@@ -0,0 +1,95 @@ ++import unittest ++ ++import tatsu ++from tatsu.codegen import codegen ++from tatsu.exceptions import FailedParse ++ ++ ++LITERAL_TRUE = ''' ++ @@ignorecase :: True ++ start = "AbC" $; ++''' ++ ++LITERAL_FALSE = ''' ++ @@ignorecase :: False ++ start = "AbC" $; ++''' ++ ++KEYWORD_GRAMMAR = r''' ++ @@ignorecase :: True ++ @@keyword :: if ELSE ++ start = {id}+ $; ++ @name ++ id = /\w+/; ++''' ++ ++PATTERN_GRAMMAR = r''' ++ @@ignorecase :: True ++ start = word $; ++ word = /[a-z]+/; ++''' ++ ++ ++class IgnorecaseContractTests(unittest.TestCase): ++ ++ def test_model_directive_and_parse_override(self): ++ model = tatsu.compile(LITERAL_TRUE, 'CaseModel') ++ self.assertEqual('AbC', model.parse('abc')) ++ self.assertEqual('AbC', model.parse('ABC')) ++ with self.assertRaises(FailedParse): ++ model.parse('ABC', ignorecase=False) ++ self.assertEqual('AbC', model.parse('ABC')) ++ ++ strict = tatsu.compile(LITERAL_FALSE, 'StrictModel') ++ with self.assertRaises(FailedParse): ++ strict.parse('abc') ++ self.assertEqual('AbC', strict.parse('abc', ignorecase=True)) ++ with self.assertRaises(FailedParse): ++ strict.parse('ABC', ignorecase=False) ++ ++ def test_pattern_matching_remains_case_sensitive(self): ++ model = tatsu.compile(PATTERN_GRAMMAR, 'PatternModel') ++ self.assertEqual('abc', model.parse('abc')) ++ with self.assertRaises(FailedParse): ++ model.parse('ABC') ++ ++ def test_keywords_follow_effective_case_mode(self): ++ model = tatsu.compile(KEYWORD_GRAMMAR, 'KeywordModel') ++ for value in ('if', 'IF', 'If', 'else', 'ELSE', 'Else'): ++ with self.assertRaises(FailedParse, msg=value): ++ model.parse(value) ++ self.assertEqual(['IF'], model.parse('IF', ignorecase=False)) ++ self.assertEqual(['else'], model.parse('else', ignorecase=False)) ++ with self.assertRaises(FailedParse): ++ model.parse('ELSE', ignorecase=False) ++ ++ def test_generated_parser_matches_model_and_overrides(self): ++ namespace = {} ++ exec(codegen(tatsu.compile(KEYWORD_GRAMMAR, 'GeneratedCase')), namespace) ++ parser = namespace['GeneratedCaseParser']() ++ for value in ('if', 'IF', 'If', 'else', 'ELSE', 'Else'): ++ with self.assertRaises(FailedParse, msg=value): ++ parser.parse(value) ++ self.assertEqual(['IF'], parser.parse('IF', ignorecase=False)) ++ with self.assertRaises(FailedParse): ++ parser.parse('IF') ++ ++ literal = {} ++ exec(codegen(tatsu.compile(LITERAL_TRUE, 'GeneratedLiteral')), literal) ++ generated = literal['GeneratedLiteralParser']() ++ self.assertEqual('AbC', generated.parse('ABC')) ++ with self.assertRaises(FailedParse): ++ generated.parse('ABC', ignorecase=False) ++ ++ strict = {} ++ exec(codegen(tatsu.compile(LITERAL_FALSE, 'GeneratedStrict')), strict) ++ strict_parser = strict['GeneratedStrictParser']() ++ with self.assertRaises(FailedParse): ++ strict_parser.parse('abc') ++ self.assertEqual('AbC', strict_parser.parse('abc', ignorecase=True)) ++ with self.assertRaises(FailedParse): ++ strict_parser.parse('abc') ++ ++ ++if __name__ == '__main__': ++ unittest.main() +diff --git a/mimo_test_command.sh b/mimo_test_command.sh +new file mode 100755 +--- /dev/null ++++ b/mimo_test_command.sh +@@ -0,0 +1,4 @@ ++#!/bin/bash ++set -euo pipefail ++ ++python -m pytest -q test/ignorecase_contract_test.py diff --git a/tasks/format-code-task-002032/tests/test.sh b/tasks/format-code-task-002032/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..e99c8fcbc80661ce4a65ef921d69400a531c0324 --- /dev/null +++ b/tasks/format-code-task-002032/tests/test.sh @@ -0,0 +1,38 @@ +#!/bin/bash +# Code grading, mimoagent opensource_code.py: reset the files the hidden test patch touches, apply it, run the +# task's test command; reward 1 when it exits 0. A testbed failure (reset or apply) writes no reward: not scored. +M=/var/lib/mimo +CWD=/testbed +V=/logs/verifier +mkdir -p "$V" +BASE=$(cat "$M/base" 2>/dev/null) || { echo "setup never ran (no $M/base)" >&2; exit 1; } +cd "$CWD" || exit 1 +if [ -d "$M/git-hidden" ]; then rm -rf "$CWD/.git"; mv "$M/git-hidden" "$CWD/.git"; fi +# the agent's change against the base, so its own commits count too +git add -A >/dev/null 2>&1 && git -c core.fileMode=false diff --cached "$BASE" > "$V/agent.diff" +git reset -q +if ! ( +while IFS= read -r tf; do + [ -z "$tf" ] && continue + if git cat-file -e $BASE:"$tf" 2>/dev/null; then + git checkout $BASE -- "$tf" 2>/dev/null || true + else + git rm -f --cached "$tf" >/dev/null 2>&1 || true + rm -f "$tf" + fi +done <<'EOF_RESET_TEST_FILES' +test/ignorecase_contract_test.py +mimo_test_command.sh +EOF_RESET_TEST_FILES + +); then echo "could not reset the test files (testbed problem, not scored)" >&2; exit 1; fi +if ! git apply --verbose /tests/test.patch > "$V/apply.log" 2>&1; then + cat "$V/apply.log" >&2 + echo "the hidden tests could not be applied (testbed problem, not scored)" >&2 + exit 1 +fi +timeout 1800 sh -c "$(cat /tests/test_command.sh)" > "$V/test_output.log" 2>&1 +RC=$? +tail -c 12000 "$V/test_output.log" +if [ $RC -eq 0 ]; then echo 1 > "$V/reward.txt"; else echo 0 > "$V/reward.txt"; fi +echo "test command exited $RC" diff --git a/tasks/format-code-task-002032/tests/test_command.sh b/tasks/format-code-task-002032/tests/test_command.sh new file mode 100644 index 0000000000000000000000000000000000000000..7cb23076694ad17d72e8296d62b2b240083e36db --- /dev/null +++ b/tasks/format-code-task-002032/tests/test_command.sh @@ -0,0 +1 @@ +bash /testbed/mimo_test_command.sh \ No newline at end of file diff --git a/tasks/format-code-task-002035/environment/Dockerfile b/tasks/format-code-task-002035/environment/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..61ed26abb2becdfaea243aedbf13e0bd5cf0547f --- /dev/null +++ b/tasks/format-code-task-002035/environment/Dockerfile @@ -0,0 +1,3 @@ +# The task's image, pinned by digest (the same as [environment].docker_image). +# Setup runs at start from [environment.healthcheck]; environment/setup/ is its readable copy. +FROM docker.io/xiaomimimo/mimo-v2.6-rl-oss@sha256:251cecea4bafa9da75094aa378f4af6c69e68597380a23abae36ee340b1d28d6 diff --git a/tasks/format-code-task-002035/environment/setup/files/blocklist b/tasks/format-code-task-002035/environment/setup/files/blocklist new file mode 100644 index 0000000000000000000000000000000000000000..a8e4bdc4c7d9b739c047a3cb58ea72a1bb05bcbc --- /dev/null +++ b/tasks/format-code-task-002035/environment/setup/files/blocklist @@ -0,0 +1,33 @@ +# mimo answer-leak blocklist (mimoagent) +0.0.0.0 github.com +0.0.0.0 www.github.com +0.0.0.0 api.github.com +0.0.0.0 raw.githubusercontent.com +0.0.0.0 codeload.github.com +0.0.0.0 objects.githubusercontent.com +0.0.0.0 gist.github.com +0.0.0.0 gist.githubusercontent.com +0.0.0.0 gitlab.com +0.0.0.0 bitbucket.org +0.0.0.0 sourceforge.net +0.0.0.0 git.kernel.org +0.0.0.0 chromium.googlesource.com +0.0.0.0 android.googlesource.com +0.0.0.0 sourcegraph.com +0.0.0.0 bugs.chromium.org +0.0.0.0 issues.oss-fuzz.com +0.0.0.0 oss-fuzz.com +0.0.0.0 osv.dev +0.0.0.0 api.osv.dev +0.0.0.0 bugzilla.mozilla.org +0.0.0.0 proxy.golang.org +0.0.0.0 sum.golang.org +0.0.0.0 pkg.go.dev +0.0.0.0 google.com +0.0.0.0 www.google.com +0.0.0.0 bing.com +0.0.0.0 www.bing.com +0.0.0.0 duckduckgo.com +0.0.0.0 html.duckduckgo.com +0.0.0.0 search.brave.com +0.0.0.0 stackoverflow.com diff --git a/tasks/format-code-task-002035/environment/setup/setup.sh b/tasks/format-code-task-002035/environment/setup/setup.sh new file mode 100644 index 0000000000000000000000000000000000000000..d883db90cfcfb48f7a139861bbe9f6b5d95cad6f --- /dev/null +++ b/tasks/format-code-task-002035/environment/setup/setup.sh @@ -0,0 +1,34 @@ +#!/bin/bash +# Runs once, as root, before the agent starts: Harbor's [environment.healthcheck] unpacks this folder into +# /var/lib/mimo and runs it. Generated by mimo_harbor; see its README for how each step maps to Xiaomi's harness. +M=/var/lib/mimo +[ -f "$M/ready" ] && exit 0 +chmod 700 "$M" +fail() { echo "setup: $*" >&2; exit 1; } +# the answer-leak blocklist (mimoagent), applied to /etc/hosts by the agent right after it installs +write_blocklist() { cp "$M/files/blocklist" "$M/blocklist"; } + +# Code: mimoagent environments/datasets/opensource_code.py + base.py, as the explorer runs it (app/runner/domains.py Code). +CWD=/testbed +git config --global --add safe.directory "$CWD" +cd "$CWD" || fail "no working directory $CWD" +if ! git rev-parse --git-dir >/dev/null 2>&1; then # a bare source tree: give it a baseline commit + git init -q && git add -A && git -c user.name=mimo -c user.email=mimo@localhost commit -q -m baseline --allow-empty +fi +BASE=$(git rev-parse HEAD 2>/dev/null) +[ ${#BASE} -eq 40 ] || fail "could not resolve the base commit in $CWD" +echo "$BASE" > "$M/base" +# Images are built with history truncated at the base. If one is not, the fix could be read out of git log, +# so .git is hidden while the agent works and put back for grading. +LATER=$(git rev-list --all --not "$BASE" 2>/dev/null | head -n 5 | grep -c . || true) +rm -f /tmp/fail.log /tmp/pass.log /tmp/patch.diff /tmp/test_patch.diff /tmp/*.log 2>/dev/null; rm -rf /tmp/claude-0 /tmp/claude-* /tmp/testem-* /tmp/puppeteer_dev_chrome_profile-* 2>/dev/null; rm -f /tmp/test_files.json 2>/dev/null; rm -rf /tmp/jest_* /tmp/jest-* /tmp/build /tmp/build_env 2>/dev/null; rm -rf /tmp/pytest-of-root /tmp/pytest-* /tmp/.pytest_cache /tmp/__pycache__ 2>/dev/null; rm -rf /tmp/go-build* /tmp/standards /tmp/wordpress /tmp/zig-* /tmp/testbase /tmp/testbed 2>/dev/null; rm -f /tmp/tmp*.tmp /tmp/*.bak /tmp/expect* /tmp/butwas* 2>/dev/null; rm -rf /root/.cache/go-build 2>/dev/null; rm -rf /tests 2>/dev/null; find /logs -mindepth 1 -delete 2>/dev/null; mkdir -p /logs/agent /logs/verifier /logs/artifacts; chmod 777 /logs/agent /logs/verifier /logs/artifacts; find /var/log -type f -delete 2>/dev/null || true; rm -rf /var/lib/postgresql/*/*/log /var/lib/postgresql/*/*/pg_log 2>/dev/null || true; find /var/lib/mysql /var/lib/mongodb -type f -name '*.log' -delete 2>/dev/null || true; rm -rf /root/.npm/_logs /root/.babel.json /root/.pytest_cache 2>/dev/null || true; find / -maxdepth 4 -xdev -name task_description.md -path '*/.build_env/*' -delete 2>/dev/null || true; true +git clean -fdx --exclude=node_modules --exclude=bower_components --exclude=.husky --exclude=vendor --exclude=third_party --exclude=_deps --exclude=vcpkg_installed --exclude=.venv --exclude=venv --exclude=.gradle --exclude=target --exclude=.build --exclude=lib --exclude=.bundle --exclude=Manifest.toml --exclude=_build --exclude=.stack-work --exclude=dist-newstyle >/dev/null 2>&1 +find /root/.m2 -type f \( -name '*-SNAPSHOT.jar' -o -name '*-SNAPSHOT-sources.jar' -o -name '*-SNAPSHOT-tests.jar' -o -name '*-SNAPSHOT-test-sources.jar' \) -delete 2>/dev/null; rm -rf /root/.julia/compiled 2>/dev/null; rm -rf /root/.gradle/caches/build-cache-* /root/.gradle/daemon 2>/dev/null; rm -rf /root/.gradle/caches/*/scripts /root/.gradle/caches/jars-* 2>/dev/null; rm -rf /root/.cache/bazel 2>/dev/null; true +if [ "$LATER" -gt 0 ]; then + mv "$CWD/.git" "$M/git-hidden" + echo "history not truncated at ${BASE:0:12}: .git hidden while the agent works" +fi +write_blocklist + +touch "$M/ready" +echo "setup done" diff --git a/tasks/format-code-task-002035/tests/test.patch b/tasks/format-code-task-002035/tests/test.patch new file mode 100644 index 0000000000000000000000000000000000000000..2ad5dfdd36f191baebe93b758290c5eb53b373ff --- /dev/null +++ b/tasks/format-code-task-002035/tests/test.patch @@ -0,0 +1,70 @@ +diff --git a/netbox/ipam/tests/test_api.py b/netbox/ipam/tests/test_api.py +index 5dc708cd035..0fefb01629e 100644 +--- a/netbox/ipam/tests/test_api.py ++++ b/netbox/ipam/tests/test_api.py +@@ -699,9 +699,18 @@ def test_list_available_vlans(self): + """ + Test retrieval of all available VLANs within a group. + """ ++ MIN_VID = 100 ++ MAX_VID = 199 ++ + self.add_permissions('ipam.view_vlangroup', 'ipam.view_vlan') +- vlangroup = VLANGroup.objects.first() ++ vlangroup = VLANGroup.objects.create( ++ name='VLAN Group X', ++ slug='vlan-group-x', ++ min_vid=MIN_VID, ++ max_vid=MAX_VID ++ ) + ++ + vlans = ( + VLAN(vid=10, name='VLAN 10', group=vlangroup), + VLAN(vid=20, name='VLAN 20', group=vlangroup), +@@ -711,13 +720,17 @@ def test_list_available_vlans(self): + + # Retrieve all available VLANs + url = reverse('ipam-api:vlangroup-available-vlans', kwargs={'pk': vlangroup.pk}) +- response = self.client.get(url, **self.header) +- +- self.assertEqual(len(response.data), 4094 - len(vlans)) ++ response = self.client.get(f'{url}?limit=0', **self.header) ++ self.assertEqual(len(response.data), MAX_VID - MIN_VID + 1) + available_vlans = {vlan['vid'] for vlan in response.data} + for vlan in vlans: + self.assertNotIn(vlan.vid, available_vlans) + ++ ++ url = reverse('ipam-api:vlangroup-available-vlans', kwargs={'pk': vlangroup.pk}) ++ response = self.client.get(f'{url}?limit=10', **self.header) ++ self.assertEqual(len(response.data), 10) ++ + def test_create_single_available_vlan(self): + """ + Test the creation of a single available VLAN. +diff --git a/mimo_build_env.tar.gz.b64 b/mimo_build_env.tar.gz.b64 +new file mode 100644 +--- /dev/null ++++ b/mimo_build_env.tar.gz.b64 +@@ -0,0 +1,9 @@ ++H4sIAAAAAAAAA+3Sz2vbMBQHcJ/1V7y1sJ78K62dw6CQkQx62mh62M3IkuIIbEmVZNOM/vGT3R/z ++Alt3aBlj73OIBH765lnPSd3LlldCDWn0VrJgWRTTGhyv0z4vFnleFnm5LKMs7PLzCIo362imd55a ++gMhq7X9X99Lzf1TyY/5eOF8x3XVU8cTtX+8/Xph/npXL5/kXy4sw/4vyPIsge70Wfu0/n//pu7SW ++Kq2p2xPGYfoIasEJOYVtuBgPTthBMuFA7kBpD7ZXSqqGmKaSzgrKDxDfwuIy5WJIVd+2cH8P4SHz ++LWvD5QoLeQkdlQrcFDgrJVZw6WLWSjAhE2Yhi8v3+Zj0UDE2EYLimFPRaSW/CTiEluZRoeG11QZa ++sfN6LB7fBDj1NLybAK+BDlpykCq0RJmXgwBjdWc8cT3EYLTzjQ2hMYMT427bcXO2vv78Bdarm9XH ++1XYDV59g8/Vqe7OdwislfK3vPpydHDeyUa63AphWO9n0lnqpVWIOIO6k844wA7F6vur0IeZp+elQ ++NdaEmxkP/0n9WHfUy3WvwO/DBVDbCD817uaTfswh5uD3WoVBKdqIMWe6P2lol0xnpt+KGgnxsCB/ +++7NFCCGEEEIIIYQQQgghhBBCCCGEEEKPvgMVzegDACgAAA== +diff --git a/mimo_test_command.sh b/mimo_test_command.sh +new file mode 100755 +--- /dev/null ++++ b/mimo_test_command.sh +@@ -0,0 +1,6 @@ ++#!/usr/bin/env bash ++ ++set -uo pipefail ++cd /testbed || exit 1 ++base64 -d mimo_build_env.tar.gz.b64 | tar -xzf - -C /testbed || exit 1 ++exec bash -lc 'cd /testbed && bash -eo pipefail /testbed/.build_env/test_command.sh' diff --git a/tasks/format-code-task-002035/tests/test.sh b/tasks/format-code-task-002035/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..f9311e5a1aeda91d85f8bd84e2cb71c2fd868065 --- /dev/null +++ b/tasks/format-code-task-002035/tests/test.sh @@ -0,0 +1,39 @@ +#!/bin/bash +# Code grading, mimoagent opensource_code.py: reset the files the hidden test patch touches, apply it, run the +# task's test command; reward 1 when it exits 0. A testbed failure (reset or apply) writes no reward: not scored. +M=/var/lib/mimo +CWD=/testbed +V=/logs/verifier +mkdir -p "$V" +BASE=$(cat "$M/base" 2>/dev/null) || { echo "setup never ran (no $M/base)" >&2; exit 1; } +cd "$CWD" || exit 1 +if [ -d "$M/git-hidden" ]; then rm -rf "$CWD/.git"; mv "$M/git-hidden" "$CWD/.git"; fi +# the agent's change against the base, so its own commits count too +git add -A >/dev/null 2>&1 && git -c core.fileMode=false diff --cached "$BASE" > "$V/agent.diff" +git reset -q +if ! ( +while IFS= read -r tf; do + [ -z "$tf" ] && continue + if git cat-file -e $BASE:"$tf" 2>/dev/null; then + git checkout $BASE -- "$tf" 2>/dev/null || true + else + git rm -f --cached "$tf" >/dev/null 2>&1 || true + rm -f "$tf" + fi +done <<'EOF_RESET_TEST_FILES' +netbox/ipam/tests/test_api.py +mimo_build_env.tar.gz.b64 +mimo_test_command.sh +EOF_RESET_TEST_FILES + +); then echo "could not reset the test files (testbed problem, not scored)" >&2; exit 1; fi +if ! git apply --verbose /tests/test.patch > "$V/apply.log" 2>&1; then + cat "$V/apply.log" >&2 + echo "the hidden tests could not be applied (testbed problem, not scored)" >&2 + exit 1 +fi +timeout 1800 sh -c "$(cat /tests/test_command.sh)" > "$V/test_output.log" 2>&1 +RC=$? +tail -c 12000 "$V/test_output.log" +if [ $RC -eq 0 ]; then echo 1 > "$V/reward.txt"; else echo 0 > "$V/reward.txt"; fi +echo "test command exited $RC" diff --git a/tasks/format-code-task-002035/tests/test_command.sh b/tasks/format-code-task-002035/tests/test_command.sh new file mode 100644 index 0000000000000000000000000000000000000000..7cb23076694ad17d72e8296d62b2b240083e36db --- /dev/null +++ b/tasks/format-code-task-002035/tests/test_command.sh @@ -0,0 +1 @@ +bash /testbed/mimo_test_command.sh \ No newline at end of file diff --git a/tasks/format-code-task-002081/environment/Dockerfile b/tasks/format-code-task-002081/environment/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..a0cc9230c7203ec9a46210e8128960d65f069b4f --- /dev/null +++ b/tasks/format-code-task-002081/environment/Dockerfile @@ -0,0 +1,3 @@ +# The task's image, pinned by digest (the same as [environment].docker_image). +# Setup runs at start from [environment.healthcheck]; environment/setup/ is its readable copy. +FROM docker.io/xiaomimimo/mimo-v2.6-rl-oss@sha256:e06c70c87bfd4182175564631bffc5abb64b48b978a025fcc39cf2554604d637 diff --git a/tasks/format-code-task-002081/environment/setup/files/blocklist b/tasks/format-code-task-002081/environment/setup/files/blocklist new file mode 100644 index 0000000000000000000000000000000000000000..a8e4bdc4c7d9b739c047a3cb58ea72a1bb05bcbc --- /dev/null +++ b/tasks/format-code-task-002081/environment/setup/files/blocklist @@ -0,0 +1,33 @@ +# mimo answer-leak blocklist (mimoagent) +0.0.0.0 github.com +0.0.0.0 www.github.com +0.0.0.0 api.github.com +0.0.0.0 raw.githubusercontent.com +0.0.0.0 codeload.github.com +0.0.0.0 objects.githubusercontent.com +0.0.0.0 gist.github.com +0.0.0.0 gist.githubusercontent.com +0.0.0.0 gitlab.com +0.0.0.0 bitbucket.org +0.0.0.0 sourceforge.net +0.0.0.0 git.kernel.org +0.0.0.0 chromium.googlesource.com +0.0.0.0 android.googlesource.com +0.0.0.0 sourcegraph.com +0.0.0.0 bugs.chromium.org +0.0.0.0 issues.oss-fuzz.com +0.0.0.0 oss-fuzz.com +0.0.0.0 osv.dev +0.0.0.0 api.osv.dev +0.0.0.0 bugzilla.mozilla.org +0.0.0.0 proxy.golang.org +0.0.0.0 sum.golang.org +0.0.0.0 pkg.go.dev +0.0.0.0 google.com +0.0.0.0 www.google.com +0.0.0.0 bing.com +0.0.0.0 www.bing.com +0.0.0.0 duckduckgo.com +0.0.0.0 html.duckduckgo.com +0.0.0.0 search.brave.com +0.0.0.0 stackoverflow.com diff --git a/tasks/format-code-task-002081/environment/setup/setup.sh b/tasks/format-code-task-002081/environment/setup/setup.sh new file mode 100644 index 0000000000000000000000000000000000000000..d883db90cfcfb48f7a139861bbe9f6b5d95cad6f --- /dev/null +++ b/tasks/format-code-task-002081/environment/setup/setup.sh @@ -0,0 +1,34 @@ +#!/bin/bash +# Runs once, as root, before the agent starts: Harbor's [environment.healthcheck] unpacks this folder into +# /var/lib/mimo and runs it. Generated by mimo_harbor; see its README for how each step maps to Xiaomi's harness. +M=/var/lib/mimo +[ -f "$M/ready" ] && exit 0 +chmod 700 "$M" +fail() { echo "setup: $*" >&2; exit 1; } +# the answer-leak blocklist (mimoagent), applied to /etc/hosts by the agent right after it installs +write_blocklist() { cp "$M/files/blocklist" "$M/blocklist"; } + +# Code: mimoagent environments/datasets/opensource_code.py + base.py, as the explorer runs it (app/runner/domains.py Code). +CWD=/testbed +git config --global --add safe.directory "$CWD" +cd "$CWD" || fail "no working directory $CWD" +if ! git rev-parse --git-dir >/dev/null 2>&1; then # a bare source tree: give it a baseline commit + git init -q && git add -A && git -c user.name=mimo -c user.email=mimo@localhost commit -q -m baseline --allow-empty +fi +BASE=$(git rev-parse HEAD 2>/dev/null) +[ ${#BASE} -eq 40 ] || fail "could not resolve the base commit in $CWD" +echo "$BASE" > "$M/base" +# Images are built with history truncated at the base. If one is not, the fix could be read out of git log, +# so .git is hidden while the agent works and put back for grading. +LATER=$(git rev-list --all --not "$BASE" 2>/dev/null | head -n 5 | grep -c . || true) +rm -f /tmp/fail.log /tmp/pass.log /tmp/patch.diff /tmp/test_patch.diff /tmp/*.log 2>/dev/null; rm -rf /tmp/claude-0 /tmp/claude-* /tmp/testem-* /tmp/puppeteer_dev_chrome_profile-* 2>/dev/null; rm -f /tmp/test_files.json 2>/dev/null; rm -rf /tmp/jest_* /tmp/jest-* /tmp/build /tmp/build_env 2>/dev/null; rm -rf /tmp/pytest-of-root /tmp/pytest-* /tmp/.pytest_cache /tmp/__pycache__ 2>/dev/null; rm -rf /tmp/go-build* /tmp/standards /tmp/wordpress /tmp/zig-* /tmp/testbase /tmp/testbed 2>/dev/null; rm -f /tmp/tmp*.tmp /tmp/*.bak /tmp/expect* /tmp/butwas* 2>/dev/null; rm -rf /root/.cache/go-build 2>/dev/null; rm -rf /tests 2>/dev/null; find /logs -mindepth 1 -delete 2>/dev/null; mkdir -p /logs/agent /logs/verifier /logs/artifacts; chmod 777 /logs/agent /logs/verifier /logs/artifacts; find /var/log -type f -delete 2>/dev/null || true; rm -rf /var/lib/postgresql/*/*/log /var/lib/postgresql/*/*/pg_log 2>/dev/null || true; find /var/lib/mysql /var/lib/mongodb -type f -name '*.log' -delete 2>/dev/null || true; rm -rf /root/.npm/_logs /root/.babel.json /root/.pytest_cache 2>/dev/null || true; find / -maxdepth 4 -xdev -name task_description.md -path '*/.build_env/*' -delete 2>/dev/null || true; true +git clean -fdx --exclude=node_modules --exclude=bower_components --exclude=.husky --exclude=vendor --exclude=third_party --exclude=_deps --exclude=vcpkg_installed --exclude=.venv --exclude=venv --exclude=.gradle --exclude=target --exclude=.build --exclude=lib --exclude=.bundle --exclude=Manifest.toml --exclude=_build --exclude=.stack-work --exclude=dist-newstyle >/dev/null 2>&1 +find /root/.m2 -type f \( -name '*-SNAPSHOT.jar' -o -name '*-SNAPSHOT-sources.jar' -o -name '*-SNAPSHOT-tests.jar' -o -name '*-SNAPSHOT-test-sources.jar' \) -delete 2>/dev/null; rm -rf /root/.julia/compiled 2>/dev/null; rm -rf /root/.gradle/caches/build-cache-* /root/.gradle/daemon 2>/dev/null; rm -rf /root/.gradle/caches/*/scripts /root/.gradle/caches/jars-* 2>/dev/null; rm -rf /root/.cache/bazel 2>/dev/null; true +if [ "$LATER" -gt 0 ]; then + mv "$CWD/.git" "$M/git-hidden" + echo "history not truncated at ${BASE:0:12}: .git hidden while the agent works" +fi +write_blocklist + +touch "$M/ready" +echo "setup done" diff --git a/tasks/format-code-task-002081/tests/test.patch b/tasks/format-code-task-002081/tests/test.patch new file mode 100644 index 0000000000000000000000000000000000000000..2ebd7ee41afb9426bcb4f90a280db9afd68c8826 --- /dev/null +++ b/tasks/format-code-task-002081/tests/test.patch @@ -0,0 +1,652 @@ +diff --git a/tests/integration/test_random_advanced.py b/tests/integration/test_random_advanced.py +index ab8031344..c5ae2bc42 100644 +--- a/tests/integration/test_random_advanced.py ++++ b/tests/integration/test_random_advanced.py +@@ -12,6 +12,7 @@ + # See the License for the specific language governing permissions and + # limitations under the License. + # ++import os + import sys + + import numpy as np +@@ -20,6 +21,7 @@ + + import cunumeric as num + ++LEGATE_TEST = os.environ.get("LEGATE_TEST", None) == "1" + if sys.platform == "darwin": + pytestmark = pytest.mark.skip() + BITGENERATOR_ARGS = [] +@@ -81,7 +83,12 @@ def test_vonmises_float64(t): + + + @pytest.mark.parametrize("t", BITGENERATOR_ARGS, ids=str) +-def test_hypergeometric(t): ++@pytest.mark.parametrize( ++ "ngood, nbad, nsample", ++ ((60, 440, 200), (20.0, 77, 1), ((3, 5, 7), 6, 22)), ++ ids=str, ++) ++def test_hypergeometric(t, ngood, nbad, nsample): + bitgen = t(seed=42) + gen = num.random.Generator(bitgen) + N = 500 +@@ -110,12 +117,24 @@ def test_geometric(t): + + + @pytest.mark.parametrize("t", BITGENERATOR_ARGS, ids=str) +-def test_zipf(t): ++@pytest.mark.parametrize( ++ "s", ++ ( ++ 7.5, ++ pytest.param( ++ (1.2, 3.1415), ++ marks=pytest.mark.xfail, ++ ++ ++ ++ ), ++ ), ++ ids=str, ++) ++def test_zipf(t, s): + bitgen = t(seed=42) + gen = num.random.Generator(bitgen) +- s = 7.5 + a = gen.zipf(a=s, size=(1024 * 1024,), dtype=np.uint32) +- a = np.random.zipf(s, 1024 * 1024) + ref_a = np.random.zipf(s, 1024 * 1024) + theo_mean = np.average(ref_a) + theo_std = np.std(ref_a) +@@ -173,6 +192,81 @@ def test_negative_binomial(t): + assert_distribution(a, theo_mean, theo_std) + + ++FUNC_ARGS = ( ++ ("binomial", (15, 0.666)), ++ ("negative_binomial", (15, 0.666)), ++ ("geometric", (0.707,)), ++ ("hypergeometric", (60, 440, 200)), ++ ("standard_t", (3.1415,)), ++ ("vonmises", (1.414, 3.1415)), ++ ("wald", (1.414, 3.1415)), ++ ("zipf", (7.5,)), ++) ++ ++ ++@pytest.mark.parametrize("func, args", FUNC_ARGS, ids=str) ++@pytest.mark.parametrize("size", ((2048 * 2048), (4096,), 25535), ids=str) ++def test_random_sizes(func, args, size): ++ seed = 42 ++ gen_np = np.random.Generator(np.random.PCG64(seed=seed)) ++ gen_num = num.random.Generator(num.random.XORWOW(seed=seed)) ++ a_np = getattr(gen_np, func)(*args, size=size) ++ a_num = getattr(gen_num, func)(*args, size=size) ++ assert a_np.shape == a_num.shape ++ ++ ++@pytest.mark.xfail ++@pytest.mark.parametrize("func, args", FUNC_ARGS, ids=str) ++def test_random_size_none(func, args): ++ seed = 42 ++ gen_np = np.random.Generator(np.random.PCG64(seed=seed)) ++ gen_num = num.random.Generator(num.random.XORWOW(seed=seed)) ++ a_np = getattr(gen_np, func)(*args, size=None) ++ a_num = getattr(gen_num, func)(*args, size=None) ++ ++ ++ assert np.ndim(a_np) == np.ndim(a_num) ++ ++ ++class TestRandomErrors: ++ ++ @pytest.mark.skipif(LEGATE_TEST, reason="Test hang when LEGATE_TEST=1") ++ @pytest.mark.parametrize( ++ "dist, expected_exc", ++ ( ++ (0.77, ValueError), ++ (-5, ValueError), ++ (None, TypeError), ++ ((1, 5, 3), ValueError), ++ ), ++ ids=str, ++ ) ++ def test_zipf_invalid_dist(self, dist, expected_exc): ++ seed = 42 ++ gen_np = np.random.Generator(np.random.PCG64(seed=seed)) ++ gen_num = num.random.Generator(num.random.XORWOW(seed=seed)) ++ with pytest.raises(expected_exc): ++ gen_np.zipf(dist) ++ with pytest.raises(expected_exc): ++ gen_num.zipf(dist) ++ ++ @pytest.mark.skipif(LEGATE_TEST, reason="Test hang when LEGATE_TEST=1") ++ @pytest.mark.parametrize( ++ "ngood, nbad, nsample", ++ ((200, 60, 500), ((1, 5, 7), 6, 22)), ++ ids=str, ++ ) ++ def test_hypergeometric_invalid_args(self, ngood, nbad, nsample): ++ expected_exc = ValueError ++ seed = 42 ++ gen_np = np.random.Generator(np.random.PCG64(seed=seed)) ++ gen_num = num.random.Generator(num.random.XORWOW(seed=seed)) ++ with pytest.raises(expected_exc): ++ gen_np.hypergeometric(ngood, nbad, nsample) ++ with pytest.raises(expected_exc): ++ gen_num.hypergeometric(ngood, nbad, nsample) ++ ++ + if __name__ == "__main__": + import sys + +diff --git a/tests/integration/test_random_beta.py b/tests/integration/test_random_beta.py +index dc451b42e..9d922f792 100644 +--- a/tests/integration/test_random_beta.py ++++ b/tests/integration/test_random_beta.py +@@ -133,6 +133,38 @@ def test_noncentral_f_float64(t): + assert_distribution(a, theo_mean, theo_std) + + ++FUNC_ARGS = ( ++ ("beta", (2.0, 5.0)), ++ ("f", (1.0, 48.0)), ++ ("logseries", (0.66,)), ++ ("noncentral_f", (1.0, 48.0, 1.414)), ++) ++ ++ ++@pytest.mark.parametrize("func, args", FUNC_ARGS, ids=str) ++@pytest.mark.parametrize("size", ((2048 * 2048), (4096,), 25535), ids=str) ++def test_beta_sizes(func, args, size): ++ seed = 42 ++ gen_np = np.random.Generator(np.random.PCG64(seed=seed)) ++ gen_num = num.random.Generator(num.random.XORWOW(seed=seed)) ++ a_np = getattr(gen_np, func)(*args, size=size) ++ a_num = getattr(gen_num, func)(*args, size=size) ++ assert a_np.shape == a_num.shape ++ ++ ++@pytest.mark.xfail ++@pytest.mark.parametrize("func, args", FUNC_ARGS, ids=str) ++def test_beta_size_none(func, args): ++ seed = 42 ++ gen_np = np.random.Generator(np.random.PCG64(seed=seed)) ++ gen_num = num.random.Generator(num.random.XORWOW(seed=seed)) ++ a_np = getattr(gen_np, func)(*args, size=None) ++ a_num = getattr(gen_num, func)(*args, size=None) ++ ++ ++ assert np.ndim(a_np) == np.ndim(a_num) ++ ++ + if __name__ == "__main__": + import sys + +diff --git a/tests/integration/test_random_bitgenerator.py b/tests/integration/test_random_bitgenerator.py +index 31155d63f..58d82631e 100644 +--- a/tests/integration/test_random_bitgenerator.py ++++ b/tests/integration/test_random_bitgenerator.py +@@ -48,6 +48,28 @@ def test_bitgenerator_type(t): + print(f"DONE for type = {t}") + + ++@pytest.mark.parametrize("size", ((2048 * 2048), (4096,), 25535), ids=str) ++def test_bitgenerator_size(size): ++ seed = 42 ++ gen_np = np.random.PCG64(seed=seed) ++ gen_num = num.random.XORWOW(seed=seed) ++ a_np = gen_np.random_raw(size=size) ++ a_num = gen_num.random_raw(shape=size) ++ assert a_np.shape == a_num.shape ++ ++ ++@pytest.mark.xfail ++def test_bitgenerator_size_none(): ++ seed = 42 ++ gen_np = np.random.PCG64(seed=seed) ++ gen_num = num.random.XORWOW(seed=seed) ++ a_np = gen_np.random_raw(size=None) ++ a_num = gen_num.random_raw(shape=None) ++ ++ ++ assert np.ndim(a_np) == np.ndim(a_num) ++ ++ + @pytest.mark.parametrize("t", BITGENERATOR_ARGS, ids=str) + def test_force_build(t): + t(42, True) +@@ -83,6 +105,15 @@ def test_integers_int16(t): + print(f"1024*1024 sum = {a.sum()}") + + ++@pytest.mark.parametrize("t", BITGENERATOR_ARGS, ids=str) ++def test_integers_endpoint(t): ++ high = 10 ++ bitgen = t(seed=42) ++ gen = num.random.Generator(bitgen) ++ a = gen.integers(high, size=100, dtype=np.int16, endpoint=True) ++ assert np.max(a) == high ++ ++ + @pytest.mark.parametrize("t", BITGENERATOR_ARGS, ids=str) + def test_random_float32(t): + # top-level random function has a different signature +@@ -105,6 +136,20 @@ def test_random_float64(t): + assert_distribution(a, 0.5, num.sqrt(1.0 / 12.0)) + + ++def test_random_out_stats(): ++ seed = 42 ++ dtype = np.float32 ++ out_shape = (2, 3, 1) ++ gen_np = np.random.Generator(np.random.PCG64(seed=seed)) ++ gen_num = num.random.Generator(num.random.XORWOW(seed=seed)) ++ out_np = np.empty(out_shape, dtype=dtype) ++ out_num = num.empty(out_shape, dtype=dtype) ++ gen_np.random(out=out_np, dtype=dtype) ++ gen_num.random(out=out_num, dtype=dtype) ++ assert out_np.shape == out_num.shape ++ assert out_np.dtype == out_np.dtype ++ ++ + @pytest.mark.parametrize("t", BITGENERATOR_ARGS, ids=str) + def test_lognormal_float32(t): + bitgen = t(seed=42) +@@ -192,6 +237,86 @@ def test_poisson(t): + assert_distribution(a, theo_mean, theo_std) + + ++FUNCS = ("poisson", "normal", "lognormal", "uniform") ++ ++ ++@pytest.mark.parametrize("func", FUNCS, ids=str) ++@pytest.mark.parametrize("size", ((2048 * 2048), (4096,), 25535), ids=str) ++def test_random_sizes(func, size): ++ seed = 42 ++ gen_np = np.random.Generator(np.random.PCG64(seed=seed)) ++ gen_num = num.random.Generator(num.random.XORWOW(seed=seed)) ++ a_np = getattr(gen_np, func)(size=size) ++ a_num = getattr(gen_num, func)(size=size) ++ assert a_np.shape == a_num.shape ++ ++ ++@pytest.mark.xfail ++@pytest.mark.parametrize("func", FUNCS, ids=str) ++def test_random_size_none(func): ++ seed = 42 ++ gen_np = np.random.Generator(np.random.PCG64(seed=seed)) ++ gen_num = num.random.Generator(num.random.XORWOW(seed=seed)) ++ a_np = getattr(gen_np, func)(size=None) ++ a_num = getattr(gen_num, func)(size=None) ++ ++ ++ assert np.ndim(a_np) == np.ndim(a_num) ++ ++ ++class TestBitGeneratorErrors: ++ def test_init_bitgenerator(self): ++ expected_exc = NotImplementedError ++ with pytest.raises(expected_exc): ++ np.random.BitGenerator() ++ with pytest.raises(expected_exc): ++ num.random.BitGenerator() ++ ++ @pytest.mark.xfail ++ @pytest.mark.parametrize("dtype", (np.int32, np.float128, str)) ++ def test_random_invalid_dtype(self, dtype): ++ expected_exc = TypeError ++ seed = 42 ++ gen_np = np.random.Generator(np.random.PCG64(seed=seed)) ++ gen_num = num.random.Generator(num.random.XORWOW(seed=seed)) ++ with pytest.raises(expected_exc): ++ gen_np.random(size=(1024 * 1024,), dtype=dtype) ++ ++ with pytest.raises(expected_exc): ++ gen_num.random(size=(1024 * 1024,), dtype=dtype) ++ ++ ++ ++ def test_random_out_dtype_mismatch(self): ++ expected_exc = TypeError ++ seed = 42 ++ dtype = np.float32 ++ out_shape = (3, 2, 3) ++ out_dtype = np.float64 ++ gen_np = np.random.Generator(np.random.PCG64(seed=seed)) ++ gen_num = num.random.Generator(num.random.XORWOW(seed=seed)) ++ out_np = np.empty(out_shape, dtype=out_dtype) ++ out_num = num.empty(out_shape, dtype=out_dtype) ++ with pytest.raises(expected_exc): ++ gen_np.random(out=out_np, dtype=dtype) ++ with pytest.raises(expected_exc): ++ gen_num.random(out=out_num, dtype=dtype) ++ ++ def test_random_out_shape_mismatch(self): ++ expected_exc = ValueError ++ seed = 42 ++ size = (1024 * 1024,) ++ out_shape = (3, 2, 3) ++ gen_np = np.random.Generator(np.random.PCG64(seed=seed)) ++ gen_num = num.random.Generator(num.random.XORWOW(seed=seed)) ++ out_np = np.empty(out_shape) ++ out_num = num.empty(out_shape) ++ with pytest.raises(expected_exc): ++ gen_np.random(size=size, out=out_np) ++ with pytest.raises(expected_exc): ++ gen_num.random(size=size, out=out_num) ++ ++ + if __name__ == "__main__": + import sys + +diff --git a/tests/integration/test_random_creation.py b/tests/integration/test_random_creation.py +index 2acd1df6b..15bf70ec1 100644 +--- a/tests/integration/test_random_creation.py ++++ b/tests/integration/test_random_creation.py +@@ -170,9 +170,10 @@ def test_rand(shape): + ] + SMALL_RNG_SIZES = [5, 1024, (1, 2)] + LARGE_RNG_SIZES = [10000, (20, 50, 4)] +-ALL_RNG_SIZES = SMALL_RNG_SIZES + LARGE_RNG_SIZES ++ALL_RNG_SIZES = SMALL_RNG_SIZES + LARGE_RNG_SIZES + [None] + INT_DTYPES = [np.int64, np.int32, np.int16] + UINT_DTYPES = [np.uint64, np.uint16, np.uint0] ++FLOAT_DTYPES = [np.float16, np.float128, np.float64] + + + @pytest.mark.parametrize("size", ALL_RNG_SIZES, ids=str) +@@ -182,10 +183,10 @@ def test_randint_basic_stats(low, high, size, dtype): + arr_np, arr_num = gen_random_from_both( + "randint", low=low, high=high, size=size, dtype=dtype + ) +- assert arr_np.dtype == arr_np.dtype ++ assert arr_np.dtype == arr_num.dtype + assert arr_np.shape == arr_num.shape + assert np.min(arr_num) >= low +- assert np.max(arr_num) <= high ++ assert np.max(arr_num) < high + + + @pytest.mark.parametrize("low", [1024, 1025, 12345], ids=str) +@@ -209,6 +210,13 @@ def test_randint_high_limit(): + assert np.max(arr_num) < limit + + ++def test_random_integers_high_limit(): ++ limit = 10 ++ arr_np, arr_num = gen_random_from_both("random_integers", 10, size=100) ++ assert np.max(arr_np) <= limit ++ assert np.max(arr_num) <= limit ++ ++ + @pytest.mark.xfail(reason="cuNumeric raises NotImplementedError") + @pytest.mark.parametrize( + "low, high", [(3000.45, 15000), (123, 456.7), (12.3, 45.6)], ids=str +@@ -295,7 +303,7 @@ def test_random_integers(low, high, size): + ) + + +-@pytest.mark.parametrize("size", ALL_RNG_SIZES, ids=str) ++@pytest.mark.parametrize("size", SMALL_RNG_SIZES + LARGE_RNG_SIZES, ids=str) + def test_random_sample_basic_stats(size): + arr_np, arr_num = gen_random_from_both("random_sample", size=size) + assert arr_np.shape == arr_num.shape +@@ -317,6 +325,22 @@ def test_random_sample(size): + ) + + ++@pytest.mark.parametrize("size", SMALL_RNG_SIZES, ids=str) ++def test_random_std_exponential_basic_stats(size): ++ arr_np, arr_num = gen_random_from_both("standard_exponential", size=size) ++ assert arr_np.shape == arr_num.shape ++ assert arr_np.dtype == arr_num.dtype ++ ++ ++@pytest.mark.parametrize("size", SMALL_RNG_SIZES, ids=str) ++def test_random_std_gamma_basic_stats(size): ++ arr_np, arr_num = gen_random_from_both( ++ "standard_gamma", shape=3.1415, size=size ++ ) ++ assert arr_np.shape == arr_num.shape ++ assert arr_np.dtype == arr_num.dtype ++ ++ + class TestRandomErrors: + def assert_exc_from_both(self, func, exc, *args, **kwargs): + with pytest.raises(exc): +diff --git a/tests/integration/test_random_gamma.py b/tests/integration/test_random_gamma.py +index dbca2ddfc..69fbc2f42 100644 +--- a/tests/integration/test_random_gamma.py ++++ b/tests/integration/test_random_gamma.py +@@ -126,6 +126,30 @@ def test_noncentral_chisquare_float64(t): + assert_distribution(a, theo_mean, theo_std) + + ++@pytest.mark.parametrize("func", ("gamma", "noncentral_chisquare"), ids=str) ++@pytest.mark.parametrize("size", ((2048 * 2048), (4096,), 25535), ids=str) ++def test_gamma_sizes(func, size): ++ seed = 42 ++ gen_np = np.random.Generator(np.random.PCG64(seed=seed)) ++ gen_num = num.random.Generator(num.random.XORWOW(seed=seed)) ++ a_np = getattr(gen_np, func)(3.1415, 1.414, size=size) ++ a_num = getattr(gen_num, func)(3.1415, 1.414, size=size) ++ assert a_np.shape == a_num.shape ++ ++ ++@pytest.mark.xfail ++@pytest.mark.parametrize("func", ("gamma", "noncentral_chisquare"), ids=str) ++def test_gamma_size_none(func): ++ seed = 42 ++ gen_np = np.random.Generator(np.random.PCG64(seed=seed)) ++ gen_num = num.random.Generator(num.random.XORWOW(seed=seed)) ++ a_np = getattr(gen_np, func)(3.1415, 1.414, size=None) ++ a_num = getattr(gen_num, func)(3.1415, 1.414, size=None) ++ ++ ++ assert np.ndim(a_np) == np.ndim(a_num) ++ ++ + if __name__ == "__main__": + import sys + +diff --git a/tests/integration/test_random_straightforward.py b/tests/integration/test_random_straightforward.py +index 584719587..b412e5341 100644 +--- a/tests/integration/test_random_straightforward.py ++++ b/tests/integration/test_random_straightforward.py +@@ -339,6 +339,47 @@ def test_bytes(t): + assert_distribution(a, theo_mean, theo_std) + + ++FUNC_ARGS = ( ++ ("exponential", ()), ++ ("gumbel", ()), ++ ("laplace", ()), ++ ("logistic", ()), ++ ("pareto", (30.0,)), ++ ("power", (3.0,)), ++ ("rayleigh", (np.pi,)), ++ ("standard_cauchy", ()), ++ ("standard_exponential", ()), ++ ("triangular", (1.414, 2.7, 3.1415)), ++ ("weibull", (3.1415,)), ++) ++ ++ ++@pytest.mark.parametrize("t", BITGENERATOR_ARGS, ids=str) ++@pytest.mark.parametrize("func, args", FUNC_ARGS, ids=str) ++@pytest.mark.parametrize("size", ((2048 * 2048), (4096,), 25535), ids=str) ++def test_beta_sizes(t, func, args, size): ++ seed = 42 ++ gen_np = np.random.Generator(np.random.PCG64(seed=seed)) ++ gen_num = num.random.Generator(t(seed=seed)) ++ a_np = getattr(gen_np, func)(*args, size=size) ++ a_num = getattr(gen_num, func)(*args, size=size) ++ assert a_np.shape == a_num.shape ++ ++ ++@pytest.mark.xfail ++@pytest.mark.parametrize("t", BITGENERATOR_ARGS, ids=str) ++@pytest.mark.parametrize("func, args", FUNC_ARGS, ids=str) ++def test_beta_size_none(t, func, args): ++ seed = 42 ++ gen_np = np.random.Generator(np.random.PCG64(seed=seed)) ++ gen_num = num.random.Generator(t(seed=seed)) ++ a_np = getattr(gen_np, func)(*args, size=None) ++ a_num = getattr(gen_num, func)(*args, size=None) ++ ++ ++ assert np.ndim(a_np) == np.ndim(a_num) ++ ++ + if __name__ == "__main__": + import sys + +diff --git a/mimo_build_env.tar.gz.b64 b/mimo_build_env.tar.gz.b64 +new file mode 100644 +--- /dev/null ++++ b/mimo_build_env.tar.gz.b64 +@@ -0,0 +1,130 @@ ++H4sIAAAAAAAAA+xcW2zbVpomJepmWQ5lyxfali0ndhLFiWz5GrdOGid2k0nTTHPZHSDTrkpbtC1H ++F4eSm9qRZjJAFlGCYEctPIhqeLdCkemoSLDwAvOQhwU2L/tOGgRqEAgQYDEPfVkY6MtgXmbP4UWi ++ZFKWIyeY7og6JiXy8L+f//DwnM+e6aVA0O+jwp/1IW9q6wfb6PCwcARb8VH47h0e8A4MekdGR0eR ++fq93xDuEuIbfmESKbSkaI2mXC6EjkVipertd/4lunrz/fb7F5RlyZp7y+fY3Fvbi/+GRIeD/oX7v ++SNX/b2PT8P9MJDwbo6Ix32JwaS4Q9swsLsfmI+ETg17vCfAVXDkx5un3DHrALbvygA4eGRrS8P/g ++4DBwdoH/BwZHB4D/+9+C/n/v/v+DzVYDj7f+1b1w8BiC/I/yok46/vgO2D1G/MgNxI/6dUH0hk44 ++6kPYjA5FQoYbRlS8YrphEo7mGxa//h5yo8avu4a4sZVLHwlB4xLDyRWLuELkTco1sxReClF0YOZI ++1DVFzlH0BE2Ty67pQGyOClM0GYvQrhAFIs8fdS1FKVeUovxRzw9QpsszqEJSM/jTQ0m7wdn7pvvm +++5b7NY9FmZAQ+tAiyacL6QWJsYc10hlDSJ9AUSRmyxNbMMnf/PpvAb2nOU4JXVy3YJZ/PTT7zUlz ++smZW58fuWRL6uD6u8+Wugl9o/tcc4jd8gyawpClpAfWN98wJg990D3loimOTyCcjCWOsIS/BA8tC ++TY6O8Vvgh6eyLxC6M9asVVOHxA2gfoHM3wK7PNXLv1Dk0ajgE8vK5IeR8E1q+cQiGZuZz7tiV0cA ++5+V9QUO5Lq8052730GTYHwlJhwInQSGgkj8ugN3vdI9BfD1A40ihuMAtyAOdL3dTTJcnsJD7ntEj ++KpsarWvId+hlN8bbfaChxwIzvpxCvC68yBtFOXkMquPW81ggHIjxdb4IHQCBSgZ98DxvAjf5QkB5 ++yNZ19+5fDvfBcJ6m/H2KBFqcNBeXeZtPsC7lF+isHBFzpw/WDMwt0ZRnPBiZIYPR056Cio2ATRR2 ++f3++i2yZm5J1qRhrbufM7Yy5/VX30aSJM3f9yVzzyPLbuofKa2L5Eeru7uSble7ziYqCw23eUXBh ++KRyYjdAhvqngbDAyFwZnySDfUHBeOllIYjESiEYjYb6l4Cz1+WIkTIVjgR1E5pZC01QxkSC5GCRn ++KL6xWI5AFPitiMIiSVOxCF9fJMZtii66H4RxkArMzRfdP0MuzcwvF5koRgfI8NxSkKSLRLtNBaaX ++gsEidtPQmby98BwVI/m6glOzOy0bBS0F3EoUWTY8A6xFg6ArvmVmPhC9tQRULpJgjgyFyCIlQJiH ++/STt98X4toIL88uLFD1HRUA7Bu20yEyfRcKhQHSHOiuBxWJZ8hQKq94mg/4iotOBcCQEvd9RqCg1 ++B1riZ1T+euFtgXCMAikoWpA8MDl5nBGSx33QH8UU1x9gC7lfD5DCjJlAk/okArIuCrIuyOAg++ku ++zxgUxGHC74TE/1fKTHFkIXfxN906JKbIN8prD2oKWcXRuA4kfmwOi4N0fxUJgKT8BP0XVMxEcT0N ++roZRP5IwxU2/qY8pZIibCnOXH10xAtFNMWO+zgImf8sopdekkTCDDGuJI3HzgxqhYwB3Pc3dKcoE ++TBGUlcMQt5E3+6lZiqbFrAdSZozm9cAjNLQRDfsz3npVSCXXwEXKbYWpMzjLG+fBySDF23J+vA7j ++zQJvMMwGybkoj5E02Btv3haOBjG16unwHG/1zQaCQR8JOx3eKnY0vjAZoqJWcL9L3u7epWE3zdvg ++nSBVihVXTpXIqvAxwydWz58tuH0SUIz+ByLm2gMNjxLMgaNb+ODvTGls3Za5w+KDHD645WhNf5gd ++2mjc1uvs9Vtjp4TjNiLvtibOF51R7MxIVw/T4kljaSzbnTJsNbQwDd0v2zszhq8url/M9rDt/amp ++l00tq4Hvm3o3m3qzU2zTANc0kNJv4W0pa3oycyhzZ2Py+WEWn+DwCUYu9AEgtVtHD0Cb1OS7bbeB ++Pg1PmeVOjH4P+u4UPGehYDWhL4OB8GneqLVKW60cLs+mE9B4Z6HxgPVeNrSmx7i2vo02tuEU13Aq ++ad7Gaixn0W2k5L4FwZ2g1xK02dEqhSZ/sQU+firbXcIQNywo2spNoWXQJnA21xaFdmaM6/y6m8I5 +++uO4ke6Lo+rPDn69H4sbwf25NvbM8C34/jT3G7ZZP2gz/6wj8i3OIJ4ZhxRgCzdotMwSXAsziNoT ++DNDBmNNB79cr+Ov9aP5XwpIwAx07ATdF1lBIYY5b4sZnpsJHwj3ooEm1LB3Me9RB/RmvUh00qZal ++g6UsHayJGkmH3FCigFtN3FqRDppUy9KhZo865AYx+6qDJtWydLBKOlwt1CFRC2TuANQtqtRrBYkL ++e+zyJdagWTTcUpe3VkNemyRvDaKyxW0VyatBsyx5bWXFyIFEnRQjVlVedfEDFcWIJtWyYqRujzrU ++vhEdNKmWpcOBPeqgeI2xjzpoUi1LB1wj9nEp9utUqeMVxb4GzbJi376LvAfegLwaNMuSt15DXqsk ++L65K21qRvBo0y5K3QZLXXzKm6xN2IP8hwMuuygtKX0A/Xr8CpI3bV/amiSr1b8Hf03wtBWUNnRyS ++TrOldAK/GhUaOhIN4JnSSLuAFPWq0pnijniDoGnBk+getCtBtzAbaOjVJOn1aUlfNQr9bhfoX9GM ++4jWmgmPjzmgTbFquJiUoF0oOqWro0izpQgFaDlVaijFF0Ui6Kdabr1cYHYmGeEOmSZVeU7EkwEoW ++4NFytW5Q2lxDq5ayeggx0mAPoXh5rOBkkuLsdXsITapl9RBEWTq0JJolHVpUuTXHWyrSQZNqWTq0 ++amRhQsrCBKKyxYmKsrAGzbKycNtrZKxWyQcwY7Wq8oY+aK0oY5WgW1bGapf0elYylloTbfFWv1Oq ++e1HyUZsq77aKfKRBswwfibHeriFTa0Wxrkm1rFjvKKu9ticaJR2cqtwa4+0V6aBJtSwdOjXaa5sU ++Cx0aFqokFjRoltVeXa/RXjsTHQmn1F47VXk74x3xzoraawm6ZbXXrrJiyZUb4bhU+dXFXRXFkibV ++smLp4C4jhi5V6pWNGDRolhVLh3bpqw6q0q6sr9KgWZa83WXFiC33xuqQKq8a6X3K68aIJtWyYqSn ++LB2IRJekQ7cqty7JC6+rgybVsnQ4vEcdet6IDppUd9dBmPE6cvkHeJqGY1hh/YIwAfbXX//113rE ++reOxaGCF4g3+GJy/gqNDN0q/D6t64A4OQmg4qqLhEIKGM/U0fPin4RMwDR8haWgKGj7G0LDvp2FX ++S8O+6gfIi4Z9AA2TJu2CO9iMadg2aBheNPTPnCwzDTWlD8PdEbg7CnduuDsGd3BEQh+HuxNQysO8 ++QZhAE4TlDdF5cpHiTXDaH07fnYcnMTjNxpvkGX+jNJlvyU/2m+SpfKty9t4oTdib5Dl6c25a3ijN ++xBvEyXdzbr79QG4iWpprr1FMr5vkGXWDOIlugQdx+s9IfR6jwn4eE6bS0VlBOmnCvLZgjtySnxZ3 ++KC7kzxrE+fEaxZR4XdEsuDk38Y0Jc92W/CVMmNE25yap7Tvmrd0HabhIg4YxK0y50WNwB1dL8Xqg ++jegJlOT1wchtHpuHZsFCFBkG3gnMheB5MgS+z5BBiteFluh/EjxHBhfnSV73eT/tF+6f5tEZHr3J ++60gShOVseCkED34qzKOLPAY153X+Wd4Qm4cWM4TnIhFgvvA06edN4SgZWgTUDTfJxUUS/IZOCEaj ++MOJcu27CzKAwcbjSU2JCMD95exVUjWbBXXeRrbr6RwtJ/VZ75/qFzK21S+lLyeij5eRy1p/EXlmb ++mNbBTesgYx3cOtCwjWC2oS1H8+MPvvwgg2bGNoaeR/9zOfUB6/gZ5/hZCt0iWtNe+Fl3pPSpCfj5 ++wpgCn1d4w2Pzl+Z0w9dta22ZK1kLSwxwxIA4Z8vI5ZWthWkf2LQNMLaBrZb29JV1U8aRIZ80pxzJ ++cwJ7vc27RbQLRK5luzeup9tY4h2OeKcUN1CRJfo4oo/F+zm8n5GLwG1w0zbI2AbfEjfvps3LAKKt ++Helb60cyQ1n0yWiqJzkpcRuA3FrXWjOT2Z4Nf7qVJd7liHe1uEkVWaKfI/pZ3MvhXkYuArehTdsQ ++A/ylwW0YcnOuOTOx7D88d6SdLHGaI05rcZMqssQgRwyy+BCHDzFyKfBbfVPq1uqRnAV78xaMQfsN ++ccRQSfuxhJsj3Cx+jMOPMXIROIxs2kYY28iWoyVtXz2fnFL6qHOtM9sIPNRZ2kNCtd3909yWnli9 ++ncEyV56YUljyrMSpT/bP2Sy2MQT9c5IjTpbyD6jIEic44gSLezjcw8ilwGIa3Pply13NOjYmoe3G ++OGKslO1ARZbwcISHxfs4vI+RS0Gka3ATrNi+1p6ZFiK9vbQdpYq7W7LIV8dlC05tYNB+wxwxXMp+ ++UyxxjCOOsXgvh/cychE49G/a+hlgpCIOQrwRa0RmGMQbUTrehGra8SZbrIiDR7YUtdEN7TTKEaOl ++7ESxxHGOOM7iJzj8BCOXAisVZB9DzienAKfvieObxPGNbgZQEFg9By3+vRcHWWJSg6l4hxgIGyDY ++R57Xg0TC4uMcPs7IRWA/vGkbZkAeaAJZe3UuHctMrN/OYtkrz0ypruSt5IQyLXWsdWTRrDdLgsTU ++UTox5apqpyY59BuJdNfqL9L+jHd9LmXPJQ3Y0NLRr++s3cl6QUO7w3ae5DpPspptTa771a/Wf8Wq ++NzY5XOyOx8SXRHpw/SRr7+bs3cmzL3HiC+uqFahba/vthYcXUlcfXHp0KXlJkqUTdGrqbO2wn/ui ++brUuJXwENn2btj4GyN/QnEZXR9OTGfv6eYUp3dCULWstmS7QCV5Pt4jdoJYhpYpfdax3sPhRDj/K ++yEXgdXzTdpwBTaqtM4Ouj4K+wP7kfGq4ME4b1xrTS0KkNpaOVKmidqzKvQnuSF1ZNeU06pV7kVug ++vTlLtzehmnZ7G920jTK20a2uHtgOst3ZW8+OgCcM9I+j6W6FXu8JrcK9SbhBL9n4HHsxxAB6xAWO ++uKDZIvK1WeIUR5xi8dMcfpqRS4GCKgkyFX14J3kHOBXwt/dvOV1ff7L2SXYAZOVPWOcY5xxLnUuj ++8PPF+ynweQWekC58eSF9TazGOj2c08M6+jhHHyOXbSPiaIHkJlBA73vn8KZzeGP6efeL64xzmHVe ++5JwXNYjm67LO9zjne6zjDOc4w8ilINqVuiSXck7zyEnSK4QGUTo0pIraoSHnEXtjilxtzqWvE3Le ++0G04YM4Y4YiRUjlDxxK9HNHL4sc5/DgjF4HD2KZtjLGNbR06Ah9ispMb9mfnN64/7/rjL9LNqaFc ++aJxDhdjo3SR6s1MgdJpfxBhAkLjEEZc0YyNfmyUmOGKCxc9y+FlGLtqPiflEPZDvPOGDW3vp/ChV ++1M6OchIp6niOycmjJ+uHqQM+iZVKHT1fda53sribw92MXN5SU5Y10Hj07Jc16c4aQCNqKf1oI1Xc ++/dGGcKbJ9eZMd+bWkyOpK8nzErdB2Ttz2VsbMeidcY4YL+UdUJElvBzhZfEBDh9g5CJwG9+0jTO2 ++cS1u40IIejYJT/b2c/QFxgCZiSmOmNIMQLmu+MjF4u9y+LuMXLatSN0pwE5YdUnDNy3uWv5AHsUh ++LBPlDeKhdQe6I7fIV1wRbMmDKvDiurwlEFqM0LFgYJq3iV/h8tOloLQ42DRPRuEqY/qM8Csqrjl2 ++W3mjONTkawA9Cb3A10goBkCAhks8eJvv2tTUpO/DqesXfj55jT6XG4nDQSsN1w/RcHkqDVfhKBcT ++nwGbuO4VLx7Y0quIuPY0egyFC1vh0tZX2BGmsGxh/YxG2cLcTGH5k72Vsx9l3GdZ+znOfu7uxe1a ++pMm16rt7eRszGJzbSMldHdLcfffivZ9vNR2Ch23M1WjcRuTd3Q+3J9EDsK7W7qBfbxjfRhT7Syak ++pWcb0RmuouI+aX1prU+NcQ1Hsm2sdZizDm8jqOUq+rK2IQXG4EezvRvxjfiLD9jRj7jRj9jaK1zt ++Fab2yp+3DXka4nJkK2/y+fyRGZ+PN0NoTCwQjvK1ZxaXfblfhE80uYeMRik6FoiEPTR1mw7EKN6S ++O8Wb5HM1ZyQPkTT9SHhBAgJicVlckA599R0iRjF051/M42Jwnab/TXjrB9xIgt22HkXRLeQqg1zd ++gm8n1D8MgufKK6Sekcu2MYqhUE/tA626gudvfts7/rMsyGfBtgv+0zsyMCrjP4cBA6R/wDs64K3i ++P9/GJuM//zvtXvivw1r4T/hauwj/CdGd+reN7vwG7O5j9w0KZKcBhdhK/TdoAk1iSYOAxTQndH7D ++PeQhFkcFbKVeCbR5YFjITzrod2ArLVo1dQiE9pSFrTTuJ7ayCuSrAvmqQD5hqwL59gHIVwB73gOU ++T4RI7yOWr3wQ9X7C/eAk7k8T7ifCunXCfHAR3A/OQirgfqPgJz2EaMH9RpDXhfvBGef9gvudRLTg ++fmeqcL8q3G+/dKjC/apwvyrcrwr326lDFe5XhftV4X5VuB9Shfv9v4b7fQpk9ewd8ueH1xrlX685 ++ClDl6UeLOO0/yE8djlgpyE+T6j6C/JoTTSWBik3x5jcAVARUKwL5tUi5Vx1C2FJR7tWg+cZAfoTk ++A5cmwBD6gKgoT5Wgu48gPyLRGid2gPzUAYatFflIg2bZID91kGBrhUAJTar7CPJry4H81CGFjRJk ++bn+BioBqRSC/VikW1CGElcWCBs03BvLrSDgT7VJ7VQcYtgtwvEraawm6+wjy68yNa9RBhXUSVPF1 ++Y0mT6r6A/Fyq1CsbJ2jQrAjkJ/dV6gDCyvoqDZpvBOSnDiisFOSnSXUfQX4tCVdJoKKrwn9koEl1 ++H0F+eR3UIYWV6qBJdY8gP5jtdgP5CcvfUPG/JApQPGFpEXz7LSxvE9ap0fD1mrigDL7iEZFR8LWD ++uPZIwBLCsaUI8hMAggJUUAslmAf5acEF1ZCC7h4Z5AeF3QHyO4P8LYP8jGHx+FNA9nWJ6MpBuBMw ++fnAxEu1FZGSfYP49IPv+ESlE9n2MKJF9+4XqgyGyO6gPzv8J04Nlgvpga43+vgrqq4L6qqC+Kqiv ++Cuqrgvr+TkB9CnwMdP/gk5Oie7K/zM48W8j+skQTE8BNX7Wvt2dIdbBMFdFXRfRVEX1VRF8V0VdF ++9O0vog8urHQbNMF8Obwd/F81ebydMYe3K4LUjeeGwHDISL8LB4NGaZx55oy4mHQnhu4eOA1fq0T/ ++HRFXi+5E0O0dx0YKCDbF/v03gmMTDIjlcWwS3kz470tQr+8QoYqgugJvlkQkvBn8/z8FeDMlkOxj ++ETOmfRBov7Wt5MrrfeJRGv81MNz/f+1dS28bNxDOWb+CUNqCcteqZMcJYEABcmpPbpDmUhg+rK2V ++JVReqVo5dv59Z4aP5UOURHOdQ8E52LI4/IbfkMvXkN53Z8b7/8ZvRuOL8/fn+f7Xj5B+v9/l5S2A ++64k7vkzf+u2pb+gxYmXD6nWv15tWM+Z2G1x8Glz2sHcBsC6uUWGZEE6WwukWsTz6kPxuPffOM2aR ++L4Tbl4GY6qvLPVJtry+zSeuhoXUtmvcDL9PrDwTIW/aZ/IH0+ADJlstmxTYV9OVsOwfe9KY7ZhS4 ++nrK7crkEzytIkXkoAb/OF+CGuoE6AO/NS6osS/V5wNYbKN8dKJRsBnpzw8DTYjuXUCWrqycqW8Gg ++VM3jbVP9+1jVW0meCtIoMDZdzGbVhpKr5nG5bdjTvKolFqJMrlZ1xfiffzHcBV6tv8tC26/oA3e2 ++vqUSC19hK7NercfxBX+EKVuZj0UqA534ln0JexYYLrbwN5R7U91tqnILZUFvaCdRWRSWbDZD72WE ++UH4sk2H0E9YpUaPnBh7D++XqtlyyL1e/sxnkwPKIJgz85jqnU8WCi9P4htJllmdIp22wu3WE680J ++Aqhca+P9wE3FfhFQkVGKYLoOWgQ1DiTLUEcw3YiABHVEYCRcRhEv2ceBwijhMlJ0ZQ+Fp2oTTFWx ++mKCCiMwEk9uATVBFxnGC6RTWCafCDDOYONvnNREb2lPzbcgozF7FjMK1i6GkYGobYQqq2IGnoJqK ++RwUVMEwVLuVBfAxqhStBBrbCznRDYEFNdatTKtwYHa1xVYwbN/+MnlZ1tNBryEuJXI++w3ZYL5iZ ++vaezoxXrOh/HG4sFEzcWi7ZjxhuLhRyF6MZiwU7wqiL8OhGXFo1CoSwQeDkbqkuTDAbEerWlXtnW ++RFFlt7LYheZeJpQXFNTDGVjfVMtmRwHVoEi/FsJppGoPMwZ7kWMvaxMYWgGnzwP2M+NnJyfnZwMv ++w6a+B9V2RDJum8rMfsHbuKOsWwCxPFsw4R9ZjW3jgE70cVPb7cNonLHALX/IRK6Euqb8OgEPEUAK ++fDmkSDz6kf7A7z+yseFxnQdUDJtsMgkPmn4LBVy/Wkqc/NT3Q3kKgI8KRvXBTtm4oDwT/FEwOu0w ++wQLSJ9/5kHR9eYOM4NcRrQyh0K08ZH5gVE+1PERdTQZsQ8vVEzzgMMKRp++b69GNqKnr8c2RDlK0 ++sJjSCNewhouOebIszh5YHGHdlb4qY1UxnTD2wOIYy9mabQQPTmCZ7h/KbhgLK9zATaHso8Vxbuew ++r0xbG+qK+U7AOPJq/u208PKhpfwCphKVA04KPwMmjpW5arBt0JGfJG4GNie0FIYeWBxPufJx2u1j ++wXBS302jFSa4Ak0h60BFPqVyFfeaXKWNTsi6WNF9kliTvipdaaQbvi5YZD8k1ti2ETqPl9YRESwn ++oKSeyMCJ7WBxd6BzXojaAa0WJo6V3tVweld7sHzRZEgA8+TB0UaKoyf3ZGwLzzBzps2Ibp4+52gu ++b5myE2nnV7AZS9uFtdGivGBsPTntF57wgt3t8IP8cPYSh7TmOBi4Ixsvr34fLa4JqE01b2IEC9D0 ++BoATrBNiLe3wf15KdgdUHFOxPejUsFq0UiJXi2a7YLego18Mw520oXhPDC/LQaRvbmPY30IlxLHF ++7U6/OXfzTCM4LxNbrgaJq8aZw4rOrBeMzqx3w27GTcwUijZS9NRIbjzbRtZJ445G5evEWZCCiV14 ++G5vl4YosGCp23PGatrlvLW1tvhc6clTWsQLXQUG3uN4QahM2Go78kge95XlMl4Sj7YB7wi7y3GTi ++DY5x8lvWepbp3AmMdl3j4cqxXVDcayBy1UsRIdsmDJ90E6ejRS9a4Aozac1rIcXxNGJbboNP6uta ++3H3NN2auuRXtNoKbE5SzDdFlKmgZtyX+FJepOu7zbPt8l8UUzxwBH+cvHZ30NwToklk37V5Z4Ro3 ++xQk+WhxnCrh2vXJG0PSFc4sS2XUFWnza5KVtaEmTFwMmcq2Eoe2dm+f2bmtK00Qb3EBNIepiRa6X ++VATe6bTEJc/CrMuktYQ0w1vgpFWFDxc5Q/VOILwuf89eR47Yh6s8MtOHFYUzFrV9qKo1AVzkge0j ++Dko4m2XHHrAowic3Bjv/q2SW/4sY57/lUVyYTtbTYTPvzgae8v5wcRE4/z0aXVyM1fnvd2fvP7wZ ++jd+9z+//+DFyN2Xqv7D3Pv8Nfc/V509f/5j0d/xr9sufWoU+Ey+EOWenD/IUN8MfzW90pAE69MWq ++Fi1Knmcpp99KWKBNh+vvBzRxe+oILWPoOKxNJ3PxRUMHNWk9dVitgYXm4n6+hY78CRYomOH0mZ1+ ++Y6dr5lykYGcffxnnbjRLlixZsmTJkiVLlixZsmTJkiVLlixZsmTJkiVLlixZsmTJkiXLa8h/ZFz/ ++9ADIAAA= +diff --git a/mimo_test_command.sh b/mimo_test_command.sh +new file mode 100755 +--- /dev/null ++++ b/mimo_test_command.sh +@@ -0,0 +1,6 @@ ++#!/usr/bin/env bash ++ ++set -uo pipefail ++cd /testbed || exit 1 ++base64 -d mimo_build_env.tar.gz.b64 | tar -xzf - -C /testbed || exit 1 ++exec bash -lc 'cd /testbed && bash -eo pipefail /testbed/.build_env/test_command.sh' diff --git a/tasks/format-code-task-002081/tests/test.sh b/tasks/format-code-task-002081/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..90f29140b18366c48b635b1f61cb6799c5e0d94e --- /dev/null +++ b/tasks/format-code-task-002081/tests/test.sh @@ -0,0 +1,44 @@ +#!/bin/bash +# Code grading, mimoagent opensource_code.py: reset the files the hidden test patch touches, apply it, run the +# task's test command; reward 1 when it exits 0. A testbed failure (reset or apply) writes no reward: not scored. +M=/var/lib/mimo +CWD=/testbed +V=/logs/verifier +mkdir -p "$V" +BASE=$(cat "$M/base" 2>/dev/null) || { echo "setup never ran (no $M/base)" >&2; exit 1; } +cd "$CWD" || exit 1 +if [ -d "$M/git-hidden" ]; then rm -rf "$CWD/.git"; mv "$M/git-hidden" "$CWD/.git"; fi +# the agent's change against the base, so its own commits count too +git add -A >/dev/null 2>&1 && git -c core.fileMode=false diff --cached "$BASE" > "$V/agent.diff" +git reset -q +if ! ( +while IFS= read -r tf; do + [ -z "$tf" ] && continue + if git cat-file -e $BASE:"$tf" 2>/dev/null; then + git checkout $BASE -- "$tf" 2>/dev/null || true + else + git rm -f --cached "$tf" >/dev/null 2>&1 || true + rm -f "$tf" + fi +done <<'EOF_RESET_TEST_FILES' +tests/integration/test_random_advanced.py +tests/integration/test_random_beta.py +tests/integration/test_random_bitgenerator.py +tests/integration/test_random_creation.py +tests/integration/test_random_gamma.py +tests/integration/test_random_straightforward.py +mimo_build_env.tar.gz.b64 +mimo_test_command.sh +EOF_RESET_TEST_FILES + +); then echo "could not reset the test files (testbed problem, not scored)" >&2; exit 1; fi +if ! git apply --verbose /tests/test.patch > "$V/apply.log" 2>&1; then + cat "$V/apply.log" >&2 + echo "the hidden tests could not be applied (testbed problem, not scored)" >&2 + exit 1 +fi +timeout 1800 sh -c "$(cat /tests/test_command.sh)" > "$V/test_output.log" 2>&1 +RC=$? +tail -c 12000 "$V/test_output.log" +if [ $RC -eq 0 ]; then echo 1 > "$V/reward.txt"; else echo 0 > "$V/reward.txt"; fi +echo "test command exited $RC" diff --git a/tasks/format-code-task-002081/tests/test_command.sh b/tasks/format-code-task-002081/tests/test_command.sh new file mode 100644 index 0000000000000000000000000000000000000000..7cb23076694ad17d72e8296d62b2b240083e36db --- /dev/null +++ b/tasks/format-code-task-002081/tests/test_command.sh @@ -0,0 +1 @@ +bash /testbed/mimo_test_command.sh \ No newline at end of file diff --git a/tasks/format-code-task-002207/environment/Dockerfile b/tasks/format-code-task-002207/environment/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..803c0697d30a4a2417dacb7a8cd8dd933f992a4f --- /dev/null +++ b/tasks/format-code-task-002207/environment/Dockerfile @@ -0,0 +1,3 @@ +# The task's image, pinned by digest (the same as [environment].docker_image). +# Setup runs at start from [environment.healthcheck]; environment/setup/ is its readable copy. +FROM docker.io/xiaomimimo/mimo-v2.6-rl-oss@sha256:f8002ad469f348cea9bf4daa685c92f474228239c24d23937c57cf2ea96af7f0 diff --git a/tasks/format-code-task-002207/environment/setup/files/blocklist b/tasks/format-code-task-002207/environment/setup/files/blocklist new file mode 100644 index 0000000000000000000000000000000000000000..a8e4bdc4c7d9b739c047a3cb58ea72a1bb05bcbc --- /dev/null +++ b/tasks/format-code-task-002207/environment/setup/files/blocklist @@ -0,0 +1,33 @@ +# mimo answer-leak blocklist (mimoagent) +0.0.0.0 github.com +0.0.0.0 www.github.com +0.0.0.0 api.github.com +0.0.0.0 raw.githubusercontent.com +0.0.0.0 codeload.github.com +0.0.0.0 objects.githubusercontent.com +0.0.0.0 gist.github.com +0.0.0.0 gist.githubusercontent.com +0.0.0.0 gitlab.com +0.0.0.0 bitbucket.org +0.0.0.0 sourceforge.net +0.0.0.0 git.kernel.org +0.0.0.0 chromium.googlesource.com +0.0.0.0 android.googlesource.com +0.0.0.0 sourcegraph.com +0.0.0.0 bugs.chromium.org +0.0.0.0 issues.oss-fuzz.com +0.0.0.0 oss-fuzz.com +0.0.0.0 osv.dev +0.0.0.0 api.osv.dev +0.0.0.0 bugzilla.mozilla.org +0.0.0.0 proxy.golang.org +0.0.0.0 sum.golang.org +0.0.0.0 pkg.go.dev +0.0.0.0 google.com +0.0.0.0 www.google.com +0.0.0.0 bing.com +0.0.0.0 www.bing.com +0.0.0.0 duckduckgo.com +0.0.0.0 html.duckduckgo.com +0.0.0.0 search.brave.com +0.0.0.0 stackoverflow.com diff --git a/tasks/format-code-task-002207/environment/setup/setup.sh b/tasks/format-code-task-002207/environment/setup/setup.sh new file mode 100644 index 0000000000000000000000000000000000000000..d883db90cfcfb48f7a139861bbe9f6b5d95cad6f --- /dev/null +++ b/tasks/format-code-task-002207/environment/setup/setup.sh @@ -0,0 +1,34 @@ +#!/bin/bash +# Runs once, as root, before the agent starts: Harbor's [environment.healthcheck] unpacks this folder into +# /var/lib/mimo and runs it. Generated by mimo_harbor; see its README for how each step maps to Xiaomi's harness. +M=/var/lib/mimo +[ -f "$M/ready" ] && exit 0 +chmod 700 "$M" +fail() { echo "setup: $*" >&2; exit 1; } +# the answer-leak blocklist (mimoagent), applied to /etc/hosts by the agent right after it installs +write_blocklist() { cp "$M/files/blocklist" "$M/blocklist"; } + +# Code: mimoagent environments/datasets/opensource_code.py + base.py, as the explorer runs it (app/runner/domains.py Code). +CWD=/testbed +git config --global --add safe.directory "$CWD" +cd "$CWD" || fail "no working directory $CWD" +if ! git rev-parse --git-dir >/dev/null 2>&1; then # a bare source tree: give it a baseline commit + git init -q && git add -A && git -c user.name=mimo -c user.email=mimo@localhost commit -q -m baseline --allow-empty +fi +BASE=$(git rev-parse HEAD 2>/dev/null) +[ ${#BASE} -eq 40 ] || fail "could not resolve the base commit in $CWD" +echo "$BASE" > "$M/base" +# Images are built with history truncated at the base. If one is not, the fix could be read out of git log, +# so .git is hidden while the agent works and put back for grading. +LATER=$(git rev-list --all --not "$BASE" 2>/dev/null | head -n 5 | grep -c . || true) +rm -f /tmp/fail.log /tmp/pass.log /tmp/patch.diff /tmp/test_patch.diff /tmp/*.log 2>/dev/null; rm -rf /tmp/claude-0 /tmp/claude-* /tmp/testem-* /tmp/puppeteer_dev_chrome_profile-* 2>/dev/null; rm -f /tmp/test_files.json 2>/dev/null; rm -rf /tmp/jest_* /tmp/jest-* /tmp/build /tmp/build_env 2>/dev/null; rm -rf /tmp/pytest-of-root /tmp/pytest-* /tmp/.pytest_cache /tmp/__pycache__ 2>/dev/null; rm -rf /tmp/go-build* /tmp/standards /tmp/wordpress /tmp/zig-* /tmp/testbase /tmp/testbed 2>/dev/null; rm -f /tmp/tmp*.tmp /tmp/*.bak /tmp/expect* /tmp/butwas* 2>/dev/null; rm -rf /root/.cache/go-build 2>/dev/null; rm -rf /tests 2>/dev/null; find /logs -mindepth 1 -delete 2>/dev/null; mkdir -p /logs/agent /logs/verifier /logs/artifacts; chmod 777 /logs/agent /logs/verifier /logs/artifacts; find /var/log -type f -delete 2>/dev/null || true; rm -rf /var/lib/postgresql/*/*/log /var/lib/postgresql/*/*/pg_log 2>/dev/null || true; find /var/lib/mysql /var/lib/mongodb -type f -name '*.log' -delete 2>/dev/null || true; rm -rf /root/.npm/_logs /root/.babel.json /root/.pytest_cache 2>/dev/null || true; find / -maxdepth 4 -xdev -name task_description.md -path '*/.build_env/*' -delete 2>/dev/null || true; true +git clean -fdx --exclude=node_modules --exclude=bower_components --exclude=.husky --exclude=vendor --exclude=third_party --exclude=_deps --exclude=vcpkg_installed --exclude=.venv --exclude=venv --exclude=.gradle --exclude=target --exclude=.build --exclude=lib --exclude=.bundle --exclude=Manifest.toml --exclude=_build --exclude=.stack-work --exclude=dist-newstyle >/dev/null 2>&1 +find /root/.m2 -type f \( -name '*-SNAPSHOT.jar' -o -name '*-SNAPSHOT-sources.jar' -o -name '*-SNAPSHOT-tests.jar' -o -name '*-SNAPSHOT-test-sources.jar' \) -delete 2>/dev/null; rm -rf /root/.julia/compiled 2>/dev/null; rm -rf /root/.gradle/caches/build-cache-* /root/.gradle/daemon 2>/dev/null; rm -rf /root/.gradle/caches/*/scripts /root/.gradle/caches/jars-* 2>/dev/null; rm -rf /root/.cache/bazel 2>/dev/null; true +if [ "$LATER" -gt 0 ]; then + mv "$CWD/.git" "$M/git-hidden" + echo "history not truncated at ${BASE:0:12}: .git hidden while the agent works" +fi +write_blocklist + +touch "$M/ready" +echo "setup done" diff --git a/tasks/format-code-task-002207/tests/test.patch b/tasks/format-code-task-002207/tests/test.patch new file mode 100644 index 0000000000000000000000000000000000000000..0e8f7fd580c2cad2bdaf65686c042f49f9da5581 --- /dev/null +++ b/tasks/format-code-task-002207/tests/test.patch @@ -0,0 +1,213 @@ +diff --git a/pandas/tests/io/test_compression.py b/pandas/tests/io/test_compression.py +index ce459ab24a..7940fcb7d9 100644 +--- a/pandas/tests/io/test_compression.py ++++ b/pandas/tests/io/test_compression.py +@@ -1,5 +1,8 @@ + import contextlib + import os ++import subprocess ++import sys ++import textwrap + import warnings + + import pytest +@@ -125,3 +128,156 @@ def test_compression_warning(compression_only): + with tm.assert_produces_warning(RuntimeWarning, check_stacklevel=False): + with f: + df.to_csv(f, compression=compression_only) ++ ++ ++def test_import_pandas_without_lzma_succeeds_and_warns(): ++ code = textwrap.dedent( ++ """ ++ import sys ++ import warnings ++ ++ sys.modules["lzma"] = None ++ ++ with warnings.catch_warnings(record=True) as caught: ++ warnings.simplefilter("always") ++ warnings.simplefilter("ignore", DeprecationWarning) ++ warnings.simplefilter("ignore", FutureWarning) ++ import pandas # noqa: F401 ++ ++ assert caught ++ assert all(issubclass(warning.category, Warning) for warning in caught) ++ """ ++ ) ++ subprocess.check_call([sys.executable, "-c", code]) ++ ++ ++def test_import_pandas_without_lzma_extension_succeeds_and_warns(): ++ code = textwrap.dedent( ++ """ ++ import builtins ++ import sys ++ import warnings ++ ++ sys.modules.pop("lzma", None) ++ sys.modules.pop("_lzma", None) ++ original_import = builtins.__import__ ++ ++ def missing_lzma_import(name, globals=None, locals=None, fromlist=(), level=0): ++ if name in {"lzma", "_lzma"}: ++ raise ImportError("No module named '_lzma'", name="_lzma") ++ return original_import(name, globals, locals, fromlist, level) ++ ++ builtins.__import__ = missing_lzma_import ++ try: ++ with warnings.catch_warnings(record=True) as caught: ++ warnings.simplefilter("always") ++ warnings.simplefilter("ignore", DeprecationWarning) ++ warnings.simplefilter("ignore", FutureWarning) ++ import pandas # noqa: F401 ++ finally: ++ builtins.__import__ = original_import ++ ++ assert caught ++ assert all(issubclass(warning.category, Warning) for warning in caught) ++ """ ++ ) ++ subprocess.check_call([sys.executable, "-c", code]) ++ ++ ++def test_missing_lzma_xz_write_raises_runtimeerror(tmpdir): ++ out_path = str(tmpdir.join("missing_lzma_write.csv.xz")) ++ code = textwrap.dedent( ++ """ ++ import sys ++ import warnings ++ ++ sys.modules["lzma"] = None ++ ++ with warnings.catch_warnings(): ++ warnings.simplefilter("ignore") ++ import pandas as pd ++ ++ df = pd.DataFrame({{"a": [1, 2], "b": ["x", "y"]}}) ++ ++ try: ++ df.to_csv({out_path!r}, compression="xz") ++ except RuntimeError: ++ pass ++ else: ++ raise AssertionError("xz write without lzma did not raise RuntimeError") ++ """.format(out_path=out_path) ++ ) ++ subprocess.check_call([sys.executable, "-c", code]) ++ ++ ++def test_missing_lzma_xz_write_raises_for_arbitrary_user_path(tmpdir): ++ out_path = str(tmpdir.join("user_supplied_archive.csv.xz")) ++ code = textwrap.dedent( ++ """ ++ import sys ++ import warnings ++ ++ sys.modules["lzma"] = None ++ ++ with warnings.catch_warnings(): ++ warnings.simplefilter("ignore") ++ import pandas as pd ++ ++ df = pd.DataFrame({{"payload": ["first", "second"]}}) ++ ++ try: ++ df.to_csv({out_path!r}, compression="xz") ++ except RuntimeError: ++ pass ++ else: ++ raise AssertionError("xz write without lzma did not raise RuntimeError") ++ """.format(out_path=out_path) ++ ) ++ subprocess.check_call([sys.executable, "-c", code]) ++ ++ ++def test_missing_lzma_xz_read_raises_runtimeerror_before_non_xz_paths_are_affected( ++ tmpdir, ++): ++ plain_path = str(tmpdir.join("plain.csv")) ++ xz_requested_path = str(tmpdir.join("xz_requested.csv")) ++ code = textwrap.dedent( ++ """ ++ import sys ++ import warnings ++ ++ sys.modules["lzma"] = None ++ ++ with warnings.catch_warnings(): ++ warnings.simplefilter("ignore") ++ import pandas as pd ++ ++ df = pd.DataFrame({{"value": [10, 20, 30]}}) ++ df.to_csv({plain_path!r}, index=False) ++ result = pd.read_csv({plain_path!r}) ++ assert result["value"].tolist() == [10, 20, 30] ++ ++ with open({xz_requested_path!r}, "w") as handle: ++ handle.write("value\\n1\\n") ++ ++ try: ++ pd.read_csv({xz_requested_path!r}, compression="xz") ++ except RuntimeError: ++ pass ++ else: ++ raise AssertionError("xz read without lzma did not raise RuntimeError") ++ """.format(plain_path=plain_path, xz_requested_path=xz_requested_path) ++ ) ++ subprocess.check_call([sys.executable, "-c", code]) ++ ++ ++def test_xz_csv_roundtrip_still_works_when_lzma_available(tmpdir): ++ pytest.importorskip("lzma") ++ ++ path = str(tmpdir.join("roundtrip.csv.xz")) ++ expected = pd.DataFrame({"a": [1, 2, 3], "b": ["alpha", "beta", "gamma"]}) ++ ++ expected.to_csv(path, index=False, compression="xz") ++ result = pd.read_csv(path, compression="xz") ++ ++ tm.assert_frame_equal(result, expected) +diff --git a/mimo_test_command.sh b/mimo_test_command.sh +new file mode 100755 +--- /dev/null ++++ b/mimo_test_command.sh +@@ -0,0 +1,38 @@ ++#!/bin/bash ++set -uo pipefail ++cd /testbed ++ ++ ++ ++dev-switch python3 3.11 ++ ++ ++python3 -m pip install -q "numpy>=1.23.0,<1.24" "Cython>=0.28.2,<3.0" python-dateutil pytz hypothesis pytest setuptools 2>/dev/null || true ++ ++ ++CFLAGS="-DNUMPY_IMPORT_ARRAY_RETVAL=0" python3 -m pip install -e /testbed --no-build-isolation --no-input -q 2>/dev/null ++ ++ ++NEW_TESTS=( ++ "pandas/tests/io/test_compression.py::test_import_pandas_without_lzma_succeeds_and_warns" ++ "pandas/tests/io/test_compression.py::test_import_pandas_without_lzma_extension_succeeds_and_warns" ++ "pandas/tests/io/test_compression.py::test_missing_lzma_xz_write_raises_runtimeerror" ++ "pandas/tests/io/test_compression.py::test_missing_lzma_xz_write_raises_for_arbitrary_user_path" ++ "pandas/tests/io/test_compression.py::test_missing_lzma_xz_read_raises_runtimeerror_before_non_xz_paths_are_affected" ++ "pandas/tests/io/test_compression.py::test_xz_csv_roundtrip_still_works_when_lzma_available" ++) ++ ++case "${1:-}" in ++ base) ++ python3 -m pytest pandas/tests/io/test_compression.py pandas/tests/io/test_pickle.py \ ++ -k 'not test_import_pandas_without_lzma_succeeds_and_warns and not test_import_pandas_without_lzma_extension_succeeds_and_warns and not test_missing_lzma_xz_write_raises_runtimeerror and not test_missing_lzma_xz_write_raises_for_arbitrary_user_path and not test_missing_lzma_xz_read_raises_runtimeerror_before_non_xz_paths_are_affected and not test_xz_csv_roundtrip_still_works_when_lzma_available' \ ++ -v ++ ;; ++ new) ++ python3 -m pytest "${NEW_TESTS[@]}" -v ++ ;; ++ *) ++ echo "usage: $0 base|new" ++ exit 2 ++ ;; ++esac diff --git a/tasks/format-code-task-002207/tests/test.sh b/tasks/format-code-task-002207/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..6efc7303a67228683993c5c371aa6aeae60052f1 --- /dev/null +++ b/tasks/format-code-task-002207/tests/test.sh @@ -0,0 +1,38 @@ +#!/bin/bash +# Code grading, mimoagent opensource_code.py: reset the files the hidden test patch touches, apply it, run the +# task's test command; reward 1 when it exits 0. A testbed failure (reset or apply) writes no reward: not scored. +M=/var/lib/mimo +CWD=/testbed +V=/logs/verifier +mkdir -p "$V" +BASE=$(cat "$M/base" 2>/dev/null) || { echo "setup never ran (no $M/base)" >&2; exit 1; } +cd "$CWD" || exit 1 +if [ -d "$M/git-hidden" ]; then rm -rf "$CWD/.git"; mv "$M/git-hidden" "$CWD/.git"; fi +# the agent's change against the base, so its own commits count too +git add -A >/dev/null 2>&1 && git -c core.fileMode=false diff --cached "$BASE" > "$V/agent.diff" +git reset -q +if ! ( +while IFS= read -r tf; do + [ -z "$tf" ] && continue + if git cat-file -e $BASE:"$tf" 2>/dev/null; then + git checkout $BASE -- "$tf" 2>/dev/null || true + else + git rm -f --cached "$tf" >/dev/null 2>&1 || true + rm -f "$tf" + fi +done <<'EOF_RESET_TEST_FILES' +pandas/tests/io/test_compression.py +mimo_test_command.sh +EOF_RESET_TEST_FILES + +); then echo "could not reset the test files (testbed problem, not scored)" >&2; exit 1; fi +if ! git apply --verbose /tests/test.patch > "$V/apply.log" 2>&1; then + cat "$V/apply.log" >&2 + echo "the hidden tests could not be applied (testbed problem, not scored)" >&2 + exit 1 +fi +timeout 1800 sh -c "$(cat /tests/test_command.sh)" > "$V/test_output.log" 2>&1 +RC=$? +tail -c 12000 "$V/test_output.log" +if [ $RC -eq 0 ]; then echo 1 > "$V/reward.txt"; else echo 0 > "$V/reward.txt"; fi +echo "test command exited $RC" diff --git a/tasks/format-code-task-002207/tests/test_command.sh b/tasks/format-code-task-002207/tests/test_command.sh new file mode 100644 index 0000000000000000000000000000000000000000..e8d2f32b64045b5a5a56e0ad5667da87d8e0bc2a --- /dev/null +++ b/tasks/format-code-task-002207/tests/test_command.sh @@ -0,0 +1 @@ +bash /testbed/mimo_test_command.sh base && bash /testbed/mimo_test_command.sh new \ No newline at end of file diff --git a/tasks/format-code-task-002209/environment/Dockerfile b/tasks/format-code-task-002209/environment/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..8c1c1e9187e52a55155b071ca13569798e4a2697 --- /dev/null +++ b/tasks/format-code-task-002209/environment/Dockerfile @@ -0,0 +1,3 @@ +# The task's image, pinned by digest (the same as [environment].docker_image). +# Setup runs at start from [environment.healthcheck]; environment/setup/ is its readable copy. +FROM docker.io/xiaomimimo/mimo-v2.6-rl-oss@sha256:98eda3c279f7b69d695a8c25d50e89b420495481ac0644e43c7b994c1a26b981 diff --git a/tasks/format-code-task-002209/environment/setup/files/blocklist b/tasks/format-code-task-002209/environment/setup/files/blocklist new file mode 100644 index 0000000000000000000000000000000000000000..a8e4bdc4c7d9b739c047a3cb58ea72a1bb05bcbc --- /dev/null +++ b/tasks/format-code-task-002209/environment/setup/files/blocklist @@ -0,0 +1,33 @@ +# mimo answer-leak blocklist (mimoagent) +0.0.0.0 github.com +0.0.0.0 www.github.com +0.0.0.0 api.github.com +0.0.0.0 raw.githubusercontent.com +0.0.0.0 codeload.github.com +0.0.0.0 objects.githubusercontent.com +0.0.0.0 gist.github.com +0.0.0.0 gist.githubusercontent.com +0.0.0.0 gitlab.com +0.0.0.0 bitbucket.org +0.0.0.0 sourceforge.net +0.0.0.0 git.kernel.org +0.0.0.0 chromium.googlesource.com +0.0.0.0 android.googlesource.com +0.0.0.0 sourcegraph.com +0.0.0.0 bugs.chromium.org +0.0.0.0 issues.oss-fuzz.com +0.0.0.0 oss-fuzz.com +0.0.0.0 osv.dev +0.0.0.0 api.osv.dev +0.0.0.0 bugzilla.mozilla.org +0.0.0.0 proxy.golang.org +0.0.0.0 sum.golang.org +0.0.0.0 pkg.go.dev +0.0.0.0 google.com +0.0.0.0 www.google.com +0.0.0.0 bing.com +0.0.0.0 www.bing.com +0.0.0.0 duckduckgo.com +0.0.0.0 html.duckduckgo.com +0.0.0.0 search.brave.com +0.0.0.0 stackoverflow.com diff --git a/tasks/format-code-task-002209/environment/setup/setup.sh b/tasks/format-code-task-002209/environment/setup/setup.sh new file mode 100644 index 0000000000000000000000000000000000000000..d883db90cfcfb48f7a139861bbe9f6b5d95cad6f --- /dev/null +++ b/tasks/format-code-task-002209/environment/setup/setup.sh @@ -0,0 +1,34 @@ +#!/bin/bash +# Runs once, as root, before the agent starts: Harbor's [environment.healthcheck] unpacks this folder into +# /var/lib/mimo and runs it. Generated by mimo_harbor; see its README for how each step maps to Xiaomi's harness. +M=/var/lib/mimo +[ -f "$M/ready" ] && exit 0 +chmod 700 "$M" +fail() { echo "setup: $*" >&2; exit 1; } +# the answer-leak blocklist (mimoagent), applied to /etc/hosts by the agent right after it installs +write_blocklist() { cp "$M/files/blocklist" "$M/blocklist"; } + +# Code: mimoagent environments/datasets/opensource_code.py + base.py, as the explorer runs it (app/runner/domains.py Code). +CWD=/testbed +git config --global --add safe.directory "$CWD" +cd "$CWD" || fail "no working directory $CWD" +if ! git rev-parse --git-dir >/dev/null 2>&1; then # a bare source tree: give it a baseline commit + git init -q && git add -A && git -c user.name=mimo -c user.email=mimo@localhost commit -q -m baseline --allow-empty +fi +BASE=$(git rev-parse HEAD 2>/dev/null) +[ ${#BASE} -eq 40 ] || fail "could not resolve the base commit in $CWD" +echo "$BASE" > "$M/base" +# Images are built with history truncated at the base. If one is not, the fix could be read out of git log, +# so .git is hidden while the agent works and put back for grading. +LATER=$(git rev-list --all --not "$BASE" 2>/dev/null | head -n 5 | grep -c . || true) +rm -f /tmp/fail.log /tmp/pass.log /tmp/patch.diff /tmp/test_patch.diff /tmp/*.log 2>/dev/null; rm -rf /tmp/claude-0 /tmp/claude-* /tmp/testem-* /tmp/puppeteer_dev_chrome_profile-* 2>/dev/null; rm -f /tmp/test_files.json 2>/dev/null; rm -rf /tmp/jest_* /tmp/jest-* /tmp/build /tmp/build_env 2>/dev/null; rm -rf /tmp/pytest-of-root /tmp/pytest-* /tmp/.pytest_cache /tmp/__pycache__ 2>/dev/null; rm -rf /tmp/go-build* /tmp/standards /tmp/wordpress /tmp/zig-* /tmp/testbase /tmp/testbed 2>/dev/null; rm -f /tmp/tmp*.tmp /tmp/*.bak /tmp/expect* /tmp/butwas* 2>/dev/null; rm -rf /root/.cache/go-build 2>/dev/null; rm -rf /tests 2>/dev/null; find /logs -mindepth 1 -delete 2>/dev/null; mkdir -p /logs/agent /logs/verifier /logs/artifacts; chmod 777 /logs/agent /logs/verifier /logs/artifacts; find /var/log -type f -delete 2>/dev/null || true; rm -rf /var/lib/postgresql/*/*/log /var/lib/postgresql/*/*/pg_log 2>/dev/null || true; find /var/lib/mysql /var/lib/mongodb -type f -name '*.log' -delete 2>/dev/null || true; rm -rf /root/.npm/_logs /root/.babel.json /root/.pytest_cache 2>/dev/null || true; find / -maxdepth 4 -xdev -name task_description.md -path '*/.build_env/*' -delete 2>/dev/null || true; true +git clean -fdx --exclude=node_modules --exclude=bower_components --exclude=.husky --exclude=vendor --exclude=third_party --exclude=_deps --exclude=vcpkg_installed --exclude=.venv --exclude=venv --exclude=.gradle --exclude=target --exclude=.build --exclude=lib --exclude=.bundle --exclude=Manifest.toml --exclude=_build --exclude=.stack-work --exclude=dist-newstyle >/dev/null 2>&1 +find /root/.m2 -type f \( -name '*-SNAPSHOT.jar' -o -name '*-SNAPSHOT-sources.jar' -o -name '*-SNAPSHOT-tests.jar' -o -name '*-SNAPSHOT-test-sources.jar' \) -delete 2>/dev/null; rm -rf /root/.julia/compiled 2>/dev/null; rm -rf /root/.gradle/caches/build-cache-* /root/.gradle/daemon 2>/dev/null; rm -rf /root/.gradle/caches/*/scripts /root/.gradle/caches/jars-* 2>/dev/null; rm -rf /root/.cache/bazel 2>/dev/null; true +if [ "$LATER" -gt 0 ]; then + mv "$CWD/.git" "$M/git-hidden" + echo "history not truncated at ${BASE:0:12}: .git hidden while the agent works" +fi +write_blocklist + +touch "$M/ready" +echo "setup done" diff --git a/tasks/format-code-task-002209/tests/test.patch b/tasks/format-code-task-002209/tests/test.patch new file mode 100644 index 0000000000000000000000000000000000000000..7ba651c76859da7121ed4aaf7a14063d66261318 --- /dev/null +++ b/tasks/format-code-task-002209/tests/test.patch @@ -0,0 +1,61 @@ +diff --git a/pandas/tests/io/test_parquet.py b/pandas/tests/io/test_parquet.py +index a98c93c250..307d535498 100644 +--- a/pandas/tests/io/test_parquet.py ++++ b/pandas/tests/io/test_parquet.py +@@ -595,6 +595,34 @@ class TestParquetFastParquet(Base): + actual_partition_cols = fastparquet.ParquetFile(path, False).cats + assert len(actual_partition_cols) == 2 + ++ def test_partition_cols_string(self, fp, df_full): ++ ++ ++ ++ partition_cols = "bool" ++ df = df_full ++ with tm.ensure_clean_dir() as path: ++ try: ++ df.to_parquet( ++ path, ++ engine="fastparquet", ++ partition_cols=partition_cols, ++ compression=None, ++ ) ++ except (ValueError, TypeError) as e: ++ ++ ++ assert "partition_cols" in str(e), ( ++ "error should clearly mention partition_cols, got: %s" % e ++ ) ++ return ++ ++ assert os.path.exists(path) ++ import fastparquet # noqa: F811 ++ ++ actual_partition_cols = fastparquet.ParquetFile(path, False).cats ++ assert len(actual_partition_cols) == 1 ++ + def test_partition_on_supported(self, fp, df_full): + # GH #23283 + partition_cols = ["bool", "int"] +diff --git a/test_commands.json b/test_commands.json +new file mode 100644 +index 0000000000..c73bdaaba5 +--- /dev/null ++++ b/test_commands.json +@@ -0,0 +1,3 @@ ++{ ++ "test_commands": ["python -m pytest pandas/tests/io/test_parquet.py::TestParquetFastParquet::test_partition_cols_string -v"] ++} +diff --git a/mimo_test_command.sh b/mimo_test_command.sh +new file mode 100755 +--- /dev/null ++++ b/mimo_test_command.sh +@@ -0,0 +1,8 @@ ++#!/usr/bin/env bash ++ ++set -uo pipefail ++cd /testbed ++rc=0 ++python -m pytest pandas/tests/io/test_parquet.py::TestParquetFastParquet::test_partition_cols_string -v ++rc=$(( rc | $? )) ++exit $rc diff --git a/tasks/format-code-task-002209/tests/test.sh b/tasks/format-code-task-002209/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..5031273344f06c2fa401548d35519a6a5319632d --- /dev/null +++ b/tasks/format-code-task-002209/tests/test.sh @@ -0,0 +1,39 @@ +#!/bin/bash +# Code grading, mimoagent opensource_code.py: reset the files the hidden test patch touches, apply it, run the +# task's test command; reward 1 when it exits 0. A testbed failure (reset or apply) writes no reward: not scored. +M=/var/lib/mimo +CWD=/testbed +V=/logs/verifier +mkdir -p "$V" +BASE=$(cat "$M/base" 2>/dev/null) || { echo "setup never ran (no $M/base)" >&2; exit 1; } +cd "$CWD" || exit 1 +if [ -d "$M/git-hidden" ]; then rm -rf "$CWD/.git"; mv "$M/git-hidden" "$CWD/.git"; fi +# the agent's change against the base, so its own commits count too +git add -A >/dev/null 2>&1 && git -c core.fileMode=false diff --cached "$BASE" > "$V/agent.diff" +git reset -q +if ! ( +while IFS= read -r tf; do + [ -z "$tf" ] && continue + if git cat-file -e $BASE:"$tf" 2>/dev/null; then + git checkout $BASE -- "$tf" 2>/dev/null || true + else + git rm -f --cached "$tf" >/dev/null 2>&1 || true + rm -f "$tf" + fi +done <<'EOF_RESET_TEST_FILES' +pandas/tests/io/test_parquet.py +test_commands.json +mimo_test_command.sh +EOF_RESET_TEST_FILES + +); then echo "could not reset the test files (testbed problem, not scored)" >&2; exit 1; fi +if ! git apply --verbose /tests/test.patch > "$V/apply.log" 2>&1; then + cat "$V/apply.log" >&2 + echo "the hidden tests could not be applied (testbed problem, not scored)" >&2 + exit 1 +fi +timeout 1800 sh -c "$(cat /tests/test_command.sh)" > "$V/test_output.log" 2>&1 +RC=$? +tail -c 12000 "$V/test_output.log" +if [ $RC -eq 0 ]; then echo 1 > "$V/reward.txt"; else echo 0 > "$V/reward.txt"; fi +echo "test command exited $RC" diff --git a/tasks/format-code-task-002209/tests/test_command.sh b/tasks/format-code-task-002209/tests/test_command.sh new file mode 100644 index 0000000000000000000000000000000000000000..7cb23076694ad17d72e8296d62b2b240083e36db --- /dev/null +++ b/tasks/format-code-task-002209/tests/test_command.sh @@ -0,0 +1 @@ +bash /testbed/mimo_test_command.sh \ No newline at end of file diff --git a/tasks/format-code-task-002213/environment/Dockerfile b/tasks/format-code-task-002213/environment/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..df1852c0ee9f69d4a1260cac46d8c3dc1f6dc5f0 --- /dev/null +++ b/tasks/format-code-task-002213/environment/Dockerfile @@ -0,0 +1,3 @@ +# The task's image, pinned by digest (the same as [environment].docker_image). +# Setup runs at start from [environment.healthcheck]; environment/setup/ is its readable copy. +FROM docker.io/xiaomimimo/mimo-v2.6-rl-oss@sha256:8f9b47a09da9eb37e1b4a5cb6ecf64b7dc7bf30ff06093c47d0fe322a85fd814 diff --git a/tasks/format-code-task-002213/environment/setup/files/blocklist b/tasks/format-code-task-002213/environment/setup/files/blocklist new file mode 100644 index 0000000000000000000000000000000000000000..a8e4bdc4c7d9b739c047a3cb58ea72a1bb05bcbc --- /dev/null +++ b/tasks/format-code-task-002213/environment/setup/files/blocklist @@ -0,0 +1,33 @@ +# mimo answer-leak blocklist (mimoagent) +0.0.0.0 github.com +0.0.0.0 www.github.com +0.0.0.0 api.github.com +0.0.0.0 raw.githubusercontent.com +0.0.0.0 codeload.github.com +0.0.0.0 objects.githubusercontent.com +0.0.0.0 gist.github.com +0.0.0.0 gist.githubusercontent.com +0.0.0.0 gitlab.com +0.0.0.0 bitbucket.org +0.0.0.0 sourceforge.net +0.0.0.0 git.kernel.org +0.0.0.0 chromium.googlesource.com +0.0.0.0 android.googlesource.com +0.0.0.0 sourcegraph.com +0.0.0.0 bugs.chromium.org +0.0.0.0 issues.oss-fuzz.com +0.0.0.0 oss-fuzz.com +0.0.0.0 osv.dev +0.0.0.0 api.osv.dev +0.0.0.0 bugzilla.mozilla.org +0.0.0.0 proxy.golang.org +0.0.0.0 sum.golang.org +0.0.0.0 pkg.go.dev +0.0.0.0 google.com +0.0.0.0 www.google.com +0.0.0.0 bing.com +0.0.0.0 www.bing.com +0.0.0.0 duckduckgo.com +0.0.0.0 html.duckduckgo.com +0.0.0.0 search.brave.com +0.0.0.0 stackoverflow.com diff --git a/tasks/format-code-task-002213/environment/setup/setup.sh b/tasks/format-code-task-002213/environment/setup/setup.sh new file mode 100644 index 0000000000000000000000000000000000000000..d883db90cfcfb48f7a139861bbe9f6b5d95cad6f --- /dev/null +++ b/tasks/format-code-task-002213/environment/setup/setup.sh @@ -0,0 +1,34 @@ +#!/bin/bash +# Runs once, as root, before the agent starts: Harbor's [environment.healthcheck] unpacks this folder into +# /var/lib/mimo and runs it. Generated by mimo_harbor; see its README for how each step maps to Xiaomi's harness. +M=/var/lib/mimo +[ -f "$M/ready" ] && exit 0 +chmod 700 "$M" +fail() { echo "setup: $*" >&2; exit 1; } +# the answer-leak blocklist (mimoagent), applied to /etc/hosts by the agent right after it installs +write_blocklist() { cp "$M/files/blocklist" "$M/blocklist"; } + +# Code: mimoagent environments/datasets/opensource_code.py + base.py, as the explorer runs it (app/runner/domains.py Code). +CWD=/testbed +git config --global --add safe.directory "$CWD" +cd "$CWD" || fail "no working directory $CWD" +if ! git rev-parse --git-dir >/dev/null 2>&1; then # a bare source tree: give it a baseline commit + git init -q && git add -A && git -c user.name=mimo -c user.email=mimo@localhost commit -q -m baseline --allow-empty +fi +BASE=$(git rev-parse HEAD 2>/dev/null) +[ ${#BASE} -eq 40 ] || fail "could not resolve the base commit in $CWD" +echo "$BASE" > "$M/base" +# Images are built with history truncated at the base. If one is not, the fix could be read out of git log, +# so .git is hidden while the agent works and put back for grading. +LATER=$(git rev-list --all --not "$BASE" 2>/dev/null | head -n 5 | grep -c . || true) +rm -f /tmp/fail.log /tmp/pass.log /tmp/patch.diff /tmp/test_patch.diff /tmp/*.log 2>/dev/null; rm -rf /tmp/claude-0 /tmp/claude-* /tmp/testem-* /tmp/puppeteer_dev_chrome_profile-* 2>/dev/null; rm -f /tmp/test_files.json 2>/dev/null; rm -rf /tmp/jest_* /tmp/jest-* /tmp/build /tmp/build_env 2>/dev/null; rm -rf /tmp/pytest-of-root /tmp/pytest-* /tmp/.pytest_cache /tmp/__pycache__ 2>/dev/null; rm -rf /tmp/go-build* /tmp/standards /tmp/wordpress /tmp/zig-* /tmp/testbase /tmp/testbed 2>/dev/null; rm -f /tmp/tmp*.tmp /tmp/*.bak /tmp/expect* /tmp/butwas* 2>/dev/null; rm -rf /root/.cache/go-build 2>/dev/null; rm -rf /tests 2>/dev/null; find /logs -mindepth 1 -delete 2>/dev/null; mkdir -p /logs/agent /logs/verifier /logs/artifacts; chmod 777 /logs/agent /logs/verifier /logs/artifacts; find /var/log -type f -delete 2>/dev/null || true; rm -rf /var/lib/postgresql/*/*/log /var/lib/postgresql/*/*/pg_log 2>/dev/null || true; find /var/lib/mysql /var/lib/mongodb -type f -name '*.log' -delete 2>/dev/null || true; rm -rf /root/.npm/_logs /root/.babel.json /root/.pytest_cache 2>/dev/null || true; find / -maxdepth 4 -xdev -name task_description.md -path '*/.build_env/*' -delete 2>/dev/null || true; true +git clean -fdx --exclude=node_modules --exclude=bower_components --exclude=.husky --exclude=vendor --exclude=third_party --exclude=_deps --exclude=vcpkg_installed --exclude=.venv --exclude=venv --exclude=.gradle --exclude=target --exclude=.build --exclude=lib --exclude=.bundle --exclude=Manifest.toml --exclude=_build --exclude=.stack-work --exclude=dist-newstyle >/dev/null 2>&1 +find /root/.m2 -type f \( -name '*-SNAPSHOT.jar' -o -name '*-SNAPSHOT-sources.jar' -o -name '*-SNAPSHOT-tests.jar' -o -name '*-SNAPSHOT-test-sources.jar' \) -delete 2>/dev/null; rm -rf /root/.julia/compiled 2>/dev/null; rm -rf /root/.gradle/caches/build-cache-* /root/.gradle/daemon 2>/dev/null; rm -rf /root/.gradle/caches/*/scripts /root/.gradle/caches/jars-* 2>/dev/null; rm -rf /root/.cache/bazel 2>/dev/null; true +if [ "$LATER" -gt 0 ]; then + mv "$CWD/.git" "$M/git-hidden" + echo "history not truncated at ${BASE:0:12}: .git hidden while the agent works" +fi +write_blocklist + +touch "$M/ready" +echo "setup done" diff --git a/tasks/format-code-task-002213/tests/test.patch b/tasks/format-code-task-002213/tests/test.patch new file mode 100644 index 0000000000000000000000000000000000000000..572a6b3acbb83ed7a9f9ae1f4117db4e2f57a550 --- /dev/null +++ b/tasks/format-code-task-002213/tests/test.patch @@ -0,0 +1,91 @@ +diff --git a/pandas/io/tests/test_parsers.py b/pandas/io/tests/test_parsers.py +index aa3fce3959860..5ff832431c917 100644 +--- a/pandas/io/tests/test_parsers.py ++++ b/pandas/io/tests/test_parsers.py +@@ -589,14 +589,21 @@ def test_string_nas(self): + tm.assert_frame_equal(result, expected) + + def test_duplicate_columns(self): +- data = """A,A,B,B,B +-1,2,3,4,5 +-6,7,8,9,10 +-11,12,13,14,15 +-""" +- df = self.read_table(StringIO(data), sep=',') +- self.assert_(np.array_equal(df.columns, +- ['A', 'A.1', 'B', 'B.1', 'B.2'])) ++ for engine in ['python', 'c']: ++ data = """A,A,B,B,B ++ 1,2,3,4,5 ++ 6,7,8,9,10 ++ 11,12,13,14,15 ++ """ ++ ++ df = self.read_table(StringIO(data), sep=',',engine=engine) ++ self.assertEqual(list(df.columns), ['A', 'A.1', 'B', 'B.1', 'B.2']) ++ ++ df = self.read_table(StringIO(data), sep=',',engine=engine,mangle_dupe_cols=False) ++ self.assertEqual(list(df.columns), ['A', 'A', 'B', 'B', 'B']) ++ ++ df = self.read_table(StringIO(data), sep=',',engine=engine,mangle_dupe_cols=True) ++ self.assertEqual(list(df.columns), ['A', 'A.1', 'B', 'B.1', 'B.2']) + + def test_csv_mixed_type(self): + data = """A,B,C +diff --git a/mimo_build_env.tar.gz.b64 b/mimo_build_env.tar.gz.b64 +new file mode 100644 +--- /dev/null ++++ b/mimo_build_env.tar.gz.b64 +@@ -0,0 +1,41 @@ ++H4sIAAAAAAAAA+1ZzU8jyRVvGzCe5muSnWhXuxulYiaDDeO228ZmwgARwzALCcNYO2yUkEStdncZ ++N9Pu7u0PwDBoOcwBRZGSSCtlj3uaZLV/QLT/BUQckE8r5ZQb0t7mlFfVbn+weJjNAKMk9bPdH/Wq ++XtV7VfV7r9tC0dN0VcLGRoq7LKQBE7kcPQNOn+m1mMuIYn48l85McGm4So9zKHdpI2qB57iyjRBn ++m6b7snrnyf9LITTnX5KsqiIrZSxJF7sWvsP8j4uZPMz/eFrMsvm/CnSYf8WsWLIrOdj1LEGxqm7Z ++NJJZURSgynfug0wwTG2n+RcnspnG/KczGS6dETNinkPpS7D3W/g/n/+/Dgzw5Dy4MLK+Fua4f7YK ++u+vnb/4Bh79wKrfKqSE1rIcq4dVwiAtzuOs5SL5sNMBhKWjj1+xZjdBz72ov1I7iyPq1hrzrOfT3 ++ZTi4d/JQo3edb8i7n4dAHgruV/vUnmfcaj/ux31Sf6PHvlad0kBb74OrgyAfXB9q6pwix/Bj+ktE ++tn/Gz9GVrhU1XXOryClrFVQybWTqKrJkQ5UdFE8LsPC3EmhTc8uoQPcCykLZmMD/i2hdrvEqVkxb ++dk3b2X7H8CpWVXCx42rGmtCUKA1TAD3w6yKuXfBdG1I5ndsNhbmnoc9b6zWghk877CnX7iAwqHvZ ++JuIHNS4RrkU9Q3PJMGoR54lmLZagrLvkGYodIe4mFRF6MZwiVYpYTbVQQdv2t6q1bkc3N20yNYOk ++aQIOe9xx9O39IfI5Hkrsb/3xk99/8pn3efFwKHE0lPjbzcOh1NFQ6iCa+oaMLXG91itJqqlIUo23 ++sSBZsu1gGwrrF9dKtrmNDeix1j/7eG5xcWl+ZWX+w8e1gTZ31nroba3HrVrYqfWWZUd2XdATyPmH ++purpeAXEta6KqdJB28TTtS6nCi0qVO58wdl9REKWzovolF86Y78Ht8ShzldwOOkKhUIn4XCo+4Qj ++hwgX+uEB937r9/ht9Kfqn3c+3dnrPeJunES50A8OuBv+95jr36Ofr3sH9zb3vT/sfqYf9o4d9Y6d ++cNFQ5ph/d/8nR/y7B+/lDvn8EZ/fm4O+etLQV3CIcNdv7M09Wzj+UWxv/tnDo+73j7sH935OPseC ++CJJfHFwfPeweO6Dfk++BVqqamvZq6MD/juZiBajRrGjb+HUDwHn8nxcz7fE/I45nxhn/XwUC/p8F ++/v/+pfI/PUdXo9DqGnB2k+dPx4EMjQONJfytONBP48AAHsD9Tb6HqNCiUxpsKY++hP8/5mc910zq ++pqxiFRWrAb3Dl6wLoD8ExFRBQB0CMGJZ4GctS9ewg5S2uAGXsHGc06HjIiMGuaYRI0In4ynh+9Dy ++F3DwWd0hFdCLm2fxeft2bhB6FFoQ3zi9HCX0obf2+y6Trn0GPp+zybh8zg7o2ibxkpK1Tcbawtjv ++1F3j/J1rMHYXYWxyiJ7L2JEzGfuY4/fo5wzqjnSg7lDPjRMuOHw99NYp4j6DrwcihK/hYF/j3hQ6 ++B/2L6+M8/hfHJ5r5v0if//J5kfH/VSAWi71mCkw0aBXLtF3UZAoEjeqXfP0stPIEmkYNBokneH4Y ++deJAtAmqbFwxN4CgNcOvh0RBvDMGrQq2uaGpGMlA116RDtstYzRC6G0ENbQgz/HpndhE+nCCIbd1 ++GxRStuJ5rYQM00V1voq3Vb2NRppjHElM8ggAnASG0dZCk9PiI51sG0nQZiouITLgOKHxuiqC+miC ++NL5RbsMOtY1GueBn9/EHsu5gGNdIwleEEHjVTJpW0w/BKAXSHQyVnGhZR+9Pk+p8y2iAwuktiYh1 ++cv5NZwN/V1fwppc5Qwe08P8TWOhlyY8CQvkC+ziH/9P5bD7g/2xmnPI/y/+vCKlR1E7/ZQypsE2Z ++VCpUpQVYE/dNr6hjNFtYREpZNtYw4eFmEEiPodEUP6wZiu4BFU/5EqE8A2UlVPi19Esg/MVHy9LC ++/K/QzDRKb6WzaTmdlid46H2xXdXt07268hPIq+OF6qPiOlZcNHobqVSSEAgPPWoGKcWE3hVZ1x2k ++uX6kWofZRfGgfku08Fc52rRly4LQRAyAdeBqCpimawaGMUl0O7ioviPah1XXiTYSaIdv4eRTtZY/ ++Wlq6DZXu8rv8MNA80XzKvjPV88PYULXSFdDmSx4SLqyP8/I/8s638fyfFmH/59K5NNv/VwGSvV31 ++I/AbzBjPz/pa0pw3ngDWSYWUvk7mxlI1hk5o4X+yJkg0qsDGFZwLTADP+f83k801+T8vivT5P8P4 ++/0ow/ONUUTNSRUg9eEVFwctDwq/zhuPZGMjJgmQEGwqhfNkmyR+4TNehkv+3QBYlK8jSrECAkkl4 ++7NQMy3NR8mMUoy+UXNPUnancnRiKKbTVVBYuKRlNZWJAsw5GoA56R/U/G1TZxZ6r6eR+G2VmUire ++SBmerpOxzelYNpBl4w3N9BxEFzEMztVKsgIP93YFJe1Sw5qUL2/c+qEpNSo4JlF2j0rr8cqPdaZn ++K3gSZEnU/liEStoW+OGVU2OqYs3w7vw0Wc8sMXWrEySahNxdzTQchCuQtuItF9uGrANpV4rgMmgf ++vJCrW6nYGDzjoIxrZpOKaWxg24VAR7PfMRqTNZgbBLaRsdA2KV0rCqP8XKHwYGn2g8fTsWSQrJ/1 ++srjd4BiaCxqVWu2IoWD2T40vM3NLRE8hb4epS+aIf+9jsKlCjCXvZixddiFHqCQdCytaCVJuv52q ++2ZDfm3aVv/fR4tJ9aWnx3vTNeGOJKSjWDM1gdklbu0t1TTfuhTXsSoH6eOIuAtecllJ1Eggc8Dmp ++Y9ma4cZLI+1rhXpsh+jaTe5A7d2RRIwmHR96BrUCSAP0+e+SkOdALKXFZ01K6yz4e6xioVu34Mlo ++ZeHRcmF2ZWE6dnOnYfTu5BmT0vQ22Wv+PvktDe5tTYOVrZlUh+Nzup9NQfZWnZxcgQJ/fRZo6eQk ++raJ6kNIpsK5g3nWvYjix/1z9nK95QVsrP4QszK5eXh9L5uardZHcYHkNAwMDAwMDAwMDAwMDAwMD ++AwMDAwMDAwMDAwMDAwMDAwMDAwMDAwPD/wj+DYQ2IbwAUAAA +diff --git a/mimo_test_command.sh b/mimo_test_command.sh +new file mode 100755 +--- /dev/null ++++ b/mimo_test_command.sh +@@ -0,0 +1,6 @@ ++#!/usr/bin/env bash ++ ++set -uo pipefail ++cd /testbed || exit 1 ++base64 -d mimo_build_env.tar.gz.b64 | tar -xzf - -C /testbed || exit 1 ++exec bash -lc 'cd /testbed && bash -eo pipefail /testbed/.build_env/test_command.sh' diff --git a/tasks/format-code-task-002213/tests/test.sh b/tasks/format-code-task-002213/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..409bf6b3dffadaf494dc954fc74bf47dec1efeeb --- /dev/null +++ b/tasks/format-code-task-002213/tests/test.sh @@ -0,0 +1,39 @@ +#!/bin/bash +# Code grading, mimoagent opensource_code.py: reset the files the hidden test patch touches, apply it, run the +# task's test command; reward 1 when it exits 0. A testbed failure (reset or apply) writes no reward: not scored. +M=/var/lib/mimo +CWD=/testbed +V=/logs/verifier +mkdir -p "$V" +BASE=$(cat "$M/base" 2>/dev/null) || { echo "setup never ran (no $M/base)" >&2; exit 1; } +cd "$CWD" || exit 1 +if [ -d "$M/git-hidden" ]; then rm -rf "$CWD/.git"; mv "$M/git-hidden" "$CWD/.git"; fi +# the agent's change against the base, so its own commits count too +git add -A >/dev/null 2>&1 && git -c core.fileMode=false diff --cached "$BASE" > "$V/agent.diff" +git reset -q +if ! ( +while IFS= read -r tf; do + [ -z "$tf" ] && continue + if git cat-file -e $BASE:"$tf" 2>/dev/null; then + git checkout $BASE -- "$tf" 2>/dev/null || true + else + git rm -f --cached "$tf" >/dev/null 2>&1 || true + rm -f "$tf" + fi +done <<'EOF_RESET_TEST_FILES' +pandas/io/tests/test_parsers.py +mimo_build_env.tar.gz.b64 +mimo_test_command.sh +EOF_RESET_TEST_FILES + +); then echo "could not reset the test files (testbed problem, not scored)" >&2; exit 1; fi +if ! git apply --verbose /tests/test.patch > "$V/apply.log" 2>&1; then + cat "$V/apply.log" >&2 + echo "the hidden tests could not be applied (testbed problem, not scored)" >&2 + exit 1 +fi +timeout 1800 sh -c "$(cat /tests/test_command.sh)" > "$V/test_output.log" 2>&1 +RC=$? +tail -c 12000 "$V/test_output.log" +if [ $RC -eq 0 ]; then echo 1 > "$V/reward.txt"; else echo 0 > "$V/reward.txt"; fi +echo "test command exited $RC" diff --git a/tasks/format-code-task-002213/tests/test_command.sh b/tasks/format-code-task-002213/tests/test_command.sh new file mode 100644 index 0000000000000000000000000000000000000000..7cb23076694ad17d72e8296d62b2b240083e36db --- /dev/null +++ b/tasks/format-code-task-002213/tests/test_command.sh @@ -0,0 +1 @@ +bash /testbed/mimo_test_command.sh \ No newline at end of file diff --git a/tasks/format-code-task-002214/environment/Dockerfile b/tasks/format-code-task-002214/environment/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..d8dc1a81092a8d23347cfea6aee0261cb7163467 --- /dev/null +++ b/tasks/format-code-task-002214/environment/Dockerfile @@ -0,0 +1,3 @@ +# The task's image, pinned by digest (the same as [environment].docker_image). +# Setup runs at start from [environment.healthcheck]; environment/setup/ is its readable copy. +FROM docker.io/xiaomimimo/mimo-v2.6-rl-oss@sha256:1a1a5409845ec61ae588aa22cb2286094084dbd7181e7d1937baf41cab7d3571 diff --git a/tasks/format-code-task-002214/environment/setup/files/blocklist b/tasks/format-code-task-002214/environment/setup/files/blocklist new file mode 100644 index 0000000000000000000000000000000000000000..a8e4bdc4c7d9b739c047a3cb58ea72a1bb05bcbc --- /dev/null +++ b/tasks/format-code-task-002214/environment/setup/files/blocklist @@ -0,0 +1,33 @@ +# mimo answer-leak blocklist (mimoagent) +0.0.0.0 github.com +0.0.0.0 www.github.com +0.0.0.0 api.github.com +0.0.0.0 raw.githubusercontent.com +0.0.0.0 codeload.github.com +0.0.0.0 objects.githubusercontent.com +0.0.0.0 gist.github.com +0.0.0.0 gist.githubusercontent.com +0.0.0.0 gitlab.com +0.0.0.0 bitbucket.org +0.0.0.0 sourceforge.net +0.0.0.0 git.kernel.org +0.0.0.0 chromium.googlesource.com +0.0.0.0 android.googlesource.com +0.0.0.0 sourcegraph.com +0.0.0.0 bugs.chromium.org +0.0.0.0 issues.oss-fuzz.com +0.0.0.0 oss-fuzz.com +0.0.0.0 osv.dev +0.0.0.0 api.osv.dev +0.0.0.0 bugzilla.mozilla.org +0.0.0.0 proxy.golang.org +0.0.0.0 sum.golang.org +0.0.0.0 pkg.go.dev +0.0.0.0 google.com +0.0.0.0 www.google.com +0.0.0.0 bing.com +0.0.0.0 www.bing.com +0.0.0.0 duckduckgo.com +0.0.0.0 html.duckduckgo.com +0.0.0.0 search.brave.com +0.0.0.0 stackoverflow.com diff --git a/tasks/format-code-task-002214/environment/setup/setup.sh b/tasks/format-code-task-002214/environment/setup/setup.sh new file mode 100644 index 0000000000000000000000000000000000000000..d883db90cfcfb48f7a139861bbe9f6b5d95cad6f --- /dev/null +++ b/tasks/format-code-task-002214/environment/setup/setup.sh @@ -0,0 +1,34 @@ +#!/bin/bash +# Runs once, as root, before the agent starts: Harbor's [environment.healthcheck] unpacks this folder into +# /var/lib/mimo and runs it. Generated by mimo_harbor; see its README for how each step maps to Xiaomi's harness. +M=/var/lib/mimo +[ -f "$M/ready" ] && exit 0 +chmod 700 "$M" +fail() { echo "setup: $*" >&2; exit 1; } +# the answer-leak blocklist (mimoagent), applied to /etc/hosts by the agent right after it installs +write_blocklist() { cp "$M/files/blocklist" "$M/blocklist"; } + +# Code: mimoagent environments/datasets/opensource_code.py + base.py, as the explorer runs it (app/runner/domains.py Code). +CWD=/testbed +git config --global --add safe.directory "$CWD" +cd "$CWD" || fail "no working directory $CWD" +if ! git rev-parse --git-dir >/dev/null 2>&1; then # a bare source tree: give it a baseline commit + git init -q && git add -A && git -c user.name=mimo -c user.email=mimo@localhost commit -q -m baseline --allow-empty +fi +BASE=$(git rev-parse HEAD 2>/dev/null) +[ ${#BASE} -eq 40 ] || fail "could not resolve the base commit in $CWD" +echo "$BASE" > "$M/base" +# Images are built with history truncated at the base. If one is not, the fix could be read out of git log, +# so .git is hidden while the agent works and put back for grading. +LATER=$(git rev-list --all --not "$BASE" 2>/dev/null | head -n 5 | grep -c . || true) +rm -f /tmp/fail.log /tmp/pass.log /tmp/patch.diff /tmp/test_patch.diff /tmp/*.log 2>/dev/null; rm -rf /tmp/claude-0 /tmp/claude-* /tmp/testem-* /tmp/puppeteer_dev_chrome_profile-* 2>/dev/null; rm -f /tmp/test_files.json 2>/dev/null; rm -rf /tmp/jest_* /tmp/jest-* /tmp/build /tmp/build_env 2>/dev/null; rm -rf /tmp/pytest-of-root /tmp/pytest-* /tmp/.pytest_cache /tmp/__pycache__ 2>/dev/null; rm -rf /tmp/go-build* /tmp/standards /tmp/wordpress /tmp/zig-* /tmp/testbase /tmp/testbed 2>/dev/null; rm -f /tmp/tmp*.tmp /tmp/*.bak /tmp/expect* /tmp/butwas* 2>/dev/null; rm -rf /root/.cache/go-build 2>/dev/null; rm -rf /tests 2>/dev/null; find /logs -mindepth 1 -delete 2>/dev/null; mkdir -p /logs/agent /logs/verifier /logs/artifacts; chmod 777 /logs/agent /logs/verifier /logs/artifacts; find /var/log -type f -delete 2>/dev/null || true; rm -rf /var/lib/postgresql/*/*/log /var/lib/postgresql/*/*/pg_log 2>/dev/null || true; find /var/lib/mysql /var/lib/mongodb -type f -name '*.log' -delete 2>/dev/null || true; rm -rf /root/.npm/_logs /root/.babel.json /root/.pytest_cache 2>/dev/null || true; find / -maxdepth 4 -xdev -name task_description.md -path '*/.build_env/*' -delete 2>/dev/null || true; true +git clean -fdx --exclude=node_modules --exclude=bower_components --exclude=.husky --exclude=vendor --exclude=third_party --exclude=_deps --exclude=vcpkg_installed --exclude=.venv --exclude=venv --exclude=.gradle --exclude=target --exclude=.build --exclude=lib --exclude=.bundle --exclude=Manifest.toml --exclude=_build --exclude=.stack-work --exclude=dist-newstyle >/dev/null 2>&1 +find /root/.m2 -type f \( -name '*-SNAPSHOT.jar' -o -name '*-SNAPSHOT-sources.jar' -o -name '*-SNAPSHOT-tests.jar' -o -name '*-SNAPSHOT-test-sources.jar' \) -delete 2>/dev/null; rm -rf /root/.julia/compiled 2>/dev/null; rm -rf /root/.gradle/caches/build-cache-* /root/.gradle/daemon 2>/dev/null; rm -rf /root/.gradle/caches/*/scripts /root/.gradle/caches/jars-* 2>/dev/null; rm -rf /root/.cache/bazel 2>/dev/null; true +if [ "$LATER" -gt 0 ]; then + mv "$CWD/.git" "$M/git-hidden" + echo "history not truncated at ${BASE:0:12}: .git hidden while the agent works" +fi +write_blocklist + +touch "$M/ready" +echo "setup done" diff --git a/tasks/format-code-task-002214/tests/test.patch b/tasks/format-code-task-002214/tests/test.patch new file mode 100644 index 0000000000000000000000000000000000000000..3bd75abb0f81e39e1944d1ea053184bcac661178 --- /dev/null +++ b/tasks/format-code-task-002214/tests/test.patch @@ -0,0 +1,75 @@ +diff --git a/pandas/tests/series/test_constructors.py b/pandas/tests/series/test_constructors.py +index bcf7039ec9..5820f14197 100644 +--- a/pandas/tests/series/test_constructors.py ++++ b/pandas/tests/series/test_constructors.py +@@ -1155,6 +1155,48 @@ class TestSeriesConstructors: + with pytest.raises(TypeError, match="'frozenset' type is unordered"): + Series(values) + ++ def test_constructor_dict_keys_gh36044(self): ++ ++ ++ d = {"a": 1, "b": 2} ++ result = Series(d.keys()) ++ expected = Series(["a", "b"]) ++ tm.assert_series_equal(result, expected) ++ assert result.dtype == object ++ ++ assert list(result) == ["a", "b"] ++ ++ def test_constructor_dict_values_gh36044(self): ++ ++ ++ d = {"a": 1, "b": 2} ++ result = Series(d.values()) ++ expected = Series([1, 2]) ++ tm.assert_series_equal(result, expected) ++ ++ assert result.dtype == np.int64 ++ assert list(result) == [1, 2] ++ ++ def test_constructor_dict_items_gh36044(self): ++ ++ ++ d = {"a": 1, "b": 2} ++ result = Series(d.items()) ++ ++ assert list(result) == [("a", 1), ("b", 2)] ++ assert result.dtype == object ++ assert len(result) == 2 ++ ++ def test_constructor_dict_keys_preserves_set_raise_gh36044(self): ++ ++ ++ result = Series({"x": 10, "y": 20}.keys()) ++ assert list(result) == ["x", "y"] ++ with pytest.raises(TypeError, match="'set' type is unordered"): ++ Series({1, 2, 3}) ++ with pytest.raises(TypeError, match="'frozenset' type is unordered"): ++ Series(frozenset({1, 2, 3})) ++ + # https://github.com/pandas-dev/pandas/issues/22698 + @pytest.mark.filterwarnings("ignore:elementwise comparison:FutureWarning") + def test_fromDict(self): +diff --git a/test_commands.json b/test_commands.json +new file mode 100644 +index 0000000000..787f851889 +--- /dev/null ++++ b/test_commands.json +@@ -0,0 +1,3 @@ ++{ ++ "test_commands": ["python -m pytest pandas/tests/series/test_constructors.py -v -k \"gh36044 or test_constructor_set\""] ++} +diff --git a/mimo_test_command.sh b/mimo_test_command.sh +new file mode 100755 +--- /dev/null ++++ b/mimo_test_command.sh +@@ -0,0 +1,8 @@ ++#!/usr/bin/env bash ++ ++set -uo pipefail ++cd /testbed ++rc=0 ++python -m pytest pandas/tests/series/test_constructors.py -v -k "gh36044 or test_constructor_set" ++rc=$(( rc | $? )) ++exit $rc diff --git a/tasks/format-code-task-002214/tests/test.sh b/tasks/format-code-task-002214/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..ce0d92f23e32e0ffd3a42a867190aabd9a5a78cc --- /dev/null +++ b/tasks/format-code-task-002214/tests/test.sh @@ -0,0 +1,39 @@ +#!/bin/bash +# Code grading, mimoagent opensource_code.py: reset the files the hidden test patch touches, apply it, run the +# task's test command; reward 1 when it exits 0. A testbed failure (reset or apply) writes no reward: not scored. +M=/var/lib/mimo +CWD=/testbed +V=/logs/verifier +mkdir -p "$V" +BASE=$(cat "$M/base" 2>/dev/null) || { echo "setup never ran (no $M/base)" >&2; exit 1; } +cd "$CWD" || exit 1 +if [ -d "$M/git-hidden" ]; then rm -rf "$CWD/.git"; mv "$M/git-hidden" "$CWD/.git"; fi +# the agent's change against the base, so its own commits count too +git add -A >/dev/null 2>&1 && git -c core.fileMode=false diff --cached "$BASE" > "$V/agent.diff" +git reset -q +if ! ( +while IFS= read -r tf; do + [ -z "$tf" ] && continue + if git cat-file -e $BASE:"$tf" 2>/dev/null; then + git checkout $BASE -- "$tf" 2>/dev/null || true + else + git rm -f --cached "$tf" >/dev/null 2>&1 || true + rm -f "$tf" + fi +done <<'EOF_RESET_TEST_FILES' +pandas/tests/series/test_constructors.py +test_commands.json +mimo_test_command.sh +EOF_RESET_TEST_FILES + +); then echo "could not reset the test files (testbed problem, not scored)" >&2; exit 1; fi +if ! git apply --verbose /tests/test.patch > "$V/apply.log" 2>&1; then + cat "$V/apply.log" >&2 + echo "the hidden tests could not be applied (testbed problem, not scored)" >&2 + exit 1 +fi +timeout 1800 sh -c "$(cat /tests/test_command.sh)" > "$V/test_output.log" 2>&1 +RC=$? +tail -c 12000 "$V/test_output.log" +if [ $RC -eq 0 ]; then echo 1 > "$V/reward.txt"; else echo 0 > "$V/reward.txt"; fi +echo "test command exited $RC" diff --git a/tasks/format-code-task-002214/tests/test_command.sh b/tasks/format-code-task-002214/tests/test_command.sh new file mode 100644 index 0000000000000000000000000000000000000000..7cb23076694ad17d72e8296d62b2b240083e36db --- /dev/null +++ b/tasks/format-code-task-002214/tests/test_command.sh @@ -0,0 +1 @@ +bash /testbed/mimo_test_command.sh \ No newline at end of file diff --git a/tasks/format-code-task-002222/environment/Dockerfile b/tasks/format-code-task-002222/environment/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..90e3f07cbb792cb33f520419b98df1142444a066 --- /dev/null +++ b/tasks/format-code-task-002222/environment/Dockerfile @@ -0,0 +1,3 @@ +# The task's image, pinned by digest (the same as [environment].docker_image). +# Setup runs at start from [environment.healthcheck]; environment/setup/ is its readable copy. +FROM docker.io/xiaomimimo/mimo-v2.6-rl-oss@sha256:70029e4c3c5bbe1f7f5b441ab37a83eb523cd5e0aae47814324564d22452af2c diff --git a/tasks/format-code-task-002222/environment/setup/files/blocklist b/tasks/format-code-task-002222/environment/setup/files/blocklist new file mode 100644 index 0000000000000000000000000000000000000000..a8e4bdc4c7d9b739c047a3cb58ea72a1bb05bcbc --- /dev/null +++ b/tasks/format-code-task-002222/environment/setup/files/blocklist @@ -0,0 +1,33 @@ +# mimo answer-leak blocklist (mimoagent) +0.0.0.0 github.com +0.0.0.0 www.github.com +0.0.0.0 api.github.com +0.0.0.0 raw.githubusercontent.com +0.0.0.0 codeload.github.com +0.0.0.0 objects.githubusercontent.com +0.0.0.0 gist.github.com +0.0.0.0 gist.githubusercontent.com +0.0.0.0 gitlab.com +0.0.0.0 bitbucket.org +0.0.0.0 sourceforge.net +0.0.0.0 git.kernel.org +0.0.0.0 chromium.googlesource.com +0.0.0.0 android.googlesource.com +0.0.0.0 sourcegraph.com +0.0.0.0 bugs.chromium.org +0.0.0.0 issues.oss-fuzz.com +0.0.0.0 oss-fuzz.com +0.0.0.0 osv.dev +0.0.0.0 api.osv.dev +0.0.0.0 bugzilla.mozilla.org +0.0.0.0 proxy.golang.org +0.0.0.0 sum.golang.org +0.0.0.0 pkg.go.dev +0.0.0.0 google.com +0.0.0.0 www.google.com +0.0.0.0 bing.com +0.0.0.0 www.bing.com +0.0.0.0 duckduckgo.com +0.0.0.0 html.duckduckgo.com +0.0.0.0 search.brave.com +0.0.0.0 stackoverflow.com diff --git a/tasks/format-code-task-002222/environment/setup/setup.sh b/tasks/format-code-task-002222/environment/setup/setup.sh new file mode 100644 index 0000000000000000000000000000000000000000..d883db90cfcfb48f7a139861bbe9f6b5d95cad6f --- /dev/null +++ b/tasks/format-code-task-002222/environment/setup/setup.sh @@ -0,0 +1,34 @@ +#!/bin/bash +# Runs once, as root, before the agent starts: Harbor's [environment.healthcheck] unpacks this folder into +# /var/lib/mimo and runs it. Generated by mimo_harbor; see its README for how each step maps to Xiaomi's harness. +M=/var/lib/mimo +[ -f "$M/ready" ] && exit 0 +chmod 700 "$M" +fail() { echo "setup: $*" >&2; exit 1; } +# the answer-leak blocklist (mimoagent), applied to /etc/hosts by the agent right after it installs +write_blocklist() { cp "$M/files/blocklist" "$M/blocklist"; } + +# Code: mimoagent environments/datasets/opensource_code.py + base.py, as the explorer runs it (app/runner/domains.py Code). +CWD=/testbed +git config --global --add safe.directory "$CWD" +cd "$CWD" || fail "no working directory $CWD" +if ! git rev-parse --git-dir >/dev/null 2>&1; then # a bare source tree: give it a baseline commit + git init -q && git add -A && git -c user.name=mimo -c user.email=mimo@localhost commit -q -m baseline --allow-empty +fi +BASE=$(git rev-parse HEAD 2>/dev/null) +[ ${#BASE} -eq 40 ] || fail "could not resolve the base commit in $CWD" +echo "$BASE" > "$M/base" +# Images are built with history truncated at the base. If one is not, the fix could be read out of git log, +# so .git is hidden while the agent works and put back for grading. +LATER=$(git rev-list --all --not "$BASE" 2>/dev/null | head -n 5 | grep -c . || true) +rm -f /tmp/fail.log /tmp/pass.log /tmp/patch.diff /tmp/test_patch.diff /tmp/*.log 2>/dev/null; rm -rf /tmp/claude-0 /tmp/claude-* /tmp/testem-* /tmp/puppeteer_dev_chrome_profile-* 2>/dev/null; rm -f /tmp/test_files.json 2>/dev/null; rm -rf /tmp/jest_* /tmp/jest-* /tmp/build /tmp/build_env 2>/dev/null; rm -rf /tmp/pytest-of-root /tmp/pytest-* /tmp/.pytest_cache /tmp/__pycache__ 2>/dev/null; rm -rf /tmp/go-build* /tmp/standards /tmp/wordpress /tmp/zig-* /tmp/testbase /tmp/testbed 2>/dev/null; rm -f /tmp/tmp*.tmp /tmp/*.bak /tmp/expect* /tmp/butwas* 2>/dev/null; rm -rf /root/.cache/go-build 2>/dev/null; rm -rf /tests 2>/dev/null; find /logs -mindepth 1 -delete 2>/dev/null; mkdir -p /logs/agent /logs/verifier /logs/artifacts; chmod 777 /logs/agent /logs/verifier /logs/artifacts; find /var/log -type f -delete 2>/dev/null || true; rm -rf /var/lib/postgresql/*/*/log /var/lib/postgresql/*/*/pg_log 2>/dev/null || true; find /var/lib/mysql /var/lib/mongodb -type f -name '*.log' -delete 2>/dev/null || true; rm -rf /root/.npm/_logs /root/.babel.json /root/.pytest_cache 2>/dev/null || true; find / -maxdepth 4 -xdev -name task_description.md -path '*/.build_env/*' -delete 2>/dev/null || true; true +git clean -fdx --exclude=node_modules --exclude=bower_components --exclude=.husky --exclude=vendor --exclude=third_party --exclude=_deps --exclude=vcpkg_installed --exclude=.venv --exclude=venv --exclude=.gradle --exclude=target --exclude=.build --exclude=lib --exclude=.bundle --exclude=Manifest.toml --exclude=_build --exclude=.stack-work --exclude=dist-newstyle >/dev/null 2>&1 +find /root/.m2 -type f \( -name '*-SNAPSHOT.jar' -o -name '*-SNAPSHOT-sources.jar' -o -name '*-SNAPSHOT-tests.jar' -o -name '*-SNAPSHOT-test-sources.jar' \) -delete 2>/dev/null; rm -rf /root/.julia/compiled 2>/dev/null; rm -rf /root/.gradle/caches/build-cache-* /root/.gradle/daemon 2>/dev/null; rm -rf /root/.gradle/caches/*/scripts /root/.gradle/caches/jars-* 2>/dev/null; rm -rf /root/.cache/bazel 2>/dev/null; true +if [ "$LATER" -gt 0 ]; then + mv "$CWD/.git" "$M/git-hidden" + echo "history not truncated at ${BASE:0:12}: .git hidden while the agent works" +fi +write_blocklist + +touch "$M/ready" +echo "setup done" diff --git a/tasks/format-code-task-002222/tests/test.patch b/tasks/format-code-task-002222/tests/test.patch new file mode 100644 index 0000000000000000000000000000000000000000..c299a5f4154b8edf8d2d15de76337dd569b680f6 --- /dev/null +++ b/tasks/format-code-task-002222/tests/test.patch @@ -0,0 +1,103 @@ +diff --git a/pandas/tests/frame/test_ufunc.py b/pandas/tests/frame/test_ufunc.py +index 0bcb62251f..208fb2c784 100644 +--- a/pandas/tests/frame/test_ufunc.py ++++ b/pandas/tests/frame/test_ufunc.py +@@ -256,3 +256,76 @@ def test_alignment_deprecation_many_inputs(): + result = my_ufunc(df1.values, df2, df3) + expected = expected.set_axis(["b", "c"], axis=1) + tm.assert_frame_equal(result, expected) ++ ++ ++def test_np_add_dataframe_scalar_with_out(): ++ ++ foo = np.array([1, 2, 3, 4]).reshape(2, 2) ++ df = pd.DataFrame(foo) ++ bar = np.zeros_like(foo) ++ result = np.add(df, 1, out=bar) ++ expected = np.array([[2, 3], [4, 5]]) ++ tm.assert_numpy_array_equal(bar, expected) ++ tm.assert_numpy_array_equal(np.asarray(result), expected) ++ ++ ++def test_np_add_two_dataframes_with_out(): ++ ++ df1 = pd.DataFrame([[1, 2], [3, 4]]) ++ df2 = pd.DataFrame([[10, 20], [30, 40]]) ++ bar = np.zeros((2, 2), dtype=np.int64) ++ np.add(df1, df2, out=bar) ++ expected = np.array([[11, 22], [33, 44]], dtype=np.int64) ++ tm.assert_numpy_array_equal(bar, expected) ++ ++ ++def test_np_unary_ufunc_dataframe_with_out(): ++ ++ df = pd.DataFrame([[1.0, 2.0], [3.0, 4.0]]) ++ bar = np.zeros((2, 2)) ++ np.exp(df, out=bar) ++ expected = np.exp(np.array([[1.0, 2.0], [3.0, 4.0]])) ++ tm.assert_numpy_array_equal(bar, expected) ++ ++ ++def test_np_negative_dataframe_with_out(): ++ ++ df = pd.DataFrame([[1, 2], [3, 4]]) ++ bar = np.zeros((2, 2), dtype=np.int64) ++ np.negative(df, out=bar) ++ expected = np.array([[-1, -2], [-3, -4]], dtype=np.int64) ++ tm.assert_numpy_array_equal(bar, expected) ++ ++ ++def test_np_unary_ufunc_dataframe_dtype_kwarg(): ++ ++ df = pd.DataFrame([[1.0, 2.0], [3.0, 4.0]]) ++ result = np.positive(df, dtype=np.float32) ++ assert all(d == np.float32 for d in result.dtypes) ++ ++ ++def test_np_add_series_with_out_preservation(): ++ ++ series = pd.Series([1, 2, 3, 4]) ++ bar = np.zeros(4, dtype=np.int64) ++ np.add(series, 1, out=bar) ++ expected = np.array([2, 3, 4, 5], dtype=np.int64) ++ tm.assert_numpy_array_equal(bar, expected) ++ ++ ++def test_np_add_dataframe_no_kwargs_preservation(): ++ ++ df = pd.DataFrame([[1, 2], [3, 4]]) ++ result = np.add(df, 1) ++ expected = pd.DataFrame([[2, 3], [4, 5]]) ++ tm.assert_frame_equal(result, expected) ++ ++ ++def test_np_add_dataframe_values_workaround_preservation(): ++ ++ foo = np.array([1, 2, 3, 4]).reshape(2, 2) ++ df = pd.DataFrame(foo) ++ bar = np.zeros_like(foo) ++ np.add(df.values, 1, out=bar) ++ expected = np.array([[2, 3], [4, 5]]) ++ tm.assert_numpy_array_equal(bar, expected) +diff --git a/test_commands.json b/test_commands.json +new file mode 100644 +index 0000000000..8cc64be884 +--- /dev/null ++++ b/test_commands.json +@@ -0,0 +1,3 @@ ++{ ++ "test_commands": ["python -m pytest pandas/tests/frame/test_ufunc.py -k \"np_add_dataframe_scalar_with_out or np_add_two_dataframes_with_out or np_unary_ufunc_dataframe_with_out or np_negative_dataframe_with_out or np_unary_ufunc_dataframe_dtype_kwarg or np_add_series_with_out_preservation or np_add_dataframe_no_kwargs_preservation or np_add_dataframe_values_workaround_preservation\""] ++} +diff --git a/mimo_test_command.sh b/mimo_test_command.sh +new file mode 100755 +--- /dev/null ++++ b/mimo_test_command.sh +@@ -0,0 +1,8 @@ ++#!/usr/bin/env bash ++ ++set -uo pipefail ++cd /testbed ++rc=0 ++python -m pytest pandas/tests/frame/test_ufunc.py -k "np_add_dataframe_scalar_with_out or np_add_two_dataframes_with_out or np_unary_ufunc_dataframe_with_out or np_negative_dataframe_with_out or np_unary_ufunc_dataframe_dtype_kwarg or np_add_series_with_out_preservation or np_add_dataframe_no_kwargs_preservation or np_add_dataframe_values_workaround_preservation" ++rc=$(( rc | $? )) ++exit $rc diff --git a/tasks/format-code-task-002222/tests/test.sh b/tasks/format-code-task-002222/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..74e33e93552d96c0b193f8ad83d8d662be3c9b13 --- /dev/null +++ b/tasks/format-code-task-002222/tests/test.sh @@ -0,0 +1,39 @@ +#!/bin/bash +# Code grading, mimoagent opensource_code.py: reset the files the hidden test patch touches, apply it, run the +# task's test command; reward 1 when it exits 0. A testbed failure (reset or apply) writes no reward: not scored. +M=/var/lib/mimo +CWD=/testbed +V=/logs/verifier +mkdir -p "$V" +BASE=$(cat "$M/base" 2>/dev/null) || { echo "setup never ran (no $M/base)" >&2; exit 1; } +cd "$CWD" || exit 1 +if [ -d "$M/git-hidden" ]; then rm -rf "$CWD/.git"; mv "$M/git-hidden" "$CWD/.git"; fi +# the agent's change against the base, so its own commits count too +git add -A >/dev/null 2>&1 && git -c core.fileMode=false diff --cached "$BASE" > "$V/agent.diff" +git reset -q +if ! ( +while IFS= read -r tf; do + [ -z "$tf" ] && continue + if git cat-file -e $BASE:"$tf" 2>/dev/null; then + git checkout $BASE -- "$tf" 2>/dev/null || true + else + git rm -f --cached "$tf" >/dev/null 2>&1 || true + rm -f "$tf" + fi +done <<'EOF_RESET_TEST_FILES' +pandas/tests/frame/test_ufunc.py +test_commands.json +mimo_test_command.sh +EOF_RESET_TEST_FILES + +); then echo "could not reset the test files (testbed problem, not scored)" >&2; exit 1; fi +if ! git apply --verbose /tests/test.patch > "$V/apply.log" 2>&1; then + cat "$V/apply.log" >&2 + echo "the hidden tests could not be applied (testbed problem, not scored)" >&2 + exit 1 +fi +timeout 1800 sh -c "$(cat /tests/test_command.sh)" > "$V/test_output.log" 2>&1 +RC=$? +tail -c 12000 "$V/test_output.log" +if [ $RC -eq 0 ]; then echo 1 > "$V/reward.txt"; else echo 0 > "$V/reward.txt"; fi +echo "test command exited $RC" diff --git a/tasks/format-code-task-002222/tests/test_command.sh b/tasks/format-code-task-002222/tests/test_command.sh new file mode 100644 index 0000000000000000000000000000000000000000..7cb23076694ad17d72e8296d62b2b240083e36db --- /dev/null +++ b/tasks/format-code-task-002222/tests/test_command.sh @@ -0,0 +1 @@ +bash /testbed/mimo_test_command.sh \ No newline at end of file diff --git a/tasks/format-code-task-002231/environment/Dockerfile b/tasks/format-code-task-002231/environment/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..7be0fb1b9de80a645a6b578a0b21755066038084 --- /dev/null +++ b/tasks/format-code-task-002231/environment/Dockerfile @@ -0,0 +1,3 @@ +# The task's image, pinned by digest (the same as [environment].docker_image). +# Setup runs at start from [environment.healthcheck]; environment/setup/ is its readable copy. +FROM docker.io/xiaomimimo/mimo-v2.6-rl-oss@sha256:7a80f5efefcb342901e79d9e5855290e23752c508c1714c2a6e6c11e894c54c1 diff --git a/tasks/format-code-task-002231/environment/setup/files/blocklist b/tasks/format-code-task-002231/environment/setup/files/blocklist new file mode 100644 index 0000000000000000000000000000000000000000..a8e4bdc4c7d9b739c047a3cb58ea72a1bb05bcbc --- /dev/null +++ b/tasks/format-code-task-002231/environment/setup/files/blocklist @@ -0,0 +1,33 @@ +# mimo answer-leak blocklist (mimoagent) +0.0.0.0 github.com +0.0.0.0 www.github.com +0.0.0.0 api.github.com +0.0.0.0 raw.githubusercontent.com +0.0.0.0 codeload.github.com +0.0.0.0 objects.githubusercontent.com +0.0.0.0 gist.github.com +0.0.0.0 gist.githubusercontent.com +0.0.0.0 gitlab.com +0.0.0.0 bitbucket.org +0.0.0.0 sourceforge.net +0.0.0.0 git.kernel.org +0.0.0.0 chromium.googlesource.com +0.0.0.0 android.googlesource.com +0.0.0.0 sourcegraph.com +0.0.0.0 bugs.chromium.org +0.0.0.0 issues.oss-fuzz.com +0.0.0.0 oss-fuzz.com +0.0.0.0 osv.dev +0.0.0.0 api.osv.dev +0.0.0.0 bugzilla.mozilla.org +0.0.0.0 proxy.golang.org +0.0.0.0 sum.golang.org +0.0.0.0 pkg.go.dev +0.0.0.0 google.com +0.0.0.0 www.google.com +0.0.0.0 bing.com +0.0.0.0 www.bing.com +0.0.0.0 duckduckgo.com +0.0.0.0 html.duckduckgo.com +0.0.0.0 search.brave.com +0.0.0.0 stackoverflow.com diff --git a/tasks/format-code-task-002231/environment/setup/setup.sh b/tasks/format-code-task-002231/environment/setup/setup.sh new file mode 100644 index 0000000000000000000000000000000000000000..d883db90cfcfb48f7a139861bbe9f6b5d95cad6f --- /dev/null +++ b/tasks/format-code-task-002231/environment/setup/setup.sh @@ -0,0 +1,34 @@ +#!/bin/bash +# Runs once, as root, before the agent starts: Harbor's [environment.healthcheck] unpacks this folder into +# /var/lib/mimo and runs it. Generated by mimo_harbor; see its README for how each step maps to Xiaomi's harness. +M=/var/lib/mimo +[ -f "$M/ready" ] && exit 0 +chmod 700 "$M" +fail() { echo "setup: $*" >&2; exit 1; } +# the answer-leak blocklist (mimoagent), applied to /etc/hosts by the agent right after it installs +write_blocklist() { cp "$M/files/blocklist" "$M/blocklist"; } + +# Code: mimoagent environments/datasets/opensource_code.py + base.py, as the explorer runs it (app/runner/domains.py Code). +CWD=/testbed +git config --global --add safe.directory "$CWD" +cd "$CWD" || fail "no working directory $CWD" +if ! git rev-parse --git-dir >/dev/null 2>&1; then # a bare source tree: give it a baseline commit + git init -q && git add -A && git -c user.name=mimo -c user.email=mimo@localhost commit -q -m baseline --allow-empty +fi +BASE=$(git rev-parse HEAD 2>/dev/null) +[ ${#BASE} -eq 40 ] || fail "could not resolve the base commit in $CWD" +echo "$BASE" > "$M/base" +# Images are built with history truncated at the base. If one is not, the fix could be read out of git log, +# so .git is hidden while the agent works and put back for grading. +LATER=$(git rev-list --all --not "$BASE" 2>/dev/null | head -n 5 | grep -c . || true) +rm -f /tmp/fail.log /tmp/pass.log /tmp/patch.diff /tmp/test_patch.diff /tmp/*.log 2>/dev/null; rm -rf /tmp/claude-0 /tmp/claude-* /tmp/testem-* /tmp/puppeteer_dev_chrome_profile-* 2>/dev/null; rm -f /tmp/test_files.json 2>/dev/null; rm -rf /tmp/jest_* /tmp/jest-* /tmp/build /tmp/build_env 2>/dev/null; rm -rf /tmp/pytest-of-root /tmp/pytest-* /tmp/.pytest_cache /tmp/__pycache__ 2>/dev/null; rm -rf /tmp/go-build* /tmp/standards /tmp/wordpress /tmp/zig-* /tmp/testbase /tmp/testbed 2>/dev/null; rm -f /tmp/tmp*.tmp /tmp/*.bak /tmp/expect* /tmp/butwas* 2>/dev/null; rm -rf /root/.cache/go-build 2>/dev/null; rm -rf /tests 2>/dev/null; find /logs -mindepth 1 -delete 2>/dev/null; mkdir -p /logs/agent /logs/verifier /logs/artifacts; chmod 777 /logs/agent /logs/verifier /logs/artifacts; find /var/log -type f -delete 2>/dev/null || true; rm -rf /var/lib/postgresql/*/*/log /var/lib/postgresql/*/*/pg_log 2>/dev/null || true; find /var/lib/mysql /var/lib/mongodb -type f -name '*.log' -delete 2>/dev/null || true; rm -rf /root/.npm/_logs /root/.babel.json /root/.pytest_cache 2>/dev/null || true; find / -maxdepth 4 -xdev -name task_description.md -path '*/.build_env/*' -delete 2>/dev/null || true; true +git clean -fdx --exclude=node_modules --exclude=bower_components --exclude=.husky --exclude=vendor --exclude=third_party --exclude=_deps --exclude=vcpkg_installed --exclude=.venv --exclude=venv --exclude=.gradle --exclude=target --exclude=.build --exclude=lib --exclude=.bundle --exclude=Manifest.toml --exclude=_build --exclude=.stack-work --exclude=dist-newstyle >/dev/null 2>&1 +find /root/.m2 -type f \( -name '*-SNAPSHOT.jar' -o -name '*-SNAPSHOT-sources.jar' -o -name '*-SNAPSHOT-tests.jar' -o -name '*-SNAPSHOT-test-sources.jar' \) -delete 2>/dev/null; rm -rf /root/.julia/compiled 2>/dev/null; rm -rf /root/.gradle/caches/build-cache-* /root/.gradle/daemon 2>/dev/null; rm -rf /root/.gradle/caches/*/scripts /root/.gradle/caches/jars-* 2>/dev/null; rm -rf /root/.cache/bazel 2>/dev/null; true +if [ "$LATER" -gt 0 ]; then + mv "$CWD/.git" "$M/git-hidden" + echo "history not truncated at ${BASE:0:12}: .git hidden while the agent works" +fi +write_blocklist + +touch "$M/ready" +echo "setup done" diff --git a/tasks/format-code-task-002231/tests/test.patch b/tasks/format-code-task-002231/tests/test.patch new file mode 100644 index 0000000000000000000000000000000000000000..e084283a3e1cfbcd47729a3cbd7e0c9fc121ddf2 --- /dev/null +++ b/tasks/format-code-task-002231/tests/test.patch @@ -0,0 +1,135 @@ +diff --git a/pandas/tests/frame/methods/test_dropna.py b/pandas/tests/frame/methods/test_dropna.py +index f072cd04f4..24e07a0c82 100644 +--- a/pandas/tests/frame/methods/test_dropna.py ++++ b/pandas/tests/frame/methods/test_dropna.py +@@ -272,3 +272,56 @@ class TestDataFrameMissingData: + + with pytest.raises(TypeError, match=msg): + df.dropna(how=None, thresh=None) ++ ++ def test_dropna_ignore_index_issue_example(self): ++ ++ df = DataFrame({"A": [0, pd.NA, 1]}) ++ result = df.dropna(ignore_index=True) ++ expected = df.dropna().reset_index(drop=True) ++ tm.assert_frame_equal(result, expected) ++ ++ assert list(result.index) == [0, 1] ++ ++ def test_dropna_ignore_index_true_resets_index(self): ++ ++ df = DataFrame( ++ {"A": [1.0, np.nan, 3.0, 4.0], "B": [10, 20, 30, np.nan]}, ++ index=[100, 200, 300, 400], ++ ) ++ result = df.dropna(ignore_index=True) ++ expected = DataFrame({"A": [1.0, 4.0], "B": [10.0, np.nan]}, index=[0, 1]) ++ ++ expected = df.dropna().reset_index(drop=True) ++ tm.assert_frame_equal(result, expected) ++ assert list(result.index) == list(range(len(result))) ++ ++ def test_dropna_ignore_index_false_preserves_index(self): ++ ++ df = DataFrame({"A": [1.0, np.nan, 3.0]}, index=[10, 20, 30]) ++ result = df.dropna(ignore_index=False) ++ assert list(result.index) == [10, 30] ++ ++ def test_dropna_ignore_index_default_preserves_index(self): ++ ++ df = DataFrame({"A": [1.0, np.nan, 3.0]}, index=[10, 20, 30]) ++ result = df.dropna() ++ assert list(result.index) == [10, 30] ++ ++ def test_dropna_ignore_index_inplace(self): ++ ++ df = DataFrame({"A": [1.0, np.nan, 3.0]}, index=[10, 20, 30]) ++ ret = df.dropna(ignore_index=True, inplace=True) ++ assert ret is None ++ assert list(df.index) == [0, 1] ++ tm.assert_frame_equal( ++ df, DataFrame({"A": [1.0, 3.0]}, index=[0, 1]) ++ ) ++ ++ def test_dropna_ignore_index_no_nan(self): ++ ++ df = DataFrame({"A": [1.0, 2.0, 3.0]}, index=[10, 20, 30]) ++ result = df.dropna(ignore_index=True) ++ assert list(result.index) == [0, 1, 2] ++ tm.assert_frame_equal( ++ result, DataFrame({"A": [1.0, 2.0, 3.0]}, index=[0, 1, 2]) ++ ) +diff --git a/pandas/tests/series/methods/test_dropna.py b/pandas/tests/series/methods/test_dropna.py +index 5bff7306fa..a0c306393a 100644 +--- a/pandas/tests/series/methods/test_dropna.py ++++ b/pandas/tests/series/methods/test_dropna.py +@@ -1,6 +1,7 @@ + import numpy as np + import pytest + ++import pandas as pd + from pandas import ( + DatetimeIndex, + IntervalIndex, +@@ -101,3 +102,39 @@ class TestDropna: + ) + assert result.dtype == "datetime64[ns, Asia/Tokyo]" + tm.assert_series_equal(result, expected) ++ ++ def test_dropna_ignore_index_issue_example(self): ++ ++ ser = Series([0, pd.NA, 1]) ++ result = ser.dropna(ignore_index=True) ++ expected = ser.dropna().reset_index(drop=True) ++ tm.assert_series_equal(result, expected) ++ assert list(result.index) == [0, 1] ++ ++ def test_dropna_ignore_index_true_resets_index(self): ++ ++ ser = Series([1.0, np.nan, 3.0], index=["x", "y", "z"]) ++ result = ser.dropna(ignore_index=True) ++ expected = Series([1.0, 3.0], index=[0, 1]) ++ tm.assert_series_equal(result, expected) ++ assert list(result.index) == [0, 1] ++ ++ def test_dropna_ignore_index_false_preserves_index(self): ++ ser = Series([1.0, np.nan, 3.0], index=["x", "y", "z"]) ++ result = ser.dropna(ignore_index=False) ++ assert list(result.index) == ["x", "z"] ++ ++ def test_dropna_ignore_index_inplace(self): ++ ser = Series([1.0, np.nan, 3.0], index=["x", "y", "z"]) ++ ret = ser.dropna(ignore_index=True, inplace=True) ++ assert ret is None ++ tm.assert_series_equal(ser, Series([1.0, 3.0], index=[0, 1])) ++ ++ def test_dropna_ignore_index_no_can_hold_na(self): ++ ++ ++ ser = Series([1, 2, 3], index=["a", "b", "c"]) ++ assert ser._can_hold_na is False ++ result = ser.dropna(ignore_index=True) ++ tm.assert_series_equal(result, Series([1, 2, 3], index=[0, 1, 2])) ++ assert list(result.index) == [0, 1, 2] +diff --git a/test_commands.json b/test_commands.json +new file mode 100644 +index 0000000000..ce96a3d565 +--- /dev/null ++++ b/test_commands.json +@@ -0,0 +1,3 @@ ++{ ++ "test_commands": ["python -m pytest pandas/tests/frame/methods/test_dropna.py pandas/tests/series/methods/test_dropna.py -v"] ++} +diff --git a/mimo_test_command.sh b/mimo_test_command.sh +new file mode 100755 +--- /dev/null ++++ b/mimo_test_command.sh +@@ -0,0 +1,8 @@ ++#!/usr/bin/env bash ++ ++set -uo pipefail ++cd /testbed ++rc=0 ++python -m pytest pandas/tests/frame/methods/test_dropna.py pandas/tests/series/methods/test_dropna.py -v ++rc=$(( rc | $? )) ++exit $rc diff --git a/tasks/format-code-task-002231/tests/test.sh b/tasks/format-code-task-002231/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..a2197d65da1c31b0a67e50aadd2b1c8bbca17c1f --- /dev/null +++ b/tasks/format-code-task-002231/tests/test.sh @@ -0,0 +1,40 @@ +#!/bin/bash +# Code grading, mimoagent opensource_code.py: reset the files the hidden test patch touches, apply it, run the +# task's test command; reward 1 when it exits 0. A testbed failure (reset or apply) writes no reward: not scored. +M=/var/lib/mimo +CWD=/testbed +V=/logs/verifier +mkdir -p "$V" +BASE=$(cat "$M/base" 2>/dev/null) || { echo "setup never ran (no $M/base)" >&2; exit 1; } +cd "$CWD" || exit 1 +if [ -d "$M/git-hidden" ]; then rm -rf "$CWD/.git"; mv "$M/git-hidden" "$CWD/.git"; fi +# the agent's change against the base, so its own commits count too +git add -A >/dev/null 2>&1 && git -c core.fileMode=false diff --cached "$BASE" > "$V/agent.diff" +git reset -q +if ! ( +while IFS= read -r tf; do + [ -z "$tf" ] && continue + if git cat-file -e $BASE:"$tf" 2>/dev/null; then + git checkout $BASE -- "$tf" 2>/dev/null || true + else + git rm -f --cached "$tf" >/dev/null 2>&1 || true + rm -f "$tf" + fi +done <<'EOF_RESET_TEST_FILES' +pandas/tests/frame/methods/test_dropna.py +pandas/tests/series/methods/test_dropna.py +test_commands.json +mimo_test_command.sh +EOF_RESET_TEST_FILES + +); then echo "could not reset the test files (testbed problem, not scored)" >&2; exit 1; fi +if ! git apply --verbose /tests/test.patch > "$V/apply.log" 2>&1; then + cat "$V/apply.log" >&2 + echo "the hidden tests could not be applied (testbed problem, not scored)" >&2 + exit 1 +fi +timeout 1800 sh -c "$(cat /tests/test_command.sh)" > "$V/test_output.log" 2>&1 +RC=$? +tail -c 12000 "$V/test_output.log" +if [ $RC -eq 0 ]; then echo 1 > "$V/reward.txt"; else echo 0 > "$V/reward.txt"; fi +echo "test command exited $RC" diff --git a/tasks/format-code-task-002231/tests/test_command.sh b/tasks/format-code-task-002231/tests/test_command.sh new file mode 100644 index 0000000000000000000000000000000000000000..7cb23076694ad17d72e8296d62b2b240083e36db --- /dev/null +++ b/tasks/format-code-task-002231/tests/test_command.sh @@ -0,0 +1 @@ +bash /testbed/mimo_test_command.sh \ No newline at end of file diff --git a/tasks/format-code-task-002238/environment/Dockerfile b/tasks/format-code-task-002238/environment/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..c5288fef265aef75e37720f6ffb7f7f08a193737 --- /dev/null +++ b/tasks/format-code-task-002238/environment/Dockerfile @@ -0,0 +1,3 @@ +# The task's image, pinned by digest (the same as [environment].docker_image). +# Setup runs at start from [environment.healthcheck]; environment/setup/ is its readable copy. +FROM docker.io/xiaomimimo/mimo-v2.6-rl-oss@sha256:692a0988d92be527d91358910c290761e5d98c6ba61c0eb2ac197eaad0641d9c diff --git a/tasks/format-code-task-002238/environment/setup/files/blocklist b/tasks/format-code-task-002238/environment/setup/files/blocklist new file mode 100644 index 0000000000000000000000000000000000000000..a8e4bdc4c7d9b739c047a3cb58ea72a1bb05bcbc --- /dev/null +++ b/tasks/format-code-task-002238/environment/setup/files/blocklist @@ -0,0 +1,33 @@ +# mimo answer-leak blocklist (mimoagent) +0.0.0.0 github.com +0.0.0.0 www.github.com +0.0.0.0 api.github.com +0.0.0.0 raw.githubusercontent.com +0.0.0.0 codeload.github.com +0.0.0.0 objects.githubusercontent.com +0.0.0.0 gist.github.com +0.0.0.0 gist.githubusercontent.com +0.0.0.0 gitlab.com +0.0.0.0 bitbucket.org +0.0.0.0 sourceforge.net +0.0.0.0 git.kernel.org +0.0.0.0 chromium.googlesource.com +0.0.0.0 android.googlesource.com +0.0.0.0 sourcegraph.com +0.0.0.0 bugs.chromium.org +0.0.0.0 issues.oss-fuzz.com +0.0.0.0 oss-fuzz.com +0.0.0.0 osv.dev +0.0.0.0 api.osv.dev +0.0.0.0 bugzilla.mozilla.org +0.0.0.0 proxy.golang.org +0.0.0.0 sum.golang.org +0.0.0.0 pkg.go.dev +0.0.0.0 google.com +0.0.0.0 www.google.com +0.0.0.0 bing.com +0.0.0.0 www.bing.com +0.0.0.0 duckduckgo.com +0.0.0.0 html.duckduckgo.com +0.0.0.0 search.brave.com +0.0.0.0 stackoverflow.com diff --git a/tasks/format-code-task-002238/environment/setup/setup.sh b/tasks/format-code-task-002238/environment/setup/setup.sh new file mode 100644 index 0000000000000000000000000000000000000000..e9eb7daf39f9542bd095367feee457f3da77e492 --- /dev/null +++ b/tasks/format-code-task-002238/environment/setup/setup.sh @@ -0,0 +1,34 @@ +#!/bin/bash +# Runs once, as root, before the agent starts: Harbor's [environment.healthcheck] unpacks this folder into +# /var/lib/mimo and runs it. Generated by mimo_harbor; see its README for how each step maps to Xiaomi's harness. +M=/var/lib/mimo +[ -f "$M/ready" ] && exit 0 +chmod 700 "$M" +fail() { echo "setup: $*" >&2; exit 1; } +# the answer-leak blocklist (mimoagent), applied to /etc/hosts by the agent right after it installs +write_blocklist() { cp "$M/files/blocklist" "$M/blocklist"; } + +# Code: mimoagent environments/datasets/opensource_code.py + base.py, as the explorer runs it (app/runner/domains.py Code). +CWD=/workspace/repo +git config --global --add safe.directory "$CWD" +cd "$CWD" || fail "no working directory $CWD" +if ! git rev-parse --git-dir >/dev/null 2>&1; then # a bare source tree: give it a baseline commit + git init -q && git add -A && git -c user.name=mimo -c user.email=mimo@localhost commit -q -m baseline --allow-empty +fi +BASE=$(git rev-parse HEAD 2>/dev/null) +[ ${#BASE} -eq 40 ] || fail "could not resolve the base commit in $CWD" +echo "$BASE" > "$M/base" +# Images are built with history truncated at the base. If one is not, the fix could be read out of git log, +# so .git is hidden while the agent works and put back for grading. +LATER=$(git rev-list --all --not "$BASE" 2>/dev/null | head -n 5 | grep -c . || true) +rm -f /tmp/fail.log /tmp/pass.log /tmp/patch.diff /tmp/test_patch.diff /tmp/*.log 2>/dev/null; rm -rf /tmp/claude-0 /tmp/claude-* /tmp/testem-* /tmp/puppeteer_dev_chrome_profile-* 2>/dev/null; rm -f /tmp/test_files.json 2>/dev/null; rm -rf /tmp/jest_* /tmp/jest-* /tmp/build /tmp/build_env 2>/dev/null; rm -rf /tmp/pytest-of-root /tmp/pytest-* /tmp/.pytest_cache /tmp/__pycache__ 2>/dev/null; rm -rf /tmp/go-build* /tmp/standards /tmp/wordpress /tmp/zig-* /tmp/testbase /tmp/testbed 2>/dev/null; rm -f /tmp/tmp*.tmp /tmp/*.bak /tmp/expect* /tmp/butwas* 2>/dev/null; rm -rf /root/.cache/go-build 2>/dev/null; rm -rf /tests 2>/dev/null; find /logs -mindepth 1 -delete 2>/dev/null; mkdir -p /logs/agent /logs/verifier /logs/artifacts; chmod 777 /logs/agent /logs/verifier /logs/artifacts; find /var/log -type f -delete 2>/dev/null || true; rm -rf /var/lib/postgresql/*/*/log /var/lib/postgresql/*/*/pg_log 2>/dev/null || true; find /var/lib/mysql /var/lib/mongodb -type f -name '*.log' -delete 2>/dev/null || true; rm -rf /root/.npm/_logs /root/.babel.json /root/.pytest_cache 2>/dev/null || true; find / -maxdepth 4 -xdev -name task_description.md -path '*/.build_env/*' -delete 2>/dev/null || true; true +git clean -fdx --exclude=node_modules --exclude=bower_components --exclude=.husky --exclude=vendor --exclude=third_party --exclude=_deps --exclude=vcpkg_installed --exclude=.venv --exclude=venv --exclude=.gradle --exclude=target --exclude=.build --exclude=lib --exclude=.bundle --exclude=Manifest.toml --exclude=_build --exclude=.stack-work --exclude=dist-newstyle >/dev/null 2>&1 +find /root/.m2 -type f \( -name '*-SNAPSHOT.jar' -o -name '*-SNAPSHOT-sources.jar' -o -name '*-SNAPSHOT-tests.jar' -o -name '*-SNAPSHOT-test-sources.jar' \) -delete 2>/dev/null; rm -rf /root/.julia/compiled 2>/dev/null; rm -rf /root/.gradle/caches/build-cache-* /root/.gradle/daemon 2>/dev/null; rm -rf /root/.gradle/caches/*/scripts /root/.gradle/caches/jars-* 2>/dev/null; rm -rf /root/.cache/bazel 2>/dev/null; true +if [ "$LATER" -gt 0 ]; then + mv "$CWD/.git" "$M/git-hidden" + echo "history not truncated at ${BASE:0:12}: .git hidden while the agent works" +fi +write_blocklist + +touch "$M/ready" +echo "setup done" diff --git a/tasks/format-code-task-002238/tests/test.patch b/tasks/format-code-task-002238/tests/test.patch new file mode 100644 index 0000000000000000000000000000000000000000..4f76ffc5c0b2691495fb63b5e405facfd3d72653 --- /dev/null +++ b/tasks/format-code-task-002238/tests/test.patch @@ -0,0 +1,520 @@ +diff --git a/usercase-test-coderl/multipool_stateful_test.go b/usercase-test-coderl/multipool_stateful_test.go +new file mode 100644 +--- /dev/null ++++ b/usercase-test-coderl/multipool_stateful_test.go +@@ -0,0 +1,491 @@ ++package usercase_test_coderl ++ ++import ( ++ "context" ++ "errors" ++ "os" ++ "reflect" ++ "runtime" ++ "sort" ++ "strings" ++ "testing" ++ "time" ++ ++ "github.com/panjf2000/ants/v2" ++) ++ ++ ++ ++ ++ ++ ++func waitUntil(t *testing.T, label string, condition func() bool) { ++ t.Helper() ++ deadline := time.Now().Add(3 * time.Second) ++ for time.Now().Before(deadline) { ++ if condition() { ++ return ++ } ++ time.Sleep(10 * time.Millisecond) ++ } ++ t.Fatalf("timed out waiting for %s", label) ++} ++ ++func requireEqual(t *testing.T, label string, got, want any) { ++ t.Helper() ++ if !reflect.DeepEqual(got, want) { ++ t.Fatalf("%s: got %v, want %v", label, got, want) ++ } ++} ++ ++func requireErrorIs(t *testing.T, label string, got error, want error) { ++ t.Helper() ++ if !errors.Is(got, want) { ++ t.Fatalf("%s: got %v, want %v", label, got, want) ++ } ++} ++ ++func runningByIndex(t *testing.T, mp interface { ++ RunningByIndex(int) (int, error) ++}, idx int) int { ++ t.Helper() ++ n, err := mp.RunningByIndex(idx) ++ if err != nil { ++ t.Fatalf("RunningByIndex(%d): %v", idx, err) ++ } ++ return n ++} ++ ++func freeByIndex(t *testing.T, mp interface { ++ FreeByIndex(int) (int, error) ++}, idx int) int { ++ t.Helper() ++ n, err := mp.FreeByIndex(idx) ++ if err != nil { ++ t.Fatalf("FreeByIndex(%d): %v", idx, err) ++ } ++ return n ++} ++ ++func waitingByIndex(t *testing.T, mp interface { ++ WaitingByIndex(int) (int, error) ++}, idx int) int { ++ t.Helper() ++ n, err := mp.WaitingByIndex(idx) ++ if err != nil { ++ t.Fatalf("WaitingByIndex(%d): %v", idx, err) ++ } ++ return n ++} ++ ++func countOpenFDs(t *testing.T) int { ++ t.Helper() ++ entries, err := os.ReadDir("/proc/self/fd") ++ if err != nil { ++ t.Fatalf("count open fds: %v", err) ++ } ++ return len(entries) ++} ++ ++func TestMultiPoolConstructorValidationUsesPublicErrors(t *testing.T) { ++ ++ ++ _, err := ants.NewMultiPool(0, 2, ants.RoundRobin) ++ requireErrorIs(t, "raw size 0", err, ants.ErrInvalidMultiPoolSize) ++ _, err = ants.NewMultiPool(2, 2, ants.LoadBalancingStrategy(99)) ++ requireErrorIs(t, "raw invalid strategy", err, ants.ErrInvalidLoadBalancingStrategy) ++ _, err = ants.NewMultiPool(2, 2, ants.RoundRobin, ants.WithExpiryDuration(-1)) ++ requireErrorIs(t, "raw invalid expiry", err, ants.ErrInvalidPoolExpiry) ++ ++ _, err = ants.NewMultiPoolWithFunc(0, 2, func(any) {}, ants.RoundRobin) ++ requireErrorIs(t, "with func size 0", err, ants.ErrInvalidMultiPoolSize) ++ _, err = ants.NewMultiPoolWithFunc(2, 2, func(any) {}, ants.LoadBalancingStrategy(99)) ++ requireErrorIs(t, "with func invalid strategy", err, ants.ErrInvalidLoadBalancingStrategy) ++ _, err = ants.NewMultiPoolWithFunc(2, 2, func(any) {}, ants.RoundRobin, ants.WithExpiryDuration(-1)) ++ requireErrorIs(t, "with func invalid expiry", err, ants.ErrInvalidPoolExpiry) ++ ++ _, err = ants.NewMultiPoolWithFuncGeneric[int](0, 2, func(int) {}, ants.RoundRobin) ++ requireErrorIs(t, "generic size 0", err, ants.ErrInvalidMultiPoolSize) ++ _, err = ants.NewMultiPoolWithFuncGeneric[int](2, 2, func(int) {}, ants.LoadBalancingStrategy(99)) ++ requireErrorIs(t, "generic invalid strategy", err, ants.ErrInvalidLoadBalancingStrategy) ++ _, err = ants.NewMultiPoolWithFuncGeneric[int](2, 2, func(int) {}, ants.RoundRobin, ants.WithExpiryDuration(-1)) ++ requireErrorIs(t, "generic invalid expiry", err, ants.ErrInvalidPoolExpiry) ++} ++ ++func TestRawMultiPoolRoundRobinMetricsPerPoolAndCloseLifecycle(t *testing.T) { ++ ++ ++ block := make(chan struct{}) ++ mp, err := ants.NewMultiPool(10, 5, ants.RoundRobin) ++ if err != nil { ++ t.Fatalf("NewMultiPool: %v", err) ++ } ++ ++ requireEqual(t, "fresh Running", mp.Running(), 0) ++ requireEqual(t, "fresh Free", mp.Free(), 50) ++ requireEqual(t, "fresh Waiting", mp.Waiting(), 0) ++ requireEqual(t, "fresh Cap", mp.Cap(), 50) ++ requireEqual(t, "fresh IsClosed", mp.IsClosed(), false) ++ ++ for i := 0; i < 50; i++ { ++ if err := mp.Submit(func() { <-block }); err != nil { ++ t.Fatalf("Submit(%d): %v", i, err) ++ } ++ } ++ waitUntil(t, "50 raw workers", func() bool { return mp.Running() == 50 }) ++ ++ requireEqual(t, "full Running", mp.Running(), 50) ++ requireEqual(t, "full Free", mp.Free(), 0) ++ requireEqual(t, "full Waiting", mp.Waiting(), 0) ++ requireEqual(t, "full Cap", mp.Cap(), 50) ++ requireEqual(t, "full IsClosed", mp.IsClosed(), false) ++ for idx := 0; idx < 10; idx++ { ++ requireEqual(t, "per-pool Running", runningByIndex(t, mp, idx), 5) ++ requireEqual(t, "per-pool Free", freeByIndex(t, mp, idx), 0) ++ requireEqual(t, "per-pool Waiting", waitingByIndex(t, mp, idx), 0) ++ } ++ ++ _, err = mp.RunningByIndex(-1) ++ requireErrorIs(t, "RunningByIndex -1", err, ants.ErrInvalidPoolIndex) ++ _, err = mp.FreeByIndex(10) ++ requireErrorIs(t, "FreeByIndex 10", err, ants.ErrInvalidPoolIndex) ++ _, err = mp.WaitingByIndex(10) ++ requireErrorIs(t, "WaitingByIndex 10", err, ants.ErrInvalidPoolIndex) ++ ++ close(block) ++ err = mp.ReleaseTimeout(2 * time.Second) ++ requireEqual(t, "first ReleaseTimeout error", err, nil) ++ requireEqual(t, "released Running", mp.Running(), 0) ++ requireEqual(t, "released Waiting", mp.Waiting(), 0) ++ ++ releasedFree, releasedCap := mp.Free(), mp.Cap() ++ if releasedFree < 0 || releasedCap < 0 || releasedFree > releasedCap { ++ t.Fatalf("released metrics out of range: Free=%d Cap=%d", releasedFree, releasedCap) ++ } ++ requireEqual(t, "released IsClosed", mp.IsClosed(), true) ++ ++ err = mp.ReleaseTimeout(2 * time.Second) ++ requireErrorIs(t, "second ReleaseTimeout", err, ants.ErrPoolClosed) ++ err = mp.Submit(func() {}) ++ requireErrorIs(t, "Submit after close", err, ants.ErrPoolClosed) ++} ++ ++func TestRoundRobinFallsBackToLeastBusyPoolWhenSelectedPoolIsOverloaded(t *testing.T) { ++ ++ ++ ++ rotateFirstBlock := make(chan struct{}) ++ rotateSecondBlock := make(chan struct{}) ++ rotateThirdBlock := make(chan struct{}) ++ rotateMP, err := ants.NewMultiPool(2, 2, ants.RoundRobin) ++ if err != nil { ++ t.Fatalf("NewMultiPool rotation check: %v", err) ++ } ++ err = rotateMP.Submit(func() { <-rotateFirstBlock }) ++ requireEqual(t, "rotation first submit error", err, nil) ++ waitUntil(t, "rotation one pool running", func() bool { return rotateMP.Running() == 1 }) ++ rotationFirstCounts := []int{runningByIndex(t, rotateMP, 0), runningByIndex(t, rotateMP, 1)} ++ rotationFirstIdx, rotationSecondIdx := -1, -1 ++ for idx, running := range rotationFirstCounts { ++ if running == 1 { ++ rotationFirstIdx = idx ++ } else if running == 0 { ++ rotationSecondIdx = idx ++ } ++ } ++ if rotationFirstIdx < 0 || rotationSecondIdx < 0 { ++ t.Fatalf("rotation first submit: got per-pool running %v, want one busy and one free", rotationFirstCounts) ++ } ++ err = rotateMP.Submit(func() { <-rotateSecondBlock }) ++ requireEqual(t, "rotation second submit error", err, nil) ++ waitUntil(t, "rotation second pool running", func() bool { return runningByIndex(t, rotateMP, rotationSecondIdx) == 1 }) ++ close(rotateSecondBlock) ++ waitUntil(t, "rotation second pool drained", func() bool { return runningByIndex(t, rotateMP, rotationSecondIdx) == 0 }) ++ err = rotateMP.Submit(func() { <-rotateThirdBlock }) ++ requireEqual(t, "rotation third submit error", err, nil) ++ waitUntil(t, "rotation first pool reused", func() bool { return runningByIndex(t, rotateMP, rotationFirstIdx) == 2 }) ++ requireEqual(t, "rotation first pool running", runningByIndex(t, rotateMP, rotationFirstIdx), 2) ++ requireEqual(t, "rotation second pool running", runningByIndex(t, rotateMP, rotationSecondIdx), 0) ++ close(rotateFirstBlock) ++ close(rotateThirdBlock) ++ requireEqual(t, "rotation ReleaseTimeout", rotateMP.ReleaseTimeout(2*time.Second), nil) ++ ++ firstBlock := make(chan struct{}) ++ fallbackBlock := make(chan struct{}) ++ mp, err := ants.NewMultiPool(2, 1, ants.RoundRobin, ants.WithNonblocking(true), ants.WithExpiryDuration(20*time.Millisecond)) ++ if err != nil { ++ t.Fatalf("NewMultiPool: %v", err) ++ } ++ ++ err = mp.Submit(func() { <-firstBlock }) ++ requireEqual(t, "first submit error", err, nil) ++ waitUntil(t, "one pool running", func() bool { return mp.Running() == 1 }) ++ firstPoolRunning := []int{runningByIndex(t, mp, 0), runningByIndex(t, mp, 1)} ++ ++ busyIdx, freeIdx := -1, -1 ++ for idx, running := range firstPoolRunning { ++ if running == 1 { ++ busyIdx = idx ++ } else if running == 0 { ++ freeIdx = idx ++ } ++ } ++ if busyIdx < 0 || freeIdx < 0 { ++ t.Fatalf("after first submit: got per-pool running %v, want one busy and one free", firstPoolRunning) ++ } ++ ++ quickDone := make(chan struct{}) ++ err = mp.Submit(func() { close(quickDone) }) ++ requireEqual(t, "second submit error", err, nil) ++ <-quickDone ++ waitUntil(t, "non-busy pool purged", func() bool { return runningByIndex(t, mp, freeIdx) == 0 }) ++ requireEqual(t, "before fallback busy pool running", runningByIndex(t, mp, busyIdx), 1) ++ requireEqual(t, "before fallback free pool running", runningByIndex(t, mp, freeIdx), 0) ++ ++ err = mp.Submit(func() { <-fallbackBlock }) ++ requireEqual(t, "fallback submit error", err, nil) ++ waitUntil(t, "fallback pool running", func() bool { return mp.Running() == 2 }) ++ requireEqual(t, "after fallback total Running", mp.Running(), 2) ++ requireEqual(t, "after fallback busy pool running", runningByIndex(t, mp, busyIdx), 1) ++ requireEqual(t, "after fallback free pool running", runningByIndex(t, mp, freeIdx), 1) ++ ++ close(firstBlock) ++ close(fallbackBlock) ++ requireEqual(t, "ReleaseTimeout", mp.ReleaseTimeout(2*time.Second), nil) ++} ++ ++func TestLeastTasksBalancesTowardFewestRunningWorkers(t *testing.T) { ++ ++ ++ block := make(chan struct{}) ++ mp, err := ants.NewMultiPool(3, 2, ants.LeastTasks) ++ if err != nil { ++ t.Fatalf("NewMultiPool: %v", err) ++ } ++ ++ for i := 0; i < 5; i++ { ++ if err := mp.Submit(func() { <-block }); err != nil { ++ t.Fatalf("Submit(%d): %v", i, err) ++ } ++ waitUntil(t, "least-tasks running count", func() bool { return mp.Running() == i+1 }) ++ } ++ ++ requireEqual(t, "least total Running", mp.Running(), 5) ++ requireEqual(t, "least total Free", mp.Free(), 1) ++ requireEqual(t, "least total Waiting", mp.Waiting(), 0) ++ requireEqual(t, "least total Cap", mp.Cap(), 6) ++ ++ perPoolRunning := []int{runningByIndex(t, mp, 0), runningByIndex(t, mp, 1), runningByIndex(t, mp, 2)} ++ sort.Ints(perPoolRunning) ++ requireEqual(t, "least per-pool running distribution", perPoolRunning, []int{1, 2, 2}) ++ ++ close(block) ++ requireEqual(t, "ReleaseTimeout", mp.ReleaseTimeout(2*time.Second), nil) ++} ++ ++func TestMultiPoolWithFuncInvokeMetricsAndClosedOrderingError(t *testing.T) { ++ ++ ++ block := make(chan struct{}) ++ mp, err := ants.NewMultiPoolWithFunc(2, 2, func(v any) { <-v.(chan struct{}) }, ants.RoundRobin) ++ if err != nil { ++ t.Fatalf("NewMultiPoolWithFunc: %v", err) ++ } ++ ++ requireEqual(t, "fresh Running", mp.Running(), 0) ++ requireEqual(t, "fresh Free", mp.Free(), 4) ++ requireEqual(t, "fresh Waiting", mp.Waiting(), 0) ++ requireEqual(t, "fresh Cap", mp.Cap(), 4) ++ for i := 0; i < 4; i++ { ++ if err := mp.Invoke(block); err != nil { ++ t.Fatalf("Invoke(%d): %v", i, err) ++ } ++ } ++ waitUntil(t, "with-func workers", func() bool { return mp.Running() == 4 }) ++ ++ requireEqual(t, "full Running", mp.Running(), 4) ++ requireEqual(t, "full Free", mp.Free(), 0) ++ requireEqual(t, "full Waiting", mp.Waiting(), 0) ++ requireEqual(t, "full Cap", mp.Cap(), 4) ++ requireEqual(t, "pool0 running", runningByIndex(t, mp, 0), 2) ++ requireEqual(t, "pool1 running", runningByIndex(t, mp, 1), 2) ++ ++ close(block) ++ requireEqual(t, "ReleaseTimeout", mp.ReleaseTimeout(2*time.Second), nil) ++ requireEqual(t, "released Running", mp.Running(), 0) ++ requireEqual(t, "released Waiting", mp.Waiting(), 0) ++ ++ releasedFree, releasedCap := mp.Free(), mp.Cap() ++ if releasedFree < 0 || releasedCap < 0 || releasedFree > releasedCap { ++ t.Fatalf("released metrics out of range: Free=%d Cap=%d", releasedFree, releasedCap) ++ } ++ requireEqual(t, "released IsClosed", mp.IsClosed(), true) ++ requireErrorIs(t, "second ReleaseTimeout", mp.ReleaseTimeout(2*time.Second), ants.ErrPoolClosed) ++ requireErrorIs(t, "Invoke after close", mp.Invoke(nil), ants.ErrPoolClosed) ++} ++ ++func TestGenericMultiPoolInvokeMetricsAndClosedOrderingError(t *testing.T) { ++ ++ ++ block := make(chan struct{}) ++ mp, err := ants.NewMultiPoolWithFuncGeneric[chan struct{}](2, 2, func(v chan struct{}) { <-v }, ants.RoundRobin) ++ if err != nil { ++ t.Fatalf("NewMultiPoolWithFuncGeneric: %v", err) ++ } ++ ++ requireEqual(t, "fresh Running", mp.Running(), 0) ++ requireEqual(t, "fresh Free", mp.Free(), 4) ++ requireEqual(t, "fresh Waiting", mp.Waiting(), 0) ++ requireEqual(t, "fresh Cap", mp.Cap(), 4) ++ for i := 0; i < 4; i++ { ++ if err := mp.Invoke(block); err != nil { ++ t.Fatalf("Invoke(%d): %v", i, err) ++ } ++ } ++ waitUntil(t, "generic workers", func() bool { return mp.Running() == 4 }) ++ ++ requireEqual(t, "full Running", mp.Running(), 4) ++ requireEqual(t, "full Free", mp.Free(), 0) ++ requireEqual(t, "full Waiting", mp.Waiting(), 0) ++ requireEqual(t, "full Cap", mp.Cap(), 4) ++ requireEqual(t, "pool0 running", runningByIndex(t, mp, 0), 2) ++ requireEqual(t, "pool1 running", runningByIndex(t, mp, 1), 2) ++ ++ close(block) ++ requireEqual(t, "ReleaseTimeout", mp.ReleaseTimeout(2*time.Second), nil) ++ requireEqual(t, "released Running", mp.Running(), 0) ++ requireEqual(t, "released Waiting", mp.Waiting(), 0) ++ ++ releasedFree, releasedCap := mp.Free(), mp.Cap() ++ if releasedFree < 0 || releasedCap < 0 || releasedFree > releasedCap { ++ t.Fatalf("released metrics out of range: Free=%d Cap=%d", releasedFree, releasedCap) ++ } ++ requireEqual(t, "released IsClosed", mp.IsClosed(), true) ++ requireErrorIs(t, "second ReleaseTimeout", mp.ReleaseTimeout(2*time.Second), ants.ErrPoolClosed) ++ requireErrorIs(t, "Invoke after close", mp.Invoke(nil), ants.ErrPoolClosed) ++} ++ ++func TestReleaseContextCanceledReportsPoolIndex(t *testing.T) { ++ ++ ++ block := make(chan struct{}) ++ mp, err := ants.NewMultiPool(1, 1, ants.RoundRobin) ++ if err != nil { ++ t.Fatalf("NewMultiPool: %v", err) ++ } ++ defer close(block) ++ ++ err = mp.Submit(func() { <-block }) ++ requireEqual(t, "submit error", err, nil) ++ waitUntil(t, "one worker", func() bool { return mp.Running() == 1 }) ++ ++ ctx, cancel := context.WithCancel(context.Background()) ++ cancel() ++ err = mp.ReleaseContext(ctx) ++ if err == nil { ++ t.Fatalf("ReleaseContext canceled: got nil, want error including pool index") ++ } ++ ++ if !strings.Contains(err.Error(), "0") { ++ t.Fatalf("ReleaseContext canceled message: got %q, want it to include pool index 0", err.Error()) ++ } ++ requireEqual(t, "canceled release IsClosed", mp.IsClosed(), true) ++} ++ ++func TestRebootReopensReleasedMultiPoolAndTuneResizesEachPool(t *testing.T) { ++ ++ ++ mp, err := ants.NewMultiPool(2, 2, ants.RoundRobin) ++ if err != nil { ++ t.Fatalf("NewMultiPool: %v", err) ++ } ++ requireEqual(t, "fresh Cap", mp.Cap(), 4) ++ requireEqual(t, "fresh Free", mp.Free(), 4) ++ requireEqual(t, "fresh IsClosed", mp.IsClosed(), false) ++ ++ mp.Tune(3) ++ requireEqual(t, "tuned Cap", mp.Cap(), 6) ++ requireEqual(t, "tuned Free", mp.Free(), 6) ++ ++ requireEqual(t, "ReleaseTimeout", mp.ReleaseTimeout(2*time.Second), nil) ++ requireEqual(t, "after release IsClosed", mp.IsClosed(), true) ++ mp.Reboot() ++ requireEqual(t, "after reboot IsClosed", mp.IsClosed(), false) ++ requireEqual(t, "after reboot Cap", mp.Cap(), 6) ++ requireEqual(t, "after reboot Free", mp.Free(), 6) ++ ++ done := make(chan struct{}) ++ err = mp.Submit(func() { close(done) }) ++ requireEqual(t, "submit after reboot", err, nil) ++ <-done ++ requireEqual(t, "final ReleaseTimeout", mp.ReleaseTimeout(2*time.Second), nil) ++} ++ ++func TestTwoMultiPoolInstancesKeepIndependentState(t *testing.T) { ++ ++ ++ block := make(chan struct{}) ++ a, err := ants.NewMultiPool(2, 2, ants.RoundRobin) ++ if err != nil { ++ t.Fatalf("NewMultiPool a: %v", err) ++ } ++ b, err := ants.NewMultiPool(2, 2, ants.RoundRobin) ++ if err != nil { ++ t.Fatalf("NewMultiPool b: %v", err) ++ } ++ ++ for i := 0; i < 3; i++ { ++ if err := a.Submit(func() { <-block }); err != nil { ++ t.Fatalf("a.Submit(%d): %v", i, err) ++ } ++ } ++ waitUntil(t, "instance a workers", func() bool { return a.Running() == 3 }) ++ ++ requireEqual(t, "a Running", a.Running(), 3) ++ requireEqual(t, "a Free", a.Free(), 1) ++ requireEqual(t, "a Waiting", a.Waiting(), 0) ++ requireEqual(t, "a Cap", a.Cap(), 4) ++ requireEqual(t, "b Running", b.Running(), 0) ++ requireEqual(t, "b Free", b.Free(), 4) ++ requireEqual(t, "b Waiting", b.Waiting(), 0) ++ requireEqual(t, "b Cap", b.Cap(), 4) ++ ++ close(block) ++ requireEqual(t, "a ReleaseTimeout", a.ReleaseTimeout(2*time.Second), nil) ++ requireEqual(t, "b ReleaseTimeout", b.ReleaseTimeout(2*time.Second), nil) ++} ++ ++func TestMultiPoolReleaseDoesNotLeakGoroutinesAcrossCycles(t *testing.T) { ++ ++ ++ runtime.GC() ++ time.Sleep(100 * time.Millisecond) ++ startGoroutines := runtime.NumGoroutine() ++ startFDs := countOpenFDs(t) ++ ++ for i := 0; i < 100; i++ { ++ done := make(chan struct{}) ++ mp, err := ants.NewMultiPool(3, 1, ants.RoundRobin) ++ if err != nil { ++ t.Fatalf("NewMultiPool(%d): %v", i, err) ++ } ++ if err := mp.Submit(func() { close(done) }); err != nil { ++ t.Fatalf("Submit(%d): %v", i, err) ++ } ++ <-done ++ if err := mp.ReleaseTimeout(2 * time.Second); err != nil { ++ t.Fatalf("ReleaseTimeout(%d): %v", i, err) ++ } ++ } ++ ++ runtime.GC() ++ time.Sleep(300 * time.Millisecond) ++ endGoroutines := runtime.NumGoroutine() ++ endFDs := countOpenFDs(t) ++ if endGoroutines > startGoroutines+30 { ++ t.Fatalf("goroutine leak floor: got %d, want at most %d", endGoroutines, startGoroutines+30) ++ } ++ if endFDs > startFDs+5 { ++ t.Fatalf("fd leak floor: got %d, want at most %d", endFDs, startFDs+5) ++ } ++} +diff --git a/mimo_test_command.sh b/mimo_test_command.sh +new file mode 100755 +--- /dev/null ++++ b/mimo_test_command.sh +@@ -0,0 +1,19 @@ ++#!/usr/bin/env bash ++ ++ ++ ++ ++export NODE_OPTIONS="${NODE_OPTIONS:-} --max-old-space-size=4096" ++export MAVEN_OPTS="${MAVEN_OPTS:-} -Xmx3g -XX:+UseG1GC" ++export GRADLE_OPTS="${GRADLE_OPTS:-} -Xmx3g -XX:+UseG1GC" ++export TEST_JVM_OPTS="${TEST_JVM_OPTS:-} -Xmx3g" ++set -e ++cd /workspace/repo ++set -euo pipefail ++ ++cd /workspace/repo ++export GOPROXY=off ++export GOSUMDB=off ++export GOTOOLCHAIN=local ++export GOFLAGS="${GOFLAGS:-} -mod=readonly" ++exec go test -v -count=1 ./usercase-test-coderl/... diff --git a/tasks/format-code-task-002238/tests/test.sh b/tasks/format-code-task-002238/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..7f297440dbd7989b5df5d553b540a50c9c9e0b4f --- /dev/null +++ b/tasks/format-code-task-002238/tests/test.sh @@ -0,0 +1,38 @@ +#!/bin/bash +# Code grading, mimoagent opensource_code.py: reset the files the hidden test patch touches, apply it, run the +# task's test command; reward 1 when it exits 0. A testbed failure (reset or apply) writes no reward: not scored. +M=/var/lib/mimo +CWD=/workspace/repo +V=/logs/verifier +mkdir -p "$V" +BASE=$(cat "$M/base" 2>/dev/null) || { echo "setup never ran (no $M/base)" >&2; exit 1; } +cd "$CWD" || exit 1 +if [ -d "$M/git-hidden" ]; then rm -rf "$CWD/.git"; mv "$M/git-hidden" "$CWD/.git"; fi +# the agent's change against the base, so its own commits count too +git add -A >/dev/null 2>&1 && git -c core.fileMode=false diff --cached "$BASE" > "$V/agent.diff" +git reset -q +if ! ( +while IFS= read -r tf; do + [ -z "$tf" ] && continue + if git cat-file -e $BASE:"$tf" 2>/dev/null; then + git checkout $BASE -- "$tf" 2>/dev/null || true + else + git rm -f --cached "$tf" >/dev/null 2>&1 || true + rm -f "$tf" + fi +done <<'EOF_RESET_TEST_FILES' +usercase-test-coderl/multipool_stateful_test.go +mimo_test_command.sh +EOF_RESET_TEST_FILES + +); then echo "could not reset the test files (testbed problem, not scored)" >&2; exit 1; fi +if ! git apply --verbose /tests/test.patch > "$V/apply.log" 2>&1; then + cat "$V/apply.log" >&2 + echo "the hidden tests could not be applied (testbed problem, not scored)" >&2 + exit 1 +fi +timeout 1800 sh -c "$(cat /tests/test_command.sh)" > "$V/test_output.log" 2>&1 +RC=$? +tail -c 12000 "$V/test_output.log" +if [ $RC -eq 0 ]; then echo 1 > "$V/reward.txt"; else echo 0 > "$V/reward.txt"; fi +echo "test command exited $RC" diff --git a/tasks/format-code-task-002238/tests/test_command.sh b/tasks/format-code-task-002238/tests/test_command.sh new file mode 100644 index 0000000000000000000000000000000000000000..88cb7810b836396c4869db31aeac7d4d4b189685 --- /dev/null +++ b/tasks/format-code-task-002238/tests/test_command.sh @@ -0,0 +1 @@ +bash /workspace/repo/mimo_test_command.sh \ No newline at end of file diff --git a/tasks/format-code-task-002240/environment/setup/files/blocklist b/tasks/format-code-task-002240/environment/setup/files/blocklist new file mode 100644 index 0000000000000000000000000000000000000000..a8e4bdc4c7d9b739c047a3cb58ea72a1bb05bcbc --- /dev/null +++ b/tasks/format-code-task-002240/environment/setup/files/blocklist @@ -0,0 +1,33 @@ +# mimo answer-leak blocklist (mimoagent) +0.0.0.0 github.com +0.0.0.0 www.github.com +0.0.0.0 api.github.com +0.0.0.0 raw.githubusercontent.com +0.0.0.0 codeload.github.com +0.0.0.0 objects.githubusercontent.com +0.0.0.0 gist.github.com +0.0.0.0 gist.githubusercontent.com +0.0.0.0 gitlab.com +0.0.0.0 bitbucket.org +0.0.0.0 sourceforge.net +0.0.0.0 git.kernel.org +0.0.0.0 chromium.googlesource.com +0.0.0.0 android.googlesource.com +0.0.0.0 sourcegraph.com +0.0.0.0 bugs.chromium.org +0.0.0.0 issues.oss-fuzz.com +0.0.0.0 oss-fuzz.com +0.0.0.0 osv.dev +0.0.0.0 api.osv.dev +0.0.0.0 bugzilla.mozilla.org +0.0.0.0 proxy.golang.org +0.0.0.0 sum.golang.org +0.0.0.0 pkg.go.dev +0.0.0.0 google.com +0.0.0.0 www.google.com +0.0.0.0 bing.com +0.0.0.0 www.bing.com +0.0.0.0 duckduckgo.com +0.0.0.0 html.duckduckgo.com +0.0.0.0 search.brave.com +0.0.0.0 stackoverflow.com diff --git a/tasks/format-code-task-002247/environment/Dockerfile b/tasks/format-code-task-002247/environment/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..ed2c22ccbe0db315cdeca1a3b16031a6d3726bdb --- /dev/null +++ b/tasks/format-code-task-002247/environment/Dockerfile @@ -0,0 +1,3 @@ +# The task's image, pinned by digest (the same as [environment].docker_image). +# Setup runs at start from [environment.healthcheck]; environment/setup/ is its readable copy. +FROM docker.io/xiaomimimo/mimo-v2.6-rl-oss@sha256:12ddddb616a20f84773a4392111bf640fde8248f12a2e02a4f18969a2621f22b diff --git a/tasks/format-code-task-002247/environment/setup/files/blocklist b/tasks/format-code-task-002247/environment/setup/files/blocklist new file mode 100644 index 0000000000000000000000000000000000000000..a8e4bdc4c7d9b739c047a3cb58ea72a1bb05bcbc --- /dev/null +++ b/tasks/format-code-task-002247/environment/setup/files/blocklist @@ -0,0 +1,33 @@ +# mimo answer-leak blocklist (mimoagent) +0.0.0.0 github.com +0.0.0.0 www.github.com +0.0.0.0 api.github.com +0.0.0.0 raw.githubusercontent.com +0.0.0.0 codeload.github.com +0.0.0.0 objects.githubusercontent.com +0.0.0.0 gist.github.com +0.0.0.0 gist.githubusercontent.com +0.0.0.0 gitlab.com +0.0.0.0 bitbucket.org +0.0.0.0 sourceforge.net +0.0.0.0 git.kernel.org +0.0.0.0 chromium.googlesource.com +0.0.0.0 android.googlesource.com +0.0.0.0 sourcegraph.com +0.0.0.0 bugs.chromium.org +0.0.0.0 issues.oss-fuzz.com +0.0.0.0 oss-fuzz.com +0.0.0.0 osv.dev +0.0.0.0 api.osv.dev +0.0.0.0 bugzilla.mozilla.org +0.0.0.0 proxy.golang.org +0.0.0.0 sum.golang.org +0.0.0.0 pkg.go.dev +0.0.0.0 google.com +0.0.0.0 www.google.com +0.0.0.0 bing.com +0.0.0.0 www.bing.com +0.0.0.0 duckduckgo.com +0.0.0.0 html.duckduckgo.com +0.0.0.0 search.brave.com +0.0.0.0 stackoverflow.com diff --git a/tasks/format-code-task-002247/environment/setup/setup.sh b/tasks/format-code-task-002247/environment/setup/setup.sh new file mode 100644 index 0000000000000000000000000000000000000000..e9eb7daf39f9542bd095367feee457f3da77e492 --- /dev/null +++ b/tasks/format-code-task-002247/environment/setup/setup.sh @@ -0,0 +1,34 @@ +#!/bin/bash +# Runs once, as root, before the agent starts: Harbor's [environment.healthcheck] unpacks this folder into +# /var/lib/mimo and runs it. Generated by mimo_harbor; see its README for how each step maps to Xiaomi's harness. +M=/var/lib/mimo +[ -f "$M/ready" ] && exit 0 +chmod 700 "$M" +fail() { echo "setup: $*" >&2; exit 1; } +# the answer-leak blocklist (mimoagent), applied to /etc/hosts by the agent right after it installs +write_blocklist() { cp "$M/files/blocklist" "$M/blocklist"; } + +# Code: mimoagent environments/datasets/opensource_code.py + base.py, as the explorer runs it (app/runner/domains.py Code). +CWD=/workspace/repo +git config --global --add safe.directory "$CWD" +cd "$CWD" || fail "no working directory $CWD" +if ! git rev-parse --git-dir >/dev/null 2>&1; then # a bare source tree: give it a baseline commit + git init -q && git add -A && git -c user.name=mimo -c user.email=mimo@localhost commit -q -m baseline --allow-empty +fi +BASE=$(git rev-parse HEAD 2>/dev/null) +[ ${#BASE} -eq 40 ] || fail "could not resolve the base commit in $CWD" +echo "$BASE" > "$M/base" +# Images are built with history truncated at the base. If one is not, the fix could be read out of git log, +# so .git is hidden while the agent works and put back for grading. +LATER=$(git rev-list --all --not "$BASE" 2>/dev/null | head -n 5 | grep -c . || true) +rm -f /tmp/fail.log /tmp/pass.log /tmp/patch.diff /tmp/test_patch.diff /tmp/*.log 2>/dev/null; rm -rf /tmp/claude-0 /tmp/claude-* /tmp/testem-* /tmp/puppeteer_dev_chrome_profile-* 2>/dev/null; rm -f /tmp/test_files.json 2>/dev/null; rm -rf /tmp/jest_* /tmp/jest-* /tmp/build /tmp/build_env 2>/dev/null; rm -rf /tmp/pytest-of-root /tmp/pytest-* /tmp/.pytest_cache /tmp/__pycache__ 2>/dev/null; rm -rf /tmp/go-build* /tmp/standards /tmp/wordpress /tmp/zig-* /tmp/testbase /tmp/testbed 2>/dev/null; rm -f /tmp/tmp*.tmp /tmp/*.bak /tmp/expect* /tmp/butwas* 2>/dev/null; rm -rf /root/.cache/go-build 2>/dev/null; rm -rf /tests 2>/dev/null; find /logs -mindepth 1 -delete 2>/dev/null; mkdir -p /logs/agent /logs/verifier /logs/artifacts; chmod 777 /logs/agent /logs/verifier /logs/artifacts; find /var/log -type f -delete 2>/dev/null || true; rm -rf /var/lib/postgresql/*/*/log /var/lib/postgresql/*/*/pg_log 2>/dev/null || true; find /var/lib/mysql /var/lib/mongodb -type f -name '*.log' -delete 2>/dev/null || true; rm -rf /root/.npm/_logs /root/.babel.json /root/.pytest_cache 2>/dev/null || true; find / -maxdepth 4 -xdev -name task_description.md -path '*/.build_env/*' -delete 2>/dev/null || true; true +git clean -fdx --exclude=node_modules --exclude=bower_components --exclude=.husky --exclude=vendor --exclude=third_party --exclude=_deps --exclude=vcpkg_installed --exclude=.venv --exclude=venv --exclude=.gradle --exclude=target --exclude=.build --exclude=lib --exclude=.bundle --exclude=Manifest.toml --exclude=_build --exclude=.stack-work --exclude=dist-newstyle >/dev/null 2>&1 +find /root/.m2 -type f \( -name '*-SNAPSHOT.jar' -o -name '*-SNAPSHOT-sources.jar' -o -name '*-SNAPSHOT-tests.jar' -o -name '*-SNAPSHOT-test-sources.jar' \) -delete 2>/dev/null; rm -rf /root/.julia/compiled 2>/dev/null; rm -rf /root/.gradle/caches/build-cache-* /root/.gradle/daemon 2>/dev/null; rm -rf /root/.gradle/caches/*/scripts /root/.gradle/caches/jars-* 2>/dev/null; rm -rf /root/.cache/bazel 2>/dev/null; true +if [ "$LATER" -gt 0 ]; then + mv "$CWD/.git" "$M/git-hidden" + echo "history not truncated at ${BASE:0:12}: .git hidden while the agent works" +fi +write_blocklist + +touch "$M/ready" +echo "setup done" diff --git a/tasks/format-code-task-002247/tests/test.patch b/tasks/format-code-task-002247/tests/test.patch new file mode 100644 index 0000000000000000000000000000000000000000..50abc7f00143bcfd5141a12c8a98a8063d99134f --- /dev/null +++ b/tasks/format-code-task-002247/tests/test.patch @@ -0,0 +1,665 @@ +diff --git a/usercase-test-coderl/dependency_helpers_test.go b/usercase-test-coderl/dependency_helpers_test.go +new file mode 100644 +--- /dev/null ++++ b/usercase-test-coderl/dependency_helpers_test.go +@@ -0,0 +1,637 @@ ++package usercase_test_coderl ++ ++import ( ++ "os" ++ "path/filepath" ++ "reflect" ++ "sort" ++ "testing" ++ ++ "pault.ag/go/debian/dependency" ++ "pault.ag/go/debian/version" ++) ++ ++ ++ ++ ++ ++ ++func concrete(name string) dependency.Possibility { ++ return dependency.Possibility{ ++ Name: name, ++ Architectures: &dependency.ArchSet{Architectures: []dependency.Arch{}}, ++ StageSets: []dependency.StageSet{}, ++ } ++} ++ ++func restricted(name string, not bool, arches ...dependency.Arch) dependency.Possibility { ++ return dependency.Possibility{ ++ Name: name, ++ Architectures: &dependency.ArchSet{ ++ Not: not, ++ Architectures: append([]dependency.Arch{}, arches...), ++ }, ++ StageSets: []dependency.StageSet{}, ++ } ++} ++ ++func substvar(name string) dependency.Possibility { ++ return dependency.Possibility{Name: name, Substvar: true} ++} ++ ++func amd64() dependency.Arch { ++ return dependency.Arch{ABI: "base", Libc: "gnu", OS: "linux", CPU: "amd64"} ++} ++ ++func sparc() dependency.Arch { ++ return dependency.Arch{ABI: "base", Libc: "gnu", OS: "linux", CPU: "sparc"} ++} ++ ++func arm64() dependency.Arch { ++ return dependency.Arch{ABI: "base", Libc: "gnu", OS: "linux", CPU: "arm64"} ++} ++ ++func native() dependency.Arch { ++ return dependency.Arch{ABI: "base", Libc: "gnu", OS: "linux", CPU: "native"} ++} ++ ++func mustVersion(t *testing.T, input string) version.Version { ++ t.Helper() ++ v, err := version.Parse(input) ++ if err != nil { ++ t.Fatalf("version.Parse(%q): %v", input, err) ++ } ++ return v ++} ++ ++func assertPossibilities(t *testing.T, actual, expected []dependency.Possibility) { ++ t.Helper() ++ ++ ++ ++ normalizedActual := normalizePossibilities(actual) ++ normalizedExpected := normalizePossibilities(expected) ++ if !reflect.DeepEqual(normalizedActual, normalizedExpected) { ++ t.Fatalf("possibilities mismatch\nactual: %#v\nexpected: %#v", normalizedActual, normalizedExpected) ++ } ++} ++ ++func normalizePossibilities(possibilities []dependency.Possibility) []dependency.Possibility { ++ out := make([]dependency.Possibility, len(possibilities)) ++ for i, possibility := range possibilities { ++ out[i] = normalizePossibility(possibility) ++ } ++ return out ++} ++ ++func normalizePossibility(possibility dependency.Possibility) dependency.Possibility { ++ out := possibility ++ if out.Architectures == nil { ++ out.Architectures = &dependency.ArchSet{Architectures: []dependency.Arch{}} ++ } else { ++ architectures := append([]dependency.Arch{}, out.Architectures.Architectures...) ++ out.Architectures = &dependency.ArchSet{ ++ Not: out.Architectures.Not, ++ Architectures: architectures, ++ } ++ } ++ out.StageSets = normalizeStageSets(out.StageSets) ++ return out ++} ++ ++func normalizeStageSets(stageSets []dependency.StageSet) []dependency.StageSet { ++ out := make([]dependency.StageSet, len(stageSets)) ++ for i, stageSet := range stageSets { ++ out[i].Stages = append([]dependency.Stage{}, stageSet.Stages...) ++ } ++ return out ++} ++ ++func relation(possibilities ...dependency.Possibility) dependency.Relation { ++ return dependency.Relation{Possibilities: possibilities} ++} ++ ++func cloneDependency(dep *dependency.Dependency) dependency.Dependency { ++ out := dependency.Dependency{ ++ Relations: make([]dependency.Relation, len(dep.Relations)), ++ } ++ for i, relation := range dep.Relations { ++ out.Relations[i].Possibilities = make([]dependency.Possibility, len(relation.Possibilities)) ++ for j, possibility := range relation.Possibilities { ++ out.Relations[i].Possibilities[j] = clonePossibility(possibility) ++ } ++ } ++ return out ++} ++ ++func clonePossibility(possibility dependency.Possibility) dependency.Possibility { ++ out := possibility ++ if possibility.Arch != nil { ++ arch := *possibility.Arch ++ out.Arch = &arch ++ } ++ if possibility.Architectures != nil { ++ out.Architectures = &dependency.ArchSet{ ++ Not: possibility.Architectures.Not, ++ Architectures: append([]dependency.Arch{}, possibility.Architectures.Architectures...), ++ } ++ } ++ if possibility.Version != nil { ++ versionRelation := *possibility.Version ++ out.Version = &versionRelation ++ } ++ if possibility.StageSets != nil { ++ out.StageSets = make([]dependency.StageSet, len(possibility.StageSets)) ++ for i, stageSet := range possibility.StageSets { ++ out.StageSets[i].Stages = append([]dependency.Stage{}, stageSet.Stages...) ++ } ++ } ++ return out ++} ++ ++func snapshotDir(t *testing.T, dir string) []string { ++ t.Helper() ++ entries, err := os.ReadDir(dir) ++ if err != nil { ++ t.Fatalf("ReadDir(%q): %v", dir, err) ++ } ++ out := make([]string, 0, len(entries)) ++ for _, entry := range entries { ++ out = append(out, entry.Name()) ++ } ++ sort.Strings(out) ++ return out ++} ++ ++func TestGetPossibilitiesReturnsFirstUnrestrictedAlternatives(t *testing.T) { ++ ++ ++ dep := &dependency.Dependency{ ++ Relations: []dependency.Relation{ ++ relation(concrete("foo")), ++ relation(concrete("bar"), concrete("baz")), ++ }, ++ } ++ ++ actual := dep.GetPossibilities(amd64()) ++ ++ expected := []dependency.Possibility{ ++ { ++ Name: "foo", ++ Architectures: &dependency.ArchSet{Architectures: []dependency.Arch{}}, ++ StageSets: []dependency.StageSet{}, ++ }, ++ { ++ Name: "bar", ++ Architectures: &dependency.ArchSet{Architectures: []dependency.Arch{}}, ++ StageSets: []dependency.StageSet{}, ++ }, ++ } ++ assertPossibilities(t, actual, expected) ++} ++ ++func TestGetPossibilitiesFallsBackWhenFirstAlternativeArchDoesNotMatch(t *testing.T) { ++ ++ ++ dep := &dependency.Dependency{ ++ Relations: []dependency.Relation{ ++ relation(concrete("foo")), ++ relation(restricted("bar", false, sparc()), concrete("baz")), ++ }, ++ } ++ ++ actual := dep.GetPossibilities(amd64()) ++ ++ expected := []dependency.Possibility{ ++ { ++ Name: "foo", ++ Architectures: &dependency.ArchSet{Architectures: []dependency.Arch{}}, ++ StageSets: []dependency.StageSet{}, ++ }, ++ { ++ Name: "baz", ++ Architectures: &dependency.ArchSet{Architectures: []dependency.Arch{}}, ++ StageSets: []dependency.StageSet{}, ++ }, ++ } ++ assertPossibilities(t, actual, expected) ++} ++ ++func TestGetPossibilitiesKeepsMatchingRestrictedAndNegatedAlternatives(t *testing.T) { ++ ++ ++ dep := &dependency.Dependency{ ++ Relations: []dependency.Relation{ ++ relation(restricted("foo", false, amd64()), concrete("bar")), ++ relation(restricted("baz", true, arm64()), concrete("qux")), ++ }, ++ } ++ ++ actual := dep.GetPossibilities(amd64()) ++ ++ expected := []dependency.Possibility{ ++ { ++ Name: "foo", ++ Architectures: &dependency.ArchSet{ ++ Architectures: []dependency.Arch{ ++ {ABI: "base", Libc: "gnu", OS: "linux", CPU: "amd64"}, ++ }, ++ }, ++ StageSets: []dependency.StageSet{}, ++ }, ++ { ++ Name: "baz", ++ Architectures: &dependency.ArchSet{ ++ Not: true, ++ Architectures: []dependency.Arch{ ++ {ABI: "base", Libc: "gnu", OS: "linux", CPU: "arm64"}, ++ }, ++ }, ++ StageSets: []dependency.StageSet{}, ++ }, ++ } ++ assertPossibilities(t, actual, expected) ++} ++ ++func TestGetPossibilitiesSkipsSubstvarsAndOmittedRelations(t *testing.T) { ++ ++ ++ dep := &dependency.Dependency{ ++ Relations: []dependency.Relation{ ++ relation(substvar("foo:Depends"), concrete("alpha")), ++ relation(restricted("beta", false, arm64()), restricted("gamma", false, sparc())), ++ relation(restricted("delta", true, arm64()), concrete("epsilon")), ++ }, ++ } ++ ++ actual := dep.GetPossibilities(amd64()) ++ ++ expected := []dependency.Possibility{ ++ { ++ Name: "alpha", ++ Architectures: &dependency.ArchSet{Architectures: []dependency.Arch{}}, ++ StageSets: []dependency.StageSet{}, ++ }, ++ { ++ Name: "delta", ++ Architectures: &dependency.ArchSet{ ++ Not: true, ++ Architectures: []dependency.Arch{ ++ {ABI: "base", Libc: "gnu", OS: "linux", CPU: "arm64"}, ++ }, ++ }, ++ StageSets: []dependency.StageSet{}, ++ }, ++ } ++ assertPossibilities(t, actual, expected) ++} ++ ++func TestGetAllPossibilitiesFlattensConcretePossibilitiesInRelationOrder(t *testing.T) { ++ ++ ++ dep := &dependency.Dependency{ ++ Relations: []dependency.Relation{ ++ relation(substvar("foo:Depends")), ++ relation(concrete("foo")), ++ relation(concrete("bar"), concrete("baz")), ++ relation(substvar("bar:Depends")), ++ }, ++ } ++ ++ actual := dep.GetAllPossibilities() ++ ++ expected := []dependency.Possibility{ ++ { ++ Name: "foo", ++ Architectures: &dependency.ArchSet{Architectures: []dependency.Arch{}}, ++ StageSets: []dependency.StageSet{}, ++ }, ++ { ++ Name: "bar", ++ Architectures: &dependency.ArchSet{Architectures: []dependency.Arch{}}, ++ StageSets: []dependency.StageSet{}, ++ }, ++ { ++ Name: "baz", ++ Architectures: &dependency.ArchSet{Architectures: []dependency.Arch{}}, ++ StageSets: []dependency.StageSet{}, ++ }, ++ } ++ assertPossibilities(t, actual, expected) ++} ++ ++func TestGetAllPossibilitiesPreservesConcretePossibilityMetadata(t *testing.T) { ++ ++ ++ dep := &dependency.Dependency{ ++ Relations: []dependency.Relation{ ++ relation(dependency.Possibility{ ++ Name: "libfoo", ++ Arch: &dependency.Arch{ABI: "any", Libc: "any", OS: "any", CPU: "any"}, ++ Architectures: &dependency.ArchSet{ ++ Architectures: []dependency.Arch{ ++ {ABI: "base", Libc: "gnu", OS: "linux", CPU: "amd64"}, ++ }, ++ }, ++ StageSets: []dependency.StageSet{ ++ {Stages: []dependency.Stage{{Name: "stage1"}}}, ++ }, ++ Version: &dependency.VersionRelation{Operator: ">=", Number: "1.2"}, ++ }), ++ relation(dependency.Possibility{ ++ Name: "libbar", ++ Arch: &dependency.Arch{ABI: "base", Libc: "gnu", OS: "linux", CPU: "native"}, ++ Architectures: &dependency.ArchSet{Architectures: []dependency.Arch{}}, ++ StageSets: []dependency.StageSet{}, ++ Version: &dependency.VersionRelation{Operator: "<<", Number: "2.0"}, ++ }, substvar("alt:Depends")), ++ }, ++ } ++ ++ actual := dep.GetAllPossibilities() ++ ++ expected := []dependency.Possibility{ ++ { ++ Name: "libfoo", ++ Arch: &dependency.Arch{ABI: "any", Libc: "any", OS: "any", CPU: "any"}, ++ Architectures: &dependency.ArchSet{ ++ Architectures: []dependency.Arch{ ++ {ABI: "base", Libc: "gnu", OS: "linux", CPU: "amd64"}, ++ }, ++ }, ++ StageSets: []dependency.StageSet{ ++ {Stages: []dependency.Stage{{Name: "stage1"}}}, ++ }, ++ Version: &dependency.VersionRelation{Operator: ">=", Number: "1.2"}, ++ }, ++ { ++ Name: "libbar", ++ Arch: &dependency.Arch{ABI: "base", Libc: "gnu", OS: "linux", CPU: "native"}, ++ Architectures: &dependency.ArchSet{Architectures: []dependency.Arch{}}, ++ StageSets: []dependency.StageSet{}, ++ Version: &dependency.VersionRelation{Operator: "<<", Number: "2.0"}, ++ }, ++ } ++ assertPossibilities(t, actual, expected) ++} ++ ++func TestGetSubstvarsReturnsOnlySubstvarsInRelationOrder(t *testing.T) { ++ ++ ++ dep := &dependency.Dependency{ ++ Relations: []dependency.Relation{ ++ relation(substvar("foo:Depends")), ++ relation(concrete("foo")), ++ relation(concrete("bar"), concrete("baz")), ++ relation(substvar("bar:Depends")), ++ }, ++ } ++ ++ actual := dep.GetSubstvars() ++ ++ expected := []dependency.Possibility{ ++ {Name: "foo:Depends", Substvar: true}, ++ {Name: "bar:Depends", Substvar: true}, ++ } ++ assertPossibilities(t, actual, expected) ++} ++ ++func TestGetSubstvarsReturnsEmptySliceWhenThereAreNoSubstvars(t *testing.T) { ++ ++ ++ dep := &dependency.Dependency{ ++ Relations: []dependency.Relation{ ++ relation(concrete("foo")), ++ relation(concrete("bar"), concrete("baz")), ++ }, ++ } ++ ++ actual := dep.GetSubstvars() ++ ++ expected := []dependency.Possibility{} ++ assertPossibilities(t, actual, expected) ++} ++ ++func TestVersionRelationEqualIsSatisfiedOnlyByExactVersion(t *testing.T) { ++ ++ ++ relation := dependency.VersionRelation{Operator: "=", Number: "1.0.0"} ++ ++ actualExact := relation.SatisfiedBy(mustVersion(t, "1.0.0")) ++ actualDifferent := relation.SatisfiedBy(mustVersion(t, "1.0.1")) ++ ++ if actualExact != true { ++ t.Fatalf("exact version result = %v, expected true", actualExact) ++ } ++ if actualDifferent != false { ++ t.Fatalf("different version result = %v, expected false", actualDifferent) ++ } ++} ++ ++func TestVersionRelationStrictlyEarlierUsesDebianOrdering(t *testing.T) { ++ ++ ++ relation := dependency.VersionRelation{Operator: "<<", Number: "2.0"} ++ ++ actualEarlier := relation.SatisfiedBy(mustVersion(t, "1.0")) ++ actualLater := relation.SatisfiedBy(mustVersion(t, "3.0")) ++ ++ if actualEarlier != true { ++ t.Fatalf("earlier version result = %v, expected true", actualEarlier) ++ } ++ if actualLater != false { ++ t.Fatalf("later version result = %v, expected false", actualLater) ++ } ++} ++ ++func TestVersionRelationStrictlyLaterUsesDebianOrdering(t *testing.T) { ++ ++ ++ relation := dependency.VersionRelation{Operator: ">>", Number: "2.0"} ++ ++ actualLater := relation.SatisfiedBy(mustVersion(t, "3.0")) ++ actualEarlier := relation.SatisfiedBy(mustVersion(t, "1.0")) ++ ++ if actualLater != true { ++ t.Fatalf("later version result = %v, expected true", actualLater) ++ } ++ if actualEarlier != false { ++ t.Fatalf("earlier version result = %v, expected false", actualEarlier) ++ } ++} ++ ++func TestVersionRelationGreaterOrEqualHonorsTildeBoundary(t *testing.T) { ++ ++ ++ relation := dependency.VersionRelation{Operator: ">=", Number: "1.0~"} ++ ++ actualOnePointZero := relation.SatisfiedBy(mustVersion(t, "1.0")) ++ actualBefore := relation.SatisfiedBy(mustVersion(t, "0.9")) ++ ++ if actualOnePointZero != true { ++ t.Fatalf("1.0 result = %v, expected true", actualOnePointZero) ++ } ++ if actualBefore != false { ++ t.Fatalf("0.9 result = %v, expected false", actualBefore) ++ } ++} ++ ++func TestVersionRelationLessOrEqualIncludesExactTildeBoundary(t *testing.T) { ++ ++ ++ relation := dependency.VersionRelation{Operator: "<=", Number: "1.0~"} ++ ++ actualExact := relation.SatisfiedBy(mustVersion(t, "1.0~")) ++ actualLater := relation.SatisfiedBy(mustVersion(t, "1.0")) ++ ++ if actualExact != true { ++ t.Fatalf("exact tilde result = %v, expected true", actualExact) ++ } ++ if actualLater != false { ++ t.Fatalf("later version result = %v, expected false", actualLater) ++ } ++} ++ ++func TestVersionRelationInvalidRelationReturnsFalse(t *testing.T) { ++ ++ ++ unknownOperator := dependency.VersionRelation{Operator: "???", Number: "1.0"} ++ invalidNumber := dependency.VersionRelation{Operator: ">=", Number: "not-a-version"} ++ ++ actualUnknown := unknownOperator.SatisfiedBy(mustVersion(t, "1.0")) ++ actualInvalidNumber := invalidNumber.SatisfiedBy(mustVersion(t, "1.0")) ++ ++ if actualUnknown != false { ++ t.Fatalf("unknown operator result = %v, expected false", actualUnknown) ++ } ++ if actualInvalidNumber != false { ++ t.Fatalf("invalid number result = %v, expected false", actualInvalidNumber) ++ } ++} ++ ++func TestHelpersAreReferentiallyTransparentForSameInputs(t *testing.T) { ++ dep := &dependency.Dependency{ ++ Relations: []dependency.Relation{ ++ relation(restricted("bar", false, sparc()), concrete("baz")), ++ }, ++ } ++ arch := amd64() ++ vr := dependency.VersionRelation{Operator: ">=", Number: "1.0~"} ++ ver := mustVersion(t, "1.0") ++ ++ if !reflect.DeepEqual(dep.GetPossibilities(arch), dep.GetPossibilities(arch)) { ++ t.Fatalf("GetPossibilities returned different values for the same input") ++ } ++ if !reflect.DeepEqual(dep.GetAllPossibilities(), dep.GetAllPossibilities()) { ++ t.Fatalf("GetAllPossibilities returned different values for the same input") ++ } ++ if !reflect.DeepEqual(dep.GetSubstvars(), dep.GetSubstvars()) { ++ t.Fatalf("GetSubstvars returned different values for the same input") ++ } ++ if vr.SatisfiedBy(ver) != vr.SatisfiedBy(ver) { ++ t.Fatalf("SatisfiedBy returned different values for the same input") ++ } ++} ++ ++func TestHelpersDoNotMutateReceiversOrArguments(t *testing.T) { ++ dep := &dependency.Dependency{ ++ Relations: []dependency.Relation{ ++ relation(substvar("foo:Depends"), concrete("alpha")), ++ relation(restricted("beta", false, arm64()), restricted("gamma", true, sparc())), ++ }, ++ } ++ arch := amd64() ++ vr := dependency.VersionRelation{Operator: ">=", Number: "1.0~"} ++ ver := mustVersion(t, "1.0") ++ ++ beforeDep := cloneDependency(dep) ++ beforeArch := arch ++ beforeVR := vr ++ beforeVer := ver ++ ++ _ = dep.GetPossibilities(arch) ++ _ = dep.GetAllPossibilities() ++ _ = dep.GetSubstvars() ++ _ = vr.SatisfiedBy(ver) ++ ++ afterDep := *dep ++ if !reflect.DeepEqual(afterDep, beforeDep) { ++ t.Fatalf("dependency receiver mutated\nafter: %#v\nbefore: %#v", afterDep, beforeDep) ++ } ++ if !reflect.DeepEqual(arch, beforeArch) { ++ t.Fatalf("arch argument mutated: after %#v before %#v", arch, beforeArch) ++ } ++ if !reflect.DeepEqual(vr, beforeVR) { ++ t.Fatalf("version relation receiver mutated: after %#v before %#v", vr, beforeVR) ++ } ++ if !reflect.DeepEqual(ver, beforeVer) { ++ t.Fatalf("version argument mutated: after %#v before %#v", ver, beforeVer) ++ } ++} ++ ++func TestHelpersDoNotDependOnCallOrderGlobalState(t *testing.T) { ++ dep := &dependency.Dependency{ ++ Relations: []dependency.Relation{ ++ relation(restricted("bar", false, sparc()), concrete("baz")), ++ relation(restricted("delta", true, arm64()), concrete("epsilon")), ++ }, ++ } ++ arch := amd64() ++ vr := dependency.VersionRelation{Operator: "<<", Number: "2.0"} ++ ver := mustVersion(t, "1.0") ++ ++ firstPossibilities := dep.GetPossibilities(arch) ++ firstAll := dep.GetAllPossibilities() ++ firstSubstvars := dep.GetSubstvars() ++ firstSatisfied := vr.SatisfiedBy(ver) ++ ++ noiseDep := &dependency.Dependency{ ++ Relations: []dependency.Relation{ ++ relation(concrete("noise-one"), concrete("noise-two")), ++ relation(substvar("noise:Depends"), concrete("noise-three")), ++ }, ++ } ++ _ = noiseDep.GetPossibilities(native()) ++ _ = noiseDep.GetAllPossibilities() ++ _ = noiseDep.GetSubstvars() ++ _ = (dependency.VersionRelation{Operator: "=", Number: "3.0"}).SatisfiedBy(mustVersion(t, "3.0")) ++ ++ assertPossibilities(t, dep.GetPossibilities(arch), firstPossibilities) ++ assertPossibilities(t, dep.GetAllPossibilities(), firstAll) ++ assertPossibilities(t, dep.GetSubstvars(), firstSubstvars) ++ if vr.SatisfiedBy(ver) != firstSatisfied { ++ t.Fatalf("SatisfiedBy changed after unrelated calls") ++ } ++} ++ ++func TestHelpersDoNotCreateRelativeFilesystemSideEffects(t *testing.T) { ++ tmp := t.TempDir() ++ originalCWD, err := os.Getwd() ++ if err != nil { ++ t.Fatalf("Getwd: %v", err) ++ } ++ if err := os.Chdir(tmp); err != nil { ++ t.Fatalf("Chdir(%q): %v", tmp, err) ++ } ++ t.Cleanup(func() { ++ _ = os.Chdir(originalCWD) ++ }) ++ ++ before := snapshotDir(t, tmp) ++ dep := &dependency.Dependency{ ++ Relations: []dependency.Relation{ ++ relation(substvar("foo:Depends"), concrete("alpha")), ++ relation(restricted("beta", false, arm64()), concrete("gamma")), ++ }, ++ } ++ ++ _ = dep.GetPossibilities(amd64()) ++ _ = dep.GetAllPossibilities() ++ _ = dep.GetSubstvars() ++ _ = (dependency.VersionRelation{Operator: ">=", Number: "1.0~"}).SatisfiedBy(mustVersion(t, "1.0")) ++ ++ after := snapshotDir(t, tmp) ++ if !reflect.DeepEqual(after, before) { ++ t.Fatalf("relative filesystem entries changed in %s: before=%v after=%v", filepath.Clean(tmp), before, after) ++ } ++} +diff --git a/mimo_test_command.sh b/mimo_test_command.sh +new file mode 100755 +--- /dev/null ++++ b/mimo_test_command.sh +@@ -0,0 +1,18 @@ ++#!/usr/bin/env bash ++ ++ ++ ++ ++export NODE_OPTIONS="${NODE_OPTIONS:-} --max-old-space-size=4096" ++export MAVEN_OPTS="${MAVEN_OPTS:-} -Xmx3g -XX:+UseG1GC" ++export GRADLE_OPTS="${GRADLE_OPTS:-} -Xmx3g -XX:+UseG1GC" ++export TEST_JVM_OPTS="${TEST_JVM_OPTS:-} -Xmx3g" ++export GOTOOLCHAIN=local ++export GOPROXY=off ++export GOSUMDB=off ++export GOFLAGS="${GOFLAGS:-} -mod=readonly" ++set -e ++cd /workspace/repo ++set -euo pipefail ++cd /workspace/repo ++exec go test -v ./usercase-test-coderl/... diff --git a/tasks/format-code-task-002247/tests/test.sh b/tasks/format-code-task-002247/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..e7a599a92b62eb81b3ad721cd973c76c62a79e15 --- /dev/null +++ b/tasks/format-code-task-002247/tests/test.sh @@ -0,0 +1,38 @@ +#!/bin/bash +# Code grading, mimoagent opensource_code.py: reset the files the hidden test patch touches, apply it, run the +# task's test command; reward 1 when it exits 0. A testbed failure (reset or apply) writes no reward: not scored. +M=/var/lib/mimo +CWD=/workspace/repo +V=/logs/verifier +mkdir -p "$V" +BASE=$(cat "$M/base" 2>/dev/null) || { echo "setup never ran (no $M/base)" >&2; exit 1; } +cd "$CWD" || exit 1 +if [ -d "$M/git-hidden" ]; then rm -rf "$CWD/.git"; mv "$M/git-hidden" "$CWD/.git"; fi +# the agent's change against the base, so its own commits count too +git add -A >/dev/null 2>&1 && git -c core.fileMode=false diff --cached "$BASE" > "$V/agent.diff" +git reset -q +if ! ( +while IFS= read -r tf; do + [ -z "$tf" ] && continue + if git cat-file -e $BASE:"$tf" 2>/dev/null; then + git checkout $BASE -- "$tf" 2>/dev/null || true + else + git rm -f --cached "$tf" >/dev/null 2>&1 || true + rm -f "$tf" + fi +done <<'EOF_RESET_TEST_FILES' +usercase-test-coderl/dependency_helpers_test.go +mimo_test_command.sh +EOF_RESET_TEST_FILES + +); then echo "could not reset the test files (testbed problem, not scored)" >&2; exit 1; fi +if ! git apply --verbose /tests/test.patch > "$V/apply.log" 2>&1; then + cat "$V/apply.log" >&2 + echo "the hidden tests could not be applied (testbed problem, not scored)" >&2 + exit 1 +fi +timeout 1800 sh -c "$(cat /tests/test_command.sh)" > "$V/test_output.log" 2>&1 +RC=$? +tail -c 12000 "$V/test_output.log" +if [ $RC -eq 0 ]; then echo 1 > "$V/reward.txt"; else echo 0 > "$V/reward.txt"; fi +echo "test command exited $RC" diff --git a/tasks/format-code-task-002247/tests/test_command.sh b/tasks/format-code-task-002247/tests/test_command.sh new file mode 100644 index 0000000000000000000000000000000000000000..88cb7810b836396c4869db31aeac7d4d4b189685 --- /dev/null +++ b/tasks/format-code-task-002247/tests/test_command.sh @@ -0,0 +1 @@ +bash /workspace/repo/mimo_test_command.sh \ No newline at end of file diff --git a/tasks/format-code-task-002278/environment/Dockerfile b/tasks/format-code-task-002278/environment/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..644a9d03b4bca99f5ff1a540afd93ef0c6e46fd5 --- /dev/null +++ b/tasks/format-code-task-002278/environment/Dockerfile @@ -0,0 +1,3 @@ +# The task's image, pinned by digest (the same as [environment].docker_image). +# Setup runs at start from [environment.healthcheck]; environment/setup/ is its readable copy. +FROM docker.io/xiaomimimo/mimo-v2.6-rl-oss@sha256:09627dd9bcf8548eb739e2d082bf4b7f82c8c6f56a781de8a0f92ad76ea04629 diff --git a/tasks/format-code-task-002278/environment/setup/files/blocklist b/tasks/format-code-task-002278/environment/setup/files/blocklist new file mode 100644 index 0000000000000000000000000000000000000000..a8e4bdc4c7d9b739c047a3cb58ea72a1bb05bcbc --- /dev/null +++ b/tasks/format-code-task-002278/environment/setup/files/blocklist @@ -0,0 +1,33 @@ +# mimo answer-leak blocklist (mimoagent) +0.0.0.0 github.com +0.0.0.0 www.github.com +0.0.0.0 api.github.com +0.0.0.0 raw.githubusercontent.com +0.0.0.0 codeload.github.com +0.0.0.0 objects.githubusercontent.com +0.0.0.0 gist.github.com +0.0.0.0 gist.githubusercontent.com +0.0.0.0 gitlab.com +0.0.0.0 bitbucket.org +0.0.0.0 sourceforge.net +0.0.0.0 git.kernel.org +0.0.0.0 chromium.googlesource.com +0.0.0.0 android.googlesource.com +0.0.0.0 sourcegraph.com +0.0.0.0 bugs.chromium.org +0.0.0.0 issues.oss-fuzz.com +0.0.0.0 oss-fuzz.com +0.0.0.0 osv.dev +0.0.0.0 api.osv.dev +0.0.0.0 bugzilla.mozilla.org +0.0.0.0 proxy.golang.org +0.0.0.0 sum.golang.org +0.0.0.0 pkg.go.dev +0.0.0.0 google.com +0.0.0.0 www.google.com +0.0.0.0 bing.com +0.0.0.0 www.bing.com +0.0.0.0 duckduckgo.com +0.0.0.0 html.duckduckgo.com +0.0.0.0 search.brave.com +0.0.0.0 stackoverflow.com diff --git a/tasks/format-code-task-002278/environment/setup/setup.sh b/tasks/format-code-task-002278/environment/setup/setup.sh new file mode 100644 index 0000000000000000000000000000000000000000..d883db90cfcfb48f7a139861bbe9f6b5d95cad6f --- /dev/null +++ b/tasks/format-code-task-002278/environment/setup/setup.sh @@ -0,0 +1,34 @@ +#!/bin/bash +# Runs once, as root, before the agent starts: Harbor's [environment.healthcheck] unpacks this folder into +# /var/lib/mimo and runs it. Generated by mimo_harbor; see its README for how each step maps to Xiaomi's harness. +M=/var/lib/mimo +[ -f "$M/ready" ] && exit 0 +chmod 700 "$M" +fail() { echo "setup: $*" >&2; exit 1; } +# the answer-leak blocklist (mimoagent), applied to /etc/hosts by the agent right after it installs +write_blocklist() { cp "$M/files/blocklist" "$M/blocklist"; } + +# Code: mimoagent environments/datasets/opensource_code.py + base.py, as the explorer runs it (app/runner/domains.py Code). +CWD=/testbed +git config --global --add safe.directory "$CWD" +cd "$CWD" || fail "no working directory $CWD" +if ! git rev-parse --git-dir >/dev/null 2>&1; then # a bare source tree: give it a baseline commit + git init -q && git add -A && git -c user.name=mimo -c user.email=mimo@localhost commit -q -m baseline --allow-empty +fi +BASE=$(git rev-parse HEAD 2>/dev/null) +[ ${#BASE} -eq 40 ] || fail "could not resolve the base commit in $CWD" +echo "$BASE" > "$M/base" +# Images are built with history truncated at the base. If one is not, the fix could be read out of git log, +# so .git is hidden while the agent works and put back for grading. +LATER=$(git rev-list --all --not "$BASE" 2>/dev/null | head -n 5 | grep -c . || true) +rm -f /tmp/fail.log /tmp/pass.log /tmp/patch.diff /tmp/test_patch.diff /tmp/*.log 2>/dev/null; rm -rf /tmp/claude-0 /tmp/claude-* /tmp/testem-* /tmp/puppeteer_dev_chrome_profile-* 2>/dev/null; rm -f /tmp/test_files.json 2>/dev/null; rm -rf /tmp/jest_* /tmp/jest-* /tmp/build /tmp/build_env 2>/dev/null; rm -rf /tmp/pytest-of-root /tmp/pytest-* /tmp/.pytest_cache /tmp/__pycache__ 2>/dev/null; rm -rf /tmp/go-build* /tmp/standards /tmp/wordpress /tmp/zig-* /tmp/testbase /tmp/testbed 2>/dev/null; rm -f /tmp/tmp*.tmp /tmp/*.bak /tmp/expect* /tmp/butwas* 2>/dev/null; rm -rf /root/.cache/go-build 2>/dev/null; rm -rf /tests 2>/dev/null; find /logs -mindepth 1 -delete 2>/dev/null; mkdir -p /logs/agent /logs/verifier /logs/artifacts; chmod 777 /logs/agent /logs/verifier /logs/artifacts; find /var/log -type f -delete 2>/dev/null || true; rm -rf /var/lib/postgresql/*/*/log /var/lib/postgresql/*/*/pg_log 2>/dev/null || true; find /var/lib/mysql /var/lib/mongodb -type f -name '*.log' -delete 2>/dev/null || true; rm -rf /root/.npm/_logs /root/.babel.json /root/.pytest_cache 2>/dev/null || true; find / -maxdepth 4 -xdev -name task_description.md -path '*/.build_env/*' -delete 2>/dev/null || true; true +git clean -fdx --exclude=node_modules --exclude=bower_components --exclude=.husky --exclude=vendor --exclude=third_party --exclude=_deps --exclude=vcpkg_installed --exclude=.venv --exclude=venv --exclude=.gradle --exclude=target --exclude=.build --exclude=lib --exclude=.bundle --exclude=Manifest.toml --exclude=_build --exclude=.stack-work --exclude=dist-newstyle >/dev/null 2>&1 +find /root/.m2 -type f \( -name '*-SNAPSHOT.jar' -o -name '*-SNAPSHOT-sources.jar' -o -name '*-SNAPSHOT-tests.jar' -o -name '*-SNAPSHOT-test-sources.jar' \) -delete 2>/dev/null; rm -rf /root/.julia/compiled 2>/dev/null; rm -rf /root/.gradle/caches/build-cache-* /root/.gradle/daemon 2>/dev/null; rm -rf /root/.gradle/caches/*/scripts /root/.gradle/caches/jars-* 2>/dev/null; rm -rf /root/.cache/bazel 2>/dev/null; true +if [ "$LATER" -gt 0 ]; then + mv "$CWD/.git" "$M/git-hidden" + echo "history not truncated at ${BASE:0:12}: .git hidden while the agent works" +fi +write_blocklist + +touch "$M/ready" +echo "setup done" diff --git a/tasks/format-code-task-002278/tests/test.patch b/tasks/format-code-task-002278/tests/test.patch new file mode 100644 index 0000000000000000000000000000000000000000..6c5df7f7450ff1d2ffcfb117c7af254e6a600c95 --- /dev/null +++ b/tasks/format-code-task-002278/tests/test.patch @@ -0,0 +1,99 @@ +diff --git a/test/basic.test.js b/test/basic.test.js +index e8310d689..c8a69623b 100644 +--- a/test/basic.test.js ++++ b/test/basic.test.js +@@ -751,3 +751,74 @@ test('Should invoke `onChild` with the newly created child', async ({ equal }) = + }).child({ foo: 'bar' }) + equal(child, innerChild) + }) ++ ++test('logger message should have the prefix message that defined in the logger creation', async ({ equal }) => { ++ const stream = sink() ++ const logger = pino({ ++ msgPrefix: 'My name is Bond ' ++ }, stream) ++ logger.info('James Bond') ++ const { msg } = await once(stream, 'data') ++ equal(msg, 'My name is Bond James Bond') ++}) ++ ++test('child message should have the prefix message that defined in the child creation', async ({ equal }) => { ++ const stream = sink() ++ const instance = pino(stream) ++ const child = instance.child({}, { msgPrefix: 'My name is Bond ' }) ++ child.info('James Bond') ++ const { msg } = await once(stream, 'data') ++ equal(msg, 'My name is Bond James Bond') ++}) ++ ++test('child message should have the prefix message that defined in the child creation when logging with log meta', async ({ equal }) => { ++ const stream = sink() ++ const instance = pino(stream) ++ const child = instance.child({}, { msgPrefix: 'My name is Bond ' }) ++ child.info({ hello: 'world' }, 'James Bond') ++ const { msg, hello } = await once(stream, 'data') ++ equal(hello, 'world') ++ equal(msg, 'My name is Bond James Bond') ++}) ++ ++test('logged message should not have the prefix when not providing any message', async ({ equal }) => { ++ const stream = sink() ++ const instance = pino(stream) ++ const child = instance.child({}, { msgPrefix: 'This should not be shown ' }) ++ child.info({ hello: 'world' }) ++ const { msg, hello } = await once(stream, 'data') ++ equal(hello, 'world') ++ equal(msg, undefined) ++}) ++ ++test('child message should append parent prefix to current prefix that defined in the child creation', async ({ equal }) => { ++ const stream = sink() ++ const instance = pino({ ++ msgPrefix: 'My name is Bond ' ++ }, stream) ++ const child = instance.child({}, { msgPrefix: 'James ' }) ++ child.info('Bond') ++ const { msg } = await once(stream, 'data') ++ equal(msg, 'My name is Bond James Bond') ++}) ++ ++test('child message should inherent parent prefix', async ({ equal }) => { ++ const stream = sink() ++ const instance = pino({ ++ msgPrefix: 'My name is Bond ' ++ }, stream) ++ const child = instance.child({}) ++ child.info('James Bond') ++ const { msg } = await once(stream, 'data') ++ equal(msg, 'My name is Bond James Bond') ++}) ++ ++test('grandchild message should inherent parent prefix', async ({ equal }) => { ++ const stream = sink() ++ const instance = pino(stream) ++ const child = instance.child({}, { msgPrefix: 'My name is Bond ' }) ++ const grandchild = child.child({}) ++ grandchild.info('James Bond') ++ const { msg } = await once(stream, 'data') ++ equal(msg, 'My name is Bond James Bond') ++}) +diff --git a/mimo_build_env.tar.gz.b64 b/mimo_build_env.tar.gz.b64 +new file mode 100644 +--- /dev/null ++++ b/mimo_build_env.tar.gz.b64 +@@ -0,0 +1,4 @@ ++H4sIAAAAAAAAA+3RSwrCMBSF4Yy7iqwgJmljl1P6AivaliYVl28tiCI+JhUR/29yb0ggB44qxmZX ++ZXV7WIlP0ZPUuXlO7ue8G2eNWetYx1ZoY1xqhXQfS3Rj9CEfpBRD14VX797d/yh17T/UPmRlt9/n ++baX8Zrk/3vafpJf+beqSqf9kbY2QerkIz/15/2Ul5+KLuora/ihD3svzeVXkvinVeVVbH307JgAA ++AAAAAAAAAAAAAIAHTpgwfOYAKAAA +diff --git a/mimo_test_command.sh b/mimo_test_command.sh +new file mode 100755 +--- /dev/null ++++ b/mimo_test_command.sh +@@ -0,0 +1,6 @@ ++#!/usr/bin/env bash ++ ++set -uo pipefail ++cd /testbed || exit 1 ++base64 -d mimo_build_env.tar.gz.b64 | tar -xzf - -C /testbed || exit 1 ++exec bash -lc 'cd /testbed && bash -eo pipefail /testbed/.build_env/test_command.sh' diff --git a/tasks/format-code-task-002278/tests/test.sh b/tasks/format-code-task-002278/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..3fb83781b57423460619123b567dad04d3dd6e67 --- /dev/null +++ b/tasks/format-code-task-002278/tests/test.sh @@ -0,0 +1,39 @@ +#!/bin/bash +# Code grading, mimoagent opensource_code.py: reset the files the hidden test patch touches, apply it, run the +# task's test command; reward 1 when it exits 0. A testbed failure (reset or apply) writes no reward: not scored. +M=/var/lib/mimo +CWD=/testbed +V=/logs/verifier +mkdir -p "$V" +BASE=$(cat "$M/base" 2>/dev/null) || { echo "setup never ran (no $M/base)" >&2; exit 1; } +cd "$CWD" || exit 1 +if [ -d "$M/git-hidden" ]; then rm -rf "$CWD/.git"; mv "$M/git-hidden" "$CWD/.git"; fi +# the agent's change against the base, so its own commits count too +git add -A >/dev/null 2>&1 && git -c core.fileMode=false diff --cached "$BASE" > "$V/agent.diff" +git reset -q +if ! ( +while IFS= read -r tf; do + [ -z "$tf" ] && continue + if git cat-file -e $BASE:"$tf" 2>/dev/null; then + git checkout $BASE -- "$tf" 2>/dev/null || true + else + git rm -f --cached "$tf" >/dev/null 2>&1 || true + rm -f "$tf" + fi +done <<'EOF_RESET_TEST_FILES' +test/basic.test.js +mimo_build_env.tar.gz.b64 +mimo_test_command.sh +EOF_RESET_TEST_FILES + +); then echo "could not reset the test files (testbed problem, not scored)" >&2; exit 1; fi +if ! git apply --verbose /tests/test.patch > "$V/apply.log" 2>&1; then + cat "$V/apply.log" >&2 + echo "the hidden tests could not be applied (testbed problem, not scored)" >&2 + exit 1 +fi +timeout 1800 sh -c "$(cat /tests/test_command.sh)" > "$V/test_output.log" 2>&1 +RC=$? +tail -c 12000 "$V/test_output.log" +if [ $RC -eq 0 ]; then echo 1 > "$V/reward.txt"; else echo 0 > "$V/reward.txt"; fi +echo "test command exited $RC" diff --git a/tasks/format-code-task-002278/tests/test_command.sh b/tasks/format-code-task-002278/tests/test_command.sh new file mode 100644 index 0000000000000000000000000000000000000000..7cb23076694ad17d72e8296d62b2b240083e36db --- /dev/null +++ b/tasks/format-code-task-002278/tests/test_command.sh @@ -0,0 +1 @@ +bash /testbed/mimo_test_command.sh \ No newline at end of file diff --git a/tasks/format-code-task-002411/environment/Dockerfile b/tasks/format-code-task-002411/environment/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..81401f59e791a1e2a814bede00cdefb1cea268a0 --- /dev/null +++ b/tasks/format-code-task-002411/environment/Dockerfile @@ -0,0 +1,3 @@ +# The task's image, pinned by digest (the same as [environment].docker_image). +# Setup runs at start from [environment.healthcheck]; environment/setup/ is its readable copy. +FROM docker.io/xiaomimimo/mimo-v2.6-rl-oss@sha256:82bd52e1cb643a1e95bccb9524a8f136fc0b64491be4525cb24bd2ada577081c diff --git a/tasks/format-code-task-002411/environment/setup/files/blocklist b/tasks/format-code-task-002411/environment/setup/files/blocklist new file mode 100644 index 0000000000000000000000000000000000000000..a8e4bdc4c7d9b739c047a3cb58ea72a1bb05bcbc --- /dev/null +++ b/tasks/format-code-task-002411/environment/setup/files/blocklist @@ -0,0 +1,33 @@ +# mimo answer-leak blocklist (mimoagent) +0.0.0.0 github.com +0.0.0.0 www.github.com +0.0.0.0 api.github.com +0.0.0.0 raw.githubusercontent.com +0.0.0.0 codeload.github.com +0.0.0.0 objects.githubusercontent.com +0.0.0.0 gist.github.com +0.0.0.0 gist.githubusercontent.com +0.0.0.0 gitlab.com +0.0.0.0 bitbucket.org +0.0.0.0 sourceforge.net +0.0.0.0 git.kernel.org +0.0.0.0 chromium.googlesource.com +0.0.0.0 android.googlesource.com +0.0.0.0 sourcegraph.com +0.0.0.0 bugs.chromium.org +0.0.0.0 issues.oss-fuzz.com +0.0.0.0 oss-fuzz.com +0.0.0.0 osv.dev +0.0.0.0 api.osv.dev +0.0.0.0 bugzilla.mozilla.org +0.0.0.0 proxy.golang.org +0.0.0.0 sum.golang.org +0.0.0.0 pkg.go.dev +0.0.0.0 google.com +0.0.0.0 www.google.com +0.0.0.0 bing.com +0.0.0.0 www.bing.com +0.0.0.0 duckduckgo.com +0.0.0.0 html.duckduckgo.com +0.0.0.0 search.brave.com +0.0.0.0 stackoverflow.com diff --git a/tasks/format-code-task-002411/environment/setup/setup.sh b/tasks/format-code-task-002411/environment/setup/setup.sh new file mode 100644 index 0000000000000000000000000000000000000000..d883db90cfcfb48f7a139861bbe9f6b5d95cad6f --- /dev/null +++ b/tasks/format-code-task-002411/environment/setup/setup.sh @@ -0,0 +1,34 @@ +#!/bin/bash +# Runs once, as root, before the agent starts: Harbor's [environment.healthcheck] unpacks this folder into +# /var/lib/mimo and runs it. Generated by mimo_harbor; see its README for how each step maps to Xiaomi's harness. +M=/var/lib/mimo +[ -f "$M/ready" ] && exit 0 +chmod 700 "$M" +fail() { echo "setup: $*" >&2; exit 1; } +# the answer-leak blocklist (mimoagent), applied to /etc/hosts by the agent right after it installs +write_blocklist() { cp "$M/files/blocklist" "$M/blocklist"; } + +# Code: mimoagent environments/datasets/opensource_code.py + base.py, as the explorer runs it (app/runner/domains.py Code). +CWD=/testbed +git config --global --add safe.directory "$CWD" +cd "$CWD" || fail "no working directory $CWD" +if ! git rev-parse --git-dir >/dev/null 2>&1; then # a bare source tree: give it a baseline commit + git init -q && git add -A && git -c user.name=mimo -c user.email=mimo@localhost commit -q -m baseline --allow-empty +fi +BASE=$(git rev-parse HEAD 2>/dev/null) +[ ${#BASE} -eq 40 ] || fail "could not resolve the base commit in $CWD" +echo "$BASE" > "$M/base" +# Images are built with history truncated at the base. If one is not, the fix could be read out of git log, +# so .git is hidden while the agent works and put back for grading. +LATER=$(git rev-list --all --not "$BASE" 2>/dev/null | head -n 5 | grep -c . || true) +rm -f /tmp/fail.log /tmp/pass.log /tmp/patch.diff /tmp/test_patch.diff /tmp/*.log 2>/dev/null; rm -rf /tmp/claude-0 /tmp/claude-* /tmp/testem-* /tmp/puppeteer_dev_chrome_profile-* 2>/dev/null; rm -f /tmp/test_files.json 2>/dev/null; rm -rf /tmp/jest_* /tmp/jest-* /tmp/build /tmp/build_env 2>/dev/null; rm -rf /tmp/pytest-of-root /tmp/pytest-* /tmp/.pytest_cache /tmp/__pycache__ 2>/dev/null; rm -rf /tmp/go-build* /tmp/standards /tmp/wordpress /tmp/zig-* /tmp/testbase /tmp/testbed 2>/dev/null; rm -f /tmp/tmp*.tmp /tmp/*.bak /tmp/expect* /tmp/butwas* 2>/dev/null; rm -rf /root/.cache/go-build 2>/dev/null; rm -rf /tests 2>/dev/null; find /logs -mindepth 1 -delete 2>/dev/null; mkdir -p /logs/agent /logs/verifier /logs/artifacts; chmod 777 /logs/agent /logs/verifier /logs/artifacts; find /var/log -type f -delete 2>/dev/null || true; rm -rf /var/lib/postgresql/*/*/log /var/lib/postgresql/*/*/pg_log 2>/dev/null || true; find /var/lib/mysql /var/lib/mongodb -type f -name '*.log' -delete 2>/dev/null || true; rm -rf /root/.npm/_logs /root/.babel.json /root/.pytest_cache 2>/dev/null || true; find / -maxdepth 4 -xdev -name task_description.md -path '*/.build_env/*' -delete 2>/dev/null || true; true +git clean -fdx --exclude=node_modules --exclude=bower_components --exclude=.husky --exclude=vendor --exclude=third_party --exclude=_deps --exclude=vcpkg_installed --exclude=.venv --exclude=venv --exclude=.gradle --exclude=target --exclude=.build --exclude=lib --exclude=.bundle --exclude=Manifest.toml --exclude=_build --exclude=.stack-work --exclude=dist-newstyle >/dev/null 2>&1 +find /root/.m2 -type f \( -name '*-SNAPSHOT.jar' -o -name '*-SNAPSHOT-sources.jar' -o -name '*-SNAPSHOT-tests.jar' -o -name '*-SNAPSHOT-test-sources.jar' \) -delete 2>/dev/null; rm -rf /root/.julia/compiled 2>/dev/null; rm -rf /root/.gradle/caches/build-cache-* /root/.gradle/daemon 2>/dev/null; rm -rf /root/.gradle/caches/*/scripts /root/.gradle/caches/jars-* 2>/dev/null; rm -rf /root/.cache/bazel 2>/dev/null; true +if [ "$LATER" -gt 0 ]; then + mv "$CWD/.git" "$M/git-hidden" + echo "history not truncated at ${BASE:0:12}: .git hidden while the agent works" +fi +write_blocklist + +touch "$M/ready" +echo "setup done" diff --git a/tasks/format-code-task-002411/tests/test.patch b/tasks/format-code-task-002411/tests/test.patch new file mode 100644 index 0000000000000000000000000000000000000000..51f337fa7489309ad2fcb33f0318ec166a90c91b --- /dev/null +++ b/tasks/format-code-task-002411/tests/test.patch @@ -0,0 +1,175 @@ +diff --git a/test_commands.json b/test_commands.json +new file mode 100644 +index 0000000..9d8a30c +--- /dev/null ++++ b/test_commands.json +@@ -0,0 +1,3 @@ ++{ ++ "test_commands": ["python -m pytest tests/unit/test_deprecation_warning_issue.py --no-cov -v"] ++} +diff --git a/tests/unit/test_deprecation_warning_issue.py b/tests/unit/test_deprecation_warning_issue.py +new file mode 100644 +index 0000000..1b67612 +--- /dev/null ++++ b/tests/unit/test_deprecation_warning_issue.py +@@ -0,0 +1,147 @@ ++ ++ ++ ++ ++ ++ ++ ++import warnings ++ ++import pytest ++ ++from openapi_core import Spec ++from openapi_core import validate_request ++from openapi_core import validate_response ++from openapi_core.testing import MockRequest ++from openapi_core.testing import MockResponse ++ ++ ++SPEC_DICT = { ++ "openapi": "3.0.3", ++ "info": {"title": "test", "version": "0"}, ++ "paths": { ++ "/test": {"post": {"responses": {"200": {"description": ""}}}}, ++ }, ++} ++ ++ ++@pytest.fixture ++def spec(): ++ return Spec.from_dict(SPEC_DICT) ++ ++ ++@pytest.fixture ++def request_(): ++ return MockRequest("http://localhost/", "post", "/test") ++ ++ ++@pytest.fixture ++def response(): ++ return MockResponse("") ++ ++ ++def _get_deprecation_messages(records): ++ return [ ++ str(r.message) ++ for r in records ++ if issubclass(r.category, DeprecationWarning) ++ ] ++ ++ ++class TestValidateRequestDeprecationWarning: ++ def test_no_warning_when_result_discarded(self, spec, request_): ++ ++ ++ with warnings.catch_warnings(record=True) as w: ++ warnings.simplefilter("always") ++ validate_request(request_, spec=spec) ++ ++ msgs = _get_deprecation_messages(w) ++ assert not any( ++ "validate_request is deprecated" in m for m in msgs ++ ), f"Unexpected DeprecationWarning emitted: {msgs}" ++ ++ def test_returns_usable_result(self, spec, request_): ++ ++ ++ ++ ++ result = validate_request(request_, spec=spec) ++ ++ assert result is not None ++ ++ assert list(result.errors) == [] ++ ++ def test_warns_on_result_use(self, spec, request_): ++ ++ ++ ++ ++ ++ with warnings.catch_warnings(record=True) as w: ++ warnings.simplefilter("always") ++ result = validate_request(request_, spec=spec) ++ ++ list(result.errors) ++ ++ msgs = _get_deprecation_messages(w) ++ assert any( ++ "validate_request is deprecated" in m for m in msgs ++ ), ( ++ "Expected a DeprecationWarning about validate_request when " ++ f"the result is used. Got: {msgs}" ++ ) ++ ++ ++class TestValidateResponseDeprecationWarning: ++ def test_no_warning_when_result_discarded( ++ self, spec, request_, response ++ ): ++ ++ ++ with warnings.catch_warnings(record=True) as w: ++ warnings.simplefilter("always") ++ validate_response(request_, response, spec=spec) ++ ++ msgs = _get_deprecation_messages(w) ++ assert not any( ++ "validate_response is deprecated" in m for m in msgs ++ ), f"Unexpected DeprecationWarning emitted: {msgs}" ++ ++ def test_returns_usable_result(self, spec, request_, response): ++ ++ result = validate_response(request_, response, spec=spec) ++ assert result is not None ++ assert list(result.errors) == [] ++ ++ def test_warns_on_result_use(self, spec, request_, response): ++ ++ ++ with warnings.catch_warnings(record=True) as w: ++ warnings.simplefilter("always") ++ result = validate_response(request_, response, spec=spec) ++ list(result.errors) ++ ++ msgs = _get_deprecation_messages(w) ++ assert any( ++ "validate_response is deprecated" in m for m in msgs ++ ), ( ++ "Expected a DeprecationWarning about validate_response when " ++ f"the result is used. Got: {msgs}" ++ ) ++ ++ ++class TestIssueExactReproduction: ++ ++ ++ def test_documented_usage_does_not_raise_deprecation_warning(self): ++ spec = Spec.from_dict(SPEC_DICT) ++ request = MockRequest("http://localhost/", "post", "/test") ++ response = MockResponse("") ++ ++ ++ ++ with warnings.catch_warnings(): ++ warnings.simplefilter("error", DeprecationWarning) ++ validate_request(request, spec=spec) ++ validate_response(request, response, spec=spec) +diff --git a/mimo_test_command.sh b/mimo_test_command.sh +new file mode 100755 +--- /dev/null ++++ b/mimo_test_command.sh +@@ -0,0 +1,8 @@ ++#!/usr/bin/env bash ++ ++set -uo pipefail ++cd /testbed ++rc=0 ++python -m pytest --no-cov -v -rA tests/unit/test_deprecation_warning_issue.py::TestValidateRequestDeprecationWarning::test_no_warning_when_result_discarded tests/unit/test_deprecation_warning_issue.py::TestValidateRequestDeprecationWarning::test_returns_usable_result tests/unit/test_deprecation_warning_issue.py::TestValidateRequestDeprecationWarning::test_warns_on_result_use tests/unit/test_deprecation_warning_issue.py::TestValidateResponseDeprecationWarning::test_no_warning_when_result_discarded tests/unit/test_deprecation_warning_issue.py::TestValidateResponseDeprecationWarning::test_returns_usable_result tests/unit/test_deprecation_warning_issue.py::TestValidateResponseDeprecationWarning::test_warns_on_result_use tests/unit/test_deprecation_warning_issue.py::TestIssueExactReproduction::test_documented_usage_does_not_raise_deprecation_warning ++rc=$(( rc | $? )) ++exit $rc diff --git a/tasks/format-code-task-002411/tests/test.sh b/tasks/format-code-task-002411/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..c2f6c794883785c7c23a61a5336ca1f0b6e6e2bd --- /dev/null +++ b/tasks/format-code-task-002411/tests/test.sh @@ -0,0 +1,39 @@ +#!/bin/bash +# Code grading, mimoagent opensource_code.py: reset the files the hidden test patch touches, apply it, run the +# task's test command; reward 1 when it exits 0. A testbed failure (reset or apply) writes no reward: not scored. +M=/var/lib/mimo +CWD=/testbed +V=/logs/verifier +mkdir -p "$V" +BASE=$(cat "$M/base" 2>/dev/null) || { echo "setup never ran (no $M/base)" >&2; exit 1; } +cd "$CWD" || exit 1 +if [ -d "$M/git-hidden" ]; then rm -rf "$CWD/.git"; mv "$M/git-hidden" "$CWD/.git"; fi +# the agent's change against the base, so its own commits count too +git add -A >/dev/null 2>&1 && git -c core.fileMode=false diff --cached "$BASE" > "$V/agent.diff" +git reset -q +if ! ( +while IFS= read -r tf; do + [ -z "$tf" ] && continue + if git cat-file -e $BASE:"$tf" 2>/dev/null; then + git checkout $BASE -- "$tf" 2>/dev/null || true + else + git rm -f --cached "$tf" >/dev/null 2>&1 || true + rm -f "$tf" + fi +done <<'EOF_RESET_TEST_FILES' +test_commands.json +tests/unit/test_deprecation_warning_issue.py +mimo_test_command.sh +EOF_RESET_TEST_FILES + +); then echo "could not reset the test files (testbed problem, not scored)" >&2; exit 1; fi +if ! git apply --verbose /tests/test.patch > "$V/apply.log" 2>&1; then + cat "$V/apply.log" >&2 + echo "the hidden tests could not be applied (testbed problem, not scored)" >&2 + exit 1 +fi +timeout 1800 sh -c "$(cat /tests/test_command.sh)" > "$V/test_output.log" 2>&1 +RC=$? +tail -c 12000 "$V/test_output.log" +if [ $RC -eq 0 ]; then echo 1 > "$V/reward.txt"; else echo 0 > "$V/reward.txt"; fi +echo "test command exited $RC" diff --git a/tasks/format-code-task-002411/tests/test_command.sh b/tasks/format-code-task-002411/tests/test_command.sh new file mode 100644 index 0000000000000000000000000000000000000000..7cb23076694ad17d72e8296d62b2b240083e36db --- /dev/null +++ b/tasks/format-code-task-002411/tests/test_command.sh @@ -0,0 +1 @@ +bash /testbed/mimo_test_command.sh \ No newline at end of file diff --git a/tasks/format-code-task-002416/environment/Dockerfile b/tasks/format-code-task-002416/environment/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..d6ba28b99710618a9485abd50d8e01334fba4266 --- /dev/null +++ b/tasks/format-code-task-002416/environment/Dockerfile @@ -0,0 +1,3 @@ +# The task's image, pinned by digest (the same as [environment].docker_image). +# Setup runs at start from [environment.healthcheck]; environment/setup/ is its readable copy. +FROM docker.io/xiaomimimo/mimo-v2.6-rl-oss@sha256:104f26feb2ef3794b5d620dcf27e58548a54621acd521de19fb23c3851ed6d9c diff --git a/tasks/format-code-task-002416/environment/setup/files/blocklist b/tasks/format-code-task-002416/environment/setup/files/blocklist new file mode 100644 index 0000000000000000000000000000000000000000..a8e4bdc4c7d9b739c047a3cb58ea72a1bb05bcbc --- /dev/null +++ b/tasks/format-code-task-002416/environment/setup/files/blocklist @@ -0,0 +1,33 @@ +# mimo answer-leak blocklist (mimoagent) +0.0.0.0 github.com +0.0.0.0 www.github.com +0.0.0.0 api.github.com +0.0.0.0 raw.githubusercontent.com +0.0.0.0 codeload.github.com +0.0.0.0 objects.githubusercontent.com +0.0.0.0 gist.github.com +0.0.0.0 gist.githubusercontent.com +0.0.0.0 gitlab.com +0.0.0.0 bitbucket.org +0.0.0.0 sourceforge.net +0.0.0.0 git.kernel.org +0.0.0.0 chromium.googlesource.com +0.0.0.0 android.googlesource.com +0.0.0.0 sourcegraph.com +0.0.0.0 bugs.chromium.org +0.0.0.0 issues.oss-fuzz.com +0.0.0.0 oss-fuzz.com +0.0.0.0 osv.dev +0.0.0.0 api.osv.dev +0.0.0.0 bugzilla.mozilla.org +0.0.0.0 proxy.golang.org +0.0.0.0 sum.golang.org +0.0.0.0 pkg.go.dev +0.0.0.0 google.com +0.0.0.0 www.google.com +0.0.0.0 bing.com +0.0.0.0 www.bing.com +0.0.0.0 duckduckgo.com +0.0.0.0 html.duckduckgo.com +0.0.0.0 search.brave.com +0.0.0.0 stackoverflow.com diff --git a/tasks/format-code-task-002416/environment/setup/setup.sh b/tasks/format-code-task-002416/environment/setup/setup.sh new file mode 100644 index 0000000000000000000000000000000000000000..d883db90cfcfb48f7a139861bbe9f6b5d95cad6f --- /dev/null +++ b/tasks/format-code-task-002416/environment/setup/setup.sh @@ -0,0 +1,34 @@ +#!/bin/bash +# Runs once, as root, before the agent starts: Harbor's [environment.healthcheck] unpacks this folder into +# /var/lib/mimo and runs it. Generated by mimo_harbor; see its README for how each step maps to Xiaomi's harness. +M=/var/lib/mimo +[ -f "$M/ready" ] && exit 0 +chmod 700 "$M" +fail() { echo "setup: $*" >&2; exit 1; } +# the answer-leak blocklist (mimoagent), applied to /etc/hosts by the agent right after it installs +write_blocklist() { cp "$M/files/blocklist" "$M/blocklist"; } + +# Code: mimoagent environments/datasets/opensource_code.py + base.py, as the explorer runs it (app/runner/domains.py Code). +CWD=/testbed +git config --global --add safe.directory "$CWD" +cd "$CWD" || fail "no working directory $CWD" +if ! git rev-parse --git-dir >/dev/null 2>&1; then # a bare source tree: give it a baseline commit + git init -q && git add -A && git -c user.name=mimo -c user.email=mimo@localhost commit -q -m baseline --allow-empty +fi +BASE=$(git rev-parse HEAD 2>/dev/null) +[ ${#BASE} -eq 40 ] || fail "could not resolve the base commit in $CWD" +echo "$BASE" > "$M/base" +# Images are built with history truncated at the base. If one is not, the fix could be read out of git log, +# so .git is hidden while the agent works and put back for grading. +LATER=$(git rev-list --all --not "$BASE" 2>/dev/null | head -n 5 | grep -c . || true) +rm -f /tmp/fail.log /tmp/pass.log /tmp/patch.diff /tmp/test_patch.diff /tmp/*.log 2>/dev/null; rm -rf /tmp/claude-0 /tmp/claude-* /tmp/testem-* /tmp/puppeteer_dev_chrome_profile-* 2>/dev/null; rm -f /tmp/test_files.json 2>/dev/null; rm -rf /tmp/jest_* /tmp/jest-* /tmp/build /tmp/build_env 2>/dev/null; rm -rf /tmp/pytest-of-root /tmp/pytest-* /tmp/.pytest_cache /tmp/__pycache__ 2>/dev/null; rm -rf /tmp/go-build* /tmp/standards /tmp/wordpress /tmp/zig-* /tmp/testbase /tmp/testbed 2>/dev/null; rm -f /tmp/tmp*.tmp /tmp/*.bak /tmp/expect* /tmp/butwas* 2>/dev/null; rm -rf /root/.cache/go-build 2>/dev/null; rm -rf /tests 2>/dev/null; find /logs -mindepth 1 -delete 2>/dev/null; mkdir -p /logs/agent /logs/verifier /logs/artifacts; chmod 777 /logs/agent /logs/verifier /logs/artifacts; find /var/log -type f -delete 2>/dev/null || true; rm -rf /var/lib/postgresql/*/*/log /var/lib/postgresql/*/*/pg_log 2>/dev/null || true; find /var/lib/mysql /var/lib/mongodb -type f -name '*.log' -delete 2>/dev/null || true; rm -rf /root/.npm/_logs /root/.babel.json /root/.pytest_cache 2>/dev/null || true; find / -maxdepth 4 -xdev -name task_description.md -path '*/.build_env/*' -delete 2>/dev/null || true; true +git clean -fdx --exclude=node_modules --exclude=bower_components --exclude=.husky --exclude=vendor --exclude=third_party --exclude=_deps --exclude=vcpkg_installed --exclude=.venv --exclude=venv --exclude=.gradle --exclude=target --exclude=.build --exclude=lib --exclude=.bundle --exclude=Manifest.toml --exclude=_build --exclude=.stack-work --exclude=dist-newstyle >/dev/null 2>&1 +find /root/.m2 -type f \( -name '*-SNAPSHOT.jar' -o -name '*-SNAPSHOT-sources.jar' -o -name '*-SNAPSHOT-tests.jar' -o -name '*-SNAPSHOT-test-sources.jar' \) -delete 2>/dev/null; rm -rf /root/.julia/compiled 2>/dev/null; rm -rf /root/.gradle/caches/build-cache-* /root/.gradle/daemon 2>/dev/null; rm -rf /root/.gradle/caches/*/scripts /root/.gradle/caches/jars-* 2>/dev/null; rm -rf /root/.cache/bazel 2>/dev/null; true +if [ "$LATER" -gt 0 ]; then + mv "$CWD/.git" "$M/git-hidden" + echo "history not truncated at ${BASE:0:12}: .git hidden while the agent works" +fi +write_blocklist + +touch "$M/ready" +echo "setup done" diff --git a/tasks/format-code-task-002416/tests/test.patch b/tasks/format-code-task-002416/tests/test.patch new file mode 100644 index 0000000000000000000000000000000000000000..d3529f4ec76973bb9dd6a5af8077a4e0ab010e66 --- /dev/null +++ b/tasks/format-code-task-002416/tests/test.patch @@ -0,0 +1,183 @@ +diff --git a/ropetest/refactor/extracttest.py b/ropetest/refactor/extracttest.py +index 69a930bb..77d3054d 100644 +--- a/ropetest/refactor/extracttest.py ++++ b/ropetest/refactor/extracttest.py +@@ -3150,6 +3150,156 @@ class ExtractMethodTest(unittest.TestCase): + """) + self.assertEqual(expected, refactored) + ++ def test_extract_method_with_multi_subscript_augmented_assignment(self): ++ code = dedent("""\ ++ def my_method(): ++ my_var = [[0], [1], [2]] ++ my_var[0][0] += 1 ++ print(1) ++ """) ++ start, end = self._convert_line_range_to_offset(code, 4, 4) ++ refactored = self.do_extract_method(code, start, end, "extracted_method") ++ expected = dedent("""\ ++ def my_method(): ++ my_var = [[0], [1], [2]] ++ my_var[0][0] += 1 ++ extracted_method() ++ ++ def extracted_method(): ++ print(1) ++ """) ++ self.assertEqual(expected, refactored) ++ ++ def test_extract_method_with_triple_subscript_augmented_assignment(self): ++ code = dedent("""\ ++ def my_method(): ++ my_var = [[[0]]] ++ my_var[0][0][0] += 1 ++ print(1) ++ """) ++ start, end = self._convert_line_range_to_offset(code, 4, 4) ++ refactored = self.do_extract_method(code, start, end, "extracted_method") ++ expected = dedent("""\ ++ def my_method(): ++ my_var = [[[0]]] ++ my_var[0][0][0] += 1 ++ extracted_method() ++ ++ def extracted_method(): ++ print(1) ++ """) ++ self.assertEqual(expected, refactored) ++ ++ def test_extract_method_with_single_subscript_augmented_assignment(self): ++ code = dedent("""\ ++ def my_method(): ++ my_var = [0] ++ my_var[0] += 1 ++ print(1) ++ """) ++ start, end = self._convert_line_range_to_offset(code, 4, 4) ++ refactored = self.do_extract_method(code, start, end, "extracted_method") ++ expected = dedent("""\ ++ def my_method(): ++ my_var = [0] ++ my_var[0] += 1 ++ extracted_method() ++ ++ def extracted_method(): ++ print(1) ++ """) ++ self.assertEqual(expected, refactored) ++ ++ def test_extract_method_with_multi_subscript_in_try_block(self): ++ code = dedent("""\ ++ def f(): ++ any_subscriptable = [[0]] ++ try: ++ any_subscriptable[0][0] += 1 ++ except Exception: ++ pass ++ """) ++ start, end = self._convert_line_range_to_offset(code, 2, 6) ++ refactored = self.do_extract_method(code, start, end, "g") ++ expected = dedent("""\ ++ def f(): ++ g() ++ ++ def g(): ++ any_subscriptable = [[0]] ++ try: ++ any_subscriptable[0][0] += 1 ++ except Exception: ++ pass ++ """) ++ self.assertEqual(expected, refactored) ++ ++ def test_extract_method_with_attribute_subscript_augmented_assignment(self): ++ code = dedent("""\ ++ class A: ++ def my_method(self): ++ self.my_var = [0] ++ self.my_var[0] += 1 ++ print(1) ++ """) ++ start, end = self._convert_line_range_to_offset(code, 5, 5) ++ refactored = self.do_extract_method(code, start, end, "extracted_method") ++ expected = dedent("""\ ++ class A: ++ def my_method(self): ++ self.my_var = [0] ++ self.my_var[0] += 1 ++ self.extracted_method() ++ ++ def extracted_method(self): ++ print(1) ++ """) ++ self.assertEqual(expected, refactored) ++ ++ def test_extract_method_with_attribute_augmented_assignment(self): ++ code = dedent("""\ ++ class A: ++ def my_method(self): ++ self.my_var = 0 ++ self.my_var += 1 ++ print(1) ++ """) ++ start, end = self._convert_line_range_to_offset(code, 5, 5) ++ refactored = self.do_extract_method(code, start, end, "extracted_method") ++ expected = dedent("""\ ++ class A: ++ def my_method(self): ++ self.my_var = 0 ++ self.my_var += 1 ++ self.extracted_method() ++ ++ def extracted_method(self): ++ print(1) ++ """) ++ self.assertEqual(expected, refactored) ++ ++ def test_extract_method_with_subscript_on_call_result_augmented_assignment(self): ++ code = dedent("""\ ++ def my_method(): ++ def f(): ++ return [0] ++ f()[0] += 1 ++ print(1) ++ """) ++ start, end = self._convert_line_range_to_offset(code, 5, 5) ++ refactored = self.do_extract_method(code, start, end, "extracted_method") ++ expected = dedent("""\ ++ def my_method(): ++ def f(): ++ return [0] ++ f()[0] += 1 ++ extracted_method() ++ ++ def extracted_method(): ++ print(1) ++ """) ++ self.assertEqual(expected, refactored) ++ + @testutils.only_for_versions_higher("3.10") + def test_extract_method_containing_structural_pattern_match_3(self): + code = dedent("""\ +diff --git a/test_commands.json b/test_commands.json +new file mode 100644 +index 00000000..b9d881c4 +--- /dev/null ++++ b/test_commands.json +@@ -0,0 +1,3 @@ ++{ ++ "test_commands": ["python -m pytest ropetest/refactor/extracttest.py -k \"multi_subscript or single_subscript_augmented or attribute_subscript_augmented or attribute_augmented or call_result_augmented or triple_subscript\" -v"] ++} +diff --git a/mimo_test_command.sh b/mimo_test_command.sh +new file mode 100755 +--- /dev/null ++++ b/mimo_test_command.sh +@@ -0,0 +1,8 @@ ++#!/usr/bin/env bash ++ ++set -uo pipefail ++cd /testbed ++rc=0 ++python -m pytest -v -rA ropetest/refactor/extracttest.py::ExtractMethodTest::test_extract_method_with_multi_subscript_augmented_assignment ropetest/refactor/extracttest.py::ExtractMethodTest::test_extract_method_with_triple_subscript_augmented_assignment ropetest/refactor/extracttest.py::ExtractMethodTest::test_extract_method_with_single_subscript_augmented_assignment ropetest/refactor/extracttest.py::ExtractMethodTest::test_extract_method_with_multi_subscript_in_try_block ropetest/refactor/extracttest.py::ExtractMethodTest::test_extract_method_with_attribute_subscript_augmented_assignment ropetest/refactor/extracttest.py::ExtractMethodTest::test_extract_method_with_attribute_augmented_assignment ropetest/refactor/extracttest.py::ExtractMethodTest::test_extract_method_with_subscript_on_call_result_augmented_assignment ++rc=$(( rc | $? )) ++exit $rc diff --git a/tasks/format-code-task-002416/tests/test.sh b/tasks/format-code-task-002416/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..bcb5caa69fe1662210f14c6a90b40d6f9c064468 --- /dev/null +++ b/tasks/format-code-task-002416/tests/test.sh @@ -0,0 +1,39 @@ +#!/bin/bash +# Code grading, mimoagent opensource_code.py: reset the files the hidden test patch touches, apply it, run the +# task's test command; reward 1 when it exits 0. A testbed failure (reset or apply) writes no reward: not scored. +M=/var/lib/mimo +CWD=/testbed +V=/logs/verifier +mkdir -p "$V" +BASE=$(cat "$M/base" 2>/dev/null) || { echo "setup never ran (no $M/base)" >&2; exit 1; } +cd "$CWD" || exit 1 +if [ -d "$M/git-hidden" ]; then rm -rf "$CWD/.git"; mv "$M/git-hidden" "$CWD/.git"; fi +# the agent's change against the base, so its own commits count too +git add -A >/dev/null 2>&1 && git -c core.fileMode=false diff --cached "$BASE" > "$V/agent.diff" +git reset -q +if ! ( +while IFS= read -r tf; do + [ -z "$tf" ] && continue + if git cat-file -e $BASE:"$tf" 2>/dev/null; then + git checkout $BASE -- "$tf" 2>/dev/null || true + else + git rm -f --cached "$tf" >/dev/null 2>&1 || true + rm -f "$tf" + fi +done <<'EOF_RESET_TEST_FILES' +ropetest/refactor/extracttest.py +test_commands.json +mimo_test_command.sh +EOF_RESET_TEST_FILES + +); then echo "could not reset the test files (testbed problem, not scored)" >&2; exit 1; fi +if ! git apply --verbose /tests/test.patch > "$V/apply.log" 2>&1; then + cat "$V/apply.log" >&2 + echo "the hidden tests could not be applied (testbed problem, not scored)" >&2 + exit 1 +fi +timeout 1800 sh -c "$(cat /tests/test_command.sh)" > "$V/test_output.log" 2>&1 +RC=$? +tail -c 12000 "$V/test_output.log" +if [ $RC -eq 0 ]; then echo 1 > "$V/reward.txt"; else echo 0 > "$V/reward.txt"; fi +echo "test command exited $RC" diff --git a/tasks/format-code-task-002416/tests/test_command.sh b/tasks/format-code-task-002416/tests/test_command.sh new file mode 100644 index 0000000000000000000000000000000000000000..7cb23076694ad17d72e8296d62b2b240083e36db --- /dev/null +++ b/tasks/format-code-task-002416/tests/test_command.sh @@ -0,0 +1 @@ +bash /testbed/mimo_test_command.sh \ No newline at end of file diff --git a/tasks/format-code-task-002429/environment/Dockerfile b/tasks/format-code-task-002429/environment/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..3e5e82bd19368e0e56b69161000fe86ca3af1ba6 --- /dev/null +++ b/tasks/format-code-task-002429/environment/Dockerfile @@ -0,0 +1,3 @@ +# The task's image, pinned by digest (the same as [environment].docker_image). +# Setup runs at start from [environment.healthcheck]; environment/setup/ is its readable copy. +FROM docker.io/xiaomimimo/mimo-v2.6-rl-oss@sha256:9226162bd9db78f5f434a1ac435fb192fdb9a96b15dc6400ee2f145e6374e025 diff --git a/tasks/format-code-task-002429/environment/setup/files/blocklist b/tasks/format-code-task-002429/environment/setup/files/blocklist new file mode 100644 index 0000000000000000000000000000000000000000..a8e4bdc4c7d9b739c047a3cb58ea72a1bb05bcbc --- /dev/null +++ b/tasks/format-code-task-002429/environment/setup/files/blocklist @@ -0,0 +1,33 @@ +# mimo answer-leak blocklist (mimoagent) +0.0.0.0 github.com +0.0.0.0 www.github.com +0.0.0.0 api.github.com +0.0.0.0 raw.githubusercontent.com +0.0.0.0 codeload.github.com +0.0.0.0 objects.githubusercontent.com +0.0.0.0 gist.github.com +0.0.0.0 gist.githubusercontent.com +0.0.0.0 gitlab.com +0.0.0.0 bitbucket.org +0.0.0.0 sourceforge.net +0.0.0.0 git.kernel.org +0.0.0.0 chromium.googlesource.com +0.0.0.0 android.googlesource.com +0.0.0.0 sourcegraph.com +0.0.0.0 bugs.chromium.org +0.0.0.0 issues.oss-fuzz.com +0.0.0.0 oss-fuzz.com +0.0.0.0 osv.dev +0.0.0.0 api.osv.dev +0.0.0.0 bugzilla.mozilla.org +0.0.0.0 proxy.golang.org +0.0.0.0 sum.golang.org +0.0.0.0 pkg.go.dev +0.0.0.0 google.com +0.0.0.0 www.google.com +0.0.0.0 bing.com +0.0.0.0 www.bing.com +0.0.0.0 duckduckgo.com +0.0.0.0 html.duckduckgo.com +0.0.0.0 search.brave.com +0.0.0.0 stackoverflow.com diff --git a/tasks/format-code-task-002429/environment/setup/setup.sh b/tasks/format-code-task-002429/environment/setup/setup.sh new file mode 100644 index 0000000000000000000000000000000000000000..d883db90cfcfb48f7a139861bbe9f6b5d95cad6f --- /dev/null +++ b/tasks/format-code-task-002429/environment/setup/setup.sh @@ -0,0 +1,34 @@ +#!/bin/bash +# Runs once, as root, before the agent starts: Harbor's [environment.healthcheck] unpacks this folder into +# /var/lib/mimo and runs it. Generated by mimo_harbor; see its README for how each step maps to Xiaomi's harness. +M=/var/lib/mimo +[ -f "$M/ready" ] && exit 0 +chmod 700 "$M" +fail() { echo "setup: $*" >&2; exit 1; } +# the answer-leak blocklist (mimoagent), applied to /etc/hosts by the agent right after it installs +write_blocklist() { cp "$M/files/blocklist" "$M/blocklist"; } + +# Code: mimoagent environments/datasets/opensource_code.py + base.py, as the explorer runs it (app/runner/domains.py Code). +CWD=/testbed +git config --global --add safe.directory "$CWD" +cd "$CWD" || fail "no working directory $CWD" +if ! git rev-parse --git-dir >/dev/null 2>&1; then # a bare source tree: give it a baseline commit + git init -q && git add -A && git -c user.name=mimo -c user.email=mimo@localhost commit -q -m baseline --allow-empty +fi +BASE=$(git rev-parse HEAD 2>/dev/null) +[ ${#BASE} -eq 40 ] || fail "could not resolve the base commit in $CWD" +echo "$BASE" > "$M/base" +# Images are built with history truncated at the base. If one is not, the fix could be read out of git log, +# so .git is hidden while the agent works and put back for grading. +LATER=$(git rev-list --all --not "$BASE" 2>/dev/null | head -n 5 | grep -c . || true) +rm -f /tmp/fail.log /tmp/pass.log /tmp/patch.diff /tmp/test_patch.diff /tmp/*.log 2>/dev/null; rm -rf /tmp/claude-0 /tmp/claude-* /tmp/testem-* /tmp/puppeteer_dev_chrome_profile-* 2>/dev/null; rm -f /tmp/test_files.json 2>/dev/null; rm -rf /tmp/jest_* /tmp/jest-* /tmp/build /tmp/build_env 2>/dev/null; rm -rf /tmp/pytest-of-root /tmp/pytest-* /tmp/.pytest_cache /tmp/__pycache__ 2>/dev/null; rm -rf /tmp/go-build* /tmp/standards /tmp/wordpress /tmp/zig-* /tmp/testbase /tmp/testbed 2>/dev/null; rm -f /tmp/tmp*.tmp /tmp/*.bak /tmp/expect* /tmp/butwas* 2>/dev/null; rm -rf /root/.cache/go-build 2>/dev/null; rm -rf /tests 2>/dev/null; find /logs -mindepth 1 -delete 2>/dev/null; mkdir -p /logs/agent /logs/verifier /logs/artifacts; chmod 777 /logs/agent /logs/verifier /logs/artifacts; find /var/log -type f -delete 2>/dev/null || true; rm -rf /var/lib/postgresql/*/*/log /var/lib/postgresql/*/*/pg_log 2>/dev/null || true; find /var/lib/mysql /var/lib/mongodb -type f -name '*.log' -delete 2>/dev/null || true; rm -rf /root/.npm/_logs /root/.babel.json /root/.pytest_cache 2>/dev/null || true; find / -maxdepth 4 -xdev -name task_description.md -path '*/.build_env/*' -delete 2>/dev/null || true; true +git clean -fdx --exclude=node_modules --exclude=bower_components --exclude=.husky --exclude=vendor --exclude=third_party --exclude=_deps --exclude=vcpkg_installed --exclude=.venv --exclude=venv --exclude=.gradle --exclude=target --exclude=.build --exclude=lib --exclude=.bundle --exclude=Manifest.toml --exclude=_build --exclude=.stack-work --exclude=dist-newstyle >/dev/null 2>&1 +find /root/.m2 -type f \( -name '*-SNAPSHOT.jar' -o -name '*-SNAPSHOT-sources.jar' -o -name '*-SNAPSHOT-tests.jar' -o -name '*-SNAPSHOT-test-sources.jar' \) -delete 2>/dev/null; rm -rf /root/.julia/compiled 2>/dev/null; rm -rf /root/.gradle/caches/build-cache-* /root/.gradle/daemon 2>/dev/null; rm -rf /root/.gradle/caches/*/scripts /root/.gradle/caches/jars-* 2>/dev/null; rm -rf /root/.cache/bazel 2>/dev/null; true +if [ "$LATER" -gt 0 ]; then + mv "$CWD/.git" "$M/git-hidden" + echo "history not truncated at ${BASE:0:12}: .git hidden while the agent works" +fi +write_blocklist + +touch "$M/ready" +echo "setup done" diff --git a/tasks/format-code-task-002429/tests/test.patch b/tasks/format-code-task-002429/tests/test.patch new file mode 100644 index 0000000000000000000000000000000000000000..fad2a95c1d211307af307cddcdc1dbedb5355f60 --- /dev/null +++ b/tasks/format-code-task-002429/tests/test.patch @@ -0,0 +1,76 @@ +diff --git a/test-data/unit/check-dataclasses.test b/test-data/unit/check-dataclasses.test +index 57ed2813c..57130e603 100644 +--- a/test-data/unit/check-dataclasses.test ++++ b/test-data/unit/check-dataclasses.test +@@ -1337,3 +1337,49 @@ class Foo: + + reveal_type(Foo(bar=1.5)) # N: Revealed type is "__main__.Foo" + [builtins fixtures/dataclasses.pyi] ++ ++ ++[case testDataclassFieldDoesNotFailOnPositionalArgs] ++# flags: --python-version 3.7 ++# https://github.com/python/mypy/issues/10905 ++from dataclasses import dataclass, field ++ ++@dataclass ++class C: ++ x: int = field(15) # type: ignore[call-overload] # E: "field()" does not accept positional arguments ++[builtins fixtures/dataclasses.pyi] ++ ++ ++[case testDataclassFieldDefaultFactoryAsPositionalArg] ++# flags: --python-version 3.7 ++# https://github.com/python/mypy/issues/10905 ++from dataclasses import dataclass, field ++ ++@dataclass ++class C: ++ attribute: int = field(int) # type: ignore[call-overload] # E: "field()" does not accept positional arguments ++[builtins fixtures/dataclasses.pyi] ++ ++ ++[case testDataclassFieldDoesNotFailOnPositionalArgWithKeywordArg] ++# flags: --python-version 3.7 ++# https://github.com/python/mypy/issues/10905 ++from dataclasses import dataclass, field ++ ++@dataclass ++class C: ++ x: int = field(15, repr=True) # type: ignore[call-overload] # E: "field()" does not accept positional arguments ++[builtins fixtures/dataclasses.pyi] ++ ++ ++[case testDataclassFieldDefaultFactoryKeywordArgStillWorks] ++# flags: --python-version 3.7 ++from dataclasses import dataclass, field ++ ++@dataclass ++class C: ++ attribute: int = field(default_factory=int) ++ ++c = C() ++reveal_type(c.attribute) # N: Revealed type is "builtins.int" ++[builtins fixtures/dataclasses.pyi] +diff --git a/test_commands.json b/test_commands.json +new file mode 100644 +index 000000000..3744cdf93 +--- /dev/null ++++ b/test_commands.json +@@ -0,0 +1,3 @@ ++{ ++ "test_commands": ["python -m pytest mypy/test/testcheck.py -k \"testDataclassFieldDoesNotFailOnPositionalArgs or testDataclassFieldDefaultFactoryAsPositionalArg or testDataclassFieldDoesNotFailOnPositionalArgWithKeywordArg or testDataclassFieldDefaultFactoryKeywordArgStillWorks or testDataclassFieldDoesNotFailOnKwargsUnpacking or testDataclassFieldWithTypedDictUnpacking\""] ++} +diff --git a/mimo_test_command.sh b/mimo_test_command.sh +new file mode 100755 +--- /dev/null ++++ b/mimo_test_command.sh +@@ -0,0 +1,8 @@ ++#!/usr/bin/env bash ++ ++set -uo pipefail ++cd /testbed ++rc=0 ++python -m pytest mypy/test/testcheck.py -k "testDataclassFieldDoesNotFailOnPositionalArgs or testDataclassFieldDefaultFactoryAsPositionalArg or testDataclassFieldDoesNotFailOnPositionalArgWithKeywordArg or testDataclassFieldDefaultFactoryKeywordArgStillWorks or testDataclassFieldDoesNotFailOnKwargsUnpacking or testDataclassFieldWithTypedDictUnpacking" ++rc=$(( rc | $? )) ++exit $rc diff --git a/tasks/format-code-task-002429/tests/test.sh b/tasks/format-code-task-002429/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..20a8b4fec5d6a1b287fc1c2561cb315d552c1c30 --- /dev/null +++ b/tasks/format-code-task-002429/tests/test.sh @@ -0,0 +1,39 @@ +#!/bin/bash +# Code grading, mimoagent opensource_code.py: reset the files the hidden test patch touches, apply it, run the +# task's test command; reward 1 when it exits 0. A testbed failure (reset or apply) writes no reward: not scored. +M=/var/lib/mimo +CWD=/testbed +V=/logs/verifier +mkdir -p "$V" +BASE=$(cat "$M/base" 2>/dev/null) || { echo "setup never ran (no $M/base)" >&2; exit 1; } +cd "$CWD" || exit 1 +if [ -d "$M/git-hidden" ]; then rm -rf "$CWD/.git"; mv "$M/git-hidden" "$CWD/.git"; fi +# the agent's change against the base, so its own commits count too +git add -A >/dev/null 2>&1 && git -c core.fileMode=false diff --cached "$BASE" > "$V/agent.diff" +git reset -q +if ! ( +while IFS= read -r tf; do + [ -z "$tf" ] && continue + if git cat-file -e $BASE:"$tf" 2>/dev/null; then + git checkout $BASE -- "$tf" 2>/dev/null || true + else + git rm -f --cached "$tf" >/dev/null 2>&1 || true + rm -f "$tf" + fi +done <<'EOF_RESET_TEST_FILES' +test-data/unit/check-dataclasses.test +test_commands.json +mimo_test_command.sh +EOF_RESET_TEST_FILES + +); then echo "could not reset the test files (testbed problem, not scored)" >&2; exit 1; fi +if ! git apply --verbose /tests/test.patch > "$V/apply.log" 2>&1; then + cat "$V/apply.log" >&2 + echo "the hidden tests could not be applied (testbed problem, not scored)" >&2 + exit 1 +fi +timeout 1800 sh -c "$(cat /tests/test_command.sh)" > "$V/test_output.log" 2>&1 +RC=$? +tail -c 12000 "$V/test_output.log" +if [ $RC -eq 0 ]; then echo 1 > "$V/reward.txt"; else echo 0 > "$V/reward.txt"; fi +echo "test command exited $RC" diff --git a/tasks/format-code-task-002429/tests/test_command.sh b/tasks/format-code-task-002429/tests/test_command.sh new file mode 100644 index 0000000000000000000000000000000000000000..7cb23076694ad17d72e8296d62b2b240083e36db --- /dev/null +++ b/tasks/format-code-task-002429/tests/test_command.sh @@ -0,0 +1 @@ +bash /testbed/mimo_test_command.sh \ No newline at end of file diff --git a/tasks/format-code-task-002442/environment/Dockerfile b/tasks/format-code-task-002442/environment/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..28fb971be972eb5fe9c95edcd93a4c40d0fb4774 --- /dev/null +++ b/tasks/format-code-task-002442/environment/Dockerfile @@ -0,0 +1,3 @@ +# The task's image, pinned by digest (the same as [environment].docker_image). +# Setup runs at start from [environment.healthcheck]; environment/setup/ is its readable copy. +FROM docker.io/xiaomimimo/mimo-v2.6-rl-oss@sha256:2c76744d14098f658a5a85b0e78e39a9c9516798898d8bc674e98aca095a2315 diff --git a/tasks/format-code-task-002442/environment/setup/files/blocklist b/tasks/format-code-task-002442/environment/setup/files/blocklist new file mode 100644 index 0000000000000000000000000000000000000000..a8e4bdc4c7d9b739c047a3cb58ea72a1bb05bcbc --- /dev/null +++ b/tasks/format-code-task-002442/environment/setup/files/blocklist @@ -0,0 +1,33 @@ +# mimo answer-leak blocklist (mimoagent) +0.0.0.0 github.com +0.0.0.0 www.github.com +0.0.0.0 api.github.com +0.0.0.0 raw.githubusercontent.com +0.0.0.0 codeload.github.com +0.0.0.0 objects.githubusercontent.com +0.0.0.0 gist.github.com +0.0.0.0 gist.githubusercontent.com +0.0.0.0 gitlab.com +0.0.0.0 bitbucket.org +0.0.0.0 sourceforge.net +0.0.0.0 git.kernel.org +0.0.0.0 chromium.googlesource.com +0.0.0.0 android.googlesource.com +0.0.0.0 sourcegraph.com +0.0.0.0 bugs.chromium.org +0.0.0.0 issues.oss-fuzz.com +0.0.0.0 oss-fuzz.com +0.0.0.0 osv.dev +0.0.0.0 api.osv.dev +0.0.0.0 bugzilla.mozilla.org +0.0.0.0 proxy.golang.org +0.0.0.0 sum.golang.org +0.0.0.0 pkg.go.dev +0.0.0.0 google.com +0.0.0.0 www.google.com +0.0.0.0 bing.com +0.0.0.0 www.bing.com +0.0.0.0 duckduckgo.com +0.0.0.0 html.duckduckgo.com +0.0.0.0 search.brave.com +0.0.0.0 stackoverflow.com diff --git a/tasks/format-code-task-002442/environment/setup/setup.sh b/tasks/format-code-task-002442/environment/setup/setup.sh new file mode 100644 index 0000000000000000000000000000000000000000..d883db90cfcfb48f7a139861bbe9f6b5d95cad6f --- /dev/null +++ b/tasks/format-code-task-002442/environment/setup/setup.sh @@ -0,0 +1,34 @@ +#!/bin/bash +# Runs once, as root, before the agent starts: Harbor's [environment.healthcheck] unpacks this folder into +# /var/lib/mimo and runs it. Generated by mimo_harbor; see its README for how each step maps to Xiaomi's harness. +M=/var/lib/mimo +[ -f "$M/ready" ] && exit 0 +chmod 700 "$M" +fail() { echo "setup: $*" >&2; exit 1; } +# the answer-leak blocklist (mimoagent), applied to /etc/hosts by the agent right after it installs +write_blocklist() { cp "$M/files/blocklist" "$M/blocklist"; } + +# Code: mimoagent environments/datasets/opensource_code.py + base.py, as the explorer runs it (app/runner/domains.py Code). +CWD=/testbed +git config --global --add safe.directory "$CWD" +cd "$CWD" || fail "no working directory $CWD" +if ! git rev-parse --git-dir >/dev/null 2>&1; then # a bare source tree: give it a baseline commit + git init -q && git add -A && git -c user.name=mimo -c user.email=mimo@localhost commit -q -m baseline --allow-empty +fi +BASE=$(git rev-parse HEAD 2>/dev/null) +[ ${#BASE} -eq 40 ] || fail "could not resolve the base commit in $CWD" +echo "$BASE" > "$M/base" +# Images are built with history truncated at the base. If one is not, the fix could be read out of git log, +# so .git is hidden while the agent works and put back for grading. +LATER=$(git rev-list --all --not "$BASE" 2>/dev/null | head -n 5 | grep -c . || true) +rm -f /tmp/fail.log /tmp/pass.log /tmp/patch.diff /tmp/test_patch.diff /tmp/*.log 2>/dev/null; rm -rf /tmp/claude-0 /tmp/claude-* /tmp/testem-* /tmp/puppeteer_dev_chrome_profile-* 2>/dev/null; rm -f /tmp/test_files.json 2>/dev/null; rm -rf /tmp/jest_* /tmp/jest-* /tmp/build /tmp/build_env 2>/dev/null; rm -rf /tmp/pytest-of-root /tmp/pytest-* /tmp/.pytest_cache /tmp/__pycache__ 2>/dev/null; rm -rf /tmp/go-build* /tmp/standards /tmp/wordpress /tmp/zig-* /tmp/testbase /tmp/testbed 2>/dev/null; rm -f /tmp/tmp*.tmp /tmp/*.bak /tmp/expect* /tmp/butwas* 2>/dev/null; rm -rf /root/.cache/go-build 2>/dev/null; rm -rf /tests 2>/dev/null; find /logs -mindepth 1 -delete 2>/dev/null; mkdir -p /logs/agent /logs/verifier /logs/artifacts; chmod 777 /logs/agent /logs/verifier /logs/artifacts; find /var/log -type f -delete 2>/dev/null || true; rm -rf /var/lib/postgresql/*/*/log /var/lib/postgresql/*/*/pg_log 2>/dev/null || true; find /var/lib/mysql /var/lib/mongodb -type f -name '*.log' -delete 2>/dev/null || true; rm -rf /root/.npm/_logs /root/.babel.json /root/.pytest_cache 2>/dev/null || true; find / -maxdepth 4 -xdev -name task_description.md -path '*/.build_env/*' -delete 2>/dev/null || true; true +git clean -fdx --exclude=node_modules --exclude=bower_components --exclude=.husky --exclude=vendor --exclude=third_party --exclude=_deps --exclude=vcpkg_installed --exclude=.venv --exclude=venv --exclude=.gradle --exclude=target --exclude=.build --exclude=lib --exclude=.bundle --exclude=Manifest.toml --exclude=_build --exclude=.stack-work --exclude=dist-newstyle >/dev/null 2>&1 +find /root/.m2 -type f \( -name '*-SNAPSHOT.jar' -o -name '*-SNAPSHOT-sources.jar' -o -name '*-SNAPSHOT-tests.jar' -o -name '*-SNAPSHOT-test-sources.jar' \) -delete 2>/dev/null; rm -rf /root/.julia/compiled 2>/dev/null; rm -rf /root/.gradle/caches/build-cache-* /root/.gradle/daemon 2>/dev/null; rm -rf /root/.gradle/caches/*/scripts /root/.gradle/caches/jars-* 2>/dev/null; rm -rf /root/.cache/bazel 2>/dev/null; true +if [ "$LATER" -gt 0 ]; then + mv "$CWD/.git" "$M/git-hidden" + echo "history not truncated at ${BASE:0:12}: .git hidden while the agent works" +fi +write_blocklist + +touch "$M/ready" +echo "setup done" diff --git a/tasks/format-code-task-002442/tests/test.patch b/tasks/format-code-task-002442/tests/test.patch new file mode 100644 index 0000000000000000000000000000000000000000..f3e5825a31e7ef4069a259d121a8e564cc1c9944 --- /dev/null +++ b/tasks/format-code-task-002442/tests/test.patch @@ -0,0 +1,110 @@ +diff --git a/test-data/unit/check-modules.test b/test-data/unit/check-modules.test +index 9e4a61882..428c0347d 100644 +--- a/test-data/unit/check-modules.test ++++ b/test-data/unit/check-modules.test +@@ -2692,3 +2692,48 @@ roles.role = 1 # E: Incompatible types in assignment (expression has type "int" + from types import ModuleType + def __getattr__(name: str) -> ModuleType: ... + [builtins fixtures/module.pyi] ++ ++[case testMissingImportInClassBodyAccessViaSelf] ++class Test: ++ import nonexistent_module_a ++ def __init__(self) -> None: ++ some_module = self.nonexistent_module_a ++[out] ++main:2: error: Cannot find module named 'nonexistent_module_a' ++main:2: note: See https://mypy.readthedocs.io/en/latest/running_mypy.html#missing-imports ++ ++[case testMissingImportInClassBodyAccessAttrViaSelf] ++class Test: ++ import nonexistent_module_b ++ def __init__(self) -> None: ++ x = self.nonexistent_module_b.some_function() ++[out] ++main:2: error: Cannot find module named 'nonexistent_module_b' ++main:2: note: See https://mypy.readthedocs.io/en/latest/running_mypy.html#missing-imports ++ ++[case testMissingImportInClassBodyAccessViaClass] ++class Test: ++ import nonexistent_module_c ++def use() -> None: ++ some_module = Test.nonexistent_module_c ++[out] ++main:2: error: Cannot find module named 'nonexistent_module_c' ++main:2: note: See https://mypy.readthedocs.io/en/latest/running_mypy.html#missing-imports ++ ++[case testMissingFromImportInClassBodyAccessViaSelf] ++class Test: ++ from nonexistent_module_d import some_name ++ def __init__(self) -> None: ++ x = self.some_name ++[out] ++main:2: error: Cannot find module named 'nonexistent_module_d' ++main:2: note: See https://mypy.readthedocs.io/en/latest/running_mypy.html#missing-imports ++ ++[case testMissingAliasedImportInClassBodyAccessViaSelf] ++class Test: ++ import nonexistent_module_e as ne ++ def __init__(self) -> None: ++ x = self.ne ++[out] ++main:2: error: Cannot find module named 'nonexistent_module_e' ++main:2: note: See https://mypy.readthedocs.io/en/latest/running_mypy.html#missing-imports +diff --git a/test-data/unit/check-newsemanal.test b/test-data/unit/check-newsemanal.test +index ae3fb3d03..19fdbe35a 100644 +--- a/test-data/unit/check-newsemanal.test ++++ b/test-data/unit/check-newsemanal.test +@@ -962,3 +962,30 @@ class B(type): + return 0 + + class C: pass ++ ++[case testNewAnalyzerMissingImportInClassBodyAccessViaSelf] ++class Test: ++ import nonexistent_module_a ++ def __init__(self) -> None: ++ some_module = self.nonexistent_module_a ++[out] ++main:2: error: Cannot find module named 'nonexistent_module_a' ++main:2: note: See https://mypy.readthedocs.io/en/latest/running_mypy.html#missing-imports ++ ++[case testNewAnalyzerMissingImportInClassBodyAccessAttrViaSelf] ++class Test: ++ import nonexistent_module_b ++ def __init__(self) -> None: ++ x = self.nonexistent_module_b.some_function() ++[out] ++main:2: error: Cannot find module named 'nonexistent_module_b' ++main:2: note: See https://mypy.readthedocs.io/en/latest/running_mypy.html#missing-imports ++ ++[case testNewAnalyzerMissingFromImportInClassBodyAccessViaSelf] ++class Test: ++ from nonexistent_module_d import some_name ++ def __init__(self) -> None: ++ x = self.some_name ++[out] ++main:2: error: Cannot find module named 'nonexistent_module_d' ++main:2: note: See https://mypy.readthedocs.io/en/latest/running_mypy.html#missing-imports +diff --git a/test_commands.json b/test_commands.json +new file mode 100644 +index 000000000..614cee0f6 +--- /dev/null ++++ b/test_commands.json +@@ -0,0 +1,3 @@ ++{ ++ "test_commands": ["python -m pytest mypy/test/testcheck.py -k \"MissingImportInClassBody or MissingFromImportInClassBody or MissingAliasedImportInClassBody\""] ++} +diff --git a/mimo_test_command.sh b/mimo_test_command.sh +new file mode 100755 +--- /dev/null ++++ b/mimo_test_command.sh +@@ -0,0 +1,8 @@ ++#!/usr/bin/env bash ++ ++set -uo pipefail ++cd /testbed ++rc=0 ++python -m pytest mypy/test/testcheck.py -k "MissingImportInClassBody or MissingFromImportInClassBody or MissingAliasedImportInClassBody" ++rc=$(( rc | $? )) ++exit $rc diff --git a/tasks/format-code-task-002442/tests/test.sh b/tasks/format-code-task-002442/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..1d21ace5611983a8106dc45aa52323c966cea6f9 --- /dev/null +++ b/tasks/format-code-task-002442/tests/test.sh @@ -0,0 +1,40 @@ +#!/bin/bash +# Code grading, mimoagent opensource_code.py: reset the files the hidden test patch touches, apply it, run the +# task's test command; reward 1 when it exits 0. A testbed failure (reset or apply) writes no reward: not scored. +M=/var/lib/mimo +CWD=/testbed +V=/logs/verifier +mkdir -p "$V" +BASE=$(cat "$M/base" 2>/dev/null) || { echo "setup never ran (no $M/base)" >&2; exit 1; } +cd "$CWD" || exit 1 +if [ -d "$M/git-hidden" ]; then rm -rf "$CWD/.git"; mv "$M/git-hidden" "$CWD/.git"; fi +# the agent's change against the base, so its own commits count too +git add -A >/dev/null 2>&1 && git -c core.fileMode=false diff --cached "$BASE" > "$V/agent.diff" +git reset -q +if ! ( +while IFS= read -r tf; do + [ -z "$tf" ] && continue + if git cat-file -e $BASE:"$tf" 2>/dev/null; then + git checkout $BASE -- "$tf" 2>/dev/null || true + else + git rm -f --cached "$tf" >/dev/null 2>&1 || true + rm -f "$tf" + fi +done <<'EOF_RESET_TEST_FILES' +test-data/unit/check-modules.test +test-data/unit/check-newsemanal.test +test_commands.json +mimo_test_command.sh +EOF_RESET_TEST_FILES + +); then echo "could not reset the test files (testbed problem, not scored)" >&2; exit 1; fi +if ! git apply --verbose /tests/test.patch > "$V/apply.log" 2>&1; then + cat "$V/apply.log" >&2 + echo "the hidden tests could not be applied (testbed problem, not scored)" >&2 + exit 1 +fi +timeout 1800 sh -c "$(cat /tests/test_command.sh)" > "$V/test_output.log" 2>&1 +RC=$? +tail -c 12000 "$V/test_output.log" +if [ $RC -eq 0 ]; then echo 1 > "$V/reward.txt"; else echo 0 > "$V/reward.txt"; fi +echo "test command exited $RC" diff --git a/tasks/format-code-task-002442/tests/test_command.sh b/tasks/format-code-task-002442/tests/test_command.sh new file mode 100644 index 0000000000000000000000000000000000000000..7cb23076694ad17d72e8296d62b2b240083e36db --- /dev/null +++ b/tasks/format-code-task-002442/tests/test_command.sh @@ -0,0 +1 @@ +bash /testbed/mimo_test_command.sh \ No newline at end of file diff --git a/tasks/format-code-task-002445/environment/Dockerfile b/tasks/format-code-task-002445/environment/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..5807713b22325d9e8eb314b78b0b0ea8ca55dac8 --- /dev/null +++ b/tasks/format-code-task-002445/environment/Dockerfile @@ -0,0 +1,3 @@ +# The task's image, pinned by digest (the same as [environment].docker_image). +# Setup runs at start from [environment.healthcheck]; environment/setup/ is its readable copy. +FROM docker.io/xiaomimimo/mimo-v2.6-rl-oss@sha256:6a45f202cacc569420b0d0c032d482d5703a0aeb8ab65e5da0f6d1640ddfcdff diff --git a/tasks/format-code-task-002445/environment/setup/files/blocklist b/tasks/format-code-task-002445/environment/setup/files/blocklist new file mode 100644 index 0000000000000000000000000000000000000000..a8e4bdc4c7d9b739c047a3cb58ea72a1bb05bcbc --- /dev/null +++ b/tasks/format-code-task-002445/environment/setup/files/blocklist @@ -0,0 +1,33 @@ +# mimo answer-leak blocklist (mimoagent) +0.0.0.0 github.com +0.0.0.0 www.github.com +0.0.0.0 api.github.com +0.0.0.0 raw.githubusercontent.com +0.0.0.0 codeload.github.com +0.0.0.0 objects.githubusercontent.com +0.0.0.0 gist.github.com +0.0.0.0 gist.githubusercontent.com +0.0.0.0 gitlab.com +0.0.0.0 bitbucket.org +0.0.0.0 sourceforge.net +0.0.0.0 git.kernel.org +0.0.0.0 chromium.googlesource.com +0.0.0.0 android.googlesource.com +0.0.0.0 sourcegraph.com +0.0.0.0 bugs.chromium.org +0.0.0.0 issues.oss-fuzz.com +0.0.0.0 oss-fuzz.com +0.0.0.0 osv.dev +0.0.0.0 api.osv.dev +0.0.0.0 bugzilla.mozilla.org +0.0.0.0 proxy.golang.org +0.0.0.0 sum.golang.org +0.0.0.0 pkg.go.dev +0.0.0.0 google.com +0.0.0.0 www.google.com +0.0.0.0 bing.com +0.0.0.0 www.bing.com +0.0.0.0 duckduckgo.com +0.0.0.0 html.duckduckgo.com +0.0.0.0 search.brave.com +0.0.0.0 stackoverflow.com diff --git a/tasks/format-code-task-002445/environment/setup/setup.sh b/tasks/format-code-task-002445/environment/setup/setup.sh new file mode 100644 index 0000000000000000000000000000000000000000..d883db90cfcfb48f7a139861bbe9f6b5d95cad6f --- /dev/null +++ b/tasks/format-code-task-002445/environment/setup/setup.sh @@ -0,0 +1,34 @@ +#!/bin/bash +# Runs once, as root, before the agent starts: Harbor's [environment.healthcheck] unpacks this folder into +# /var/lib/mimo and runs it. Generated by mimo_harbor; see its README for how each step maps to Xiaomi's harness. +M=/var/lib/mimo +[ -f "$M/ready" ] && exit 0 +chmod 700 "$M" +fail() { echo "setup: $*" >&2; exit 1; } +# the answer-leak blocklist (mimoagent), applied to /etc/hosts by the agent right after it installs +write_blocklist() { cp "$M/files/blocklist" "$M/blocklist"; } + +# Code: mimoagent environments/datasets/opensource_code.py + base.py, as the explorer runs it (app/runner/domains.py Code). +CWD=/testbed +git config --global --add safe.directory "$CWD" +cd "$CWD" || fail "no working directory $CWD" +if ! git rev-parse --git-dir >/dev/null 2>&1; then # a bare source tree: give it a baseline commit + git init -q && git add -A && git -c user.name=mimo -c user.email=mimo@localhost commit -q -m baseline --allow-empty +fi +BASE=$(git rev-parse HEAD 2>/dev/null) +[ ${#BASE} -eq 40 ] || fail "could not resolve the base commit in $CWD" +echo "$BASE" > "$M/base" +# Images are built with history truncated at the base. If one is not, the fix could be read out of git log, +# so .git is hidden while the agent works and put back for grading. +LATER=$(git rev-list --all --not "$BASE" 2>/dev/null | head -n 5 | grep -c . || true) +rm -f /tmp/fail.log /tmp/pass.log /tmp/patch.diff /tmp/test_patch.diff /tmp/*.log 2>/dev/null; rm -rf /tmp/claude-0 /tmp/claude-* /tmp/testem-* /tmp/puppeteer_dev_chrome_profile-* 2>/dev/null; rm -f /tmp/test_files.json 2>/dev/null; rm -rf /tmp/jest_* /tmp/jest-* /tmp/build /tmp/build_env 2>/dev/null; rm -rf /tmp/pytest-of-root /tmp/pytest-* /tmp/.pytest_cache /tmp/__pycache__ 2>/dev/null; rm -rf /tmp/go-build* /tmp/standards /tmp/wordpress /tmp/zig-* /tmp/testbase /tmp/testbed 2>/dev/null; rm -f /tmp/tmp*.tmp /tmp/*.bak /tmp/expect* /tmp/butwas* 2>/dev/null; rm -rf /root/.cache/go-build 2>/dev/null; rm -rf /tests 2>/dev/null; find /logs -mindepth 1 -delete 2>/dev/null; mkdir -p /logs/agent /logs/verifier /logs/artifacts; chmod 777 /logs/agent /logs/verifier /logs/artifacts; find /var/log -type f -delete 2>/dev/null || true; rm -rf /var/lib/postgresql/*/*/log /var/lib/postgresql/*/*/pg_log 2>/dev/null || true; find /var/lib/mysql /var/lib/mongodb -type f -name '*.log' -delete 2>/dev/null || true; rm -rf /root/.npm/_logs /root/.babel.json /root/.pytest_cache 2>/dev/null || true; find / -maxdepth 4 -xdev -name task_description.md -path '*/.build_env/*' -delete 2>/dev/null || true; true +git clean -fdx --exclude=node_modules --exclude=bower_components --exclude=.husky --exclude=vendor --exclude=third_party --exclude=_deps --exclude=vcpkg_installed --exclude=.venv --exclude=venv --exclude=.gradle --exclude=target --exclude=.build --exclude=lib --exclude=.bundle --exclude=Manifest.toml --exclude=_build --exclude=.stack-work --exclude=dist-newstyle >/dev/null 2>&1 +find /root/.m2 -type f \( -name '*-SNAPSHOT.jar' -o -name '*-SNAPSHOT-sources.jar' -o -name '*-SNAPSHOT-tests.jar' -o -name '*-SNAPSHOT-test-sources.jar' \) -delete 2>/dev/null; rm -rf /root/.julia/compiled 2>/dev/null; rm -rf /root/.gradle/caches/build-cache-* /root/.gradle/daemon 2>/dev/null; rm -rf /root/.gradle/caches/*/scripts /root/.gradle/caches/jars-* 2>/dev/null; rm -rf /root/.cache/bazel 2>/dev/null; true +if [ "$LATER" -gt 0 ]; then + mv "$CWD/.git" "$M/git-hidden" + echo "history not truncated at ${BASE:0:12}: .git hidden while the agent works" +fi +write_blocklist + +touch "$M/ready" +echo "setup done" diff --git a/tasks/format-code-task-002445/tests/test.patch b/tasks/format-code-task-002445/tests/test.patch new file mode 100644 index 0000000000000000000000000000000000000000..4c6351cbb3436cd15b882ba16fc900fc3a7ac4bd --- /dev/null +++ b/tasks/format-code-task-002445/tests/test.patch @@ -0,0 +1,206 @@ +diff --git a/tests/unit/gui/test_color_picker_example_layout.py b/tests/unit/gui/test_color_picker_example_layout.py +new file mode 100644 +index 00000000..a5871130 +--- /dev/null ++++ b/tests/unit/gui/test_color_picker_example_layout.py +@@ -0,0 +1,40 @@ ++import importlib ++from collections import defaultdict ++ ++from arcade.gui import UIAnchorLayout, UIGridLayout ++ ++ ++def load_color_picker_module(): ++ return importlib.import_module("arcade.examples.gui.5_uicolor_picker") ++ ++ ++def test_color_picker_palette_buttons_are_added_once_to_palette_area(monkeypatch, window): ++ module = load_color_picker_module() ++ added_to = defaultdict(list) ++ grid_children = set() ++ ++ anchor_add = UIAnchorLayout.add ++ grid_add = UIGridLayout.add ++ ++ def record_anchor_add(self, child, *args, **kwargs): ++ added_to[child].append(type(self).__name__) ++ return anchor_add(self, child, *args, **kwargs) ++ ++ def record_grid_add(self, child, *args, **kwargs): ++ grid_children.add(child) ++ added_to[child].append(type(self).__name__) ++ return grid_add(self, child, *args, **kwargs) ++ ++ monkeypatch.setattr(UIAnchorLayout, "add", record_anchor_add) ++ monkeypatch.setattr(UIGridLayout, "add", record_grid_add) ++ ++ view = module.ColorView() ++ window.show_view(view) ++ ++ palette_button_attachments = { ++ button: added_to[button] ++ for button in grid_children ++ if added_to[button] ++ } ++ ++ assert all(len(containers) == 1 for containers in palette_button_attachments.values()) ++ assert len(palette_button_attachments) > 1 +diff --git a/tests/unit/gui/test_layouting_box_zero_size_public.py b/tests/unit/gui/test_layouting_box_zero_size_public.py +new file mode 100644 +index 00000000..9af6809e +--- /dev/null ++++ b/tests/unit/gui/test_layouting_box_zero_size_public.py +@@ -0,0 +1,84 @@ ++import warnings ++ ++from arcade.gui import UIBoxLayout, UIWidget ++ ++ ++WARNING_MESSAGE = "Container size is 0, cannot calculate sizes for children." ++ ++ ++def layout_children(vertical, container_width, container_height, child_sizes): ++ layout = UIBoxLayout(vertical=vertical, width=container_width, height=container_height) ++ children = [] ++ ++ for width, height in child_sizes: ++ child = UIWidget( ++ width=width, ++ height=height, ++ size_hint=(1, 1), ++ size_hint_min=(width, height), ++ ) ++ layout.add(child) ++ children.append(child) ++ ++ with warnings.catch_warnings(): ++ warnings.simplefilter("ignore") ++ layout.do_layout() ++ ++ return children ++ ++ ++def axis_sizes(children, axis): ++ if axis == "width": ++ return [child.width for child in children] ++ return [child.height for child in children] ++ ++ ++def warning_messages_for_layout(vertical, container_width, container_height, child_sizes): ++ layout = UIBoxLayout(vertical=vertical, width=container_width, height=container_height) ++ for width, height in child_sizes: ++ layout.add( ++ UIWidget( ++ width=width, ++ height=height, ++ size_hint=(1, 1), ++ size_hint_min=(width, height), ++ ) ++ ) ++ ++ with warnings.catch_warnings(record=True) as caught: ++ warnings.simplefilter("always") ++ layout.do_layout() ++ ++ return [str(entry.message) for entry in caught] ++ ++ ++def test_horizontal_box_zero_available_width_uses_child_minimums(): ++ children = layout_children(False, 0, 90, [(10, 12), (25, 12), (40, 12)]) ++ ++ assert axis_sizes(children, "width") == [10, 25, 40] ++ ++ ++def test_horizontal_box_negative_available_width_uses_child_minimums(): ++ children = layout_children(False, -7, 90, [(10, 12), (25, 12), (40, 12)]) ++ ++ assert axis_sizes(children, "width") == [10, 25, 40] ++ ++ ++def test_vertical_box_zero_available_height_uses_child_minimums(): ++ children = layout_children(True, 90, 0, [(12, 11), (12, 27), (12, 43)]) ++ ++ assert axis_sizes(children, "height") == [11, 27, 43] ++ ++ ++def test_zero_available_size_warns_with_promised_message(): ++ messages = warning_messages_for_layout(False, 0, 90, [(10, 12), (25, 12), (40, 12)]) ++ ++ ++ assert WARNING_MESSAGE in messages ++ ++ ++def test_negative_available_size_warns_with_promised_message(): ++ messages = warning_messages_for_layout(False, -7, 90, [(10, 12), (25, 12), (40, 12)]) ++ ++ ++ assert WARNING_MESSAGE in messages +diff --git a/tests/unit/gui/test_widget_background_color_inputs.py b/tests/unit/gui/test_widget_background_color_inputs.py +new file mode 100644 +index 00000000..3dfe55a2 +--- /dev/null ++++ b/tests/unit/gui/test_widget_background_color_inputs.py +@@ -0,0 +1,39 @@ ++import pytest ++ ++from arcade.gui import UIWidget ++ ++ ++class BackgroundProbeSurface: ++ def __init__(self): ++ self.colors = [] ++ ++ def limit(self, rect): ++ return None ++ ++ def clear(self, color): ++ color.a ++ self.colors.append(color) ++ ++ def draw_texture(self, *args, **kwargs): ++ raise AssertionError("background color rendering should not require a texture") ++ ++ ++def render_background(widget): ++ surface = BackgroundProbeSurface() ++ widget.do_render_base(surface) ++ return surface.colors ++ ++ ++@pytest.mark.parametrize("rgba", [(40, 90, 160, 255), (1, 2, 3, 255)]) ++def test_with_background_accepts_multiple_rgba_tuples_as_renderable_colors(rgba): ++ widget = UIWidget(width=20, height=10).with_background(color=rgba) ++ ++ used_colors = render_background(widget) ++ ++ assert used_colors ++ ++ ++def test_with_background_none_keeps_no_background(): ++ widget = UIWidget(width=20, height=10).with_background(color=None) ++ ++ assert render_background(widget) == [] +diff --git a/mimo_test_command.sh b/mimo_test_command.sh +new file mode 100755 +--- /dev/null ++++ b/mimo_test_command.sh +@@ -0,0 +1,19 @@ ++#!/bin/bash ++set -uo pipefail ++cd /testbed ++ ++case "${1:-}" in ++ base) ++ xvfb-run -a python -m pytest tests/unit/gui/test_layouting_box_main_algorithm.py -v ++ ;; ++ new) ++ xvfb-run -a python -m pytest -q \ ++ tests/unit/gui/test_widget_background_color_inputs.py \ ++ tests/unit/gui/test_layouting_box_zero_size_public.py \ ++ tests/unit/gui/test_color_picker_example_layout.py ++ ;; ++ *) ++ echo "usage: $0 base|new" ++ exit 2 ++ ;; ++esac diff --git a/tasks/format-code-task-002445/tests/test.sh b/tasks/format-code-task-002445/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..8c6e2656e4d0f918416dbaf9ff74eb29ee5faa66 --- /dev/null +++ b/tasks/format-code-task-002445/tests/test.sh @@ -0,0 +1,40 @@ +#!/bin/bash +# Code grading, mimoagent opensource_code.py: reset the files the hidden test patch touches, apply it, run the +# task's test command; reward 1 when it exits 0. A testbed failure (reset or apply) writes no reward: not scored. +M=/var/lib/mimo +CWD=/testbed +V=/logs/verifier +mkdir -p "$V" +BASE=$(cat "$M/base" 2>/dev/null) || { echo "setup never ran (no $M/base)" >&2; exit 1; } +cd "$CWD" || exit 1 +if [ -d "$M/git-hidden" ]; then rm -rf "$CWD/.git"; mv "$M/git-hidden" "$CWD/.git"; fi +# the agent's change against the base, so its own commits count too +git add -A >/dev/null 2>&1 && git -c core.fileMode=false diff --cached "$BASE" > "$V/agent.diff" +git reset -q +if ! ( +while IFS= read -r tf; do + [ -z "$tf" ] && continue + if git cat-file -e $BASE:"$tf" 2>/dev/null; then + git checkout $BASE -- "$tf" 2>/dev/null || true + else + git rm -f --cached "$tf" >/dev/null 2>&1 || true + rm -f "$tf" + fi +done <<'EOF_RESET_TEST_FILES' +tests/unit/gui/test_color_picker_example_layout.py +tests/unit/gui/test_layouting_box_zero_size_public.py +tests/unit/gui/test_widget_background_color_inputs.py +mimo_test_command.sh +EOF_RESET_TEST_FILES + +); then echo "could not reset the test files (testbed problem, not scored)" >&2; exit 1; fi +if ! git apply --verbose /tests/test.patch > "$V/apply.log" 2>&1; then + cat "$V/apply.log" >&2 + echo "the hidden tests could not be applied (testbed problem, not scored)" >&2 + exit 1 +fi +timeout 1800 sh -c "$(cat /tests/test_command.sh)" > "$V/test_output.log" 2>&1 +RC=$? +tail -c 12000 "$V/test_output.log" +if [ $RC -eq 0 ]; then echo 1 > "$V/reward.txt"; else echo 0 > "$V/reward.txt"; fi +echo "test command exited $RC" diff --git a/tasks/format-code-task-002445/tests/test_command.sh b/tasks/format-code-task-002445/tests/test_command.sh new file mode 100644 index 0000000000000000000000000000000000000000..e8d2f32b64045b5a5a56e0ad5667da87d8e0bc2a --- /dev/null +++ b/tasks/format-code-task-002445/tests/test_command.sh @@ -0,0 +1 @@ +bash /testbed/mimo_test_command.sh base && bash /testbed/mimo_test_command.sh new \ No newline at end of file diff --git a/tasks/format-code-task-002451/environment/Dockerfile b/tasks/format-code-task-002451/environment/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..d5333f2c15f4b2421130eca9c92174b86bf7ad05 --- /dev/null +++ b/tasks/format-code-task-002451/environment/Dockerfile @@ -0,0 +1,3 @@ +# The task's image, pinned by digest (the same as [environment].docker_image). +# Setup runs at start from [environment.healthcheck]; environment/setup/ is its readable copy. +FROM docker.io/xiaomimimo/mimo-v2.6-rl-oss@sha256:906a158548059866a64c4da4b6836002b92484faaceaee7266f8dfb700b68e4a diff --git a/tasks/format-code-task-002451/environment/setup/files/blocklist b/tasks/format-code-task-002451/environment/setup/files/blocklist new file mode 100644 index 0000000000000000000000000000000000000000..a8e4bdc4c7d9b739c047a3cb58ea72a1bb05bcbc --- /dev/null +++ b/tasks/format-code-task-002451/environment/setup/files/blocklist @@ -0,0 +1,33 @@ +# mimo answer-leak blocklist (mimoagent) +0.0.0.0 github.com +0.0.0.0 www.github.com +0.0.0.0 api.github.com +0.0.0.0 raw.githubusercontent.com +0.0.0.0 codeload.github.com +0.0.0.0 objects.githubusercontent.com +0.0.0.0 gist.github.com +0.0.0.0 gist.githubusercontent.com +0.0.0.0 gitlab.com +0.0.0.0 bitbucket.org +0.0.0.0 sourceforge.net +0.0.0.0 git.kernel.org +0.0.0.0 chromium.googlesource.com +0.0.0.0 android.googlesource.com +0.0.0.0 sourcegraph.com +0.0.0.0 bugs.chromium.org +0.0.0.0 issues.oss-fuzz.com +0.0.0.0 oss-fuzz.com +0.0.0.0 osv.dev +0.0.0.0 api.osv.dev +0.0.0.0 bugzilla.mozilla.org +0.0.0.0 proxy.golang.org +0.0.0.0 sum.golang.org +0.0.0.0 pkg.go.dev +0.0.0.0 google.com +0.0.0.0 www.google.com +0.0.0.0 bing.com +0.0.0.0 www.bing.com +0.0.0.0 duckduckgo.com +0.0.0.0 html.duckduckgo.com +0.0.0.0 search.brave.com +0.0.0.0 stackoverflow.com diff --git a/tasks/format-code-task-002451/environment/setup/setup.sh b/tasks/format-code-task-002451/environment/setup/setup.sh new file mode 100644 index 0000000000000000000000000000000000000000..d883db90cfcfb48f7a139861bbe9f6b5d95cad6f --- /dev/null +++ b/tasks/format-code-task-002451/environment/setup/setup.sh @@ -0,0 +1,34 @@ +#!/bin/bash +# Runs once, as root, before the agent starts: Harbor's [environment.healthcheck] unpacks this folder into +# /var/lib/mimo and runs it. Generated by mimo_harbor; see its README for how each step maps to Xiaomi's harness. +M=/var/lib/mimo +[ -f "$M/ready" ] && exit 0 +chmod 700 "$M" +fail() { echo "setup: $*" >&2; exit 1; } +# the answer-leak blocklist (mimoagent), applied to /etc/hosts by the agent right after it installs +write_blocklist() { cp "$M/files/blocklist" "$M/blocklist"; } + +# Code: mimoagent environments/datasets/opensource_code.py + base.py, as the explorer runs it (app/runner/domains.py Code). +CWD=/testbed +git config --global --add safe.directory "$CWD" +cd "$CWD" || fail "no working directory $CWD" +if ! git rev-parse --git-dir >/dev/null 2>&1; then # a bare source tree: give it a baseline commit + git init -q && git add -A && git -c user.name=mimo -c user.email=mimo@localhost commit -q -m baseline --allow-empty +fi +BASE=$(git rev-parse HEAD 2>/dev/null) +[ ${#BASE} -eq 40 ] || fail "could not resolve the base commit in $CWD" +echo "$BASE" > "$M/base" +# Images are built with history truncated at the base. If one is not, the fix could be read out of git log, +# so .git is hidden while the agent works and put back for grading. +LATER=$(git rev-list --all --not "$BASE" 2>/dev/null | head -n 5 | grep -c . || true) +rm -f /tmp/fail.log /tmp/pass.log /tmp/patch.diff /tmp/test_patch.diff /tmp/*.log 2>/dev/null; rm -rf /tmp/claude-0 /tmp/claude-* /tmp/testem-* /tmp/puppeteer_dev_chrome_profile-* 2>/dev/null; rm -f /tmp/test_files.json 2>/dev/null; rm -rf /tmp/jest_* /tmp/jest-* /tmp/build /tmp/build_env 2>/dev/null; rm -rf /tmp/pytest-of-root /tmp/pytest-* /tmp/.pytest_cache /tmp/__pycache__ 2>/dev/null; rm -rf /tmp/go-build* /tmp/standards /tmp/wordpress /tmp/zig-* /tmp/testbase /tmp/testbed 2>/dev/null; rm -f /tmp/tmp*.tmp /tmp/*.bak /tmp/expect* /tmp/butwas* 2>/dev/null; rm -rf /root/.cache/go-build 2>/dev/null; rm -rf /tests 2>/dev/null; find /logs -mindepth 1 -delete 2>/dev/null; mkdir -p /logs/agent /logs/verifier /logs/artifacts; chmod 777 /logs/agent /logs/verifier /logs/artifacts; find /var/log -type f -delete 2>/dev/null || true; rm -rf /var/lib/postgresql/*/*/log /var/lib/postgresql/*/*/pg_log 2>/dev/null || true; find /var/lib/mysql /var/lib/mongodb -type f -name '*.log' -delete 2>/dev/null || true; rm -rf /root/.npm/_logs /root/.babel.json /root/.pytest_cache 2>/dev/null || true; find / -maxdepth 4 -xdev -name task_description.md -path '*/.build_env/*' -delete 2>/dev/null || true; true +git clean -fdx --exclude=node_modules --exclude=bower_components --exclude=.husky --exclude=vendor --exclude=third_party --exclude=_deps --exclude=vcpkg_installed --exclude=.venv --exclude=venv --exclude=.gradle --exclude=target --exclude=.build --exclude=lib --exclude=.bundle --exclude=Manifest.toml --exclude=_build --exclude=.stack-work --exclude=dist-newstyle >/dev/null 2>&1 +find /root/.m2 -type f \( -name '*-SNAPSHOT.jar' -o -name '*-SNAPSHOT-sources.jar' -o -name '*-SNAPSHOT-tests.jar' -o -name '*-SNAPSHOT-test-sources.jar' \) -delete 2>/dev/null; rm -rf /root/.julia/compiled 2>/dev/null; rm -rf /root/.gradle/caches/build-cache-* /root/.gradle/daemon 2>/dev/null; rm -rf /root/.gradle/caches/*/scripts /root/.gradle/caches/jars-* 2>/dev/null; rm -rf /root/.cache/bazel 2>/dev/null; true +if [ "$LATER" -gt 0 ]; then + mv "$CWD/.git" "$M/git-hidden" + echo "history not truncated at ${BASE:0:12}: .git hidden while the agent works" +fi +write_blocklist + +touch "$M/ready" +echo "setup done" diff --git a/tasks/format-code-task-002451/tests/test.patch b/tasks/format-code-task-002451/tests/test.patch new file mode 100644 index 0000000000000000000000000000000000000000..917580e98815a8916b17f5dce5682edc5ced35af --- /dev/null +++ b/tasks/format-code-task-002451/tests/test.patch @@ -0,0 +1,89 @@ +diff --git a/satpy/tests/writer_tests/test_ninjotiff.py b/satpy/tests/writer_tests/test_ninjotiff.py +index 233b74b0d..befd4a6bc 100644 +--- a/satpy/tests/writer_tests/test_ninjotiff.py ++++ b/satpy/tests/writer_tests/test_ninjotiff.py +@@ -133,6 +133,62 @@ class TestNinjoTIFFWriter(unittest.TestCase): + with pytest.raises(NotImplementedError): + convert_units(ds_in, "millimeter/hour", "m/s") + ++ @mock.patch('satpy.writers.ninjotiff.ImageWriter.save_dataset') ++ @mock.patch('satpy.writers.ninjotiff.nt', pyninjotiff_mock.ninjotiff) ++ def test_dataset_skip_unit_conversion(self, iwsd): ++ """Test that passing convert_temperature_units=False skips conversion.""" ++ from satpy.writers.ninjotiff import NinjoTIFFWriter ++ ntw = NinjoTIFFWriter() ++ dataset = xr.DataArray([1, 2, 3], attrs={'units': 'K'}) ++ with mock.patch('satpy.writers.ninjotiff.convert_units') as uconv: ++ ntw.save_dataset( ++ dataset, physic_unit='CELSIUS', ++ convert_temperature_units=False) ++ uconv.assert_not_called() ++ self.assertEqual(iwsd.call_count, 1) ++ ++ @mock.patch('satpy.writers.ninjotiff.ImageWriter.save_dataset') ++ @mock.patch('satpy.writers.ninjotiff.nt', pyninjotiff_mock.ninjotiff) ++ def test_dataset_explicit_convert_true(self, iwsd): ++ """Test that explicit convert_temperature_units=True still converts.""" ++ from satpy.writers.ninjotiff import NinjoTIFFWriter ++ ntw = NinjoTIFFWriter() ++ dataset = xr.DataArray([1, 2, 3], attrs={'units': 'K'}) ++ with mock.patch('satpy.writers.ninjotiff.convert_units') as uconv: ++ ntw.save_dataset( ++ dataset, physic_unit='CELSIUS', ++ convert_temperature_units=True) ++ uconv.assert_called_once_with(dataset, 'K', 'CELSIUS') ++ self.assertEqual(iwsd.call_count, 1) ++ ++ @mock.patch('satpy.writers.ninjotiff.ImageWriter.save_dataset') ++ @mock.patch('satpy.writers.ninjotiff.nt', pyninjotiff_mock.ninjotiff) ++ def test_dataset_default_still_converts(self, iwsd): ++ """Test that without convert_temperature_units, conversion happens.""" ++ from satpy.writers.ninjotiff import NinjoTIFFWriter ++ ntw = NinjoTIFFWriter() ++ dataset = xr.DataArray([1, 2, 3], attrs={'units': 'K'}) ++ with mock.patch('satpy.writers.ninjotiff.convert_units') as uconv: ++ ntw.save_dataset(dataset, physic_unit='CELSIUS') ++ uconv.assert_called_once_with(dataset, 'K', 'CELSIUS') ++ self.assertEqual(iwsd.call_count, 1) ++ ++ @mock.patch('satpy.writers.ninjotiff.ImageWriter.save_dataset') ++ @mock.patch('satpy.writers.ninjotiff.nt', pyninjotiff_mock.ninjotiff) ++ def test_dataset_skip_unit_conversion_does_not_leak_kwarg(self, iwsd): ++ """convert_temperature_units must not be forwarded to parent save_dataset.""" ++ from satpy.writers.ninjotiff import NinjoTIFFWriter ++ ntw = NinjoTIFFWriter() ++ dataset = xr.DataArray([1, 2, 3], attrs={'units': 'K'}) ++ with mock.patch('satpy.writers.ninjotiff.convert_units'): ++ ntw.save_dataset( ++ dataset, physic_unit='CELSIUS', ++ convert_temperature_units=False) ++ self.assertEqual(iwsd.call_count, 1) ++ ++ _, call_kwargs = iwsd.call_args ++ assert 'convert_temperature_units' not in call_kwargs ++ + @mock.patch('satpy.writers.ninjotiff.NinjoTIFFWriter.save_dataset') + @mock.patch('satpy.writers.ninjotiff.ImageWriter.save_image') + @mock.patch('satpy.writers.ninjotiff.nt', pyninjotiff_mock.ninjotiff) +diff --git a/test_commands.json b/test_commands.json +new file mode 100644 +index 000000000..7b525f216 +--- /dev/null ++++ b/test_commands.json +@@ -0,0 +1,3 @@ ++{ ++ "test_commands": ["python -m pytest satpy/tests/writer_tests/test_ninjotiff.py -v"] ++} +diff --git a/mimo_test_command.sh b/mimo_test_command.sh +new file mode 100755 +--- /dev/null ++++ b/mimo_test_command.sh +@@ -0,0 +1,8 @@ ++#!/usr/bin/env bash ++ ++set -uo pipefail ++cd /testbed ++rc=0 ++python -m pytest -v -rA satpy/tests/writer_tests/test_ninjotiff.py::TestNinjoTIFFWriter::test_dataset_skip_unit_conversion satpy/tests/writer_tests/test_ninjotiff.py::TestNinjoTIFFWriter::test_dataset_explicit_convert_true satpy/tests/writer_tests/test_ninjotiff.py::TestNinjoTIFFWriter::test_dataset_default_still_converts satpy/tests/writer_tests/test_ninjotiff.py::TestNinjoTIFFWriter::test_dataset_skip_unit_conversion_does_not_leak_kwarg ++rc=$(( rc | $? )) ++exit $rc diff --git a/tasks/format-code-task-002451/tests/test.sh b/tasks/format-code-task-002451/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..2a0ed612144260502d0f3dad4e09881dd1116958 --- /dev/null +++ b/tasks/format-code-task-002451/tests/test.sh @@ -0,0 +1,39 @@ +#!/bin/bash +# Code grading, mimoagent opensource_code.py: reset the files the hidden test patch touches, apply it, run the +# task's test command; reward 1 when it exits 0. A testbed failure (reset or apply) writes no reward: not scored. +M=/var/lib/mimo +CWD=/testbed +V=/logs/verifier +mkdir -p "$V" +BASE=$(cat "$M/base" 2>/dev/null) || { echo "setup never ran (no $M/base)" >&2; exit 1; } +cd "$CWD" || exit 1 +if [ -d "$M/git-hidden" ]; then rm -rf "$CWD/.git"; mv "$M/git-hidden" "$CWD/.git"; fi +# the agent's change against the base, so its own commits count too +git add -A >/dev/null 2>&1 && git -c core.fileMode=false diff --cached "$BASE" > "$V/agent.diff" +git reset -q +if ! ( +while IFS= read -r tf; do + [ -z "$tf" ] && continue + if git cat-file -e $BASE:"$tf" 2>/dev/null; then + git checkout $BASE -- "$tf" 2>/dev/null || true + else + git rm -f --cached "$tf" >/dev/null 2>&1 || true + rm -f "$tf" + fi +done <<'EOF_RESET_TEST_FILES' +satpy/tests/writer_tests/test_ninjotiff.py +test_commands.json +mimo_test_command.sh +EOF_RESET_TEST_FILES + +); then echo "could not reset the test files (testbed problem, not scored)" >&2; exit 1; fi +if ! git apply --verbose /tests/test.patch > "$V/apply.log" 2>&1; then + cat "$V/apply.log" >&2 + echo "the hidden tests could not be applied (testbed problem, not scored)" >&2 + exit 1 +fi +timeout 1800 sh -c "$(cat /tests/test_command.sh)" > "$V/test_output.log" 2>&1 +RC=$? +tail -c 12000 "$V/test_output.log" +if [ $RC -eq 0 ]; then echo 1 > "$V/reward.txt"; else echo 0 > "$V/reward.txt"; fi +echo "test command exited $RC" diff --git a/tasks/format-code-task-002451/tests/test_command.sh b/tasks/format-code-task-002451/tests/test_command.sh new file mode 100644 index 0000000000000000000000000000000000000000..7cb23076694ad17d72e8296d62b2b240083e36db --- /dev/null +++ b/tasks/format-code-task-002451/tests/test_command.sh @@ -0,0 +1 @@ +bash /testbed/mimo_test_command.sh \ No newline at end of file diff --git a/tasks/format-code-task-002469/environment/Dockerfile b/tasks/format-code-task-002469/environment/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..2bf8f1101a7ba603d23faa8fbc4773f49bf03322 --- /dev/null +++ b/tasks/format-code-task-002469/environment/Dockerfile @@ -0,0 +1,3 @@ +# The task's image, pinned by digest (the same as [environment].docker_image). +# Setup runs at start from [environment.healthcheck]; environment/setup/ is its readable copy. +FROM docker.io/xiaomimimo/mimo-v2.6-rl-oss@sha256:6f67249d62c9f6a2aaa5ebcfc494ed94a1f6c2f0879a8dfdb2eb5ae448e0d0f8 diff --git a/tasks/format-code-task-002469/environment/setup/files/blocklist b/tasks/format-code-task-002469/environment/setup/files/blocklist new file mode 100644 index 0000000000000000000000000000000000000000..a8e4bdc4c7d9b739c047a3cb58ea72a1bb05bcbc --- /dev/null +++ b/tasks/format-code-task-002469/environment/setup/files/blocklist @@ -0,0 +1,33 @@ +# mimo answer-leak blocklist (mimoagent) +0.0.0.0 github.com +0.0.0.0 www.github.com +0.0.0.0 api.github.com +0.0.0.0 raw.githubusercontent.com +0.0.0.0 codeload.github.com +0.0.0.0 objects.githubusercontent.com +0.0.0.0 gist.github.com +0.0.0.0 gist.githubusercontent.com +0.0.0.0 gitlab.com +0.0.0.0 bitbucket.org +0.0.0.0 sourceforge.net +0.0.0.0 git.kernel.org +0.0.0.0 chromium.googlesource.com +0.0.0.0 android.googlesource.com +0.0.0.0 sourcegraph.com +0.0.0.0 bugs.chromium.org +0.0.0.0 issues.oss-fuzz.com +0.0.0.0 oss-fuzz.com +0.0.0.0 osv.dev +0.0.0.0 api.osv.dev +0.0.0.0 bugzilla.mozilla.org +0.0.0.0 proxy.golang.org +0.0.0.0 sum.golang.org +0.0.0.0 pkg.go.dev +0.0.0.0 google.com +0.0.0.0 www.google.com +0.0.0.0 bing.com +0.0.0.0 www.bing.com +0.0.0.0 duckduckgo.com +0.0.0.0 html.duckduckgo.com +0.0.0.0 search.brave.com +0.0.0.0 stackoverflow.com diff --git a/tasks/format-code-task-002469/environment/setup/setup.sh b/tasks/format-code-task-002469/environment/setup/setup.sh new file mode 100644 index 0000000000000000000000000000000000000000..e9eb7daf39f9542bd095367feee457f3da77e492 --- /dev/null +++ b/tasks/format-code-task-002469/environment/setup/setup.sh @@ -0,0 +1,34 @@ +#!/bin/bash +# Runs once, as root, before the agent starts: Harbor's [environment.healthcheck] unpacks this folder into +# /var/lib/mimo and runs it. Generated by mimo_harbor; see its README for how each step maps to Xiaomi's harness. +M=/var/lib/mimo +[ -f "$M/ready" ] && exit 0 +chmod 700 "$M" +fail() { echo "setup: $*" >&2; exit 1; } +# the answer-leak blocklist (mimoagent), applied to /etc/hosts by the agent right after it installs +write_blocklist() { cp "$M/files/blocklist" "$M/blocklist"; } + +# Code: mimoagent environments/datasets/opensource_code.py + base.py, as the explorer runs it (app/runner/domains.py Code). +CWD=/workspace/repo +git config --global --add safe.directory "$CWD" +cd "$CWD" || fail "no working directory $CWD" +if ! git rev-parse --git-dir >/dev/null 2>&1; then # a bare source tree: give it a baseline commit + git init -q && git add -A && git -c user.name=mimo -c user.email=mimo@localhost commit -q -m baseline --allow-empty +fi +BASE=$(git rev-parse HEAD 2>/dev/null) +[ ${#BASE} -eq 40 ] || fail "could not resolve the base commit in $CWD" +echo "$BASE" > "$M/base" +# Images are built with history truncated at the base. If one is not, the fix could be read out of git log, +# so .git is hidden while the agent works and put back for grading. +LATER=$(git rev-list --all --not "$BASE" 2>/dev/null | head -n 5 | grep -c . || true) +rm -f /tmp/fail.log /tmp/pass.log /tmp/patch.diff /tmp/test_patch.diff /tmp/*.log 2>/dev/null; rm -rf /tmp/claude-0 /tmp/claude-* /tmp/testem-* /tmp/puppeteer_dev_chrome_profile-* 2>/dev/null; rm -f /tmp/test_files.json 2>/dev/null; rm -rf /tmp/jest_* /tmp/jest-* /tmp/build /tmp/build_env 2>/dev/null; rm -rf /tmp/pytest-of-root /tmp/pytest-* /tmp/.pytest_cache /tmp/__pycache__ 2>/dev/null; rm -rf /tmp/go-build* /tmp/standards /tmp/wordpress /tmp/zig-* /tmp/testbase /tmp/testbed 2>/dev/null; rm -f /tmp/tmp*.tmp /tmp/*.bak /tmp/expect* /tmp/butwas* 2>/dev/null; rm -rf /root/.cache/go-build 2>/dev/null; rm -rf /tests 2>/dev/null; find /logs -mindepth 1 -delete 2>/dev/null; mkdir -p /logs/agent /logs/verifier /logs/artifacts; chmod 777 /logs/agent /logs/verifier /logs/artifacts; find /var/log -type f -delete 2>/dev/null || true; rm -rf /var/lib/postgresql/*/*/log /var/lib/postgresql/*/*/pg_log 2>/dev/null || true; find /var/lib/mysql /var/lib/mongodb -type f -name '*.log' -delete 2>/dev/null || true; rm -rf /root/.npm/_logs /root/.babel.json /root/.pytest_cache 2>/dev/null || true; find / -maxdepth 4 -xdev -name task_description.md -path '*/.build_env/*' -delete 2>/dev/null || true; true +git clean -fdx --exclude=node_modules --exclude=bower_components --exclude=.husky --exclude=vendor --exclude=third_party --exclude=_deps --exclude=vcpkg_installed --exclude=.venv --exclude=venv --exclude=.gradle --exclude=target --exclude=.build --exclude=lib --exclude=.bundle --exclude=Manifest.toml --exclude=_build --exclude=.stack-work --exclude=dist-newstyle >/dev/null 2>&1 +find /root/.m2 -type f \( -name '*-SNAPSHOT.jar' -o -name '*-SNAPSHOT-sources.jar' -o -name '*-SNAPSHOT-tests.jar' -o -name '*-SNAPSHOT-test-sources.jar' \) -delete 2>/dev/null; rm -rf /root/.julia/compiled 2>/dev/null; rm -rf /root/.gradle/caches/build-cache-* /root/.gradle/daemon 2>/dev/null; rm -rf /root/.gradle/caches/*/scripts /root/.gradle/caches/jars-* 2>/dev/null; rm -rf /root/.cache/bazel 2>/dev/null; true +if [ "$LATER" -gt 0 ]; then + mv "$CWD/.git" "$M/git-hidden" + echo "history not truncated at ${BASE:0:12}: .git hidden while the agent works" +fi +write_blocklist + +touch "$M/ready" +echo "setup done" diff --git a/tasks/format-code-task-002469/tests/test.patch b/tasks/format-code-task-002469/tests/test.patch new file mode 100644 index 0000000000000000000000000000000000000000..3ea681554ba0491acb7c90a6e32cbe39a3855e05 --- /dev/null +++ b/tasks/format-code-task-002469/tests/test.patch @@ -0,0 +1,161 @@ +diff --git a/usercase-test-coderl/usecase.sh b/usercase-test-coderl/usecase.sh +new file mode 100755 +--- /dev/null ++++ b/usercase-test-coderl/usecase.sh +@@ -0,0 +1,139 @@ ++#!/usr/bin/env bash ++ ++set -u ++export LANG=C.UTF-8 LC_ALL=C.UTF-8 TZ=UTC ++export PIP_DISABLE_PIP_VERSION_CHECK=1 ++export PIP_NO_INDEX=1 ++export PIP_CONFIG_FILE=/dev/null ++ ++fail() { echo "FAIL: $*" >&2; exit 1; } ++ ++VENV="/opt/factorio-sat-stage4-blueprint-book-venv" ++TMP="" ++rm -rf "$VENV" ++python -m venv --system-site-packages "$VENV" || fail "create venv" ++trap 'rm -rf "$TMP" "$VENV"' EXIT ++ ++"$VENV/bin/python" -m pip install -e /workspace/repo --no-deps --no-index --no-build-isolation >/tmp/blueprint_book_fixture_pip.out 2>/tmp/blueprint_book_fixture_pip.err \ ++ || { cat /tmp/blueprint_book_fixture_pip.err >&2; fail "build/install"; } ++BIN="$VENV/bin/blueprint_book" ++[ -x "$BIN" ] || fail "blueprint_book console command is not installed" ++ ++TMP=$(mktemp -d) ++cd "$TMP" || fail "cd tmp" ++ ++BP_ONE='0eNqrVkrKKU0tKMrMK1GyUqhWyixJzQUykER1FJTKUouKM/PzgOJGFoYm5iaW5mbmhgZmpmZAuZzEpNQckI78vFSl2loADV8YQw==' ++BP_TWO='0eNqrVkrKKU0tKMrMK1GyUqhWyixJzQUykER1FJTKUouKM/PzgOJGFoYm5iaW5mbmhgZmpmZAuZzEpNQckI6S8nyl2loADdIYWw==' ++PACKED_PAIR='0eNqrVkrKKU0tKMrMK4lPys/PVrJSqFbKLEnNBTIQUrpgKR0FpcTkksyy1PjMvJTUCqAKA6BQWWpRcWZ+HpBnZGFoYm5iaW5mbmhgZmoGlMtJTErNAZkUkJhZBNIPN7EYKBpdjeBjt1eJWPPz81KVaoECcIcBOdQzvaQ8H8V0w9rY2loAVG5fsw==' ++ ++decode_json() { ++ "$VENV/bin/python" - "$1" <<'PY' ++import base64 ++import json ++import sys ++import zlib ++ ++encoded = sys.argv[1].strip() ++data = json.loads(zlib.decompress(base64.b64decode(encoded[1:]))) ++print(json.dumps(data, sort_keys=True, separators=(',', ':'))) ++PY ++} ++ ++check_unpacked_payloads() { ++ "$VENV/bin/python" - "$BP_ONE" "$BP_TWO" out <<'PY' ++import base64 ++import json ++import sys ++import zlib ++ ++ ++def decode(encoded): ++ return json.loads(zlib.decompress(base64.b64decode(encoded.strip()[1:]))) ++ ++ ++def blueprint_payload(data): ++ ++ if set(data.keys()) == {'blueprint'}: ++ return data['blueprint'] ++ if 'blueprint' in data and 'index' in data: ++ return data['blueprint'] ++ raise AssertionError(f'not an encoded blueprint payload: {data!r}') ++ ++ ++expected = [blueprint_payload(decode(arg)) for arg in sys.argv[1:3]] ++with open(sys.argv[3], encoding='utf-8') as handle: ++ actual = [blueprint_payload(decode(line)) for line in handle.read().splitlines() if line.strip()] ++if actual != expected: ++ raise AssertionError(f'unpacked payloads differ: {actual!r}') ++PY ++} ++ ++ ++ ++ ++printf '%s\n%s\n' "$BP_ONE" "$BP_TWO" | "$BIN" pack --label Pair >out 2>err ++ec=$? ++EXPECTED="$PACKED_PAIR" ++[ "$ec" -eq 0 ] || fail "F1 exit $ec; want 0" ++[ "$(cat out)" = "$EXPECTED" ] || fail "F1 stdout: $(cat out)" ++[ ! -s err ] || fail "F1 unexpected stderr: $(cat err)" ++ ++ ++ ++ ++printf '%s\n' "$BP_ONE" | "$BIN" pack >out 2>err ++ec=$? ++EXPECTED_JSON='{"blueprint_book":{"active_index":0,"blueprints":[{"blueprint":{"item":"blueprint","label":"one","version":281474976710656},"index":0}],"item":"blueprint-book","version":281474976710656}}' ++ACTUAL_JSON=$(decode_json "$(cat out)") || fail "F2 could not decode stdout" ++[ "$ec" -eq 0 ] || fail "F2 exit $ec; want 0" ++[ "$ACTUAL_JSON" = "$EXPECTED_JSON" ] || fail "F2 decoded JSON: $ACTUAL_JSON" ++[ ! -s err ] || fail "F2 unexpected stderr: $(cat err)" ++ ++ ++ ++ ++printf '' | "$BIN" pack >out 2>err ++ec=$? ++EXPECTED_JSON='{"blueprint_book":{"active_index":0,"blueprints":[],"item":"blueprint-book","version":281474976710656}}' ++ACTUAL_JSON=$(decode_json "$(cat out)") || fail "F3 could not decode stdout" ++[ "$ec" -eq 0 ] || fail "F3 exit $ec; want 0" ++[ "$ACTUAL_JSON" = "$EXPECTED_JSON" ] || fail "F3 decoded JSON: $ACTUAL_JSON" ++[ ! -s err ] || fail "F3 unexpected stderr: $(cat err)" ++ ++ ++ ++ ++printf '%s\n' "$PACKED_PAIR" | "$BIN" unpack >out 2>err ++ec=$? ++[ "$ec" -eq 0 ] || fail "F4 exit $ec; want 0" ++ ++check_unpacked_payloads || fail "F4 decoded payloads did not match originals: $(cat out)" ++[ "$(wc -l out 2>err ++ec=$? ++[ "$ec" -ne 0 ] || fail "F5 exit $ec; want non-zero" ++[ ! -s out ] || fail "F5 unexpected stdout: $(cat out)" ++ ++grep -Eiq "usage|error" err || fail "F5 stderr missing usage/error: $(cat err)" ++grep -q "bogus" err || fail "F5 stderr missing invalid mode: $(cat err)" ++ ++ ++ ++ ++"$BIN" --help >out 2>err ++ec=$? ++[ "$ec" -eq 0 ] || fail "F6 exit $ec; want 0" ++ ++grep -iq "usage" out || fail "F6 help missing usage: $(cat out)" ++grep -q "pack" out || fail "F6 help missing pack mode: $(cat out)" ++grep -q "unpack" out || fail "F6 help missing unpack mode: $(cat out)" ++grep -q -- "--label" out || fail "F6 help missing --label: $(cat out)" ++[ ! -s err ] || fail "F6 unexpected stderr: $(cat err)" ++ ++echo "PASS" ++exit 0 +diff --git a/mimo_test_command.sh b/mimo_test_command.sh +new file mode 100755 +--- /dev/null ++++ b/mimo_test_command.sh +@@ -0,0 +1,12 @@ ++#!/usr/bin/env bash ++ ++ ++ ++ ++export NODE_OPTIONS="${NODE_OPTIONS:-} --max-old-space-size=4096" ++export MAVEN_OPTS="${MAVEN_OPTS:-} -Xmx3g -XX:+UseG1GC" ++export GRADLE_OPTS="${GRADLE_OPTS:-} -Xmx3g -XX:+UseG1GC" ++export TEST_JVM_OPTS="${TEST_JVM_OPTS:-} -Xmx3g" ++set -e ++cd /workspace/repo ++exec bash /workspace/repo/usercase-test-coderl/usecase.sh diff --git a/tasks/format-code-task-002469/tests/test.sh b/tasks/format-code-task-002469/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..d4d80bb634b14076ae561be99f395189577b7ac6 --- /dev/null +++ b/tasks/format-code-task-002469/tests/test.sh @@ -0,0 +1,38 @@ +#!/bin/bash +# Code grading, mimoagent opensource_code.py: reset the files the hidden test patch touches, apply it, run the +# task's test command; reward 1 when it exits 0. A testbed failure (reset or apply) writes no reward: not scored. +M=/var/lib/mimo +CWD=/workspace/repo +V=/logs/verifier +mkdir -p "$V" +BASE=$(cat "$M/base" 2>/dev/null) || { echo "setup never ran (no $M/base)" >&2; exit 1; } +cd "$CWD" || exit 1 +if [ -d "$M/git-hidden" ]; then rm -rf "$CWD/.git"; mv "$M/git-hidden" "$CWD/.git"; fi +# the agent's change against the base, so its own commits count too +git add -A >/dev/null 2>&1 && git -c core.fileMode=false diff --cached "$BASE" > "$V/agent.diff" +git reset -q +if ! ( +while IFS= read -r tf; do + [ -z "$tf" ] && continue + if git cat-file -e $BASE:"$tf" 2>/dev/null; then + git checkout $BASE -- "$tf" 2>/dev/null || true + else + git rm -f --cached "$tf" >/dev/null 2>&1 || true + rm -f "$tf" + fi +done <<'EOF_RESET_TEST_FILES' +usercase-test-coderl/usecase.sh +mimo_test_command.sh +EOF_RESET_TEST_FILES + +); then echo "could not reset the test files (testbed problem, not scored)" >&2; exit 1; fi +if ! git apply --verbose /tests/test.patch > "$V/apply.log" 2>&1; then + cat "$V/apply.log" >&2 + echo "the hidden tests could not be applied (testbed problem, not scored)" >&2 + exit 1 +fi +timeout 1800 sh -c "$(cat /tests/test_command.sh)" > "$V/test_output.log" 2>&1 +RC=$? +tail -c 12000 "$V/test_output.log" +if [ $RC -eq 0 ]; then echo 1 > "$V/reward.txt"; else echo 0 > "$V/reward.txt"; fi +echo "test command exited $RC" diff --git a/tasks/format-code-task-002469/tests/test_command.sh b/tasks/format-code-task-002469/tests/test_command.sh new file mode 100644 index 0000000000000000000000000000000000000000..88cb7810b836396c4869db31aeac7d4d4b189685 --- /dev/null +++ b/tasks/format-code-task-002469/tests/test_command.sh @@ -0,0 +1 @@ +bash /workspace/repo/mimo_test_command.sh \ No newline at end of file diff --git a/tasks/format-code-task-002474/environment/Dockerfile b/tasks/format-code-task-002474/environment/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..bb8177b940bb52cef45e7ab20f26c53819988ae8 --- /dev/null +++ b/tasks/format-code-task-002474/environment/Dockerfile @@ -0,0 +1,3 @@ +# The task's image, pinned by digest (the same as [environment].docker_image). +# Setup runs at start from [environment.healthcheck]; environment/setup/ is its readable copy. +FROM docker.io/xiaomimimo/mimo-v2.6-rl-oss@sha256:ff78f2215fd46d9b4ace1acf061306ab3a1e8d6008ae1151ca7051b5f3be1cb5 diff --git a/tasks/format-code-task-002474/environment/setup/files/blocklist b/tasks/format-code-task-002474/environment/setup/files/blocklist new file mode 100644 index 0000000000000000000000000000000000000000..a8e4bdc4c7d9b739c047a3cb58ea72a1bb05bcbc --- /dev/null +++ b/tasks/format-code-task-002474/environment/setup/files/blocklist @@ -0,0 +1,33 @@ +# mimo answer-leak blocklist (mimoagent) +0.0.0.0 github.com +0.0.0.0 www.github.com +0.0.0.0 api.github.com +0.0.0.0 raw.githubusercontent.com +0.0.0.0 codeload.github.com +0.0.0.0 objects.githubusercontent.com +0.0.0.0 gist.github.com +0.0.0.0 gist.githubusercontent.com +0.0.0.0 gitlab.com +0.0.0.0 bitbucket.org +0.0.0.0 sourceforge.net +0.0.0.0 git.kernel.org +0.0.0.0 chromium.googlesource.com +0.0.0.0 android.googlesource.com +0.0.0.0 sourcegraph.com +0.0.0.0 bugs.chromium.org +0.0.0.0 issues.oss-fuzz.com +0.0.0.0 oss-fuzz.com +0.0.0.0 osv.dev +0.0.0.0 api.osv.dev +0.0.0.0 bugzilla.mozilla.org +0.0.0.0 proxy.golang.org +0.0.0.0 sum.golang.org +0.0.0.0 pkg.go.dev +0.0.0.0 google.com +0.0.0.0 www.google.com +0.0.0.0 bing.com +0.0.0.0 www.bing.com +0.0.0.0 duckduckgo.com +0.0.0.0 html.duckduckgo.com +0.0.0.0 search.brave.com +0.0.0.0 stackoverflow.com diff --git a/tasks/format-code-task-002474/environment/setup/setup.sh b/tasks/format-code-task-002474/environment/setup/setup.sh new file mode 100644 index 0000000000000000000000000000000000000000..d883db90cfcfb48f7a139861bbe9f6b5d95cad6f --- /dev/null +++ b/tasks/format-code-task-002474/environment/setup/setup.sh @@ -0,0 +1,34 @@ +#!/bin/bash +# Runs once, as root, before the agent starts: Harbor's [environment.healthcheck] unpacks this folder into +# /var/lib/mimo and runs it. Generated by mimo_harbor; see its README for how each step maps to Xiaomi's harness. +M=/var/lib/mimo +[ -f "$M/ready" ] && exit 0 +chmod 700 "$M" +fail() { echo "setup: $*" >&2; exit 1; } +# the answer-leak blocklist (mimoagent), applied to /etc/hosts by the agent right after it installs +write_blocklist() { cp "$M/files/blocklist" "$M/blocklist"; } + +# Code: mimoagent environments/datasets/opensource_code.py + base.py, as the explorer runs it (app/runner/domains.py Code). +CWD=/testbed +git config --global --add safe.directory "$CWD" +cd "$CWD" || fail "no working directory $CWD" +if ! git rev-parse --git-dir >/dev/null 2>&1; then # a bare source tree: give it a baseline commit + git init -q && git add -A && git -c user.name=mimo -c user.email=mimo@localhost commit -q -m baseline --allow-empty +fi +BASE=$(git rev-parse HEAD 2>/dev/null) +[ ${#BASE} -eq 40 ] || fail "could not resolve the base commit in $CWD" +echo "$BASE" > "$M/base" +# Images are built with history truncated at the base. If one is not, the fix could be read out of git log, +# so .git is hidden while the agent works and put back for grading. +LATER=$(git rev-list --all --not "$BASE" 2>/dev/null | head -n 5 | grep -c . || true) +rm -f /tmp/fail.log /tmp/pass.log /tmp/patch.diff /tmp/test_patch.diff /tmp/*.log 2>/dev/null; rm -rf /tmp/claude-0 /tmp/claude-* /tmp/testem-* /tmp/puppeteer_dev_chrome_profile-* 2>/dev/null; rm -f /tmp/test_files.json 2>/dev/null; rm -rf /tmp/jest_* /tmp/jest-* /tmp/build /tmp/build_env 2>/dev/null; rm -rf /tmp/pytest-of-root /tmp/pytest-* /tmp/.pytest_cache /tmp/__pycache__ 2>/dev/null; rm -rf /tmp/go-build* /tmp/standards /tmp/wordpress /tmp/zig-* /tmp/testbase /tmp/testbed 2>/dev/null; rm -f /tmp/tmp*.tmp /tmp/*.bak /tmp/expect* /tmp/butwas* 2>/dev/null; rm -rf /root/.cache/go-build 2>/dev/null; rm -rf /tests 2>/dev/null; find /logs -mindepth 1 -delete 2>/dev/null; mkdir -p /logs/agent /logs/verifier /logs/artifacts; chmod 777 /logs/agent /logs/verifier /logs/artifacts; find /var/log -type f -delete 2>/dev/null || true; rm -rf /var/lib/postgresql/*/*/log /var/lib/postgresql/*/*/pg_log 2>/dev/null || true; find /var/lib/mysql /var/lib/mongodb -type f -name '*.log' -delete 2>/dev/null || true; rm -rf /root/.npm/_logs /root/.babel.json /root/.pytest_cache 2>/dev/null || true; find / -maxdepth 4 -xdev -name task_description.md -path '*/.build_env/*' -delete 2>/dev/null || true; true +git clean -fdx --exclude=node_modules --exclude=bower_components --exclude=.husky --exclude=vendor --exclude=third_party --exclude=_deps --exclude=vcpkg_installed --exclude=.venv --exclude=venv --exclude=.gradle --exclude=target --exclude=.build --exclude=lib --exclude=.bundle --exclude=Manifest.toml --exclude=_build --exclude=.stack-work --exclude=dist-newstyle >/dev/null 2>&1 +find /root/.m2 -type f \( -name '*-SNAPSHOT.jar' -o -name '*-SNAPSHOT-sources.jar' -o -name '*-SNAPSHOT-tests.jar' -o -name '*-SNAPSHOT-test-sources.jar' \) -delete 2>/dev/null; rm -rf /root/.julia/compiled 2>/dev/null; rm -rf /root/.gradle/caches/build-cache-* /root/.gradle/daemon 2>/dev/null; rm -rf /root/.gradle/caches/*/scripts /root/.gradle/caches/jars-* 2>/dev/null; rm -rf /root/.cache/bazel 2>/dev/null; true +if [ "$LATER" -gt 0 ]; then + mv "$CWD/.git" "$M/git-hidden" + echo "history not truncated at ${BASE:0:12}: .git hidden while the agent works" +fi +write_blocklist + +touch "$M/ready" +echo "setup done" diff --git a/tasks/format-code-task-002474/tests/test.patch b/tasks/format-code-task-002474/tests/test.patch new file mode 100644 index 0000000000000000000000000000000000000000..1fabd789092efdfebe809c86b3950afede2b31fc --- /dev/null +++ b/tasks/format-code-task-002474/tests/test.patch @@ -0,0 +1,120 @@ +diff --git a/pkg/connectorrp/renderers/mongodatabases/renderer_test.go b/pkg/connectorrp/renderers/mongodatabases/renderer_test.go +index 8d18be66d8..987dd18e0b 100644 +--- a/pkg/connectorrp/renderers/mongodatabases/renderer_test.go ++++ b/pkg/connectorrp/renderers/mongodatabases/renderer_test.go +@@ -195,7 +195,7 @@ func Test_Render_InvalidSourceResourceIdentifier(t *testing.T) { + Application: "/subscriptions/test-sub/resourceGroups/test-group/providers/Applications.Core/applications/testApplication", + Environment: "/subscriptions/test-sub/resourceGroups/test-group/providers/Applications.Core/environments/env0", + }, +- Resource: "/subscriptions/test-sub/resourceGroups/test-group/Microsoft.DocumentDB/databaseAccounts/test-account/mongodbDatabases/test-database", ++ Resource: "//subscriptions/test-sub/resourceGroups/test-group/providers/Microsoft.DocumentDB/databaseAccounts/test-account/mongodbDatabases/test-database", + }, + }, + } +diff --git a/pkg/connectorrp/renderers/rediscaches/renderer_test.go b/pkg/connectorrp/renderers/rediscaches/renderer_test.go +index 7f0b2924db..2bae706677 100644 +--- a/pkg/connectorrp/renderers/rediscaches/renderer_test.go ++++ b/pkg/connectorrp/renderers/rediscaches/renderer_test.go +@@ -205,7 +205,7 @@ func Test_Render_InvalidSourceResourceIdentifier(t *testing.T) { + Environment: "/subscriptions/test-sub/resourceGroups/test-group/providers/Applications.Core/environments/env0", + Application: "/subscriptions/test-sub/resourceGroups/test-group/providers/Applications.Core/applications/testApplication", + }, +- Resource: "/subscriptions/test-sub/resourceGroups/testGroup/Microsoft.Cache/Redis/testCache", ++ Resource: "//subscriptions/test-sub/resourceGroups/testGroup/providers/Microsoft.Cache/Redis/testCache", + }, + }, + } +diff --git a/pkg/corerp/renderers/container/render_test.go b/pkg/corerp/renderers/container/render_test.go +index ea374f0515..ca5ebea748 100644 +--- a/pkg/corerp/renderers/container/render_test.go ++++ b/pkg/corerp/renderers/container/render_test.go +@@ -178,7 +178,7 @@ func Test_GetDependencyIDs_InvalidAzureResourceId(t *testing.T) { + // Revert this once TODO: https://github.com/project-radius/core-team/issues/238 is done. + Connections: map[string]datamodel.ConnectionProperties{ + "AzureResourceTest": { +- Source: "/subscriptions/test-sub-id/Microsoft.ServiceBus/namespaces/testNamespace", ++ Source: "//subscriptions/test-sub-id/providers/Microsoft.ServiceBus/namespaces/testNamespace", + IAM: datamodel.IAMProperties{ + Kind: datamodel.KindAzure, + }, +@@ -194,7 +194,7 @@ func Test_GetDependencyIDs_InvalidAzureResourceId(t *testing.T) { + ids, azureIDs, err := renderer.GetDependencyIDs(createContext(t), resource) + require.Error(t, err) + require.Equal(t, err.(*conv.ErrClientRP).Code, apiv1.CodeInvalid) +- require.Equal(t, err.(*conv.ErrClientRP).Message, "'subscriptions/test-sub-id/Microsoft.ServiceBus/namespaces/testNamespace' is not a valid resource id") ++ require.Equal(t, err.(*conv.ErrClientRP).Message, "'/subscriptions/test-sub-id/providers/Microsoft.ServiceBus/namespaces/testNamespace' is not a valid resource id") + require.Empty(t, ids) + require.Empty(t, azureIDs) + } +diff --git a/pkg/ucp/resources/id_test.go b/pkg/ucp/resources/id_test.go +index e9e9c0bc91..4ad7c79452 100644 +--- a/pkg/ucp/resources/id_test.go ++++ b/pkg/ucp/resources/id_test.go +@@ -21,7 +21,6 @@ func Test_ParseInvalidIDs(t *testing.T) { + "//subscriptions/{%s}/resourceGroups/{%s}/providers/Microsoft.CustomProviders/resourceProviders", + "/subscriptions/{%s}/resourceGroups/{%s}/providers/Microsoft.CustomProviders/resourceProviders//", + "/subscriptions/{%s}/resourceGroups/{%s}/providers/Microsoft.CustomProviders//", +- "/subscriptions/{%s}/resourceGroups/{%s}/ddproviders/Microsoft.CustomProviders/resourceProviders", + "/subscriptions/{%s}/resourceGroups//providers/Microsoft.CustomProviders/resourceProviders", + "/subscriptions/{%s}/resourceGroups/providers/Microsoft.CustomProviders/resourceProviders", + "/planes/radius", +@@ -261,6 +260,17 @@ func Test_ParseValidIDs(t *testing.T) { + types: []TypeSegment{}, + provider: "", + }, ++ { ++ id: "/planes/radius/local/resourceGroups/r1/resources", ++ expected: "/planes/radius/local/resourceGroups/r1/resources", ++ scopes: []ScopeSegment{ ++ {Type: "radius", Name: "local"}, ++ {Type: "resourceGroups", Name: "r1"}, ++ {Type: "resources", Name: ""}, ++ }, ++ types: []TypeSegment{}, ++ provider: "", ++ }, + { + id: "/planes/radius/local/resourceGroups/r1/providers/Applications.Core/environments/env", + expected: "/planes/radius/local/resourceGroups/r1/providers/Applications.Core/environments/env", +@@ -273,6 +283,20 @@ func Test_ParseValidIDs(t *testing.T) { + }, + provider: "Applications.Core", + }, ++ ++ ++ { ++ id: "/planes/radius/local/resourceGroups/r1/Applications.Core/environments/env", ++ expected: "/planes/radius/local/resourceGroups/r1/Applications.Core/environments/env", ++ scopes: []ScopeSegment{ ++ {Type: "radius", Name: "local"}, ++ {Type: "resourceGroups", Name: "r1"}, ++ {Type: "Applications.Core", Name: "environments"}, ++ {Type: "env", Name: ""}, ++ }, ++ types: []TypeSegment{}, ++ provider: "", ++ }, + } + + for i, v := range values { +diff --git a/mimo_build_env.tar.gz.b64 b/mimo_build_env.tar.gz.b64 +new file mode 100644 +--- /dev/null ++++ b/mimo_build_env.tar.gz.b64 +@@ -0,0 +1,5 @@ ++H4sIAAAAAAAAA+3RQW7DIBAFUK9zCi4QY5CJVz1LhGHkWK2ZCHDOX2JViVWp9SZRW/W/DWhmEIhf ++9/P45o8ULrJ6lqbojFnW4vO67JXRSmvddKqrGqUOpSTM0160MqdsoxBVZM7fzW31/6j6nn+mlI+O ++p8kGX6fT4+7Yyl+b9pa/6XTJvz2othLN457wtX+ev/NiCb4nvxtYXLeilufXQc7uLCMlnqOjJD+K ++jkMglznGazN4ihSTnDgM7G22vU1bs5H8mJx1p/Vg6axnyslsx0BRiv1F7B3PIb+o3U//FQAAAAAA ++AAAAAAAAAAAAAADAb/MOafwRxwAoAAA= +diff --git a/mimo_test_command.sh b/mimo_test_command.sh +new file mode 100755 +--- /dev/null ++++ b/mimo_test_command.sh +@@ -0,0 +1,6 @@ ++#!/usr/bin/env bash ++ ++set -uo pipefail ++cd /testbed || exit 1 ++base64 -d mimo_build_env.tar.gz.b64 | tar -xzf - -C /testbed || exit 1 ++exec bash -lc 'cd /testbed && bash -eo pipefail /testbed/.build_env/test_command.sh' diff --git a/tasks/format-code-task-002474/tests/test.sh b/tasks/format-code-task-002474/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..0c7b83aa94875fdc5c4f32fce74f6d75c1fd0fcd --- /dev/null +++ b/tasks/format-code-task-002474/tests/test.sh @@ -0,0 +1,42 @@ +#!/bin/bash +# Code grading, mimoagent opensource_code.py: reset the files the hidden test patch touches, apply it, run the +# task's test command; reward 1 when it exits 0. A testbed failure (reset or apply) writes no reward: not scored. +M=/var/lib/mimo +CWD=/testbed +V=/logs/verifier +mkdir -p "$V" +BASE=$(cat "$M/base" 2>/dev/null) || { echo "setup never ran (no $M/base)" >&2; exit 1; } +cd "$CWD" || exit 1 +if [ -d "$M/git-hidden" ]; then rm -rf "$CWD/.git"; mv "$M/git-hidden" "$CWD/.git"; fi +# the agent's change against the base, so its own commits count too +git add -A >/dev/null 2>&1 && git -c core.fileMode=false diff --cached "$BASE" > "$V/agent.diff" +git reset -q +if ! ( +while IFS= read -r tf; do + [ -z "$tf" ] && continue + if git cat-file -e $BASE:"$tf" 2>/dev/null; then + git checkout $BASE -- "$tf" 2>/dev/null || true + else + git rm -f --cached "$tf" >/dev/null 2>&1 || true + rm -f "$tf" + fi +done <<'EOF_RESET_TEST_FILES' +pkg/connectorrp/renderers/mongodatabases/renderer_test.go +pkg/connectorrp/renderers/rediscaches/renderer_test.go +pkg/corerp/renderers/container/render_test.go +pkg/ucp/resources/id_test.go +mimo_build_env.tar.gz.b64 +mimo_test_command.sh +EOF_RESET_TEST_FILES + +); then echo "could not reset the test files (testbed problem, not scored)" >&2; exit 1; fi +if ! git apply --verbose /tests/test.patch > "$V/apply.log" 2>&1; then + cat "$V/apply.log" >&2 + echo "the hidden tests could not be applied (testbed problem, not scored)" >&2 + exit 1 +fi +timeout 1800 sh -c "$(cat /tests/test_command.sh)" > "$V/test_output.log" 2>&1 +RC=$? +tail -c 12000 "$V/test_output.log" +if [ $RC -eq 0 ]; then echo 1 > "$V/reward.txt"; else echo 0 > "$V/reward.txt"; fi +echo "test command exited $RC" diff --git a/tasks/format-code-task-002474/tests/test_command.sh b/tasks/format-code-task-002474/tests/test_command.sh new file mode 100644 index 0000000000000000000000000000000000000000..7cb23076694ad17d72e8296d62b2b240083e36db --- /dev/null +++ b/tasks/format-code-task-002474/tests/test_command.sh @@ -0,0 +1 @@ +bash /testbed/mimo_test_command.sh \ No newline at end of file diff --git a/tasks/format-code-task-002480/environment/Dockerfile b/tasks/format-code-task-002480/environment/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..112a7887df1d9d84f34936d55c0ef42b96fd1d9b --- /dev/null +++ b/tasks/format-code-task-002480/environment/Dockerfile @@ -0,0 +1,3 @@ +# The task's image, pinned by digest (the same as [environment].docker_image). +# Setup runs at start from [environment.healthcheck]; environment/setup/ is its readable copy. +FROM docker.io/xiaomimimo/mimo-v2.6-rl-oss@sha256:b4a23caee05f5d994d739cc14de38ab2ea41ebfb9006877fc9e8a42de9c67ca1 diff --git a/tasks/format-code-task-002480/environment/setup/files/blocklist b/tasks/format-code-task-002480/environment/setup/files/blocklist new file mode 100644 index 0000000000000000000000000000000000000000..a8e4bdc4c7d9b739c047a3cb58ea72a1bb05bcbc --- /dev/null +++ b/tasks/format-code-task-002480/environment/setup/files/blocklist @@ -0,0 +1,33 @@ +# mimo answer-leak blocklist (mimoagent) +0.0.0.0 github.com +0.0.0.0 www.github.com +0.0.0.0 api.github.com +0.0.0.0 raw.githubusercontent.com +0.0.0.0 codeload.github.com +0.0.0.0 objects.githubusercontent.com +0.0.0.0 gist.github.com +0.0.0.0 gist.githubusercontent.com +0.0.0.0 gitlab.com +0.0.0.0 bitbucket.org +0.0.0.0 sourceforge.net +0.0.0.0 git.kernel.org +0.0.0.0 chromium.googlesource.com +0.0.0.0 android.googlesource.com +0.0.0.0 sourcegraph.com +0.0.0.0 bugs.chromium.org +0.0.0.0 issues.oss-fuzz.com +0.0.0.0 oss-fuzz.com +0.0.0.0 osv.dev +0.0.0.0 api.osv.dev +0.0.0.0 bugzilla.mozilla.org +0.0.0.0 proxy.golang.org +0.0.0.0 sum.golang.org +0.0.0.0 pkg.go.dev +0.0.0.0 google.com +0.0.0.0 www.google.com +0.0.0.0 bing.com +0.0.0.0 www.bing.com +0.0.0.0 duckduckgo.com +0.0.0.0 html.duckduckgo.com +0.0.0.0 search.brave.com +0.0.0.0 stackoverflow.com diff --git a/tasks/format-code-task-002480/environment/setup/setup.sh b/tasks/format-code-task-002480/environment/setup/setup.sh new file mode 100644 index 0000000000000000000000000000000000000000..d883db90cfcfb48f7a139861bbe9f6b5d95cad6f --- /dev/null +++ b/tasks/format-code-task-002480/environment/setup/setup.sh @@ -0,0 +1,34 @@ +#!/bin/bash +# Runs once, as root, before the agent starts: Harbor's [environment.healthcheck] unpacks this folder into +# /var/lib/mimo and runs it. Generated by mimo_harbor; see its README for how each step maps to Xiaomi's harness. +M=/var/lib/mimo +[ -f "$M/ready" ] && exit 0 +chmod 700 "$M" +fail() { echo "setup: $*" >&2; exit 1; } +# the answer-leak blocklist (mimoagent), applied to /etc/hosts by the agent right after it installs +write_blocklist() { cp "$M/files/blocklist" "$M/blocklist"; } + +# Code: mimoagent environments/datasets/opensource_code.py + base.py, as the explorer runs it (app/runner/domains.py Code). +CWD=/testbed +git config --global --add safe.directory "$CWD" +cd "$CWD" || fail "no working directory $CWD" +if ! git rev-parse --git-dir >/dev/null 2>&1; then # a bare source tree: give it a baseline commit + git init -q && git add -A && git -c user.name=mimo -c user.email=mimo@localhost commit -q -m baseline --allow-empty +fi +BASE=$(git rev-parse HEAD 2>/dev/null) +[ ${#BASE} -eq 40 ] || fail "could not resolve the base commit in $CWD" +echo "$BASE" > "$M/base" +# Images are built with history truncated at the base. If one is not, the fix could be read out of git log, +# so .git is hidden while the agent works and put back for grading. +LATER=$(git rev-list --all --not "$BASE" 2>/dev/null | head -n 5 | grep -c . || true) +rm -f /tmp/fail.log /tmp/pass.log /tmp/patch.diff /tmp/test_patch.diff /tmp/*.log 2>/dev/null; rm -rf /tmp/claude-0 /tmp/claude-* /tmp/testem-* /tmp/puppeteer_dev_chrome_profile-* 2>/dev/null; rm -f /tmp/test_files.json 2>/dev/null; rm -rf /tmp/jest_* /tmp/jest-* /tmp/build /tmp/build_env 2>/dev/null; rm -rf /tmp/pytest-of-root /tmp/pytest-* /tmp/.pytest_cache /tmp/__pycache__ 2>/dev/null; rm -rf /tmp/go-build* /tmp/standards /tmp/wordpress /tmp/zig-* /tmp/testbase /tmp/testbed 2>/dev/null; rm -f /tmp/tmp*.tmp /tmp/*.bak /tmp/expect* /tmp/butwas* 2>/dev/null; rm -rf /root/.cache/go-build 2>/dev/null; rm -rf /tests 2>/dev/null; find /logs -mindepth 1 -delete 2>/dev/null; mkdir -p /logs/agent /logs/verifier /logs/artifacts; chmod 777 /logs/agent /logs/verifier /logs/artifacts; find /var/log -type f -delete 2>/dev/null || true; rm -rf /var/lib/postgresql/*/*/log /var/lib/postgresql/*/*/pg_log 2>/dev/null || true; find /var/lib/mysql /var/lib/mongodb -type f -name '*.log' -delete 2>/dev/null || true; rm -rf /root/.npm/_logs /root/.babel.json /root/.pytest_cache 2>/dev/null || true; find / -maxdepth 4 -xdev -name task_description.md -path '*/.build_env/*' -delete 2>/dev/null || true; true +git clean -fdx --exclude=node_modules --exclude=bower_components --exclude=.husky --exclude=vendor --exclude=third_party --exclude=_deps --exclude=vcpkg_installed --exclude=.venv --exclude=venv --exclude=.gradle --exclude=target --exclude=.build --exclude=lib --exclude=.bundle --exclude=Manifest.toml --exclude=_build --exclude=.stack-work --exclude=dist-newstyle >/dev/null 2>&1 +find /root/.m2 -type f \( -name '*-SNAPSHOT.jar' -o -name '*-SNAPSHOT-sources.jar' -o -name '*-SNAPSHOT-tests.jar' -o -name '*-SNAPSHOT-test-sources.jar' \) -delete 2>/dev/null; rm -rf /root/.julia/compiled 2>/dev/null; rm -rf /root/.gradle/caches/build-cache-* /root/.gradle/daemon 2>/dev/null; rm -rf /root/.gradle/caches/*/scripts /root/.gradle/caches/jars-* 2>/dev/null; rm -rf /root/.cache/bazel 2>/dev/null; true +if [ "$LATER" -gt 0 ]; then + mv "$CWD/.git" "$M/git-hidden" + echo "history not truncated at ${BASE:0:12}: .git hidden while the agent works" +fi +write_blocklist + +touch "$M/ready" +echo "setup done" diff --git a/tasks/format-code-task-002480/tests/test.patch b/tasks/format-code-task-002480/tests/test.patch new file mode 100644 index 0000000000000000000000000000000000000000..de08bb6f0598504ab7580f4e2bffe05d01f8dcb0 --- /dev/null +++ b/tasks/format-code-task-002480/tests/test.patch @@ -0,0 +1,451 @@ +diff --git a/tests/scripts/post_delete_hook_mock.sh b/tests/scripts/post_delete_hook_mock.sh +new file mode 100644 +index 0000000..65ab214 +--- /dev/null ++++ b/tests/scripts/post_delete_hook_mock.sh +@@ -0,0 +1,198 @@ ++#!/bin/bash ++set -u ++ ++tool="${0##*/}" ++: "${MOCK_LOG:?}" ++: "${MOCK_CASE:?}" ++ ++{ ++ printf '%s' "${tool}" ++ printf '\t%s' "$@" ++ printf '\n' ++} >> "${MOCK_LOG}" ++ ++argument_after() { ++ local wanted="$1" ++ shift ++ local previous="" ++ local argument ++ for argument in "$@"; do ++ if [[ "${previous}" == "${wanted}" ]]; then ++ printf '%s' "${argument}" ++ return ++ fi ++ previous="${argument}" ++ done ++} ++ ++namespace_from_args() { ++ local namespace ++ namespace="$(argument_after -n "$@")" ++ if [[ -z "${namespace}" ]]; then ++ namespace="$(argument_after --namespace "$@")" ++ fi ++ local argument ++ for argument in "$@"; do ++ if [[ "${argument}" == --namespace=* ]]; then ++ namespace="${argument#--namespace=}" ++ fi ++ if [[ "${argument}" == -n=* ]]; then ++ namespace="${argument#-n=}" ++ fi ++ done ++ printf '%s' "${namespace}" ++} ++ ++release_from_args() { ++ local seen_uninstall=false ++ local skip_next=false ++ local argument ++ for argument in "$@"; do ++ if [[ "${skip_next}" == true ]]; then ++ skip_next=false ++ continue ++ fi ++ if [[ "${seen_uninstall}" == false ]]; then ++ [[ "${argument}" == uninstall ]] && seen_uninstall=true ++ continue ++ fi ++ case "${argument}" in ++ -n|--namespace) skip_next=true ;; ++ -*) ;; ++ *) printf '%s' "${argument}"; return ;; ++ esac ++ done ++} ++ ++app_from_args() { ++ local selector="" ++ selector="$(argument_after --selector "$@")" ++ if [[ -z "${selector}" ]]; then ++ selector="$(argument_after -l "$@")" ++ fi ++ local argument ++ for argument in "$@"; do ++ case "${argument}" in ++ --selector=*|-l=*) selector="${argument#*=}" ;; ++ esac ++ done ++ printf '%s' "${selector#app=}" ++} ++ ++has_argument() { ++ local wanted="$1" ++ shift ++ local argument ++ for argument in "$@"; do ++ [[ "${argument}" == "${wanted}" ]] && return 0 ++ done ++ return 1 ++} ++ ++emit_pods() { ++ local count="$1" ++ shift ++ local joined=" $* " ++ if [[ "${joined}" == *"jsonpath"* ]]; then ++ printf '%s' "${count}" ++ elif has_argument json "$@" || [[ "${joined}" == *" json"* ]]; then ++ if [[ "${count}" -eq 0 ]]; then ++ printf '{"items":[]}' ++ else ++ printf '{"items":[{"metadata":{"name":"remaining"}}]}' ++ fi ++ elif [[ "${count}" -gt 0 ]]; then ++ printf 'pod/remaining\n' ++ fi ++} ++ ++case "${tool}" in ++ helm) ++ command="${1:-}" ++ if [[ "${command}" == list ]]; then ++ namespace="$(namespace_from_args "$@")" ++ if [[ "${MOCK_CASE}" == list-error && "${namespace}" == alpha ]]; then ++ printf 'repository unavailable\n' >&2 ++ exit 11 ++ fi ++ case "${MOCK_CASE}:${namespace}" in ++ success:alpha) printf 'ready\naddon.crd\n' ;; ++ success:beta) printf 'steady\n' ;; ++ uninstall-error:alpha|poll-error:alpha) printf 'broken\nready\n' ;; ++ timeout:alpha) printf 'stuck\nready\n' ;; ++ list-error:beta|ops-list:alpha|ops-delete:alpha|bootstrap-error:alpha|validation:alpha) printf 'ready\n' ;; ++ esac ++ exit 0 ++ fi ++ if [[ "${command}" == uninstall ]]; then ++ release="$(release_from_args "$@")" ++ if [[ "${MOCK_CASE}" == uninstall-error && "${release}" == broken ]]; then ++ printf 'uninstall refused\n' ++ exit 17 ++ fi ++ exit 0 ++ fi ++ printf 'unexpected helm invocation\n' >&2 ++ exit 90 ++ ;; ++ kubectl) ++ joined=" $* " ++ if [[ "${joined}" == *" delete "* && "${joined}" == *" secret "* && "${joined}" == *" bootstrap-secret "* ]]; then ++ if [[ "${MOCK_CASE}" == bootstrap-error ]]; then ++ printf 'bootstrap delete denied\n' >&2 ++ exit 15 ++ fi ++ exit 0 ++ fi ++ if [[ "${joined}" == *" delete "* && "${joined}" == *"helm-operation-fail"* ]]; then ++ printf 'operation pod delete denied\n' >&2 ++ exit 14 ++ fi ++ if [[ "${joined}" == *" delete "* ]]; then ++ exit 0 ++ fi ++ if [[ "${joined}" == *" wait "* ]]; then ++ app="$(app_from_args "$@")" ++ if [[ "${MOCK_CASE}" == timeout && "${app}" == stuck ]]; then ++ exit 1 ++ fi ++ if [[ "${MOCK_CASE}" == poll-error && "${app}" == broken ]]; then ++ exit 12 ++ fi ++ exit 0 ++ fi ++ if [[ "${joined}" == *" get pod "* || "${joined}" == *" get pods "* ]]; then ++ app="$(app_from_args "$@")" ++ if [[ -n "${app}" ]]; then ++ if [[ "${MOCK_CASE}" == poll-error && "${app}" == broken ]]; then ++ printf 'pod lookup failed\n' >&2 ++ exit 12 ++ fi ++ if [[ "${MOCK_CASE}" == timeout && "${app}" == stuck ]]; then ++ emit_pods 1 "$@" ++ else ++ emit_pods 0 "$@" ++ fi ++ exit 0 ++ fi ++ if [[ "${MOCK_CASE}" == ops-list ]]; then ++ printf 'operation pod list denied\n' >&2 ++ exit 13 ++ fi ++ if [[ "${MOCK_CASE}" == ops-delete ]]; then ++ printf 'pod/helm-operation-fail\n' ++ else ++ printf 'pod/helm-operation-old\n' ++ fi ++ exit 0 ++ fi ++ printf 'unexpected kubectl invocation\n' >&2 ++ exit 91 ++ ;; ++ sleep) ++ exit 0 ++ ;; ++esac ++ ++printf 'unexpected mock tool %s\n' "${tool}" >&2 ++exit 92 +diff --git a/tests/scripts/post_delete_hook_contract_test.sh b/tests/scripts/post_delete_hook_contract_test.sh +new file mode 100644 +index 0000000..aa24c55 +--- /dev/null ++++ b/tests/scripts/post_delete_hook_contract_test.sh +@@ -0,0 +1,228 @@ ++#!/bin/bash ++set -euo pipefail ++ ++repo_root="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)" ++hook="${repo_root}/chart/scripts/post-delete-hook.sh" ++scratch="$(mktemp -d)" ++mock_bin="${scratch}/bin" ++mock_log="${scratch}/commands.log" ++last_output="${scratch}/output.log" ++last_status=0 ++failures=0 ++mkdir -p "${mock_bin}" ++trap 'rm -rf "${scratch}"' EXIT ++ ++cp "${repo_root}/tests/scripts/post_delete_hook_mock.sh" "${mock_bin}/mock-tool" ++chmod +x "${mock_bin}/mock-tool" ++ln -s mock-tool "${mock_bin}/helm" ++ln -s mock-tool "${mock_bin}/kubectl" ++ln -s mock-tool "${mock_bin}/sleep" ++ ++fail() { ++ printf 'FAIL: %s\n' "$*" >&2 ++ failures=$((failures + 1)) ++} ++ ++assert_status() { ++ local expected="$1" ++ local label="$2" ++ if [[ "${last_status}" -ne "${expected}" ]]; then ++ fail "${label}: expected status ${expected}, got ${last_status}; output: $(tr '\n' ' ' < "${last_output}")" ++ fi ++} ++ ++assert_log_matches() { ++ local pattern="$1" ++ local label="$2" ++ if ! grep -Eq "${pattern}" "${mock_log}"; then ++ fail "${label}: command log did not match ${pattern}" ++ fi ++} ++ ++assert_log_not_matches() { ++ local pattern="$1" ++ local label="$2" ++ if grep -Eq "${pattern}" "${mock_log}"; then ++ fail "${label}: command log unexpectedly matched ${pattern}" ++ fi ++} ++ ++assert_log_match_count() { ++ local expected="$1" ++ local pattern="$2" ++ local label="$3" ++ local count ++ count="$(grep -Ec "${pattern}" "${mock_log}" || true)" ++ if [[ "${count}" -ne "${expected}" ]]; then ++ fail "${label}: expected ${expected} matching commands, got ${count}" ++ fi ++} ++ ++assert_output_matches() { ++ local pattern="$1" ++ local label="$2" ++ if ! grep -Eqi "${pattern}" "${last_output}"; then ++ fail "${label}: output did not match ${pattern}" ++ fi ++} ++ ++reset_run() { ++ : > "${mock_log}" ++ : > "${last_output}" ++ last_status=0 ++} ++ ++run_hook() { ++ local scenario="$1" ++ local namespaces="$2" ++ local timeout="$3" ++ local ignore_timeout="$4" ++ reset_run ++ set +e ++ env PATH="${mock_bin}:${PATH}" \ ++ MOCK_CASE="${scenario}" MOCK_LOG="${mock_log}" \ ++ NAMESPACES="${namespaces}" RANCHER_NAMESPACE="cattle-system" \ ++ TIMEOUT="${timeout}" IGNORETIMEOUTERROR="${ignore_timeout}" \ ++ bash "${hook}" > "${last_output}" 2>&1 ++ last_status=$? ++ set -e ++} ++ ++run_without_required_input() { ++ local omitted="$1" ++ reset_run ++ set +e ++ ( ++ export PATH="${mock_bin}:${PATH}" ++ export MOCK_CASE=validation MOCK_LOG="${mock_log}" ++ export NAMESPACES=alpha RANCHER_NAMESPACE=cattle-system ++ export TIMEOUT=10 IGNORETIMEOUTERROR=false ++ unset "${omitted}" ++ bash "${hook}" ++ ) > "${last_output}" 2>&1 ++ last_status=$? ++ set -e ++} ++ ++printf 'case: input validation\n' ++for omitted in NAMESPACES RANCHER_NAMESPACE TIMEOUT IGNORETIMEOUTERROR; do ++ run_without_required_input "${omitted}" ++ if [[ "${last_status}" -eq 0 ]]; then ++ fail "missing ${omitted} must be rejected" ++ fi ++ if [[ -s "${mock_log}" ]]; then ++ fail "tools were invoked before ${omitted} validation completed" ++ fi ++ assert_output_matches "${omitted}|namespace|timeout|ignore" "missing ${omitted} diagnostic" ++done ++ ++run_hook validation ' ' 10 false ++if [[ "${last_status}" -eq 0 ]]; then ++ fail "whitespace-only NAMESPACES must be rejected" ++fi ++if [[ -s "${mock_log}" ]]; then ++ fail "tools were invoked for whitespace-only NAMESPACES" ++fi ++ ++run_hook validation alpha twelve false ++if [[ "${last_status}" -eq 0 ]]; then ++ fail "non-integer TIMEOUT must be rejected" ++fi ++if [[ -s "${mock_log}" ]]; then ++ fail "tools were invoked before TIMEOUT validation completed" ++fi ++assert_output_matches 'timeout' 'invalid TIMEOUT diagnostic' ++ ++run_hook validation alpha -1 false ++if [[ "${last_status}" -eq 0 ]]; then ++ fail "negative TIMEOUT must be rejected" ++fi ++if [[ -s "${mock_log}" ]]; then ++ fail "tools were invoked before negative TIMEOUT validation completed" ++fi ++ ++run_hook validation alpha 10 yes ++if [[ "${last_status}" -eq 0 ]]; then ++ fail "IGNORETIMEOUTERROR other than true or false must be rejected" ++fi ++if [[ -s "${mock_log}" ]]; then ++ fail "tools were invoked before IGNORETIMEOUTERROR validation completed" ++fi ++assert_output_matches 'ignore|true|false' 'invalid IGNORETIMEOUTERROR diagnostic' ++ ++printf 'case: successful aggregate cleanup and namespace deduplication\n' ++run_hook success 'alpha alpha beta' 10 false ++assert_status 0 'successful cleanup' ++assert_log_match_count 1 '^helm.*list.*alpha' 'alpha namespace is processed once' ++assert_log_match_count 1 '^helm.*list.*beta' 'beta namespace is processed once' ++assert_log_matches '^helm.*uninstall.*ready' 'ready release uninstall' ++assert_log_matches '^helm.*uninstall.*steady' 'steady release uninstall' ++assert_log_not_matches '^helm.*uninstall.*addon\.crd' 'CRD release skip' ++assert_log_matches '^kubectl.*delete.*helm-operation-old' 'helm operation pod cleanup' ++assert_log_matches 'kubectl.*delete.*secret.*bootstrap-secret' 'bootstrap secret cleanup' ++assert_output_matches 'success|finished' 'successful summary' ++ ++printf 'case: namespace listing failure is isolated\n' ++run_hook list-error 'alpha beta' 10 false ++assert_status 2 'list failure aggregate status' ++assert_log_matches '^helm.*list.*beta' 'later namespace listed after list failure' ++assert_log_matches '^helm.*uninstall.*ready' 'later namespace release uninstalled' ++assert_log_matches 'kubectl.*delete.*secret.*bootstrap-secret' 'bootstrap cleanup after list failure' ++assert_output_matches 'alpha.*list|list.*alpha' 'list failure summary identity and reason' ++ ++printf 'case: uninstall failure is hard and does not block later work\n' ++run_hook uninstall-error alpha 10 true ++assert_status 2 'uninstall failure remains hard when timeout errors are ignored' ++assert_log_matches '^helm.*uninstall.*broken' 'failing uninstall attempted' ++assert_log_matches '^helm.*uninstall.*ready' 'later uninstall attempted' ++assert_log_not_matches 'kubectl.*(selector|-l).*app=broken' 'failed uninstall is not polled' ++assert_log_matches 'kubectl.*delete.*secret.*bootstrap-secret' 'bootstrap cleanup after uninstall failure' ++assert_output_matches 'broken.*uninstall|uninstall.*broken' 'uninstall failure summary identity and reason' ++ ++printf 'case: timeout policy applies only to timeouts\n' ++run_hook timeout alpha 0 false ++assert_status 2 'non-ignored timeout status' ++assert_log_matches 'kubectl.*(selector|-l).*app=stuck' 'one immediate pod check at zero timeout' ++assert_log_not_matches '^sleep' 'zero timeout does not sleep' ++assert_log_matches '^helm.*uninstall.*ready' 'later release continues after timeout' ++assert_log_matches 'kubectl.*delete.*secret.*bootstrap-secret' 'bootstrap cleanup after timeout' ++assert_output_matches 'stuck.*timeout|timeout.*stuck' 'timeout summary identity and reason' ++ ++run_hook timeout alpha 0 true ++assert_status 0 'ignored timeout status' ++assert_log_matches '^helm.*uninstall.*ready' 'later release continues after ignored timeout' ++assert_log_matches 'kubectl.*delete.*secret.*bootstrap-secret' 'bootstrap cleanup after ignored timeout' ++ ++printf 'case: pod inspection failure is isolated and hard\n' ++run_hook poll-error alpha 10 true ++assert_status 2 'pod inspection aggregate status' ++assert_log_matches '^helm.*uninstall.*ready' 'later release continues after pod lookup failure' ++assert_log_matches 'kubectl.*delete.*secret.*bootstrap-secret' 'bootstrap cleanup after pod lookup failure' ++assert_output_matches 'broken.*pod|pod.*broken' 'pod lookup failure summary identity and reason' ++ ++printf 'case: operation pod listing failure still finalizes\n' ++run_hook ops-list alpha 10 true ++assert_status 2 'operation pod list aggregate status' ++assert_log_matches 'kubectl.*get.*pods' 'operation pod list attempted' ++assert_log_matches 'kubectl.*delete.*secret.*bootstrap-secret' 'bootstrap cleanup after operation pod list failure' ++assert_output_matches 'operation.*pod.*list|list.*operation.*pod' 'operation pod list failure summary' ++ ++printf 'case: operation pod deletion failure still finalizes\n' ++run_hook ops-delete alpha 10 true ++assert_status 2 'operation pod delete aggregate status' ++assert_log_matches 'kubectl.*delete.*helm-operation-fail' 'operation pod delete attempted' ++assert_log_matches 'kubectl.*delete.*secret.*bootstrap-secret' 'bootstrap cleanup after operation pod delete failure' ++assert_output_matches 'helm-operation-fail|operation pod' 'operation pod failure summary' ++ ++printf 'case: bootstrap secret failure is aggregated\n' ++run_hook bootstrap-error alpha 10 true ++assert_status 2 'bootstrap secret aggregate status' ++assert_log_matches 'kubectl.*delete.*secret.*bootstrap-secret' 'bootstrap secret delete attempted' ++assert_output_matches 'bootstrap' 'bootstrap failure summary' ++ ++if [[ "${failures}" -ne 0 ]]; then ++ printf '%d contract assertion(s) failed\n' "${failures}" >&2 ++ exit 1 ++fi ++ ++printf 'post-delete hook contract checks passed\n' +diff --git a/mimo_test_command.sh b/mimo_test_command.sh +new file mode 100755 +--- /dev/null ++++ b/mimo_test_command.sh +@@ -0,0 +1,8 @@ ++#!/bin/bash ++set -euo pipefail ++ ++ ++bash -n chart/scripts/post-delete-hook.sh ++bash -n tests/scripts/post_delete_hook_mock.sh ++bash -n tests/scripts/post_delete_hook_contract_test.sh ++bash tests/scripts/post_delete_hook_contract_test.sh diff --git a/tasks/format-code-task-002480/tests/test.sh b/tasks/format-code-task-002480/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..ac08448e442324827774aaf863a76290a5a0332e --- /dev/null +++ b/tasks/format-code-task-002480/tests/test.sh @@ -0,0 +1,39 @@ +#!/bin/bash +# Code grading, mimoagent opensource_code.py: reset the files the hidden test patch touches, apply it, run the +# task's test command; reward 1 when it exits 0. A testbed failure (reset or apply) writes no reward: not scored. +M=/var/lib/mimo +CWD=/testbed +V=/logs/verifier +mkdir -p "$V" +BASE=$(cat "$M/base" 2>/dev/null) || { echo "setup never ran (no $M/base)" >&2; exit 1; } +cd "$CWD" || exit 1 +if [ -d "$M/git-hidden" ]; then rm -rf "$CWD/.git"; mv "$M/git-hidden" "$CWD/.git"; fi +# the agent's change against the base, so its own commits count too +git add -A >/dev/null 2>&1 && git -c core.fileMode=false diff --cached "$BASE" > "$V/agent.diff" +git reset -q +if ! ( +while IFS= read -r tf; do + [ -z "$tf" ] && continue + if git cat-file -e $BASE:"$tf" 2>/dev/null; then + git checkout $BASE -- "$tf" 2>/dev/null || true + else + git rm -f --cached "$tf" >/dev/null 2>&1 || true + rm -f "$tf" + fi +done <<'EOF_RESET_TEST_FILES' +tests/scripts/post_delete_hook_mock.sh +tests/scripts/post_delete_hook_contract_test.sh +mimo_test_command.sh +EOF_RESET_TEST_FILES + +); then echo "could not reset the test files (testbed problem, not scored)" >&2; exit 1; fi +if ! git apply --verbose /tests/test.patch > "$V/apply.log" 2>&1; then + cat "$V/apply.log" >&2 + echo "the hidden tests could not be applied (testbed problem, not scored)" >&2 + exit 1 +fi +timeout 1800 sh -c "$(cat /tests/test_command.sh)" > "$V/test_output.log" 2>&1 +RC=$? +tail -c 12000 "$V/test_output.log" +if [ $RC -eq 0 ]; then echo 1 > "$V/reward.txt"; else echo 0 > "$V/reward.txt"; fi +echo "test command exited $RC" diff --git a/tasks/format-code-task-002480/tests/test_command.sh b/tasks/format-code-task-002480/tests/test_command.sh new file mode 100644 index 0000000000000000000000000000000000000000..7cb23076694ad17d72e8296d62b2b240083e36db --- /dev/null +++ b/tasks/format-code-task-002480/tests/test_command.sh @@ -0,0 +1 @@ +bash /testbed/mimo_test_command.sh \ No newline at end of file diff --git a/tasks/format-code-task-002487/environment/Dockerfile b/tasks/format-code-task-002487/environment/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..cea47bebea056c0f63c11f19bb7666773cd93518 --- /dev/null +++ b/tasks/format-code-task-002487/environment/Dockerfile @@ -0,0 +1,3 @@ +# The task's image, pinned by digest (the same as [environment].docker_image). +# Setup runs at start from [environment.healthcheck]; environment/setup/ is its readable copy. +FROM docker.io/xiaomimimo/mimo-v2.6-rl-oss@sha256:3ce961a988da1df44522d20fcb01e121106da8db90710ae1368c1e72244e0155 diff --git a/tasks/format-code-task-002487/environment/setup/files/blocklist b/tasks/format-code-task-002487/environment/setup/files/blocklist new file mode 100644 index 0000000000000000000000000000000000000000..a8e4bdc4c7d9b739c047a3cb58ea72a1bb05bcbc --- /dev/null +++ b/tasks/format-code-task-002487/environment/setup/files/blocklist @@ -0,0 +1,33 @@ +# mimo answer-leak blocklist (mimoagent) +0.0.0.0 github.com +0.0.0.0 www.github.com +0.0.0.0 api.github.com +0.0.0.0 raw.githubusercontent.com +0.0.0.0 codeload.github.com +0.0.0.0 objects.githubusercontent.com +0.0.0.0 gist.github.com +0.0.0.0 gist.githubusercontent.com +0.0.0.0 gitlab.com +0.0.0.0 bitbucket.org +0.0.0.0 sourceforge.net +0.0.0.0 git.kernel.org +0.0.0.0 chromium.googlesource.com +0.0.0.0 android.googlesource.com +0.0.0.0 sourcegraph.com +0.0.0.0 bugs.chromium.org +0.0.0.0 issues.oss-fuzz.com +0.0.0.0 oss-fuzz.com +0.0.0.0 osv.dev +0.0.0.0 api.osv.dev +0.0.0.0 bugzilla.mozilla.org +0.0.0.0 proxy.golang.org +0.0.0.0 sum.golang.org +0.0.0.0 pkg.go.dev +0.0.0.0 google.com +0.0.0.0 www.google.com +0.0.0.0 bing.com +0.0.0.0 www.bing.com +0.0.0.0 duckduckgo.com +0.0.0.0 html.duckduckgo.com +0.0.0.0 search.brave.com +0.0.0.0 stackoverflow.com diff --git a/tasks/format-code-task-002487/environment/setup/setup.sh b/tasks/format-code-task-002487/environment/setup/setup.sh new file mode 100644 index 0000000000000000000000000000000000000000..d883db90cfcfb48f7a139861bbe9f6b5d95cad6f --- /dev/null +++ b/tasks/format-code-task-002487/environment/setup/setup.sh @@ -0,0 +1,34 @@ +#!/bin/bash +# Runs once, as root, before the agent starts: Harbor's [environment.healthcheck] unpacks this folder into +# /var/lib/mimo and runs it. Generated by mimo_harbor; see its README for how each step maps to Xiaomi's harness. +M=/var/lib/mimo +[ -f "$M/ready" ] && exit 0 +chmod 700 "$M" +fail() { echo "setup: $*" >&2; exit 1; } +# the answer-leak blocklist (mimoagent), applied to /etc/hosts by the agent right after it installs +write_blocklist() { cp "$M/files/blocklist" "$M/blocklist"; } + +# Code: mimoagent environments/datasets/opensource_code.py + base.py, as the explorer runs it (app/runner/domains.py Code). +CWD=/testbed +git config --global --add safe.directory "$CWD" +cd "$CWD" || fail "no working directory $CWD" +if ! git rev-parse --git-dir >/dev/null 2>&1; then # a bare source tree: give it a baseline commit + git init -q && git add -A && git -c user.name=mimo -c user.email=mimo@localhost commit -q -m baseline --allow-empty +fi +BASE=$(git rev-parse HEAD 2>/dev/null) +[ ${#BASE} -eq 40 ] || fail "could not resolve the base commit in $CWD" +echo "$BASE" > "$M/base" +# Images are built with history truncated at the base. If one is not, the fix could be read out of git log, +# so .git is hidden while the agent works and put back for grading. +LATER=$(git rev-list --all --not "$BASE" 2>/dev/null | head -n 5 | grep -c . || true) +rm -f /tmp/fail.log /tmp/pass.log /tmp/patch.diff /tmp/test_patch.diff /tmp/*.log 2>/dev/null; rm -rf /tmp/claude-0 /tmp/claude-* /tmp/testem-* /tmp/puppeteer_dev_chrome_profile-* 2>/dev/null; rm -f /tmp/test_files.json 2>/dev/null; rm -rf /tmp/jest_* /tmp/jest-* /tmp/build /tmp/build_env 2>/dev/null; rm -rf /tmp/pytest-of-root /tmp/pytest-* /tmp/.pytest_cache /tmp/__pycache__ 2>/dev/null; rm -rf /tmp/go-build* /tmp/standards /tmp/wordpress /tmp/zig-* /tmp/testbase /tmp/testbed 2>/dev/null; rm -f /tmp/tmp*.tmp /tmp/*.bak /tmp/expect* /tmp/butwas* 2>/dev/null; rm -rf /root/.cache/go-build 2>/dev/null; rm -rf /tests 2>/dev/null; find /logs -mindepth 1 -delete 2>/dev/null; mkdir -p /logs/agent /logs/verifier /logs/artifacts; chmod 777 /logs/agent /logs/verifier /logs/artifacts; find /var/log -type f -delete 2>/dev/null || true; rm -rf /var/lib/postgresql/*/*/log /var/lib/postgresql/*/*/pg_log 2>/dev/null || true; find /var/lib/mysql /var/lib/mongodb -type f -name '*.log' -delete 2>/dev/null || true; rm -rf /root/.npm/_logs /root/.babel.json /root/.pytest_cache 2>/dev/null || true; find / -maxdepth 4 -xdev -name task_description.md -path '*/.build_env/*' -delete 2>/dev/null || true; true +git clean -fdx --exclude=node_modules --exclude=bower_components --exclude=.husky --exclude=vendor --exclude=third_party --exclude=_deps --exclude=vcpkg_installed --exclude=.venv --exclude=venv --exclude=.gradle --exclude=target --exclude=.build --exclude=lib --exclude=.bundle --exclude=Manifest.toml --exclude=_build --exclude=.stack-work --exclude=dist-newstyle >/dev/null 2>&1 +find /root/.m2 -type f \( -name '*-SNAPSHOT.jar' -o -name '*-SNAPSHOT-sources.jar' -o -name '*-SNAPSHOT-tests.jar' -o -name '*-SNAPSHOT-test-sources.jar' \) -delete 2>/dev/null; rm -rf /root/.julia/compiled 2>/dev/null; rm -rf /root/.gradle/caches/build-cache-* /root/.gradle/daemon 2>/dev/null; rm -rf /root/.gradle/caches/*/scripts /root/.gradle/caches/jars-* 2>/dev/null; rm -rf /root/.cache/bazel 2>/dev/null; true +if [ "$LATER" -gt 0 ]; then + mv "$CWD/.git" "$M/git-hidden" + echo "history not truncated at ${BASE:0:12}: .git hidden while the agent works" +fi +write_blocklist + +touch "$M/ready" +echo "setup done" diff --git a/tasks/format-code-task-002487/tests/test.patch b/tasks/format-code-task-002487/tests/test.patch new file mode 100644 index 0000000000000000000000000000000000000000..e55ce64a79d8bcb6a8db2516385223aada582b97 --- /dev/null +++ b/tasks/format-code-task-002487/tests/test.patch @@ -0,0 +1,111 @@ +diff --git a/python/ray/rllib/test/test_nested_spaces.py b/python/ray/rllib/test/test_nested_spaces.py +index 3d9a569f604f..490e6af1520a 100644 +--- a/python/ray/rllib/test/test_nested_spaces.py ++++ b/python/ray/rllib/test/test_nested_spaces.py +@@ -174,7 +174,7 @@ def testInvalidModel2(self): + }, + })) + +- def doTestNestedDict(self, make_env): ++ def doTestNestedDict(self, make_env, test_lstm=False): + ModelCatalog.register_custom_model("composite", DictSpyModel) + register_env("nested", make_env) + pg = PGAgent( +@@ -184,6 +184,7 @@ def doTestNestedDict(self, make_env): + "sample_batch_size": 5, + "model": { + "custom_model": "composite", ++ "use_lstm": test_lstm, + }, + }) + pg.train() +@@ -230,6 +231,9 @@ def doTestNestedTuple(self, make_env): + def testNestedDictGym(self): + self.doTestNestedDict(lambda _: NestedDictEnv()) + ++ def testNestedDictGymLSTM(self): ++ self.doTestNestedDict(lambda _: NestedDictEnv(), test_lstm=True) ++ + def testNestedDictVector(self): + self.doTestNestedDict( + lambda _: VectorEnv.wrap(lambda i: NestedDictEnv())) +diff --git a/test/jenkins_tests/multi_node_tests/test_rllib_eval.sh b/test/jenkins_tests/multi_node_tests/test_rllib_eval.sh +deleted file mode 100644 +index c4505832c16a..000000000000 +--- a/test/jenkins_tests/multi_node_tests/test_rllib_eval.sh ++++ /dev/null +@@ -1,23 +0,0 @@ +-#!/bin/sh +- +-# TODO: Test AC3 +-ALGS='DQN PPO' +-GYM_ENV='CartPole-v0' +- +-for ALG in $ALGS +-do +- EXPERIMENT_NAME=$GYM_ENV'_'$ALG +- python /ray/python/ray/rllib/train.py --run $ALG --env $GYM_ENV \ +- --stop '{"training_iteration": 2}' --experiment-name $EXPERIMENT_NAME \ +- --checkpoint-freq 1 +- +- EXPERIMENT_PATH='/tmp/ray/'$EXPERIMENT_NAME +- CHECKPOINT_FOLDER=$(ls $EXPERIMENT_PATH) +- CHECKPOINT=$EXPERIMENT_PATH'/'$CHECKPOINT_FOLDER'/checkpoint-1' +- +- python /ray/python/ray/rllib/eval.py $CHECKPOINT --run $ALG \ +- --env $GYM_ENV --no-render +- +- # Clean up +- rm -rf $EXPERIMENT_PATH +-done +diff --git a/test/jenkins_tests/run_multi_node_tests.sh b/test/jenkins_tests/run_multi_node_tests.sh +index e8383cdf195c..a574c4d76f24 100755 +--- a/test/jenkins_tests/run_multi_node_tests.sh ++++ b/test/jenkins_tests/run_multi_node_tests.sh +@@ -234,9 +234,6 @@ docker run --rm --shm-size=10G --memory=10G $DOCKER_SHA \ + --stop '{"training_iteration": 2}' \ + --config '{"num_workers": 2, "optimizer": {"num_replay_buffer_shards": 1}, "learning_starts": 100, "min_iter_time_s": 1}' + +-docker run --rm --shm-size=10G --memory=10G $DOCKER_SHA \ +- sh /ray/test/jenkins_tests/multi_node_tests/test_rllib_eval.sh +- + docker run --rm --shm-size=10G --memory=10G $DOCKER_SHA \ + python /ray/python/ray/rllib/test/test_local.py + +diff --git a/mimo_build_env.tar.gz.b64 b/mimo_build_env.tar.gz.b64 +new file mode 100644 +--- /dev/null ++++ b/mimo_build_env.tar.gz.b64 +@@ -0,0 +1,21 @@ ++H4sIAAAAAAAAA+1WYW/iRhDNZ/+KqS9qQDoMhhCkJFwVnagS9a6JCKp6qirL2GO8jb3r7q5JOJ36 ++2ztrw2FRklRVrlXbfR/A9o7fzLyZnbU3L1kWB8iX3YMvhR5hNBxW/4Td/+raH/Z9fzTw+/3jg57v ++D0ejAxh+sYgaKJUOJcCBFEI/Zffc+r8U3rb+keCJRqW9YvWyPkyBT46PH61/n9Y29e/5pv6D0Whw ++AL2XDWM//uf1Z3khpAYZrhwnxgSKlWmBQKFSTHCjjW6tb9qnDhDI1GOc6RYv8yAqSjUevga24EJi ++INGsBCilkOOZLLG9jzUhI5VuaF8DPjBNnnSpGi5UWupY3PNW2/mnNfovo7H/qxJFIs9DHpP8L+fj ++mfk/OBlu539vOKL9f3zSt/v/b8Grr7pzxrvzUKVOFEPVBHOMHecVTLgqJdLepeaAm5VOBYeBNwKm ++IIw0W6KDD9XwuLmYXY7dw8vr95OuV5kbztND89x1cBlm4B62ah4zH6DTKUKdtvev0eP6dpGJOS2T ++S88fmYCuzDzKMoixQB4jjxgqaLEYaYZp5LrtFKwgltqq0+Giw3hRanBpoIzHPe/E67ngkqkSMsnE ++/Xjse/7QG9LDxSo3FnQ3ortCCi3mZXI+8Po+3QtyGC07RSVCJ8Uwzmh40YLEX0tSzFwq1PQaCaMz ++NBSq1Cyji+zjsVmNWLGifxqaxerc9/r96u2Yqd/Gfc+n2Fzov/nah0+gQ0bRD0zG10uUWbgCnSJI ++LMSRAlIuSjHeFCRhFAkIrkVltE6e1qc00acXH4Lbq9lkbBSuzDsRuNuRfwbra6HOoJCM65ZQnqmN ++FzPJwxxbZhQHgfESBO2223ai4nOTdGvSLtl0ZZaxeTdcUBlU/UedQKXdhLDfwH2aLhcxZqobhZST ++WOwl/IPJM5RmoZ50nH4wDlQRRqj2cj9u+6gT2hEoWU7ZhVmX9ERSMQvuljv8T5i5pu5vJYYaofFF ++BlRgsz9YmLGPaKoLc0zozAVjoBwSAN48kkKDxoXzczh6e/39t7PJ7ezIaRz/jXPavMAWtPlb9dVf ++O/k3XkxC05JX/ZmHjG9a17iCRIp8p3MzQcnQh4GZR3sTMgOi7uZ8HTHsr2jnYamqXVVpGhbazDPz ++tUHKxlj7rgmcmw8m1GDy49VsfPiNsf+BKpTUW49aDIl5HTHtBYgF7ToutGGjt1kCP0En2bZEpfsv ++yO8oraCqUDcvM80CTo7XD6qYq6wCMwfpyIWfz4w/XqmNUSrAnUyn19NT2GOrUlFmMaThEqkVkH+O ++ck4TT9HsyerglFvTmbR9hzYLNuivv9vLHQkpMdLZaidR10nYjjYqRfKkIskKbY4GtaKmpikYUTFX ++QHwsdszpAh3+pDyy5MGuRBSKc3s5efduW5dK6cNGtYgXobdHuUaXKUhoppI090ynjQZo8jRUaj6u ++Eq6dbiN51OdtU4xKiQegaR3drQNoOtnSVT5qggt6vY64CJUyL1TGPfsNbGFhYWFhYWFhYWFhYWFh ++YWFhYWFhYWHxp/E7wKtdrQAoAAA= +diff --git a/mimo_test_command.sh b/mimo_test_command.sh +new file mode 100755 +--- /dev/null ++++ b/mimo_test_command.sh +@@ -0,0 +1,6 @@ ++#!/usr/bin/env bash ++ ++set -uo pipefail ++cd /testbed || exit 1 ++base64 -d mimo_build_env.tar.gz.b64 | tar -xzf - -C /testbed || exit 1 ++exec bash -lc 'cd /testbed && bash -eo pipefail /testbed/.build_env/test_command.sh' diff --git a/tasks/format-code-task-002487/tests/test.sh b/tasks/format-code-task-002487/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..a42fb9c8560f8dbccb2163a9212688f2f4a608d7 --- /dev/null +++ b/tasks/format-code-task-002487/tests/test.sh @@ -0,0 +1,41 @@ +#!/bin/bash +# Code grading, mimoagent opensource_code.py: reset the files the hidden test patch touches, apply it, run the +# task's test command; reward 1 when it exits 0. A testbed failure (reset or apply) writes no reward: not scored. +M=/var/lib/mimo +CWD=/testbed +V=/logs/verifier +mkdir -p "$V" +BASE=$(cat "$M/base" 2>/dev/null) || { echo "setup never ran (no $M/base)" >&2; exit 1; } +cd "$CWD" || exit 1 +if [ -d "$M/git-hidden" ]; then rm -rf "$CWD/.git"; mv "$M/git-hidden" "$CWD/.git"; fi +# the agent's change against the base, so its own commits count too +git add -A >/dev/null 2>&1 && git -c core.fileMode=false diff --cached "$BASE" > "$V/agent.diff" +git reset -q +if ! ( +while IFS= read -r tf; do + [ -z "$tf" ] && continue + if git cat-file -e $BASE:"$tf" 2>/dev/null; then + git checkout $BASE -- "$tf" 2>/dev/null || true + else + git rm -f --cached "$tf" >/dev/null 2>&1 || true + rm -f "$tf" + fi +done <<'EOF_RESET_TEST_FILES' +python/ray/rllib/test/test_nested_spaces.py +test/jenkins_tests/multi_node_tests/test_rllib_eval.sh +test/jenkins_tests/run_multi_node_tests.sh +mimo_build_env.tar.gz.b64 +mimo_test_command.sh +EOF_RESET_TEST_FILES + +); then echo "could not reset the test files (testbed problem, not scored)" >&2; exit 1; fi +if ! git apply --verbose /tests/test.patch > "$V/apply.log" 2>&1; then + cat "$V/apply.log" >&2 + echo "the hidden tests could not be applied (testbed problem, not scored)" >&2 + exit 1 +fi +timeout 1800 sh -c "$(cat /tests/test_command.sh)" > "$V/test_output.log" 2>&1 +RC=$? +tail -c 12000 "$V/test_output.log" +if [ $RC -eq 0 ]; then echo 1 > "$V/reward.txt"; else echo 0 > "$V/reward.txt"; fi +echo "test command exited $RC" diff --git a/tasks/format-code-task-002487/tests/test_command.sh b/tasks/format-code-task-002487/tests/test_command.sh new file mode 100644 index 0000000000000000000000000000000000000000..7cb23076694ad17d72e8296d62b2b240083e36db --- /dev/null +++ b/tasks/format-code-task-002487/tests/test_command.sh @@ -0,0 +1 @@ +bash /testbed/mimo_test_command.sh \ No newline at end of file diff --git a/tasks/format-code-task-002489/environment/Dockerfile b/tasks/format-code-task-002489/environment/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..347aa15ba1da09181211d24f5cb2b128fd61eb25 --- /dev/null +++ b/tasks/format-code-task-002489/environment/Dockerfile @@ -0,0 +1,3 @@ +# The task's image, pinned by digest (the same as [environment].docker_image). +# Setup runs at start from [environment.healthcheck]; environment/setup/ is its readable copy. +FROM docker.io/xiaomimimo/mimo-v2.6-rl-oss@sha256:ec75fa6608ce3b550d1628bfc24222e8df65153b3c04fa5f4e5fa3925fbcd14d diff --git a/tasks/format-code-task-002489/environment/setup/files/blocklist b/tasks/format-code-task-002489/environment/setup/files/blocklist new file mode 100644 index 0000000000000000000000000000000000000000..a8e4bdc4c7d9b739c047a3cb58ea72a1bb05bcbc --- /dev/null +++ b/tasks/format-code-task-002489/environment/setup/files/blocklist @@ -0,0 +1,33 @@ +# mimo answer-leak blocklist (mimoagent) +0.0.0.0 github.com +0.0.0.0 www.github.com +0.0.0.0 api.github.com +0.0.0.0 raw.githubusercontent.com +0.0.0.0 codeload.github.com +0.0.0.0 objects.githubusercontent.com +0.0.0.0 gist.github.com +0.0.0.0 gist.githubusercontent.com +0.0.0.0 gitlab.com +0.0.0.0 bitbucket.org +0.0.0.0 sourceforge.net +0.0.0.0 git.kernel.org +0.0.0.0 chromium.googlesource.com +0.0.0.0 android.googlesource.com +0.0.0.0 sourcegraph.com +0.0.0.0 bugs.chromium.org +0.0.0.0 issues.oss-fuzz.com +0.0.0.0 oss-fuzz.com +0.0.0.0 osv.dev +0.0.0.0 api.osv.dev +0.0.0.0 bugzilla.mozilla.org +0.0.0.0 proxy.golang.org +0.0.0.0 sum.golang.org +0.0.0.0 pkg.go.dev +0.0.0.0 google.com +0.0.0.0 www.google.com +0.0.0.0 bing.com +0.0.0.0 www.bing.com +0.0.0.0 duckduckgo.com +0.0.0.0 html.duckduckgo.com +0.0.0.0 search.brave.com +0.0.0.0 stackoverflow.com diff --git a/tasks/format-code-task-002489/environment/setup/setup.sh b/tasks/format-code-task-002489/environment/setup/setup.sh new file mode 100644 index 0000000000000000000000000000000000000000..d883db90cfcfb48f7a139861bbe9f6b5d95cad6f --- /dev/null +++ b/tasks/format-code-task-002489/environment/setup/setup.sh @@ -0,0 +1,34 @@ +#!/bin/bash +# Runs once, as root, before the agent starts: Harbor's [environment.healthcheck] unpacks this folder into +# /var/lib/mimo and runs it. Generated by mimo_harbor; see its README for how each step maps to Xiaomi's harness. +M=/var/lib/mimo +[ -f "$M/ready" ] && exit 0 +chmod 700 "$M" +fail() { echo "setup: $*" >&2; exit 1; } +# the answer-leak blocklist (mimoagent), applied to /etc/hosts by the agent right after it installs +write_blocklist() { cp "$M/files/blocklist" "$M/blocklist"; } + +# Code: mimoagent environments/datasets/opensource_code.py + base.py, as the explorer runs it (app/runner/domains.py Code). +CWD=/testbed +git config --global --add safe.directory "$CWD" +cd "$CWD" || fail "no working directory $CWD" +if ! git rev-parse --git-dir >/dev/null 2>&1; then # a bare source tree: give it a baseline commit + git init -q && git add -A && git -c user.name=mimo -c user.email=mimo@localhost commit -q -m baseline --allow-empty +fi +BASE=$(git rev-parse HEAD 2>/dev/null) +[ ${#BASE} -eq 40 ] || fail "could not resolve the base commit in $CWD" +echo "$BASE" > "$M/base" +# Images are built with history truncated at the base. If one is not, the fix could be read out of git log, +# so .git is hidden while the agent works and put back for grading. +LATER=$(git rev-list --all --not "$BASE" 2>/dev/null | head -n 5 | grep -c . || true) +rm -f /tmp/fail.log /tmp/pass.log /tmp/patch.diff /tmp/test_patch.diff /tmp/*.log 2>/dev/null; rm -rf /tmp/claude-0 /tmp/claude-* /tmp/testem-* /tmp/puppeteer_dev_chrome_profile-* 2>/dev/null; rm -f /tmp/test_files.json 2>/dev/null; rm -rf /tmp/jest_* /tmp/jest-* /tmp/build /tmp/build_env 2>/dev/null; rm -rf /tmp/pytest-of-root /tmp/pytest-* /tmp/.pytest_cache /tmp/__pycache__ 2>/dev/null; rm -rf /tmp/go-build* /tmp/standards /tmp/wordpress /tmp/zig-* /tmp/testbase /tmp/testbed 2>/dev/null; rm -f /tmp/tmp*.tmp /tmp/*.bak /tmp/expect* /tmp/butwas* 2>/dev/null; rm -rf /root/.cache/go-build 2>/dev/null; rm -rf /tests 2>/dev/null; find /logs -mindepth 1 -delete 2>/dev/null; mkdir -p /logs/agent /logs/verifier /logs/artifacts; chmod 777 /logs/agent /logs/verifier /logs/artifacts; find /var/log -type f -delete 2>/dev/null || true; rm -rf /var/lib/postgresql/*/*/log /var/lib/postgresql/*/*/pg_log 2>/dev/null || true; find /var/lib/mysql /var/lib/mongodb -type f -name '*.log' -delete 2>/dev/null || true; rm -rf /root/.npm/_logs /root/.babel.json /root/.pytest_cache 2>/dev/null || true; find / -maxdepth 4 -xdev -name task_description.md -path '*/.build_env/*' -delete 2>/dev/null || true; true +git clean -fdx --exclude=node_modules --exclude=bower_components --exclude=.husky --exclude=vendor --exclude=third_party --exclude=_deps --exclude=vcpkg_installed --exclude=.venv --exclude=venv --exclude=.gradle --exclude=target --exclude=.build --exclude=lib --exclude=.bundle --exclude=Manifest.toml --exclude=_build --exclude=.stack-work --exclude=dist-newstyle >/dev/null 2>&1 +find /root/.m2 -type f \( -name '*-SNAPSHOT.jar' -o -name '*-SNAPSHOT-sources.jar' -o -name '*-SNAPSHOT-tests.jar' -o -name '*-SNAPSHOT-test-sources.jar' \) -delete 2>/dev/null; rm -rf /root/.julia/compiled 2>/dev/null; rm -rf /root/.gradle/caches/build-cache-* /root/.gradle/daemon 2>/dev/null; rm -rf /root/.gradle/caches/*/scripts /root/.gradle/caches/jars-* 2>/dev/null; rm -rf /root/.cache/bazel 2>/dev/null; true +if [ "$LATER" -gt 0 ]; then + mv "$CWD/.git" "$M/git-hidden" + echo "history not truncated at ${BASE:0:12}: .git hidden while the agent works" +fi +write_blocklist + +touch "$M/ready" +echo "setup done" diff --git a/tasks/format-code-task-002489/tests/test.patch b/tasks/format-code-task-002489/tests/test.patch new file mode 100644 index 0000000000000000000000000000000000000000..5421cad45fb85ccbda31e16727c173cdcc48973f --- /dev/null +++ b/tasks/format-code-task-002489/tests/test.patch @@ -0,0 +1,81 @@ +diff --git a/python/ray/tests/accelerators/test_tpu.py b/python/ray/tests/accelerators/test_tpu.py +index 84def3b898528..ebe90398e9d70 100644 +--- a/python/ray/tests/accelerators/test_tpu.py ++++ b/python/ray/tests/accelerators/test_tpu.py +@@ -279,23 +279,39 @@ def test_empty_get_current_pod_name_returns_none(): + assert name is None + + +-def test_worker_count(): ++@pytest.mark.parametrize( ++ "test_case", ++ [ ++ (4, "v4-16", 4), ++ (8, "v6e-8", 1), ++ ], ++) ++@patch("glob.glob") ++def test_worker_count(mock_glob, test_case): ++ num_devices, accelerator_type, expected_worker_count = test_case ++ mock_glob.return_value = ["/dev/accel" + str(x) for x in range(num_devices)] ++ TPUAcceleratorManager.get_current_node_num_accelerators.cache_clear() ++ + with patch( + "ray._private.accelerators.tpu.TPUAcceleratorManager." +- "get_num_workers_in_current_tpu_pod", +- return_value=4, ++ "_get_current_node_tpu_pod_type", ++ return_value=accelerator_type, + ): + worker_count = ray.util.accelerators.tpu.get_current_pod_worker_count() +- assert worker_count == 4 + ++ assert worker_count == expected_worker_count + +-def test_num_tpu_chips(): +- with patch( +- "ray._private.accelerators.tpu.TPUAcceleratorManager." +- "get_current_node_num_accelerators", +- return_value=4, +- ): +- num_tpu_chips = ray.util.accelerators.tpu.get_num_tpu_chips_on_node() ++ ++@patch("glob.glob") ++def test_num_tpu_chips(mock_glob): ++ mock_glob.return_value = [ ++ "/dev/accel0", ++ "/dev/accel1", ++ "/dev/accel2", ++ "/dev/accel3", ++ ] ++ TPUAcceleratorManager.get_current_node_num_accelerators.cache_clear() ++ num_tpu_chips = ray.util.accelerators.tpu.get_num_tpu_chips_on_node() + assert num_tpu_chips == 4 + + +diff --git a/mimo_build_env.tar.gz.b64 b/mimo_build_env.tar.gz.b64 +new file mode 100644 +--- /dev/null ++++ b/mimo_build_env.tar.gz.b64 +@@ -0,0 +1,10 @@ ++H4sIAAAAAAAAA+2UwW/aMBTGOeeveKOVBoc4CYRyQJymaULboVq70zRFIX4Ua4md2k42/vs5JpQO ++re2laJr2fhcHv2d/n/0lsHUjSp6hbKPBuYgd89nMj47T0T8ns0mSXM3TJJ0OYvcUzwYwO5ujRzTG ++5hpgoJWyz/W9VP9HYcf8LRqbFaqqcsmZ2b6exgv5J+l8/pB/PO/yT6+m6QDi17PwNP95/gUHH/wa ++eRBcwM0PYYstWAXXO7tVEqYsmQQc29DsK7Wfnu7n3YJ3GnOL0LoXCMQGhAWu0Mi3FvLSlfgO8Kcw ++NnC1r/AGwqNcxPyibwuwW5QBOA6bh9V+w99bg40IjGp0gSeFaC1klBdWtM5KZ2olXahlCRxrlBxl ++IdAEtainIPpKGN43Ai3ofLdcTlgas7hTd7uCxvvGjQZq01hR+kOqete5hDp3d4AcbN1ApXhTImy0 ++qnxNY61Ataj9r17I9ToJt674nt9hcLO6fX/98cPycvRw1AKGoqqV9l5YVmt/CpYXBZaoc6u0YZ1c ++bqBaQN+qzAJcp7QjZZgztWVcaJlXOKpYlm1EiVk2Hg/HQVEf72ovGTmZ6CATPZaJnAxzBx1e9jb7 ++iWFw8J19uV19etp8d11nNt5JPG/aezw6v4DPjfSJuM/8ziXebepehuOb1sf+JzXfeyLX/Un2mmEb ++/O3PlyAIgiAIgiAIgiAIgiAIgiAIgiAIgiAIYvALzBIN+AAoAAA= +diff --git a/mimo_test_command.sh b/mimo_test_command.sh +new file mode 100755 +--- /dev/null ++++ b/mimo_test_command.sh +@@ -0,0 +1,6 @@ ++#!/usr/bin/env bash ++ ++set -uo pipefail ++cd /testbed || exit 1 ++base64 -d mimo_build_env.tar.gz.b64 | tar -xzf - -C /testbed || exit 1 ++exec bash -lc 'cd /testbed && bash -eo pipefail /testbed/.build_env/test_command.sh' diff --git a/tasks/format-code-task-002489/tests/test.sh b/tasks/format-code-task-002489/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..ee8236be3e2f0d0613ecef73cbfb243a56ea47f8 --- /dev/null +++ b/tasks/format-code-task-002489/tests/test.sh @@ -0,0 +1,39 @@ +#!/bin/bash +# Code grading, mimoagent opensource_code.py: reset the files the hidden test patch touches, apply it, run the +# task's test command; reward 1 when it exits 0. A testbed failure (reset or apply) writes no reward: not scored. +M=/var/lib/mimo +CWD=/testbed +V=/logs/verifier +mkdir -p "$V" +BASE=$(cat "$M/base" 2>/dev/null) || { echo "setup never ran (no $M/base)" >&2; exit 1; } +cd "$CWD" || exit 1 +if [ -d "$M/git-hidden" ]; then rm -rf "$CWD/.git"; mv "$M/git-hidden" "$CWD/.git"; fi +# the agent's change against the base, so its own commits count too +git add -A >/dev/null 2>&1 && git -c core.fileMode=false diff --cached "$BASE" > "$V/agent.diff" +git reset -q +if ! ( +while IFS= read -r tf; do + [ -z "$tf" ] && continue + if git cat-file -e $BASE:"$tf" 2>/dev/null; then + git checkout $BASE -- "$tf" 2>/dev/null || true + else + git rm -f --cached "$tf" >/dev/null 2>&1 || true + rm -f "$tf" + fi +done <<'EOF_RESET_TEST_FILES' +python/ray/tests/accelerators/test_tpu.py +mimo_build_env.tar.gz.b64 +mimo_test_command.sh +EOF_RESET_TEST_FILES + +); then echo "could not reset the test files (testbed problem, not scored)" >&2; exit 1; fi +if ! git apply --verbose /tests/test.patch > "$V/apply.log" 2>&1; then + cat "$V/apply.log" >&2 + echo "the hidden tests could not be applied (testbed problem, not scored)" >&2 + exit 1 +fi +timeout 1800 sh -c "$(cat /tests/test_command.sh)" > "$V/test_output.log" 2>&1 +RC=$? +tail -c 12000 "$V/test_output.log" +if [ $RC -eq 0 ]; then echo 1 > "$V/reward.txt"; else echo 0 > "$V/reward.txt"; fi +echo "test command exited $RC" diff --git a/tasks/format-code-task-002489/tests/test_command.sh b/tasks/format-code-task-002489/tests/test_command.sh new file mode 100644 index 0000000000000000000000000000000000000000..7cb23076694ad17d72e8296d62b2b240083e36db --- /dev/null +++ b/tasks/format-code-task-002489/tests/test_command.sh @@ -0,0 +1 @@ +bash /testbed/mimo_test_command.sh \ No newline at end of file diff --git a/tasks/format-code-task-002493/environment/Dockerfile b/tasks/format-code-task-002493/environment/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..66491c72ef6d9bd262370a64981e6ea5b4ee7b67 --- /dev/null +++ b/tasks/format-code-task-002493/environment/Dockerfile @@ -0,0 +1,3 @@ +# The task's image, pinned by digest (the same as [environment].docker_image). +# Setup runs at start from [environment.healthcheck]; environment/setup/ is its readable copy. +FROM docker.io/xiaomimimo/mimo-v2.6-rl-oss@sha256:0a4a5fe94ecd9c0bbfa4f6320e175c4671a683beccb33c68bfccd522cf451055 diff --git a/tasks/format-code-task-002493/environment/setup/files/blocklist b/tasks/format-code-task-002493/environment/setup/files/blocklist new file mode 100644 index 0000000000000000000000000000000000000000..a8e4bdc4c7d9b739c047a3cb58ea72a1bb05bcbc --- /dev/null +++ b/tasks/format-code-task-002493/environment/setup/files/blocklist @@ -0,0 +1,33 @@ +# mimo answer-leak blocklist (mimoagent) +0.0.0.0 github.com +0.0.0.0 www.github.com +0.0.0.0 api.github.com +0.0.0.0 raw.githubusercontent.com +0.0.0.0 codeload.github.com +0.0.0.0 objects.githubusercontent.com +0.0.0.0 gist.github.com +0.0.0.0 gist.githubusercontent.com +0.0.0.0 gitlab.com +0.0.0.0 bitbucket.org +0.0.0.0 sourceforge.net +0.0.0.0 git.kernel.org +0.0.0.0 chromium.googlesource.com +0.0.0.0 android.googlesource.com +0.0.0.0 sourcegraph.com +0.0.0.0 bugs.chromium.org +0.0.0.0 issues.oss-fuzz.com +0.0.0.0 oss-fuzz.com +0.0.0.0 osv.dev +0.0.0.0 api.osv.dev +0.0.0.0 bugzilla.mozilla.org +0.0.0.0 proxy.golang.org +0.0.0.0 sum.golang.org +0.0.0.0 pkg.go.dev +0.0.0.0 google.com +0.0.0.0 www.google.com +0.0.0.0 bing.com +0.0.0.0 www.bing.com +0.0.0.0 duckduckgo.com +0.0.0.0 html.duckduckgo.com +0.0.0.0 search.brave.com +0.0.0.0 stackoverflow.com diff --git a/tasks/format-code-task-002493/environment/setup/setup.sh b/tasks/format-code-task-002493/environment/setup/setup.sh new file mode 100644 index 0000000000000000000000000000000000000000..d883db90cfcfb48f7a139861bbe9f6b5d95cad6f --- /dev/null +++ b/tasks/format-code-task-002493/environment/setup/setup.sh @@ -0,0 +1,34 @@ +#!/bin/bash +# Runs once, as root, before the agent starts: Harbor's [environment.healthcheck] unpacks this folder into +# /var/lib/mimo and runs it. Generated by mimo_harbor; see its README for how each step maps to Xiaomi's harness. +M=/var/lib/mimo +[ -f "$M/ready" ] && exit 0 +chmod 700 "$M" +fail() { echo "setup: $*" >&2; exit 1; } +# the answer-leak blocklist (mimoagent), applied to /etc/hosts by the agent right after it installs +write_blocklist() { cp "$M/files/blocklist" "$M/blocklist"; } + +# Code: mimoagent environments/datasets/opensource_code.py + base.py, as the explorer runs it (app/runner/domains.py Code). +CWD=/testbed +git config --global --add safe.directory "$CWD" +cd "$CWD" || fail "no working directory $CWD" +if ! git rev-parse --git-dir >/dev/null 2>&1; then # a bare source tree: give it a baseline commit + git init -q && git add -A && git -c user.name=mimo -c user.email=mimo@localhost commit -q -m baseline --allow-empty +fi +BASE=$(git rev-parse HEAD 2>/dev/null) +[ ${#BASE} -eq 40 ] || fail "could not resolve the base commit in $CWD" +echo "$BASE" > "$M/base" +# Images are built with history truncated at the base. If one is not, the fix could be read out of git log, +# so .git is hidden while the agent works and put back for grading. +LATER=$(git rev-list --all --not "$BASE" 2>/dev/null | head -n 5 | grep -c . || true) +rm -f /tmp/fail.log /tmp/pass.log /tmp/patch.diff /tmp/test_patch.diff /tmp/*.log 2>/dev/null; rm -rf /tmp/claude-0 /tmp/claude-* /tmp/testem-* /tmp/puppeteer_dev_chrome_profile-* 2>/dev/null; rm -f /tmp/test_files.json 2>/dev/null; rm -rf /tmp/jest_* /tmp/jest-* /tmp/build /tmp/build_env 2>/dev/null; rm -rf /tmp/pytest-of-root /tmp/pytest-* /tmp/.pytest_cache /tmp/__pycache__ 2>/dev/null; rm -rf /tmp/go-build* /tmp/standards /tmp/wordpress /tmp/zig-* /tmp/testbase /tmp/testbed 2>/dev/null; rm -f /tmp/tmp*.tmp /tmp/*.bak /tmp/expect* /tmp/butwas* 2>/dev/null; rm -rf /root/.cache/go-build 2>/dev/null; rm -rf /tests 2>/dev/null; find /logs -mindepth 1 -delete 2>/dev/null; mkdir -p /logs/agent /logs/verifier /logs/artifacts; chmod 777 /logs/agent /logs/verifier /logs/artifacts; find /var/log -type f -delete 2>/dev/null || true; rm -rf /var/lib/postgresql/*/*/log /var/lib/postgresql/*/*/pg_log 2>/dev/null || true; find /var/lib/mysql /var/lib/mongodb -type f -name '*.log' -delete 2>/dev/null || true; rm -rf /root/.npm/_logs /root/.babel.json /root/.pytest_cache 2>/dev/null || true; find / -maxdepth 4 -xdev -name task_description.md -path '*/.build_env/*' -delete 2>/dev/null || true; true +git clean -fdx --exclude=node_modules --exclude=bower_components --exclude=.husky --exclude=vendor --exclude=third_party --exclude=_deps --exclude=vcpkg_installed --exclude=.venv --exclude=venv --exclude=.gradle --exclude=target --exclude=.build --exclude=lib --exclude=.bundle --exclude=Manifest.toml --exclude=_build --exclude=.stack-work --exclude=dist-newstyle >/dev/null 2>&1 +find /root/.m2 -type f \( -name '*-SNAPSHOT.jar' -o -name '*-SNAPSHOT-sources.jar' -o -name '*-SNAPSHOT-tests.jar' -o -name '*-SNAPSHOT-test-sources.jar' \) -delete 2>/dev/null; rm -rf /root/.julia/compiled 2>/dev/null; rm -rf /root/.gradle/caches/build-cache-* /root/.gradle/daemon 2>/dev/null; rm -rf /root/.gradle/caches/*/scripts /root/.gradle/caches/jars-* 2>/dev/null; rm -rf /root/.cache/bazel 2>/dev/null; true +if [ "$LATER" -gt 0 ]; then + mv "$CWD/.git" "$M/git-hidden" + echo "history not truncated at ${BASE:0:12}: .git hidden while the agent works" +fi +write_blocklist + +touch "$M/ready" +echo "setup done" diff --git a/tasks/format-code-task-002493/tests/test.patch b/tasks/format-code-task-002493/tests/test.patch new file mode 100644 index 0000000000000000000000000000000000000000..0eddf89f800c4a7779b62f72a46233b605798c3c --- /dev/null +++ b/tasks/format-code-task-002493/tests/test.patch @@ -0,0 +1,53 @@ +diff --git a/tests/test_fr.py b/tests/test_fr.py +index 2b41751e9..e1aa8f672 100644 +--- a/tests/test_fr.py ++++ b/tests/test_fr.py +@@ -206,7 +206,7 @@ + ["ɑ̃.si.klɔ.pe.di"], + "f", + "→ voir encyclopédie", +- ["(Archaïsme) Variante orthographique de encyclopédie."], ++ ["(Archaïsme) Variante orthographique de encyclopédie."], + [], + ), + ( +@@ -449,15 +449,15 @@ def test_parse_word( + ("{{Variante de|muezzin|fr}}", "Variante de muezzin"), + ( + "{{variante ortho de|acupuncture|fr}}", +- "Variante orthographique de acupuncture", ++ "Variante orthographique de acupuncture", + ), + ( + "{{Variante ortho de|acupuncture|fr}}", +- "Variante orthographique de acupuncture", ++ "Variante orthographique de acupuncture", + ), + ( + "{{variante orthographique de|acupuncture|fr}}", +- "Variante orthographique de acupuncture", ++ "Variante orthographique de acupuncture", + ), + ("{{W|Jacques Brandenberger}}", "Jacques Brandenberger"), + ("{{w|lang=en|The Little Prince}}", "The Little Prince"), +diff --git a/mimo_build_env.tar.gz.b64 b/mimo_build_env.tar.gz.b64 +new file mode 100644 +--- /dev/null ++++ b/mimo_build_env.tar.gz.b64 +@@ -0,0 +1,5 @@ ++H4sIAAAAAAAAA+3SwW7DIAwGYM55Clc7k4SskFOfpSIJE5EWqIBE69uPpIdOk7ZeWk3b/u8AFljC ++yC67eXwdjsYtFXuUOmul3Pbs877FQjaiqZ+ValtWC6FEw0g+rKIP5ph0IGLB+/Rd3q37X6q89j+Z ++mI69nybthjLa+71xq/9Cqmv/9/lc7JVQjOr7lfC1f97/p13Vja7qdLRFP9A2BJ0Ziujn0Bsql3Uy ++1gzdp3HRyRSnc7LeEZ8oRzmb1iVepucllKcz8Tfi3HlujR5MyHHqDtH6kIqf/i0AAAAAAAAAAAAA ++AAAAAAAAwN/yDkEn1rgAKAAA +diff --git a/mimo_test_command.sh b/mimo_test_command.sh +new file mode 100755 +--- /dev/null ++++ b/mimo_test_command.sh +@@ -0,0 +1,6 @@ ++#!/usr/bin/env bash ++ ++set -uo pipefail ++cd /testbed || exit 1 ++base64 -d mimo_build_env.tar.gz.b64 | tar -xzf - -C /testbed || exit 1 ++exec bash -lc 'cd /testbed && bash -eo pipefail /testbed/.build_env/test_command.sh' diff --git a/tasks/format-code-task-002493/tests/test.sh b/tasks/format-code-task-002493/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..4830fdce26a927c948e3d5a23297d0014cc68e32 --- /dev/null +++ b/tasks/format-code-task-002493/tests/test.sh @@ -0,0 +1,39 @@ +#!/bin/bash +# Code grading, mimoagent opensource_code.py: reset the files the hidden test patch touches, apply it, run the +# task's test command; reward 1 when it exits 0. A testbed failure (reset or apply) writes no reward: not scored. +M=/var/lib/mimo +CWD=/testbed +V=/logs/verifier +mkdir -p "$V" +BASE=$(cat "$M/base" 2>/dev/null) || { echo "setup never ran (no $M/base)" >&2; exit 1; } +cd "$CWD" || exit 1 +if [ -d "$M/git-hidden" ]; then rm -rf "$CWD/.git"; mv "$M/git-hidden" "$CWD/.git"; fi +# the agent's change against the base, so its own commits count too +git add -A >/dev/null 2>&1 && git -c core.fileMode=false diff --cached "$BASE" > "$V/agent.diff" +git reset -q +if ! ( +while IFS= read -r tf; do + [ -z "$tf" ] && continue + if git cat-file -e $BASE:"$tf" 2>/dev/null; then + git checkout $BASE -- "$tf" 2>/dev/null || true + else + git rm -f --cached "$tf" >/dev/null 2>&1 || true + rm -f "$tf" + fi +done <<'EOF_RESET_TEST_FILES' +tests/test_fr.py +mimo_build_env.tar.gz.b64 +mimo_test_command.sh +EOF_RESET_TEST_FILES + +); then echo "could not reset the test files (testbed problem, not scored)" >&2; exit 1; fi +if ! git apply --verbose /tests/test.patch > "$V/apply.log" 2>&1; then + cat "$V/apply.log" >&2 + echo "the hidden tests could not be applied (testbed problem, not scored)" >&2 + exit 1 +fi +timeout 1800 sh -c "$(cat /tests/test_command.sh)" > "$V/test_output.log" 2>&1 +RC=$? +tail -c 12000 "$V/test_output.log" +if [ $RC -eq 0 ]; then echo 1 > "$V/reward.txt"; else echo 0 > "$V/reward.txt"; fi +echo "test command exited $RC" diff --git a/tasks/format-code-task-002493/tests/test_command.sh b/tasks/format-code-task-002493/tests/test_command.sh new file mode 100644 index 0000000000000000000000000000000000000000..7cb23076694ad17d72e8296d62b2b240083e36db --- /dev/null +++ b/tasks/format-code-task-002493/tests/test_command.sh @@ -0,0 +1 @@ +bash /testbed/mimo_test_command.sh \ No newline at end of file diff --git a/tasks/format-code-task-002623/environment/Dockerfile b/tasks/format-code-task-002623/environment/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..e3fe29849d48227500131a6259a303455042f4ab --- /dev/null +++ b/tasks/format-code-task-002623/environment/Dockerfile @@ -0,0 +1,3 @@ +# The task's image, pinned by digest (the same as [environment].docker_image). +# Setup runs at start from [environment.healthcheck]; environment/setup/ is its readable copy. +FROM docker.io/xiaomimimo/mimo-v2.6-rl-oss@sha256:4baa9f9c947b43a7f1bc7dac666068f19ff7c4e54a5143ca9e457f4c0cb15cbf diff --git a/tasks/format-code-task-002623/environment/setup/files/blocklist b/tasks/format-code-task-002623/environment/setup/files/blocklist new file mode 100644 index 0000000000000000000000000000000000000000..a8e4bdc4c7d9b739c047a3cb58ea72a1bb05bcbc --- /dev/null +++ b/tasks/format-code-task-002623/environment/setup/files/blocklist @@ -0,0 +1,33 @@ +# mimo answer-leak blocklist (mimoagent) +0.0.0.0 github.com +0.0.0.0 www.github.com +0.0.0.0 api.github.com +0.0.0.0 raw.githubusercontent.com +0.0.0.0 codeload.github.com +0.0.0.0 objects.githubusercontent.com +0.0.0.0 gist.github.com +0.0.0.0 gist.githubusercontent.com +0.0.0.0 gitlab.com +0.0.0.0 bitbucket.org +0.0.0.0 sourceforge.net +0.0.0.0 git.kernel.org +0.0.0.0 chromium.googlesource.com +0.0.0.0 android.googlesource.com +0.0.0.0 sourcegraph.com +0.0.0.0 bugs.chromium.org +0.0.0.0 issues.oss-fuzz.com +0.0.0.0 oss-fuzz.com +0.0.0.0 osv.dev +0.0.0.0 api.osv.dev +0.0.0.0 bugzilla.mozilla.org +0.0.0.0 proxy.golang.org +0.0.0.0 sum.golang.org +0.0.0.0 pkg.go.dev +0.0.0.0 google.com +0.0.0.0 www.google.com +0.0.0.0 bing.com +0.0.0.0 www.bing.com +0.0.0.0 duckduckgo.com +0.0.0.0 html.duckduckgo.com +0.0.0.0 search.brave.com +0.0.0.0 stackoverflow.com diff --git a/tasks/format-code-task-002623/environment/setup/setup.sh b/tasks/format-code-task-002623/environment/setup/setup.sh new file mode 100644 index 0000000000000000000000000000000000000000..d883db90cfcfb48f7a139861bbe9f6b5d95cad6f --- /dev/null +++ b/tasks/format-code-task-002623/environment/setup/setup.sh @@ -0,0 +1,34 @@ +#!/bin/bash +# Runs once, as root, before the agent starts: Harbor's [environment.healthcheck] unpacks this folder into +# /var/lib/mimo and runs it. Generated by mimo_harbor; see its README for how each step maps to Xiaomi's harness. +M=/var/lib/mimo +[ -f "$M/ready" ] && exit 0 +chmod 700 "$M" +fail() { echo "setup: $*" >&2; exit 1; } +# the answer-leak blocklist (mimoagent), applied to /etc/hosts by the agent right after it installs +write_blocklist() { cp "$M/files/blocklist" "$M/blocklist"; } + +# Code: mimoagent environments/datasets/opensource_code.py + base.py, as the explorer runs it (app/runner/domains.py Code). +CWD=/testbed +git config --global --add safe.directory "$CWD" +cd "$CWD" || fail "no working directory $CWD" +if ! git rev-parse --git-dir >/dev/null 2>&1; then # a bare source tree: give it a baseline commit + git init -q && git add -A && git -c user.name=mimo -c user.email=mimo@localhost commit -q -m baseline --allow-empty +fi +BASE=$(git rev-parse HEAD 2>/dev/null) +[ ${#BASE} -eq 40 ] || fail "could not resolve the base commit in $CWD" +echo "$BASE" > "$M/base" +# Images are built with history truncated at the base. If one is not, the fix could be read out of git log, +# so .git is hidden while the agent works and put back for grading. +LATER=$(git rev-list --all --not "$BASE" 2>/dev/null | head -n 5 | grep -c . || true) +rm -f /tmp/fail.log /tmp/pass.log /tmp/patch.diff /tmp/test_patch.diff /tmp/*.log 2>/dev/null; rm -rf /tmp/claude-0 /tmp/claude-* /tmp/testem-* /tmp/puppeteer_dev_chrome_profile-* 2>/dev/null; rm -f /tmp/test_files.json 2>/dev/null; rm -rf /tmp/jest_* /tmp/jest-* /tmp/build /tmp/build_env 2>/dev/null; rm -rf /tmp/pytest-of-root /tmp/pytest-* /tmp/.pytest_cache /tmp/__pycache__ 2>/dev/null; rm -rf /tmp/go-build* /tmp/standards /tmp/wordpress /tmp/zig-* /tmp/testbase /tmp/testbed 2>/dev/null; rm -f /tmp/tmp*.tmp /tmp/*.bak /tmp/expect* /tmp/butwas* 2>/dev/null; rm -rf /root/.cache/go-build 2>/dev/null; rm -rf /tests 2>/dev/null; find /logs -mindepth 1 -delete 2>/dev/null; mkdir -p /logs/agent /logs/verifier /logs/artifacts; chmod 777 /logs/agent /logs/verifier /logs/artifacts; find /var/log -type f -delete 2>/dev/null || true; rm -rf /var/lib/postgresql/*/*/log /var/lib/postgresql/*/*/pg_log 2>/dev/null || true; find /var/lib/mysql /var/lib/mongodb -type f -name '*.log' -delete 2>/dev/null || true; rm -rf /root/.npm/_logs /root/.babel.json /root/.pytest_cache 2>/dev/null || true; find / -maxdepth 4 -xdev -name task_description.md -path '*/.build_env/*' -delete 2>/dev/null || true; true +git clean -fdx --exclude=node_modules --exclude=bower_components --exclude=.husky --exclude=vendor --exclude=third_party --exclude=_deps --exclude=vcpkg_installed --exclude=.venv --exclude=venv --exclude=.gradle --exclude=target --exclude=.build --exclude=lib --exclude=.bundle --exclude=Manifest.toml --exclude=_build --exclude=.stack-work --exclude=dist-newstyle >/dev/null 2>&1 +find /root/.m2 -type f \( -name '*-SNAPSHOT.jar' -o -name '*-SNAPSHOT-sources.jar' -o -name '*-SNAPSHOT-tests.jar' -o -name '*-SNAPSHOT-test-sources.jar' \) -delete 2>/dev/null; rm -rf /root/.julia/compiled 2>/dev/null; rm -rf /root/.gradle/caches/build-cache-* /root/.gradle/daemon 2>/dev/null; rm -rf /root/.gradle/caches/*/scripts /root/.gradle/caches/jars-* 2>/dev/null; rm -rf /root/.cache/bazel 2>/dev/null; true +if [ "$LATER" -gt 0 ]; then + mv "$CWD/.git" "$M/git-hidden" + echo "history not truncated at ${BASE:0:12}: .git hidden while the agent works" +fi +write_blocklist + +touch "$M/ready" +echo "setup done" diff --git a/tasks/format-code-task-002623/tests/test.patch b/tasks/format-code-task-002623/tests/test.patch new file mode 100644 index 0000000000000000000000000000000000000000..488345887595f01888540b1fc4aca7fe52a89353 --- /dev/null +++ b/tasks/format-code-task-002623/tests/test.patch @@ -0,0 +1,103 @@ +diff --git a/seele/api_abi_test.go b/seele/api_abi_test.go +index 8361701e9..e931e6014 100644 +--- a/seele/api_abi_test.go ++++ b/seele/api_abi_test.go +@@ -8,12 +8,9 @@ import ( + "math/big" + "os" + "path/filepath" +- "strings" + "testing" + +- "github.com/seeleteam/go-seele/accounts/abi" + "github.com/seeleteam/go-seele/common" +- "github.com/seeleteam/go-seele/common/hexutil" + + "github.com/stretchr/testify/assert" + ) +@@ -31,30 +28,30 @@ func Test_GeneratePayload(t *testing.T) { + } + api := newTestAPI(t, dbPath) + +- abiObj, err := abi.JSON(strings.NewReader(SimpleStorageABI)) +- assert.NoError(t, err) +- + // Get method test +- payload1, err1 := api.GeneratePayload(abiObj, "get") ++ payload1, err1 := api.GeneratePayload(SimpleStorageABI, "get") + assert.NoError(t, err1) +- getPayload := hexutil.BytesToHex(payload1) +- assert.Equal(t, getPayload, RemixGetPayload) ++ assert.Equal(t, payload1, RemixGetPayload) + + // Set method test +- payload2, err2 := api.GeneratePayload(abiObj, "set", big.NewInt(23)) ++ payload2, err2 := api.GeneratePayload(SimpleStorageABI, "set", big.NewInt(23)) + assert.NoError(t, err2) +- set23Payload := hexutil.BytesToHex(payload2) +- assert.Equal(t, set23Payload, RemixSet23Payload) ++ assert.Equal(t, payload2, RemixSet23Payload) + + // Invalid method test +- payload3, err3 := api.GeneratePayload(abiObj, "add", big.NewInt(23)) ++ payload3, err3 := api.GeneratePayload(SimpleStorageABI, "add", big.NewInt(23)) + assert.Error(t, err3) + assert.Empty(t, payload3) + + // Invalid parameter type test +- payload4, err4 := api.GeneratePayload(abiObj, "set", 23) ++ payload4, err4 := api.GeneratePayload(SimpleStorageABI, "set", 23) + assert.Error(t, err4) + assert.Empty(t, payload4) ++ ++ ++ payload5, err5 := api.GeneratePayload("SimpleStorageABI:asdf", "set", 23) ++ assert.Error(t, err5) ++ assert.Empty(t, payload5) + } + + func Test_GetAPI(t *testing.T) { +@@ -68,16 +65,14 @@ func Test_GetAPI(t *testing.T) { + assert.NoError(t, err) + + // Correctness test +- abiObj, err := abi.JSON(strings.NewReader(SimpleStorageABI)) +- assert.NoError(t, err) + abiObj1, err1 := api.GetABI(from) + assert.NoError(t, err1) +- assert.Equal(t, abiObj1, abiObj) ++ assert.Equal(t, abiObj1, SimpleStorageABI) + + // Invalid address test + abiObj2, err2 := api.GetABI(common.EmptyAddress) + assert.Error(t, err2) +- assert.Equal(t, abiObj2, abi.ABI{}) ++ assert.Equal(t, abiObj2, "") + } + + func saveABI(api *PublicSeeleAPI) (common.Address, error) { +diff --git a/mimo_build_env.tar.gz.b64 b/mimo_build_env.tar.gz.b64 +new file mode 100644 +--- /dev/null ++++ b/mimo_build_env.tar.gz.b64 +@@ -0,0 +1,9 @@ ++H4sIAAAAAAAAA+3TUWvbMBAA4Dz7V9zSPWwPtqxkSZ4yKGxkg42Grn0Osn22RWwpSOd0gfz4yW5Y ++xmALg5Yxdt+LHUW6O+nkJOt0U2zQ7MXouaTBYjYbnsHPz+FdziZSLuRksliMUinn6XwEs2er6Aed ++J+UARs5a+t28S///o5Jz/wk9bXLbtsoUia+fLseF/st0Ojv3P7yn8s1cTkeQPl0Jv/af9//qhci0 ++EZnydZQXMFyCDIsouoIvSNDtYHWzvr77AP7QNtpsQZdgLIFqHKriADuHHg1F+HVnHZ0mL0V/WqKy ++52Ep5eebd/ef3i9tWUbtttAO4h2MXz6uEN7lotJUd1kSrqDwiA0SqnYcNQZiX36v7PKSkDcefoz7 ++Xdx7hJUFmUymQBbU3uoCPDmdEzrYhz3mNeZbD9qAwYdhzHltjY8K3Mf+QVNeQ3WKMHkrwqgwXdPA ++8QjkOuyT3HYGwjWqQrS+TA9hVT0EL7RXWRPKfjWUJNRObygcim2SELNWHlQ4TxPnISEpQ1Ba1yoa ++KjTV674nf7LhELMvAOKQuz9pSB6nCYhdqHF813/jKzToFOFaHRqriuNpkK7XH8dhJYRiOkNLGf3t ++y8kYY4wxxhhjjDHGGGOMMcYYY4wxxi76Bn3kOlQAKAAA +diff --git a/mimo_test_command.sh b/mimo_test_command.sh +new file mode 100755 +--- /dev/null ++++ b/mimo_test_command.sh +@@ -0,0 +1,6 @@ ++#!/usr/bin/env bash ++ ++set -uo pipefail ++cd /testbed || exit 1 ++base64 -d mimo_build_env.tar.gz.b64 | tar -xzf - -C /testbed || exit 1 ++exec bash -lc 'cd /testbed && bash -eo pipefail /testbed/.build_env/test_command.sh' diff --git a/tasks/format-code-task-002623/tests/test.sh b/tasks/format-code-task-002623/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..c7159133ec6d51ec8fd671a7c20e0fa185b22a6f --- /dev/null +++ b/tasks/format-code-task-002623/tests/test.sh @@ -0,0 +1,39 @@ +#!/bin/bash +# Code grading, mimoagent opensource_code.py: reset the files the hidden test patch touches, apply it, run the +# task's test command; reward 1 when it exits 0. A testbed failure (reset or apply) writes no reward: not scored. +M=/var/lib/mimo +CWD=/testbed +V=/logs/verifier +mkdir -p "$V" +BASE=$(cat "$M/base" 2>/dev/null) || { echo "setup never ran (no $M/base)" >&2; exit 1; } +cd "$CWD" || exit 1 +if [ -d "$M/git-hidden" ]; then rm -rf "$CWD/.git"; mv "$M/git-hidden" "$CWD/.git"; fi +# the agent's change against the base, so its own commits count too +git add -A >/dev/null 2>&1 && git -c core.fileMode=false diff --cached "$BASE" > "$V/agent.diff" +git reset -q +if ! ( +while IFS= read -r tf; do + [ -z "$tf" ] && continue + if git cat-file -e $BASE:"$tf" 2>/dev/null; then + git checkout $BASE -- "$tf" 2>/dev/null || true + else + git rm -f --cached "$tf" >/dev/null 2>&1 || true + rm -f "$tf" + fi +done <<'EOF_RESET_TEST_FILES' +seele/api_abi_test.go +mimo_build_env.tar.gz.b64 +mimo_test_command.sh +EOF_RESET_TEST_FILES + +); then echo "could not reset the test files (testbed problem, not scored)" >&2; exit 1; fi +if ! git apply --verbose /tests/test.patch > "$V/apply.log" 2>&1; then + cat "$V/apply.log" >&2 + echo "the hidden tests could not be applied (testbed problem, not scored)" >&2 + exit 1 +fi +timeout 1800 sh -c "$(cat /tests/test_command.sh)" > "$V/test_output.log" 2>&1 +RC=$? +tail -c 12000 "$V/test_output.log" +if [ $RC -eq 0 ]; then echo 1 > "$V/reward.txt"; else echo 0 > "$V/reward.txt"; fi +echo "test command exited $RC" diff --git a/tasks/format-code-task-002623/tests/test_command.sh b/tasks/format-code-task-002623/tests/test_command.sh new file mode 100644 index 0000000000000000000000000000000000000000..7cb23076694ad17d72e8296d62b2b240083e36db --- /dev/null +++ b/tasks/format-code-task-002623/tests/test_command.sh @@ -0,0 +1 @@ +bash /testbed/mimo_test_command.sh \ No newline at end of file diff --git a/tasks/format-code-task-002624/environment/Dockerfile b/tasks/format-code-task-002624/environment/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..93293809427b94d1eaafc0dae653e664d5d37ae6 --- /dev/null +++ b/tasks/format-code-task-002624/environment/Dockerfile @@ -0,0 +1,3 @@ +# The task's image, pinned by digest (the same as [environment].docker_image). +# Setup runs at start from [environment.healthcheck]; environment/setup/ is its readable copy. +FROM docker.io/xiaomimimo/mimo-v2.6-rl-oss@sha256:30a963ba3e1577601a6650a47fa55c4c3c23360e7867b31c62a205b7f2f0bc03 diff --git a/tasks/format-code-task-002624/environment/setup/files/blocklist b/tasks/format-code-task-002624/environment/setup/files/blocklist new file mode 100644 index 0000000000000000000000000000000000000000..a8e4bdc4c7d9b739c047a3cb58ea72a1bb05bcbc --- /dev/null +++ b/tasks/format-code-task-002624/environment/setup/files/blocklist @@ -0,0 +1,33 @@ +# mimo answer-leak blocklist (mimoagent) +0.0.0.0 github.com +0.0.0.0 www.github.com +0.0.0.0 api.github.com +0.0.0.0 raw.githubusercontent.com +0.0.0.0 codeload.github.com +0.0.0.0 objects.githubusercontent.com +0.0.0.0 gist.github.com +0.0.0.0 gist.githubusercontent.com +0.0.0.0 gitlab.com +0.0.0.0 bitbucket.org +0.0.0.0 sourceforge.net +0.0.0.0 git.kernel.org +0.0.0.0 chromium.googlesource.com +0.0.0.0 android.googlesource.com +0.0.0.0 sourcegraph.com +0.0.0.0 bugs.chromium.org +0.0.0.0 issues.oss-fuzz.com +0.0.0.0 oss-fuzz.com +0.0.0.0 osv.dev +0.0.0.0 api.osv.dev +0.0.0.0 bugzilla.mozilla.org +0.0.0.0 proxy.golang.org +0.0.0.0 sum.golang.org +0.0.0.0 pkg.go.dev +0.0.0.0 google.com +0.0.0.0 www.google.com +0.0.0.0 bing.com +0.0.0.0 www.bing.com +0.0.0.0 duckduckgo.com +0.0.0.0 html.duckduckgo.com +0.0.0.0 search.brave.com +0.0.0.0 stackoverflow.com diff --git a/tasks/format-code-task-002624/environment/setup/setup.sh b/tasks/format-code-task-002624/environment/setup/setup.sh new file mode 100644 index 0000000000000000000000000000000000000000..d883db90cfcfb48f7a139861bbe9f6b5d95cad6f --- /dev/null +++ b/tasks/format-code-task-002624/environment/setup/setup.sh @@ -0,0 +1,34 @@ +#!/bin/bash +# Runs once, as root, before the agent starts: Harbor's [environment.healthcheck] unpacks this folder into +# /var/lib/mimo and runs it. Generated by mimo_harbor; see its README for how each step maps to Xiaomi's harness. +M=/var/lib/mimo +[ -f "$M/ready" ] && exit 0 +chmod 700 "$M" +fail() { echo "setup: $*" >&2; exit 1; } +# the answer-leak blocklist (mimoagent), applied to /etc/hosts by the agent right after it installs +write_blocklist() { cp "$M/files/blocklist" "$M/blocklist"; } + +# Code: mimoagent environments/datasets/opensource_code.py + base.py, as the explorer runs it (app/runner/domains.py Code). +CWD=/testbed +git config --global --add safe.directory "$CWD" +cd "$CWD" || fail "no working directory $CWD" +if ! git rev-parse --git-dir >/dev/null 2>&1; then # a bare source tree: give it a baseline commit + git init -q && git add -A && git -c user.name=mimo -c user.email=mimo@localhost commit -q -m baseline --allow-empty +fi +BASE=$(git rev-parse HEAD 2>/dev/null) +[ ${#BASE} -eq 40 ] || fail "could not resolve the base commit in $CWD" +echo "$BASE" > "$M/base" +# Images are built with history truncated at the base. If one is not, the fix could be read out of git log, +# so .git is hidden while the agent works and put back for grading. +LATER=$(git rev-list --all --not "$BASE" 2>/dev/null | head -n 5 | grep -c . || true) +rm -f /tmp/fail.log /tmp/pass.log /tmp/patch.diff /tmp/test_patch.diff /tmp/*.log 2>/dev/null; rm -rf /tmp/claude-0 /tmp/claude-* /tmp/testem-* /tmp/puppeteer_dev_chrome_profile-* 2>/dev/null; rm -f /tmp/test_files.json 2>/dev/null; rm -rf /tmp/jest_* /tmp/jest-* /tmp/build /tmp/build_env 2>/dev/null; rm -rf /tmp/pytest-of-root /tmp/pytest-* /tmp/.pytest_cache /tmp/__pycache__ 2>/dev/null; rm -rf /tmp/go-build* /tmp/standards /tmp/wordpress /tmp/zig-* /tmp/testbase /tmp/testbed 2>/dev/null; rm -f /tmp/tmp*.tmp /tmp/*.bak /tmp/expect* /tmp/butwas* 2>/dev/null; rm -rf /root/.cache/go-build 2>/dev/null; rm -rf /tests 2>/dev/null; find /logs -mindepth 1 -delete 2>/dev/null; mkdir -p /logs/agent /logs/verifier /logs/artifacts; chmod 777 /logs/agent /logs/verifier /logs/artifacts; find /var/log -type f -delete 2>/dev/null || true; rm -rf /var/lib/postgresql/*/*/log /var/lib/postgresql/*/*/pg_log 2>/dev/null || true; find /var/lib/mysql /var/lib/mongodb -type f -name '*.log' -delete 2>/dev/null || true; rm -rf /root/.npm/_logs /root/.babel.json /root/.pytest_cache 2>/dev/null || true; find / -maxdepth 4 -xdev -name task_description.md -path '*/.build_env/*' -delete 2>/dev/null || true; true +git clean -fdx --exclude=node_modules --exclude=bower_components --exclude=.husky --exclude=vendor --exclude=third_party --exclude=_deps --exclude=vcpkg_installed --exclude=.venv --exclude=venv --exclude=.gradle --exclude=target --exclude=.build --exclude=lib --exclude=.bundle --exclude=Manifest.toml --exclude=_build --exclude=.stack-work --exclude=dist-newstyle >/dev/null 2>&1 +find /root/.m2 -type f \( -name '*-SNAPSHOT.jar' -o -name '*-SNAPSHOT-sources.jar' -o -name '*-SNAPSHOT-tests.jar' -o -name '*-SNAPSHOT-test-sources.jar' \) -delete 2>/dev/null; rm -rf /root/.julia/compiled 2>/dev/null; rm -rf /root/.gradle/caches/build-cache-* /root/.gradle/daemon 2>/dev/null; rm -rf /root/.gradle/caches/*/scripts /root/.gradle/caches/jars-* 2>/dev/null; rm -rf /root/.cache/bazel 2>/dev/null; true +if [ "$LATER" -gt 0 ]; then + mv "$CWD/.git" "$M/git-hidden" + echo "history not truncated at ${BASE:0:12}: .git hidden while the agent works" +fi +write_blocklist + +touch "$M/ready" +echo "setup done" diff --git a/tasks/format-code-task-002624/tests/test.patch b/tasks/format-code-task-002624/tests/test.patch new file mode 100644 index 0000000000000000000000000000000000000000..12dec821cec0c290faae9e26dc2bc5b2cc1cf16b --- /dev/null +++ b/tasks/format-code-task-002624/tests/test.patch @@ -0,0 +1,160 @@ +diff --git a/ascii/ascii_test.go b/ascii/ascii_test.go +index bca499b..d0567d6 100644 +--- a/ascii/ascii_test.go ++++ b/ascii/ascii_test.go +@@ -3,10 +3,15 @@ package ascii + import ( + "strings" + "testing" ++ "unicode/utf8" + ) + + var testStrings = [...]string{ + "", ++ "a", ++ "ab", ++ "abc", ++ "abcd", + "hello", + "Hello World!", + "Hello\"World!", +@@ -30,6 +35,16 @@ var testStrings = [...]string{ + strings.Repeat("1234567890", 1000), + } + ++var testStringsUTF8 []string ++ ++func init() { ++ for _, test := range testStrings { ++ if utf8.ValidString(test) { ++ testStringsUTF8 = append(testStringsUTF8, test) ++ } ++ } ++} ++ + func testString(s string, f func(byte) bool) bool { + for i := range s { + if !f(s[i]) { +@@ -92,3 +107,102 @@ func limit(s string) string { + } + return s + } ++ ++func TestHasPrefixFold(t *testing.T) { ++ for _, test := range testStringsUTF8 { ++ t.Run(limit(test), func(t *testing.T) { ++ prefix := test ++ if len(prefix) > 0 { ++ prefix = prefix[:len(prefix)/2] ++ } ++ upper := strings.ToUpper(prefix) ++ lower := strings.ToLower(prefix) ++ ++ if !HasPrefixFoldString(test, prefix) { ++ t.Errorf("%q does not match %q", test, prefix) ++ } ++ ++ if !HasPrefixFoldString(test, upper) { ++ t.Errorf("%q does not match %q", test, upper) ++ } ++ ++ if !HasPrefixFoldString(test, lower) { ++ t.Errorf("%q does not match %q", test, lower) ++ } ++ }) ++ } ++} ++ ++func TestHasSuffixFold(t *testing.T) { ++ for _, test := range testStringsUTF8 { ++ t.Run(limit(test), func(t *testing.T) { ++ suffix := test ++ if len(suffix) > 0 { ++ suffix = suffix[len(suffix)/2:] ++ } ++ upper := strings.ToUpper(suffix) ++ lower := strings.ToLower(suffix) ++ ++ if !HasSuffixFoldString(test, suffix) { ++ t.Errorf("%q does not match %q", test, suffix) ++ } ++ ++ if !HasSuffixFoldString(test, upper) { ++ t.Errorf("%q does not match %q", test, upper) ++ } ++ ++ if !HasSuffixFoldString(test, lower) { ++ t.Errorf("%q does not match %q", test, lower) ++ } ++ }) ++ } ++} ++ ++func TestEqualFold(t *testing.T) { ++ ++ ++ ++ for _, test := range testStringsUTF8 { ++ t.Run(limit(test), func(t *testing.T) { ++ upper := strings.ToUpper(test) ++ lower := strings.ToLower(test) ++ ++ if !EqualFoldString(test, test) { ++ t.Errorf("%q does not match %q", test, test) ++ } ++ ++ if !EqualFoldString(test, upper) { ++ t.Errorf("%q does not match %q", test, upper) ++ } ++ ++ if !EqualFoldString(test, lower) { ++ t.Errorf("%q does not match %q", test, lower) ++ } ++ ++ if len(test) > 1 { ++ reverse := make([]byte, len(test)) ++ for i := range reverse { ++ reverse[i] = test[len(test)-(i+1)] ++ } ++ ++ if EqualFoldString(test, string(reverse)) { ++ t.Errorf("%q matches %q", test, reverse) ++ } ++ } ++ }) ++ } ++} ++ ++func BenchmarkEqualFold(b *testing.B) { ++ for _, test := range testStringsUTF8 { ++ b.Run(limit(test), func(b *testing.B) { ++ other := test + "_" ++ ++ for i := 0; i < b.N; i++ { ++ _ = EqualFoldString(test, other[:len(test)]) ++ } ++ ++ b.SetBytes(int64(len(test))) ++ }) ++ } ++} +diff --git a/mimo_build_env.tar.gz.b64 b/mimo_build_env.tar.gz.b64 +new file mode 100644 +--- /dev/null ++++ b/mimo_build_env.tar.gz.b64 +@@ -0,0 +1,4 @@ ++H4sIAAAAAAAAA+3R0QqCMBTG8V37FHuBdLOpVz2L6JQS0kHOnj8ToojKGyWi/+/mHDiDffCF5dAc ++q7zuzpFYixplSTLN0fOcdp3EKs5ivTVGKK1TpYVMVkv0YOh9cZJSnJzzn97N3X9UeO/f173PrWvb ++oqvC/rDcH7P9m/TWvzImG/s3aayEVMtFeO/P+7eVnIov6yrYO3ldZRgVvW2aSG6sGzq/08G3UwIA ++AAAAAAAAAAAAAAB45QKm2Pw4ACgAAA== +diff --git a/mimo_test_command.sh b/mimo_test_command.sh +new file mode 100755 +--- /dev/null ++++ b/mimo_test_command.sh +@@ -0,0 +1,6 @@ ++#!/usr/bin/env bash ++ ++set -uo pipefail ++cd /testbed || exit 1 ++base64 -d mimo_build_env.tar.gz.b64 | tar -xzf - -C /testbed || exit 1 ++exec bash -lc 'cd /testbed && bash -eo pipefail /testbed/.build_env/test_command.sh' diff --git a/tasks/format-code-task-002624/tests/test.sh b/tasks/format-code-task-002624/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..396b36ec6f2eae44bac77b6017d43f78b8ae9237 --- /dev/null +++ b/tasks/format-code-task-002624/tests/test.sh @@ -0,0 +1,39 @@ +#!/bin/bash +# Code grading, mimoagent opensource_code.py: reset the files the hidden test patch touches, apply it, run the +# task's test command; reward 1 when it exits 0. A testbed failure (reset or apply) writes no reward: not scored. +M=/var/lib/mimo +CWD=/testbed +V=/logs/verifier +mkdir -p "$V" +BASE=$(cat "$M/base" 2>/dev/null) || { echo "setup never ran (no $M/base)" >&2; exit 1; } +cd "$CWD" || exit 1 +if [ -d "$M/git-hidden" ]; then rm -rf "$CWD/.git"; mv "$M/git-hidden" "$CWD/.git"; fi +# the agent's change against the base, so its own commits count too +git add -A >/dev/null 2>&1 && git -c core.fileMode=false diff --cached "$BASE" > "$V/agent.diff" +git reset -q +if ! ( +while IFS= read -r tf; do + [ -z "$tf" ] && continue + if git cat-file -e $BASE:"$tf" 2>/dev/null; then + git checkout $BASE -- "$tf" 2>/dev/null || true + else + git rm -f --cached "$tf" >/dev/null 2>&1 || true + rm -f "$tf" + fi +done <<'EOF_RESET_TEST_FILES' +ascii/ascii_test.go +mimo_build_env.tar.gz.b64 +mimo_test_command.sh +EOF_RESET_TEST_FILES + +); then echo "could not reset the test files (testbed problem, not scored)" >&2; exit 1; fi +if ! git apply --verbose /tests/test.patch > "$V/apply.log" 2>&1; then + cat "$V/apply.log" >&2 + echo "the hidden tests could not be applied (testbed problem, not scored)" >&2 + exit 1 +fi +timeout 1800 sh -c "$(cat /tests/test_command.sh)" > "$V/test_output.log" 2>&1 +RC=$? +tail -c 12000 "$V/test_output.log" +if [ $RC -eq 0 ]; then echo 1 > "$V/reward.txt"; else echo 0 > "$V/reward.txt"; fi +echo "test command exited $RC" diff --git a/tasks/format-code-task-002624/tests/test_command.sh b/tasks/format-code-task-002624/tests/test_command.sh new file mode 100644 index 0000000000000000000000000000000000000000..7cb23076694ad17d72e8296d62b2b240083e36db --- /dev/null +++ b/tasks/format-code-task-002624/tests/test_command.sh @@ -0,0 +1 @@ +bash /testbed/mimo_test_command.sh \ No newline at end of file diff --git a/tasks/format-code-task-002641/environment/Dockerfile b/tasks/format-code-task-002641/environment/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..59912634a99553e0b212b995adf3971beadb856d --- /dev/null +++ b/tasks/format-code-task-002641/environment/Dockerfile @@ -0,0 +1,3 @@ +# The task's image, pinned by digest (the same as [environment].docker_image). +# Setup runs at start from [environment.healthcheck]; environment/setup/ is its readable copy. +FROM docker.io/xiaomimimo/mimo-v2.6-rl-oss@sha256:bcad4d7495000ba3f7ca8fee699284aea48c5ea6b7770e619f1403f02b449d4d diff --git a/tasks/format-code-task-002641/environment/setup/files/blocklist b/tasks/format-code-task-002641/environment/setup/files/blocklist new file mode 100644 index 0000000000000000000000000000000000000000..a8e4bdc4c7d9b739c047a3cb58ea72a1bb05bcbc --- /dev/null +++ b/tasks/format-code-task-002641/environment/setup/files/blocklist @@ -0,0 +1,33 @@ +# mimo answer-leak blocklist (mimoagent) +0.0.0.0 github.com +0.0.0.0 www.github.com +0.0.0.0 api.github.com +0.0.0.0 raw.githubusercontent.com +0.0.0.0 codeload.github.com +0.0.0.0 objects.githubusercontent.com +0.0.0.0 gist.github.com +0.0.0.0 gist.githubusercontent.com +0.0.0.0 gitlab.com +0.0.0.0 bitbucket.org +0.0.0.0 sourceforge.net +0.0.0.0 git.kernel.org +0.0.0.0 chromium.googlesource.com +0.0.0.0 android.googlesource.com +0.0.0.0 sourcegraph.com +0.0.0.0 bugs.chromium.org +0.0.0.0 issues.oss-fuzz.com +0.0.0.0 oss-fuzz.com +0.0.0.0 osv.dev +0.0.0.0 api.osv.dev +0.0.0.0 bugzilla.mozilla.org +0.0.0.0 proxy.golang.org +0.0.0.0 sum.golang.org +0.0.0.0 pkg.go.dev +0.0.0.0 google.com +0.0.0.0 www.google.com +0.0.0.0 bing.com +0.0.0.0 www.bing.com +0.0.0.0 duckduckgo.com +0.0.0.0 html.duckduckgo.com +0.0.0.0 search.brave.com +0.0.0.0 stackoverflow.com diff --git a/tasks/format-code-task-002641/environment/setup/setup.sh b/tasks/format-code-task-002641/environment/setup/setup.sh new file mode 100644 index 0000000000000000000000000000000000000000..d883db90cfcfb48f7a139861bbe9f6b5d95cad6f --- /dev/null +++ b/tasks/format-code-task-002641/environment/setup/setup.sh @@ -0,0 +1,34 @@ +#!/bin/bash +# Runs once, as root, before the agent starts: Harbor's [environment.healthcheck] unpacks this folder into +# /var/lib/mimo and runs it. Generated by mimo_harbor; see its README for how each step maps to Xiaomi's harness. +M=/var/lib/mimo +[ -f "$M/ready" ] && exit 0 +chmod 700 "$M" +fail() { echo "setup: $*" >&2; exit 1; } +# the answer-leak blocklist (mimoagent), applied to /etc/hosts by the agent right after it installs +write_blocklist() { cp "$M/files/blocklist" "$M/blocklist"; } + +# Code: mimoagent environments/datasets/opensource_code.py + base.py, as the explorer runs it (app/runner/domains.py Code). +CWD=/testbed +git config --global --add safe.directory "$CWD" +cd "$CWD" || fail "no working directory $CWD" +if ! git rev-parse --git-dir >/dev/null 2>&1; then # a bare source tree: give it a baseline commit + git init -q && git add -A && git -c user.name=mimo -c user.email=mimo@localhost commit -q -m baseline --allow-empty +fi +BASE=$(git rev-parse HEAD 2>/dev/null) +[ ${#BASE} -eq 40 ] || fail "could not resolve the base commit in $CWD" +echo "$BASE" > "$M/base" +# Images are built with history truncated at the base. If one is not, the fix could be read out of git log, +# so .git is hidden while the agent works and put back for grading. +LATER=$(git rev-list --all --not "$BASE" 2>/dev/null | head -n 5 | grep -c . || true) +rm -f /tmp/fail.log /tmp/pass.log /tmp/patch.diff /tmp/test_patch.diff /tmp/*.log 2>/dev/null; rm -rf /tmp/claude-0 /tmp/claude-* /tmp/testem-* /tmp/puppeteer_dev_chrome_profile-* 2>/dev/null; rm -f /tmp/test_files.json 2>/dev/null; rm -rf /tmp/jest_* /tmp/jest-* /tmp/build /tmp/build_env 2>/dev/null; rm -rf /tmp/pytest-of-root /tmp/pytest-* /tmp/.pytest_cache /tmp/__pycache__ 2>/dev/null; rm -rf /tmp/go-build* /tmp/standards /tmp/wordpress /tmp/zig-* /tmp/testbase /tmp/testbed 2>/dev/null; rm -f /tmp/tmp*.tmp /tmp/*.bak /tmp/expect* /tmp/butwas* 2>/dev/null; rm -rf /root/.cache/go-build 2>/dev/null; rm -rf /tests 2>/dev/null; find /logs -mindepth 1 -delete 2>/dev/null; mkdir -p /logs/agent /logs/verifier /logs/artifacts; chmod 777 /logs/agent /logs/verifier /logs/artifacts; find /var/log -type f -delete 2>/dev/null || true; rm -rf /var/lib/postgresql/*/*/log /var/lib/postgresql/*/*/pg_log 2>/dev/null || true; find /var/lib/mysql /var/lib/mongodb -type f -name '*.log' -delete 2>/dev/null || true; rm -rf /root/.npm/_logs /root/.babel.json /root/.pytest_cache 2>/dev/null || true; find / -maxdepth 4 -xdev -name task_description.md -path '*/.build_env/*' -delete 2>/dev/null || true; true +git clean -fdx --exclude=node_modules --exclude=bower_components --exclude=.husky --exclude=vendor --exclude=third_party --exclude=_deps --exclude=vcpkg_installed --exclude=.venv --exclude=venv --exclude=.gradle --exclude=target --exclude=.build --exclude=lib --exclude=.bundle --exclude=Manifest.toml --exclude=_build --exclude=.stack-work --exclude=dist-newstyle >/dev/null 2>&1 +find /root/.m2 -type f \( -name '*-SNAPSHOT.jar' -o -name '*-SNAPSHOT-sources.jar' -o -name '*-SNAPSHOT-tests.jar' -o -name '*-SNAPSHOT-test-sources.jar' \) -delete 2>/dev/null; rm -rf /root/.julia/compiled 2>/dev/null; rm -rf /root/.gradle/caches/build-cache-* /root/.gradle/daemon 2>/dev/null; rm -rf /root/.gradle/caches/*/scripts /root/.gradle/caches/jars-* 2>/dev/null; rm -rf /root/.cache/bazel 2>/dev/null; true +if [ "$LATER" -gt 0 ]; then + mv "$CWD/.git" "$M/git-hidden" + echo "history not truncated at ${BASE:0:12}: .git hidden while the agent works" +fi +write_blocklist + +touch "$M/ready" +echo "setup done" diff --git a/tasks/format-code-task-002641/tests/test.patch b/tasks/format-code-task-002641/tests/test.patch new file mode 100644 index 0000000000000000000000000000000000000000..ce2587d3e402d221cfb18c76da5746216ea07b58 --- /dev/null +++ b/tasks/format-code-task-002641/tests/test.patch @@ -0,0 +1,104 @@ +diff --git a/sgkit/tests/test_display.py b/sgkit/tests/test_display.py +index 3d6a7fae..8ea9798a 100644 +--- a/sgkit/tests/test_display.py ++++ b/sgkit/tests/test_display.py +@@ -1,3 +1,4 @@ ++import numpy as np + import pytest + + from sgkit import display_genotypes +@@ -204,6 +205,72 @@ variants ... + ) + + ++def test_display_genotypes__duplicate_variant_position(): ++ ++ ++ ds = simulate_genotype_call_dataset(n_variant=4, n_sample=3, n_contig=2, seed=0) ++ assert "variant_id" not in ds ++ ++ assert len(set(ds.variant_position.values.tolist())) < ds.sizes["variants"] ++ disp = display_genotypes(ds) ++ lines = [line.rstrip() for line in str(disp).split("\n")] ++ assert lines == [ ++ "samples S0 S1 S2", ++ "variants", ++ "0 0/0 1/0 1/0", ++ "1 0/1 1/0 0/1", ++ "2 0/0 1/0 1/1", ++ "3 0/0 1/0 0/1", ++ ] ++ ++ ++def test_display_genotypes__duplicate_variant_id(): ++ ++ ++ ds = simulate_genotype_call_dataset(n_variant=3, n_sample=3, seed=0) ++ ds = ds.assign(variant_id=("variants", np.array(["v0", "v0", "v0"]))) ++ disp = display_genotypes(ds) ++ lines = [line.rstrip() for line in str(disp).split("\n")] ++ assert lines == [ ++ "samples S0 S1 S2", ++ "variants", ++ "0 0/0 1/0 1/0", ++ "1 0/1 1/0 0/1", ++ "2 0/0 1/0 1/1", ++ ] ++ ++ ++def test_display_genotypes__unique_variant_id_used_as_index(): ++ ++ ds = simulate_genotype_call_dataset(n_variant=3, n_sample=3, seed=0) ++ ds = ds.assign(variant_id=("variants", np.array(["v0", "v1", "v2"]))) ++ disp = display_genotypes(ds) ++ lines = [line.rstrip() for line in str(disp).split("\n")] ++ assert lines == [ ++ "samples S0 S1 S2", ++ "variants", ++ "v0 0/0 1/0 1/0", ++ "v1 0/1 1/0 0/1", ++ "v2 0/0 1/0 1/1", ++ ] ++ ++ ++def test_display_genotypes__duplicate_sample_id(): ++ ++ ++ ds = simulate_genotype_call_dataset(n_variant=3, n_sample=3, seed=0) ++ ds = ds.assign(sample_id=("samples", np.array(["S0", "S0", "S0"]))) ++ disp = display_genotypes(ds) ++ lines = [line.rstrip() for line in str(disp).split("\n")] ++ assert lines == [ ++ "samples 0 1 2", ++ "variants", ++ "0 0/0 1/0 1/0", ++ "1 0/1 1/0 0/1", ++ "2 0/0 1/0 1/1", ++ ] ++ ++ + def test_truncate_fails_with_only_one_dimension(): + ds = simulate_genotype_call_dataset(n_variant=10, n_sample=10, seed=0) + with pytest.raises( +diff --git a/test_commands.json b/test_commands.json +new file mode 100644 +index 00000000..4d5a41ea +--- /dev/null ++++ b/test_commands.json +@@ -0,0 +1,3 @@ ++{ ++ "test_commands": ["python -m pytest sgkit/tests/test_display.py -v -W ignore::UserWarning"] ++} +diff --git a/mimo_test_command.sh b/mimo_test_command.sh +new file mode 100755 +--- /dev/null ++++ b/mimo_test_command.sh +@@ -0,0 +1,8 @@ ++#!/usr/bin/env bash ++ ++set -uo pipefail ++cd /testbed ++rc=0 ++python -m pytest -v -W ignore::UserWarning -rA sgkit/tests/test_display.py::test_display_genotypes__duplicate_variant_position sgkit/tests/test_display.py::test_display_genotypes__duplicate_variant_id sgkit/tests/test_display.py::test_display_genotypes__unique_variant_id_used_as_index sgkit/tests/test_display.py::test_display_genotypes__duplicate_sample_id ++rc=$(( rc | $? )) ++exit $rc diff --git a/tasks/format-code-task-002641/tests/test.sh b/tasks/format-code-task-002641/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..48cb41cc8b69285f9f74c29d28f05cfdd82e0e26 --- /dev/null +++ b/tasks/format-code-task-002641/tests/test.sh @@ -0,0 +1,39 @@ +#!/bin/bash +# Code grading, mimoagent opensource_code.py: reset the files the hidden test patch touches, apply it, run the +# task's test command; reward 1 when it exits 0. A testbed failure (reset or apply) writes no reward: not scored. +M=/var/lib/mimo +CWD=/testbed +V=/logs/verifier +mkdir -p "$V" +BASE=$(cat "$M/base" 2>/dev/null) || { echo "setup never ran (no $M/base)" >&2; exit 1; } +cd "$CWD" || exit 1 +if [ -d "$M/git-hidden" ]; then rm -rf "$CWD/.git"; mv "$M/git-hidden" "$CWD/.git"; fi +# the agent's change against the base, so its own commits count too +git add -A >/dev/null 2>&1 && git -c core.fileMode=false diff --cached "$BASE" > "$V/agent.diff" +git reset -q +if ! ( +while IFS= read -r tf; do + [ -z "$tf" ] && continue + if git cat-file -e $BASE:"$tf" 2>/dev/null; then + git checkout $BASE -- "$tf" 2>/dev/null || true + else + git rm -f --cached "$tf" >/dev/null 2>&1 || true + rm -f "$tf" + fi +done <<'EOF_RESET_TEST_FILES' +sgkit/tests/test_display.py +test_commands.json +mimo_test_command.sh +EOF_RESET_TEST_FILES + +); then echo "could not reset the test files (testbed problem, not scored)" >&2; exit 1; fi +if ! git apply --verbose /tests/test.patch > "$V/apply.log" 2>&1; then + cat "$V/apply.log" >&2 + echo "the hidden tests could not be applied (testbed problem, not scored)" >&2 + exit 1 +fi +timeout 1800 sh -c "$(cat /tests/test_command.sh)" > "$V/test_output.log" 2>&1 +RC=$? +tail -c 12000 "$V/test_output.log" +if [ $RC -eq 0 ]; then echo 1 > "$V/reward.txt"; else echo 0 > "$V/reward.txt"; fi +echo "test command exited $RC" diff --git a/tasks/format-code-task-002641/tests/test_command.sh b/tasks/format-code-task-002641/tests/test_command.sh new file mode 100644 index 0000000000000000000000000000000000000000..7cb23076694ad17d72e8296d62b2b240083e36db --- /dev/null +++ b/tasks/format-code-task-002641/tests/test_command.sh @@ -0,0 +1 @@ +bash /testbed/mimo_test_command.sh \ No newline at end of file diff --git a/tasks/format-code-task-002646/environment/Dockerfile b/tasks/format-code-task-002646/environment/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..ba0b507bc1b135166d4d148bd10711fe4176f4cc --- /dev/null +++ b/tasks/format-code-task-002646/environment/Dockerfile @@ -0,0 +1,3 @@ +# The task's image, pinned by digest (the same as [environment].docker_image). +# Setup runs at start from [environment.healthcheck]; environment/setup/ is its readable copy. +FROM docker.io/xiaomimimo/mimo-v2.6-rl-oss@sha256:3840f57b086819e29732668c515bed24e06dd64fba4adc589765ecf63d39f026 diff --git a/tasks/format-code-task-002646/environment/setup/files/blocklist b/tasks/format-code-task-002646/environment/setup/files/blocklist new file mode 100644 index 0000000000000000000000000000000000000000..a8e4bdc4c7d9b739c047a3cb58ea72a1bb05bcbc --- /dev/null +++ b/tasks/format-code-task-002646/environment/setup/files/blocklist @@ -0,0 +1,33 @@ +# mimo answer-leak blocklist (mimoagent) +0.0.0.0 github.com +0.0.0.0 www.github.com +0.0.0.0 api.github.com +0.0.0.0 raw.githubusercontent.com +0.0.0.0 codeload.github.com +0.0.0.0 objects.githubusercontent.com +0.0.0.0 gist.github.com +0.0.0.0 gist.githubusercontent.com +0.0.0.0 gitlab.com +0.0.0.0 bitbucket.org +0.0.0.0 sourceforge.net +0.0.0.0 git.kernel.org +0.0.0.0 chromium.googlesource.com +0.0.0.0 android.googlesource.com +0.0.0.0 sourcegraph.com +0.0.0.0 bugs.chromium.org +0.0.0.0 issues.oss-fuzz.com +0.0.0.0 oss-fuzz.com +0.0.0.0 osv.dev +0.0.0.0 api.osv.dev +0.0.0.0 bugzilla.mozilla.org +0.0.0.0 proxy.golang.org +0.0.0.0 sum.golang.org +0.0.0.0 pkg.go.dev +0.0.0.0 google.com +0.0.0.0 www.google.com +0.0.0.0 bing.com +0.0.0.0 www.bing.com +0.0.0.0 duckduckgo.com +0.0.0.0 html.duckduckgo.com +0.0.0.0 search.brave.com +0.0.0.0 stackoverflow.com diff --git a/tasks/format-code-task-002646/environment/setup/setup.sh b/tasks/format-code-task-002646/environment/setup/setup.sh new file mode 100644 index 0000000000000000000000000000000000000000..d883db90cfcfb48f7a139861bbe9f6b5d95cad6f --- /dev/null +++ b/tasks/format-code-task-002646/environment/setup/setup.sh @@ -0,0 +1,34 @@ +#!/bin/bash +# Runs once, as root, before the agent starts: Harbor's [environment.healthcheck] unpacks this folder into +# /var/lib/mimo and runs it. Generated by mimo_harbor; see its README for how each step maps to Xiaomi's harness. +M=/var/lib/mimo +[ -f "$M/ready" ] && exit 0 +chmod 700 "$M" +fail() { echo "setup: $*" >&2; exit 1; } +# the answer-leak blocklist (mimoagent), applied to /etc/hosts by the agent right after it installs +write_blocklist() { cp "$M/files/blocklist" "$M/blocklist"; } + +# Code: mimoagent environments/datasets/opensource_code.py + base.py, as the explorer runs it (app/runner/domains.py Code). +CWD=/testbed +git config --global --add safe.directory "$CWD" +cd "$CWD" || fail "no working directory $CWD" +if ! git rev-parse --git-dir >/dev/null 2>&1; then # a bare source tree: give it a baseline commit + git init -q && git add -A && git -c user.name=mimo -c user.email=mimo@localhost commit -q -m baseline --allow-empty +fi +BASE=$(git rev-parse HEAD 2>/dev/null) +[ ${#BASE} -eq 40 ] || fail "could not resolve the base commit in $CWD" +echo "$BASE" > "$M/base" +# Images are built with history truncated at the base. If one is not, the fix could be read out of git log, +# so .git is hidden while the agent works and put back for grading. +LATER=$(git rev-list --all --not "$BASE" 2>/dev/null | head -n 5 | grep -c . || true) +rm -f /tmp/fail.log /tmp/pass.log /tmp/patch.diff /tmp/test_patch.diff /tmp/*.log 2>/dev/null; rm -rf /tmp/claude-0 /tmp/claude-* /tmp/testem-* /tmp/puppeteer_dev_chrome_profile-* 2>/dev/null; rm -f /tmp/test_files.json 2>/dev/null; rm -rf /tmp/jest_* /tmp/jest-* /tmp/build /tmp/build_env 2>/dev/null; rm -rf /tmp/pytest-of-root /tmp/pytest-* /tmp/.pytest_cache /tmp/__pycache__ 2>/dev/null; rm -rf /tmp/go-build* /tmp/standards /tmp/wordpress /tmp/zig-* /tmp/testbase /tmp/testbed 2>/dev/null; rm -f /tmp/tmp*.tmp /tmp/*.bak /tmp/expect* /tmp/butwas* 2>/dev/null; rm -rf /root/.cache/go-build 2>/dev/null; rm -rf /tests 2>/dev/null; find /logs -mindepth 1 -delete 2>/dev/null; mkdir -p /logs/agent /logs/verifier /logs/artifacts; chmod 777 /logs/agent /logs/verifier /logs/artifacts; find /var/log -type f -delete 2>/dev/null || true; rm -rf /var/lib/postgresql/*/*/log /var/lib/postgresql/*/*/pg_log 2>/dev/null || true; find /var/lib/mysql /var/lib/mongodb -type f -name '*.log' -delete 2>/dev/null || true; rm -rf /root/.npm/_logs /root/.babel.json /root/.pytest_cache 2>/dev/null || true; find / -maxdepth 4 -xdev -name task_description.md -path '*/.build_env/*' -delete 2>/dev/null || true; true +git clean -fdx --exclude=node_modules --exclude=bower_components --exclude=.husky --exclude=vendor --exclude=third_party --exclude=_deps --exclude=vcpkg_installed --exclude=.venv --exclude=venv --exclude=.gradle --exclude=target --exclude=.build --exclude=lib --exclude=.bundle --exclude=Manifest.toml --exclude=_build --exclude=.stack-work --exclude=dist-newstyle >/dev/null 2>&1 +find /root/.m2 -type f \( -name '*-SNAPSHOT.jar' -o -name '*-SNAPSHOT-sources.jar' -o -name '*-SNAPSHOT-tests.jar' -o -name '*-SNAPSHOT-test-sources.jar' \) -delete 2>/dev/null; rm -rf /root/.julia/compiled 2>/dev/null; rm -rf /root/.gradle/caches/build-cache-* /root/.gradle/daemon 2>/dev/null; rm -rf /root/.gradle/caches/*/scripts /root/.gradle/caches/jars-* 2>/dev/null; rm -rf /root/.cache/bazel 2>/dev/null; true +if [ "$LATER" -gt 0 ]; then + mv "$CWD/.git" "$M/git-hidden" + echo "history not truncated at ${BASE:0:12}: .git hidden while the agent works" +fi +write_blocklist + +touch "$M/ready" +echo "setup done" diff --git a/tasks/format-code-task-002646/tests/test.patch b/tasks/format-code-task-002646/tests/test.patch new file mode 100644 index 0000000000000000000000000000000000000000..d0f8e923cf99df2200a776ed27733676642e5b80 --- /dev/null +++ b/tasks/format-code-task-002646/tests/test.patch @@ -0,0 +1,55 @@ +diff --git a/tests/unit/Core/Framework/Plugin/PluginLifecycleServiceTest.php b/tests/unit/Core/Framework/Plugin/PluginLifecycleServiceTest.php +index 94954b32f88..d509a8d2142 100644 +--- a/tests/unit/Core/Framework/Plugin/PluginLifecycleServiceTest.php ++++ b/tests/unit/Core/Framework/Plugin/PluginLifecycleServiceTest.php +@@ -386,12 +386,28 @@ public function testUpdatePluginWithComposerCommandExecutionDisabledAfterUpdate( + $plugin->setUpgradeVersion('1.0.1'); + $plugin->setManagedByComposer(true); + $plugin->setComposerName('swag/mock-plugin'); ++ $plugin->setPath('custom/plugins/mock-plugin'); + + $this->commandExecutor->expects($this->once())->method('remove'); + + $this->pluginLifecycleService->updatePlugin($plugin, Context::createDefaultContext()); + } + ++ public function testUpdatePluginWithComposerCommandExecutionDisabledAfterUpdateButInstalledViaComposerDirectly(): void ++ { ++ $plugin = $this->getPluginEntityMock(); ++ $plugin->setInstalledAt(new \DateTime()); ++ $plugin->setActive(true); ++ $plugin->setUpgradeVersion('1.0.1'); ++ $plugin->setManagedByComposer(true); ++ $plugin->setComposerName('swag/mock-plugin'); ++ $plugin->setPath('vendor/shopware/mock-plugin'); ++ ++ $this->commandExecutor->expects($this->never())->method('remove'); ++ ++ $this->pluginLifecycleService->updatePlugin($plugin, Context::createDefaultContext()); ++ } ++ + public function testActivatePlugin(): void + { + $pluginEntityMock = $this->getPluginEntityMock(); +diff --git a/mimo_build_env.tar.gz.b64 b/mimo_build_env.tar.gz.b64 +new file mode 100644 +--- /dev/null ++++ b/mimo_build_env.tar.gz.b64 +@@ -0,0 +1,6 @@ ++H4sIAAAAAAAAA+3SvU7DMBAH8Mx5CiPmxLGpywMgMTEgwV45sdtaTezKH0G8PU4qUYQEXVoB4v9b ++LnHuLpbPdZtMr1bajrS4lCa7FWKO2ec4PzPBGc9ZC5HXGVs2vCDiYjv6IIUoPSGFdy5+l3fq+x9V ++H+cfdYirzg2DtKoO2/P949T8ueDH+TOe579YspuCNOfbwtf++fyvr2gKnrbG0nwHSCvDtuwUmS9D ++q1W53+7JqK1yh5z8mqyJpKqsqzpn12aTvIzG2bzU5iMK0cv3Cpmi651U9dRl6hjoVE3vnNf03stB ++vzi/o4992uTeh/Bg1rp77Xr9pP1oOv2cy6b68qdPCgAAAAAAAAAAAAAAAAAAAADg93kDwwCjCAAo ++AAA= +diff --git a/mimo_test_command.sh b/mimo_test_command.sh +new file mode 100755 +--- /dev/null ++++ b/mimo_test_command.sh +@@ -0,0 +1,6 @@ ++#!/usr/bin/env bash ++ ++set -uo pipefail ++cd /testbed || exit 1 ++base64 -d mimo_build_env.tar.gz.b64 | tar -xzf - -C /testbed || exit 1 ++exec bash -lc 'cd /testbed && bash -eo pipefail /testbed/.build_env/test_command.sh' diff --git a/tasks/format-code-task-002646/tests/test.sh b/tasks/format-code-task-002646/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..aebfc0585baf61fb1b0c0790d0b37bc28f9ed4c5 --- /dev/null +++ b/tasks/format-code-task-002646/tests/test.sh @@ -0,0 +1,39 @@ +#!/bin/bash +# Code grading, mimoagent opensource_code.py: reset the files the hidden test patch touches, apply it, run the +# task's test command; reward 1 when it exits 0. A testbed failure (reset or apply) writes no reward: not scored. +M=/var/lib/mimo +CWD=/testbed +V=/logs/verifier +mkdir -p "$V" +BASE=$(cat "$M/base" 2>/dev/null) || { echo "setup never ran (no $M/base)" >&2; exit 1; } +cd "$CWD" || exit 1 +if [ -d "$M/git-hidden" ]; then rm -rf "$CWD/.git"; mv "$M/git-hidden" "$CWD/.git"; fi +# the agent's change against the base, so its own commits count too +git add -A >/dev/null 2>&1 && git -c core.fileMode=false diff --cached "$BASE" > "$V/agent.diff" +git reset -q +if ! ( +while IFS= read -r tf; do + [ -z "$tf" ] && continue + if git cat-file -e $BASE:"$tf" 2>/dev/null; then + git checkout $BASE -- "$tf" 2>/dev/null || true + else + git rm -f --cached "$tf" >/dev/null 2>&1 || true + rm -f "$tf" + fi +done <<'EOF_RESET_TEST_FILES' +tests/unit/Core/Framework/Plugin/PluginLifecycleServiceTest.php +mimo_build_env.tar.gz.b64 +mimo_test_command.sh +EOF_RESET_TEST_FILES + +); then echo "could not reset the test files (testbed problem, not scored)" >&2; exit 1; fi +if ! git apply --verbose /tests/test.patch > "$V/apply.log" 2>&1; then + cat "$V/apply.log" >&2 + echo "the hidden tests could not be applied (testbed problem, not scored)" >&2 + exit 1 +fi +timeout 1800 sh -c "$(cat /tests/test_command.sh)" > "$V/test_output.log" 2>&1 +RC=$? +tail -c 12000 "$V/test_output.log" +if [ $RC -eq 0 ]; then echo 1 > "$V/reward.txt"; else echo 0 > "$V/reward.txt"; fi +echo "test command exited $RC" diff --git a/tasks/format-code-task-002646/tests/test_command.sh b/tasks/format-code-task-002646/tests/test_command.sh new file mode 100644 index 0000000000000000000000000000000000000000..7cb23076694ad17d72e8296d62b2b240083e36db --- /dev/null +++ b/tasks/format-code-task-002646/tests/test_command.sh @@ -0,0 +1 @@ +bash /testbed/mimo_test_command.sh \ No newline at end of file diff --git a/tasks/format-code-task-002648/environment/Dockerfile b/tasks/format-code-task-002648/environment/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..bfa1bcd166fd5d1343b0764cfa55a394d259376f --- /dev/null +++ b/tasks/format-code-task-002648/environment/Dockerfile @@ -0,0 +1,3 @@ +# The task's image, pinned by digest (the same as [environment].docker_image). +# Setup runs at start from [environment.healthcheck]; environment/setup/ is its readable copy. +FROM docker.io/xiaomimimo/mimo-v2.6-rl-oss@sha256:bf88efb0ead8343d8aa8316d2f97a12246a2d9ad47ccca6dad6cce52a5f1843e diff --git a/tasks/format-code-task-002648/environment/setup/files/blocklist b/tasks/format-code-task-002648/environment/setup/files/blocklist new file mode 100644 index 0000000000000000000000000000000000000000..a8e4bdc4c7d9b739c047a3cb58ea72a1bb05bcbc --- /dev/null +++ b/tasks/format-code-task-002648/environment/setup/files/blocklist @@ -0,0 +1,33 @@ +# mimo answer-leak blocklist (mimoagent) +0.0.0.0 github.com +0.0.0.0 www.github.com +0.0.0.0 api.github.com +0.0.0.0 raw.githubusercontent.com +0.0.0.0 codeload.github.com +0.0.0.0 objects.githubusercontent.com +0.0.0.0 gist.github.com +0.0.0.0 gist.githubusercontent.com +0.0.0.0 gitlab.com +0.0.0.0 bitbucket.org +0.0.0.0 sourceforge.net +0.0.0.0 git.kernel.org +0.0.0.0 chromium.googlesource.com +0.0.0.0 android.googlesource.com +0.0.0.0 sourcegraph.com +0.0.0.0 bugs.chromium.org +0.0.0.0 issues.oss-fuzz.com +0.0.0.0 oss-fuzz.com +0.0.0.0 osv.dev +0.0.0.0 api.osv.dev +0.0.0.0 bugzilla.mozilla.org +0.0.0.0 proxy.golang.org +0.0.0.0 sum.golang.org +0.0.0.0 pkg.go.dev +0.0.0.0 google.com +0.0.0.0 www.google.com +0.0.0.0 bing.com +0.0.0.0 www.bing.com +0.0.0.0 duckduckgo.com +0.0.0.0 html.duckduckgo.com +0.0.0.0 search.brave.com +0.0.0.0 stackoverflow.com diff --git a/tasks/format-code-task-002648/environment/setup/setup.sh b/tasks/format-code-task-002648/environment/setup/setup.sh new file mode 100644 index 0000000000000000000000000000000000000000..e9eb7daf39f9542bd095367feee457f3da77e492 --- /dev/null +++ b/tasks/format-code-task-002648/environment/setup/setup.sh @@ -0,0 +1,34 @@ +#!/bin/bash +# Runs once, as root, before the agent starts: Harbor's [environment.healthcheck] unpacks this folder into +# /var/lib/mimo and runs it. Generated by mimo_harbor; see its README for how each step maps to Xiaomi's harness. +M=/var/lib/mimo +[ -f "$M/ready" ] && exit 0 +chmod 700 "$M" +fail() { echo "setup: $*" >&2; exit 1; } +# the answer-leak blocklist (mimoagent), applied to /etc/hosts by the agent right after it installs +write_blocklist() { cp "$M/files/blocklist" "$M/blocklist"; } + +# Code: mimoagent environments/datasets/opensource_code.py + base.py, as the explorer runs it (app/runner/domains.py Code). +CWD=/workspace/repo +git config --global --add safe.directory "$CWD" +cd "$CWD" || fail "no working directory $CWD" +if ! git rev-parse --git-dir >/dev/null 2>&1; then # a bare source tree: give it a baseline commit + git init -q && git add -A && git -c user.name=mimo -c user.email=mimo@localhost commit -q -m baseline --allow-empty +fi +BASE=$(git rev-parse HEAD 2>/dev/null) +[ ${#BASE} -eq 40 ] || fail "could not resolve the base commit in $CWD" +echo "$BASE" > "$M/base" +# Images are built with history truncated at the base. If one is not, the fix could be read out of git log, +# so .git is hidden while the agent works and put back for grading. +LATER=$(git rev-list --all --not "$BASE" 2>/dev/null | head -n 5 | grep -c . || true) +rm -f /tmp/fail.log /tmp/pass.log /tmp/patch.diff /tmp/test_patch.diff /tmp/*.log 2>/dev/null; rm -rf /tmp/claude-0 /tmp/claude-* /tmp/testem-* /tmp/puppeteer_dev_chrome_profile-* 2>/dev/null; rm -f /tmp/test_files.json 2>/dev/null; rm -rf /tmp/jest_* /tmp/jest-* /tmp/build /tmp/build_env 2>/dev/null; rm -rf /tmp/pytest-of-root /tmp/pytest-* /tmp/.pytest_cache /tmp/__pycache__ 2>/dev/null; rm -rf /tmp/go-build* /tmp/standards /tmp/wordpress /tmp/zig-* /tmp/testbase /tmp/testbed 2>/dev/null; rm -f /tmp/tmp*.tmp /tmp/*.bak /tmp/expect* /tmp/butwas* 2>/dev/null; rm -rf /root/.cache/go-build 2>/dev/null; rm -rf /tests 2>/dev/null; find /logs -mindepth 1 -delete 2>/dev/null; mkdir -p /logs/agent /logs/verifier /logs/artifacts; chmod 777 /logs/agent /logs/verifier /logs/artifacts; find /var/log -type f -delete 2>/dev/null || true; rm -rf /var/lib/postgresql/*/*/log /var/lib/postgresql/*/*/pg_log 2>/dev/null || true; find /var/lib/mysql /var/lib/mongodb -type f -name '*.log' -delete 2>/dev/null || true; rm -rf /root/.npm/_logs /root/.babel.json /root/.pytest_cache 2>/dev/null || true; find / -maxdepth 4 -xdev -name task_description.md -path '*/.build_env/*' -delete 2>/dev/null || true; true +git clean -fdx --exclude=node_modules --exclude=bower_components --exclude=.husky --exclude=vendor --exclude=third_party --exclude=_deps --exclude=vcpkg_installed --exclude=.venv --exclude=venv --exclude=.gradle --exclude=target --exclude=.build --exclude=lib --exclude=.bundle --exclude=Manifest.toml --exclude=_build --exclude=.stack-work --exclude=dist-newstyle >/dev/null 2>&1 +find /root/.m2 -type f \( -name '*-SNAPSHOT.jar' -o -name '*-SNAPSHOT-sources.jar' -o -name '*-SNAPSHOT-tests.jar' -o -name '*-SNAPSHOT-test-sources.jar' \) -delete 2>/dev/null; rm -rf /root/.julia/compiled 2>/dev/null; rm -rf /root/.gradle/caches/build-cache-* /root/.gradle/daemon 2>/dev/null; rm -rf /root/.gradle/caches/*/scripts /root/.gradle/caches/jars-* 2>/dev/null; rm -rf /root/.cache/bazel 2>/dev/null; true +if [ "$LATER" -gt 0 ]; then + mv "$CWD/.git" "$M/git-hidden" + echo "history not truncated at ${BASE:0:12}: .git hidden while the agent works" +fi +write_blocklist + +touch "$M/ready" +echo "setup done" diff --git a/tasks/format-code-task-002648/tests/test.patch b/tasks/format-code-task-002648/tests/test.patch new file mode 100644 index 0000000000000000000000000000000000000000..10feb604a546c285b7d2349794c7dcf9ac9f7218 --- /dev/null +++ b/tasks/format-code-task-002648/tests/test.patch @@ -0,0 +1,244 @@ +diff --git a/usercase-test-coderl/test_loader_load.py b/usercase-test-coderl/test_loader_load.py +new file mode 100644 +--- /dev/null ++++ b/usercase-test-coderl/test_loader_load.py +@@ -0,0 +1,218 @@ ++import io ++import sys ++ ++import pytest ++import yaml ++ ++from maestro import exceptions, loader ++ ++ ++def _write(path, text): ++ path.write_text(text, encoding="utf-8") ++ return str(path) ++ ++ ++def test_file_path_renders_env_and_adds_maestro_base_dir(tmp_path, monkeypatch): ++ ++ ++ ++ env_dir = tmp_path / "envs" ++ env_dir.mkdir() ++ filename = _write(env_dir / "demo.yaml", "name: demo\nfoo: {{ env.BAR }}\n") ++ monkeypatch.setenv("BAR", "bar") ++ ++ actual = loader.load(filename) ++ ++ assert actual == { ++ "name": "demo", ++ "foo": "bar", ++ "__maestro": {"base_dir": str(env_dir)}, ++ } ++ ++ ++def test_existing_maestro_keys_are_preserved_and_base_dir_is_set(tmp_path): ++ ++ ++ ++ env_dir = tmp_path / "envs" ++ env_dir.mkdir() ++ filename = _write( ++ env_dir / "existing.yaml", ++ "__maestro:\n owner: ops\nname: demo2\nnested:\n flag: true\n", ++ ) ++ ++ actual = loader.load(filename) ++ ++ assert actual == { ++ "__maestro": {"owner": "ops", "base_dir": str(env_dir)}, ++ "name": "demo2", ++ "nested": {"flag": True}, ++ } ++ ++ ++def test_custom_filters_and_functions_are_available_during_rendering(tmp_path, monkeypatch): ++ ++ ++ ++ env_dir = tmp_path / "envs" ++ env_dir.mkdir() ++ filename = _write( ++ env_dir / "filter_global.yaml", ++ 'name: {{ service_name("api")|shout }}\ncount: {{ "one"|length }}\ncolor: {{ env.COLOR }}\n', ++ ) ++ monkeypatch.setenv("COLOR", "blue") ++ ++ actual = loader.load( ++ filename, ++ filters={"shout": lambda value: value.upper() + "!"}, ++ functions={"service_name": lambda name: "svc-" + name}, ++ ) ++ ++ assert actual == { ++ "name": "SVC-API!", ++ "count": 3, ++ "color": "blue", ++ "__maestro": {"base_dir": str(env_dir)}, ++ } ++ ++ ++def test_templates_are_resolved_relative_to_file_directory(tmp_path, monkeypatch): ++ ++ ++ ++ env_dir = tmp_path / "envs" ++ env_dir.mkdir() ++ _write(env_dir / "fragment.yaml", "{{ env.BAR }}-fragment\n") ++ filename = _write( ++ env_dir / "include.yaml", ++ 'name: include-demo\nchild: {% include "fragment.yaml" %}\n', ++ ) ++ monkeypatch.setenv("BAR", "bar") ++ ++ actual = loader.load(filename) ++ ++ assert actual == { ++ "name": "include-demo", ++ "child": "bar-fragment", ++ "__maestro": {"base_dir": str(env_dir)}, ++ } ++ ++ ++def test_stdin_template_uses_current_working_directory_as_base_dir(tmp_path, monkeypatch): ++ ++ ++ ++ monkeypatch.chdir(tmp_path) ++ monkeypatch.setenv("STDIN_VALUE", "from-stdin") ++ monkeypatch.setattr( ++ sys, ++ "stdin", ++ io.StringIO( ++ "name: stdin-demo\nfoo: {{ env.STDIN_VALUE }}\n__maestro:\n channel: pipe\n" ++ ), ++ ) ++ ++ actual = loader.load("-") ++ ++ assert actual == { ++ "name": "stdin-demo", ++ "foo": "from-stdin", ++ "__maestro": {"channel": "pipe", "base_dir": str(tmp_path)}, ++ } ++ ++ ++def test_duplicate_yaml_mapping_keys_raise_constructor_error(tmp_path): ++ ++ ++ ++ filename = _write(tmp_path / "duplicate.yaml", "name: first\nname: second\n") ++ ++ with pytest.raises(yaml.constructor.ConstructorError) as excinfo: ++ loader.load(filename) ++ ++ ++ assert isinstance(excinfo.value, yaml.constructor.ConstructorError) ++ ++ ++def test_missing_named_template_file_raises_maestro_exception(tmp_path): ++ ++ ++ ++ filename = str(tmp_path / "missing.yaml") ++ ++ with pytest.raises(exceptions.MaestroException) as excinfo: ++ loader.load(filename) ++ ++ ++ assert "not found" in str(excinfo.value).lower() ++ ++ ++def test_template_read_failures_are_wrapped_as_maestro_exception(tmp_path): ++ ++ ++ ++ filename = _write(tmp_path / "syntax.yaml", "name: {% if true %}\n") ++ ++ with pytest.raises(exceptions.MaestroException) as excinfo: ++ loader.load(filename) ++ ++ ++ message = str(excinfo.value).lower() ++ assert message ++ assert "error" in message or "fail" in message or "read" in message ++ ++ ++def test_referential_transparency_same_input_returns_same_value(tmp_path, monkeypatch): ++ env_dir = tmp_path / "envs" ++ env_dir.mkdir() ++ filename = _write(env_dir / "same.yaml", "name: repeat\nfoo: {{ env.BAR }}\n") ++ monkeypatch.setenv("BAR", "bar") ++ ++ assert loader.load(filename) == loader.load(filename) ++ ++ ++def test_load_does_not_mutate_caller_supplied_filter_or_function_mappings(tmp_path): ++ env_dir = tmp_path / "envs" ++ env_dir.mkdir() ++ filename = _write( ++ env_dir / "custom.yaml", ++ 'name: {{ service_name("api")|shout }}\n', ++ ) ++ inputs = { ++ "filters": {"shout": lambda value: value.upper() + "!"}, ++ "functions": {"service_name": lambda name: "svc-" + name}, ++ } ++ ++ actual = loader.load(filename, filters=inputs["filters"], functions=inputs["functions"]) ++ ++ ++ assert actual == { ++ "name": "SVC-API!", ++ "__maestro": {"base_dir": str(env_dir)}, ++ } ++ ++ ++def test_load_has_no_same_key_process_global_cache(tmp_path, monkeypatch): ++ env_dir = tmp_path / "envs" ++ env_dir.mkdir() ++ filename = _write(env_dir / "fresh.yaml", "name: fresh\nfoo: {{ env.BAR }}\n") ++ monkeypatch.setenv("BAR", "first") ++ first = loader.load(filename) ++ monkeypatch.setenv("BAR", "second") ++ second = loader.load(filename) ++ ++ ++ assert first["foo"] == "first" ++ assert second["foo"] == "second" ++ assert first["__maestro"]["base_dir"] == str(env_dir) ++ assert second["__maestro"]["base_dir"] == str(env_dir) ++ ++ ++def test_load_does_not_create_cwd_files_or_open_network_sockets(tmp_path, monkeypatch): ++ monkeypatch.chdir(tmp_path) ++ filename = _write(tmp_path / "side_effect.yaml", "name: quiet\n") ++ ++ actual = loader.load(filename) ++ ++ ++ assert actual == {"name": "quiet", "__maestro": {"base_dir": str(tmp_path)}} +diff --git a/mimo_test_command.sh b/mimo_test_command.sh +new file mode 100755 +--- /dev/null ++++ b/mimo_test_command.sh +@@ -0,0 +1,16 @@ ++#!/usr/bin/env bash ++ ++ ++ ++ ++export NODE_OPTIONS="${NODE_OPTIONS:-} --max-old-space-size=4096" ++export MAVEN_OPTS="${MAVEN_OPTS:-} -Xmx3g -XX:+UseG1GC" ++export GRADLE_OPTS="${GRADLE_OPTS:-} -Xmx3g -XX:+UseG1GC" ++export TEST_JVM_OPTS="${TEST_JVM_OPTS:-} -Xmx3g" ++set -e ++cd /workspace/repo ++set -euo pipefail ++ ++export PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 ++export PYTHONNOUSERSITE=1 ++exec /workspace/repo/.stage4-venv/bin/python -m pytest /workspace/repo/usercase-test-coderl/test_loader_load.py -v diff --git a/tasks/format-code-task-002648/tests/test.sh b/tasks/format-code-task-002648/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..000a049870ca9ea8dfa3d49fda24df48ca697439 --- /dev/null +++ b/tasks/format-code-task-002648/tests/test.sh @@ -0,0 +1,38 @@ +#!/bin/bash +# Code grading, mimoagent opensource_code.py: reset the files the hidden test patch touches, apply it, run the +# task's test command; reward 1 when it exits 0. A testbed failure (reset or apply) writes no reward: not scored. +M=/var/lib/mimo +CWD=/workspace/repo +V=/logs/verifier +mkdir -p "$V" +BASE=$(cat "$M/base" 2>/dev/null) || { echo "setup never ran (no $M/base)" >&2; exit 1; } +cd "$CWD" || exit 1 +if [ -d "$M/git-hidden" ]; then rm -rf "$CWD/.git"; mv "$M/git-hidden" "$CWD/.git"; fi +# the agent's change against the base, so its own commits count too +git add -A >/dev/null 2>&1 && git -c core.fileMode=false diff --cached "$BASE" > "$V/agent.diff" +git reset -q +if ! ( +while IFS= read -r tf; do + [ -z "$tf" ] && continue + if git cat-file -e $BASE:"$tf" 2>/dev/null; then + git checkout $BASE -- "$tf" 2>/dev/null || true + else + git rm -f --cached "$tf" >/dev/null 2>&1 || true + rm -f "$tf" + fi +done <<'EOF_RESET_TEST_FILES' +usercase-test-coderl/test_loader_load.py +mimo_test_command.sh +EOF_RESET_TEST_FILES + +); then echo "could not reset the test files (testbed problem, not scored)" >&2; exit 1; fi +if ! git apply --verbose /tests/test.patch > "$V/apply.log" 2>&1; then + cat "$V/apply.log" >&2 + echo "the hidden tests could not be applied (testbed problem, not scored)" >&2 + exit 1 +fi +timeout 1800 sh -c "$(cat /tests/test_command.sh)" > "$V/test_output.log" 2>&1 +RC=$? +tail -c 12000 "$V/test_output.log" +if [ $RC -eq 0 ]; then echo 1 > "$V/reward.txt"; else echo 0 > "$V/reward.txt"; fi +echo "test command exited $RC" diff --git a/tasks/format-code-task-002648/tests/test_command.sh b/tasks/format-code-task-002648/tests/test_command.sh new file mode 100644 index 0000000000000000000000000000000000000000..88cb7810b836396c4869db31aeac7d4d4b189685 --- /dev/null +++ b/tasks/format-code-task-002648/tests/test_command.sh @@ -0,0 +1 @@ +bash /workspace/repo/mimo_test_command.sh \ No newline at end of file diff --git a/tasks/format-code-task-002655/environment/Dockerfile b/tasks/format-code-task-002655/environment/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..a555d56033038444c1f0f631c40fe166c2b09ae0 --- /dev/null +++ b/tasks/format-code-task-002655/environment/Dockerfile @@ -0,0 +1,3 @@ +# The task's image, pinned by digest (the same as [environment].docker_image). +# Setup runs at start from [environment.healthcheck]; environment/setup/ is its readable copy. +FROM docker.io/xiaomimimo/mimo-v2.6-rl-oss@sha256:e1187e85091771a35508affe597495776aa4362fd3366a021bf5371b1fe07415 diff --git a/tasks/format-code-task-002655/environment/setup/files/blocklist b/tasks/format-code-task-002655/environment/setup/files/blocklist new file mode 100644 index 0000000000000000000000000000000000000000..a8e4bdc4c7d9b739c047a3cb58ea72a1bb05bcbc --- /dev/null +++ b/tasks/format-code-task-002655/environment/setup/files/blocklist @@ -0,0 +1,33 @@ +# mimo answer-leak blocklist (mimoagent) +0.0.0.0 github.com +0.0.0.0 www.github.com +0.0.0.0 api.github.com +0.0.0.0 raw.githubusercontent.com +0.0.0.0 codeload.github.com +0.0.0.0 objects.githubusercontent.com +0.0.0.0 gist.github.com +0.0.0.0 gist.githubusercontent.com +0.0.0.0 gitlab.com +0.0.0.0 bitbucket.org +0.0.0.0 sourceforge.net +0.0.0.0 git.kernel.org +0.0.0.0 chromium.googlesource.com +0.0.0.0 android.googlesource.com +0.0.0.0 sourcegraph.com +0.0.0.0 bugs.chromium.org +0.0.0.0 issues.oss-fuzz.com +0.0.0.0 oss-fuzz.com +0.0.0.0 osv.dev +0.0.0.0 api.osv.dev +0.0.0.0 bugzilla.mozilla.org +0.0.0.0 proxy.golang.org +0.0.0.0 sum.golang.org +0.0.0.0 pkg.go.dev +0.0.0.0 google.com +0.0.0.0 www.google.com +0.0.0.0 bing.com +0.0.0.0 www.bing.com +0.0.0.0 duckduckgo.com +0.0.0.0 html.duckduckgo.com +0.0.0.0 search.brave.com +0.0.0.0 stackoverflow.com diff --git a/tasks/format-code-task-002655/environment/setup/setup.sh b/tasks/format-code-task-002655/environment/setup/setup.sh new file mode 100644 index 0000000000000000000000000000000000000000..d883db90cfcfb48f7a139861bbe9f6b5d95cad6f --- /dev/null +++ b/tasks/format-code-task-002655/environment/setup/setup.sh @@ -0,0 +1,34 @@ +#!/bin/bash +# Runs once, as root, before the agent starts: Harbor's [environment.healthcheck] unpacks this folder into +# /var/lib/mimo and runs it. Generated by mimo_harbor; see its README for how each step maps to Xiaomi's harness. +M=/var/lib/mimo +[ -f "$M/ready" ] && exit 0 +chmod 700 "$M" +fail() { echo "setup: $*" >&2; exit 1; } +# the answer-leak blocklist (mimoagent), applied to /etc/hosts by the agent right after it installs +write_blocklist() { cp "$M/files/blocklist" "$M/blocklist"; } + +# Code: mimoagent environments/datasets/opensource_code.py + base.py, as the explorer runs it (app/runner/domains.py Code). +CWD=/testbed +git config --global --add safe.directory "$CWD" +cd "$CWD" || fail "no working directory $CWD" +if ! git rev-parse --git-dir >/dev/null 2>&1; then # a bare source tree: give it a baseline commit + git init -q && git add -A && git -c user.name=mimo -c user.email=mimo@localhost commit -q -m baseline --allow-empty +fi +BASE=$(git rev-parse HEAD 2>/dev/null) +[ ${#BASE} -eq 40 ] || fail "could not resolve the base commit in $CWD" +echo "$BASE" > "$M/base" +# Images are built with history truncated at the base. If one is not, the fix could be read out of git log, +# so .git is hidden while the agent works and put back for grading. +LATER=$(git rev-list --all --not "$BASE" 2>/dev/null | head -n 5 | grep -c . || true) +rm -f /tmp/fail.log /tmp/pass.log /tmp/patch.diff /tmp/test_patch.diff /tmp/*.log 2>/dev/null; rm -rf /tmp/claude-0 /tmp/claude-* /tmp/testem-* /tmp/puppeteer_dev_chrome_profile-* 2>/dev/null; rm -f /tmp/test_files.json 2>/dev/null; rm -rf /tmp/jest_* /tmp/jest-* /tmp/build /tmp/build_env 2>/dev/null; rm -rf /tmp/pytest-of-root /tmp/pytest-* /tmp/.pytest_cache /tmp/__pycache__ 2>/dev/null; rm -rf /tmp/go-build* /tmp/standards /tmp/wordpress /tmp/zig-* /tmp/testbase /tmp/testbed 2>/dev/null; rm -f /tmp/tmp*.tmp /tmp/*.bak /tmp/expect* /tmp/butwas* 2>/dev/null; rm -rf /root/.cache/go-build 2>/dev/null; rm -rf /tests 2>/dev/null; find /logs -mindepth 1 -delete 2>/dev/null; mkdir -p /logs/agent /logs/verifier /logs/artifacts; chmod 777 /logs/agent /logs/verifier /logs/artifacts; find /var/log -type f -delete 2>/dev/null || true; rm -rf /var/lib/postgresql/*/*/log /var/lib/postgresql/*/*/pg_log 2>/dev/null || true; find /var/lib/mysql /var/lib/mongodb -type f -name '*.log' -delete 2>/dev/null || true; rm -rf /root/.npm/_logs /root/.babel.json /root/.pytest_cache 2>/dev/null || true; find / -maxdepth 4 -xdev -name task_description.md -path '*/.build_env/*' -delete 2>/dev/null || true; true +git clean -fdx --exclude=node_modules --exclude=bower_components --exclude=.husky --exclude=vendor --exclude=third_party --exclude=_deps --exclude=vcpkg_installed --exclude=.venv --exclude=venv --exclude=.gradle --exclude=target --exclude=.build --exclude=lib --exclude=.bundle --exclude=Manifest.toml --exclude=_build --exclude=.stack-work --exclude=dist-newstyle >/dev/null 2>&1 +find /root/.m2 -type f \( -name '*-SNAPSHOT.jar' -o -name '*-SNAPSHOT-sources.jar' -o -name '*-SNAPSHOT-tests.jar' -o -name '*-SNAPSHOT-test-sources.jar' \) -delete 2>/dev/null; rm -rf /root/.julia/compiled 2>/dev/null; rm -rf /root/.gradle/caches/build-cache-* /root/.gradle/daemon 2>/dev/null; rm -rf /root/.gradle/caches/*/scripts /root/.gradle/caches/jars-* 2>/dev/null; rm -rf /root/.cache/bazel 2>/dev/null; true +if [ "$LATER" -gt 0 ]; then + mv "$CWD/.git" "$M/git-hidden" + echo "history not truncated at ${BASE:0:12}: .git hidden while the agent works" +fi +write_blocklist + +touch "$M/ready" +echo "setup done" diff --git a/tasks/format-code-task-002655/tests/test.patch b/tasks/format-code-task-002655/tests/test.patch new file mode 100644 index 0000000000000000000000000000000000000000..78555e599f3306397c190729b5ebe6af286ea8ee --- /dev/null +++ b/tasks/format-code-task-002655/tests/test.patch @@ -0,0 +1,70 @@ +diff --git a/test/consistent-function-scoping.mjs b/test/consistent-function-scoping.mjs +index a08deef7..916d1089 100644 +--- a/test/consistent-function-scoping.mjs ++++ b/test/consistent-function-scoping.mjs +@@ -269,6 +269,19 @@ test({ + function foo() {} + }, []) + `, ++ // React Hooks - namespace import (#1681) ++ outdent` ++ import * as React from "react"; ++ React.useEffect(() => { ++ function foo() {} ++ }, []) ++ `, ++ outdent` ++ import * as React from "react"; ++ React.useState(() => { ++ function foo() {} ++ }) ++ `, + // IIFE + outdent` + (function() { +@@ -749,6 +762,23 @@ test({ + errors: [createError('function \'inner\'')], + options: [{checkArrowFunctions: false}], + }, ++ ++ { ++ code: outdent` ++ Foo.useEffect(() => { ++ function foo() {} ++ }, []) ++ `, ++ errors: [createError('function \'foo\'')], ++ }, ++ { ++ code: outdent` ++ notReact.useEffect(() => { ++ function foo() {} ++ }, []) ++ `, ++ errors: [createError('function \'foo\'')], ++ }, + ], + }); + +diff --git a/test_commands.json b/test_commands.json +new file mode 100644 +index 00000000..772c0458 +--- /dev/null ++++ b/test_commands.json +@@ -0,0 +1,3 @@ ++{ ++ "test_commands": ["npx ava test/consistent-function-scoping.mjs"] ++} +diff --git a/mimo_test_command.sh b/mimo_test_command.sh +new file mode 100755 +--- /dev/null ++++ b/mimo_test_command.sh +@@ -0,0 +1,8 @@ ++#!/usr/bin/env bash ++ ++set -uo pipefail ++cd /testbed ++rc=0 ++npx ava test/consistent-function-scoping.mjs ++rc=$(( rc | $? )) ++exit $rc diff --git a/tasks/format-code-task-002655/tests/test.sh b/tasks/format-code-task-002655/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..9887aa2e71da2e821c2f6824faaf887c6ff2a9b3 --- /dev/null +++ b/tasks/format-code-task-002655/tests/test.sh @@ -0,0 +1,39 @@ +#!/bin/bash +# Code grading, mimoagent opensource_code.py: reset the files the hidden test patch touches, apply it, run the +# task's test command; reward 1 when it exits 0. A testbed failure (reset or apply) writes no reward: not scored. +M=/var/lib/mimo +CWD=/testbed +V=/logs/verifier +mkdir -p "$V" +BASE=$(cat "$M/base" 2>/dev/null) || { echo "setup never ran (no $M/base)" >&2; exit 1; } +cd "$CWD" || exit 1 +if [ -d "$M/git-hidden" ]; then rm -rf "$CWD/.git"; mv "$M/git-hidden" "$CWD/.git"; fi +# the agent's change against the base, so its own commits count too +git add -A >/dev/null 2>&1 && git -c core.fileMode=false diff --cached "$BASE" > "$V/agent.diff" +git reset -q +if ! ( +while IFS= read -r tf; do + [ -z "$tf" ] && continue + if git cat-file -e $BASE:"$tf" 2>/dev/null; then + git checkout $BASE -- "$tf" 2>/dev/null || true + else + git rm -f --cached "$tf" >/dev/null 2>&1 || true + rm -f "$tf" + fi +done <<'EOF_RESET_TEST_FILES' +test/consistent-function-scoping.mjs +test_commands.json +mimo_test_command.sh +EOF_RESET_TEST_FILES + +); then echo "could not reset the test files (testbed problem, not scored)" >&2; exit 1; fi +if ! git apply --verbose /tests/test.patch > "$V/apply.log" 2>&1; then + cat "$V/apply.log" >&2 + echo "the hidden tests could not be applied (testbed problem, not scored)" >&2 + exit 1 +fi +timeout 1800 sh -c "$(cat /tests/test_command.sh)" > "$V/test_output.log" 2>&1 +RC=$? +tail -c 12000 "$V/test_output.log" +if [ $RC -eq 0 ]; then echo 1 > "$V/reward.txt"; else echo 0 > "$V/reward.txt"; fi +echo "test command exited $RC" diff --git a/tasks/format-code-task-002655/tests/test_command.sh b/tasks/format-code-task-002655/tests/test_command.sh new file mode 100644 index 0000000000000000000000000000000000000000..7cb23076694ad17d72e8296d62b2b240083e36db --- /dev/null +++ b/tasks/format-code-task-002655/tests/test_command.sh @@ -0,0 +1 @@ +bash /testbed/mimo_test_command.sh \ No newline at end of file diff --git a/tasks/format-code-task-002663/environment/Dockerfile b/tasks/format-code-task-002663/environment/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..71c366383152c8214371c0c5b43daa725337a6b9 --- /dev/null +++ b/tasks/format-code-task-002663/environment/Dockerfile @@ -0,0 +1,3 @@ +# The task's image, pinned by digest (the same as [environment].docker_image). +# Setup runs at start from [environment.healthcheck]; environment/setup/ is its readable copy. +FROM docker.io/xiaomimimo/mimo-v2.6-rl-oss@sha256:7698aca86b53a212a77d3c5585802e69f0b711bf96a9bb2df23f6a4ab94fea36 diff --git a/tasks/format-code-task-002663/environment/setup/files/blocklist b/tasks/format-code-task-002663/environment/setup/files/blocklist new file mode 100644 index 0000000000000000000000000000000000000000..a8e4bdc4c7d9b739c047a3cb58ea72a1bb05bcbc --- /dev/null +++ b/tasks/format-code-task-002663/environment/setup/files/blocklist @@ -0,0 +1,33 @@ +# mimo answer-leak blocklist (mimoagent) +0.0.0.0 github.com +0.0.0.0 www.github.com +0.0.0.0 api.github.com +0.0.0.0 raw.githubusercontent.com +0.0.0.0 codeload.github.com +0.0.0.0 objects.githubusercontent.com +0.0.0.0 gist.github.com +0.0.0.0 gist.githubusercontent.com +0.0.0.0 gitlab.com +0.0.0.0 bitbucket.org +0.0.0.0 sourceforge.net +0.0.0.0 git.kernel.org +0.0.0.0 chromium.googlesource.com +0.0.0.0 android.googlesource.com +0.0.0.0 sourcegraph.com +0.0.0.0 bugs.chromium.org +0.0.0.0 issues.oss-fuzz.com +0.0.0.0 oss-fuzz.com +0.0.0.0 osv.dev +0.0.0.0 api.osv.dev +0.0.0.0 bugzilla.mozilla.org +0.0.0.0 proxy.golang.org +0.0.0.0 sum.golang.org +0.0.0.0 pkg.go.dev +0.0.0.0 google.com +0.0.0.0 www.google.com +0.0.0.0 bing.com +0.0.0.0 www.bing.com +0.0.0.0 duckduckgo.com +0.0.0.0 html.duckduckgo.com +0.0.0.0 search.brave.com +0.0.0.0 stackoverflow.com diff --git a/tasks/format-code-task-002663/environment/setup/setup.sh b/tasks/format-code-task-002663/environment/setup/setup.sh new file mode 100644 index 0000000000000000000000000000000000000000..e9eb7daf39f9542bd095367feee457f3da77e492 --- /dev/null +++ b/tasks/format-code-task-002663/environment/setup/setup.sh @@ -0,0 +1,34 @@ +#!/bin/bash +# Runs once, as root, before the agent starts: Harbor's [environment.healthcheck] unpacks this folder into +# /var/lib/mimo and runs it. Generated by mimo_harbor; see its README for how each step maps to Xiaomi's harness. +M=/var/lib/mimo +[ -f "$M/ready" ] && exit 0 +chmod 700 "$M" +fail() { echo "setup: $*" >&2; exit 1; } +# the answer-leak blocklist (mimoagent), applied to /etc/hosts by the agent right after it installs +write_blocklist() { cp "$M/files/blocklist" "$M/blocklist"; } + +# Code: mimoagent environments/datasets/opensource_code.py + base.py, as the explorer runs it (app/runner/domains.py Code). +CWD=/workspace/repo +git config --global --add safe.directory "$CWD" +cd "$CWD" || fail "no working directory $CWD" +if ! git rev-parse --git-dir >/dev/null 2>&1; then # a bare source tree: give it a baseline commit + git init -q && git add -A && git -c user.name=mimo -c user.email=mimo@localhost commit -q -m baseline --allow-empty +fi +BASE=$(git rev-parse HEAD 2>/dev/null) +[ ${#BASE} -eq 40 ] || fail "could not resolve the base commit in $CWD" +echo "$BASE" > "$M/base" +# Images are built with history truncated at the base. If one is not, the fix could be read out of git log, +# so .git is hidden while the agent works and put back for grading. +LATER=$(git rev-list --all --not "$BASE" 2>/dev/null | head -n 5 | grep -c . || true) +rm -f /tmp/fail.log /tmp/pass.log /tmp/patch.diff /tmp/test_patch.diff /tmp/*.log 2>/dev/null; rm -rf /tmp/claude-0 /tmp/claude-* /tmp/testem-* /tmp/puppeteer_dev_chrome_profile-* 2>/dev/null; rm -f /tmp/test_files.json 2>/dev/null; rm -rf /tmp/jest_* /tmp/jest-* /tmp/build /tmp/build_env 2>/dev/null; rm -rf /tmp/pytest-of-root /tmp/pytest-* /tmp/.pytest_cache /tmp/__pycache__ 2>/dev/null; rm -rf /tmp/go-build* /tmp/standards /tmp/wordpress /tmp/zig-* /tmp/testbase /tmp/testbed 2>/dev/null; rm -f /tmp/tmp*.tmp /tmp/*.bak /tmp/expect* /tmp/butwas* 2>/dev/null; rm -rf /root/.cache/go-build 2>/dev/null; rm -rf /tests 2>/dev/null; find /logs -mindepth 1 -delete 2>/dev/null; mkdir -p /logs/agent /logs/verifier /logs/artifacts; chmod 777 /logs/agent /logs/verifier /logs/artifacts; find /var/log -type f -delete 2>/dev/null || true; rm -rf /var/lib/postgresql/*/*/log /var/lib/postgresql/*/*/pg_log 2>/dev/null || true; find /var/lib/mysql /var/lib/mongodb -type f -name '*.log' -delete 2>/dev/null || true; rm -rf /root/.npm/_logs /root/.babel.json /root/.pytest_cache 2>/dev/null || true; find / -maxdepth 4 -xdev -name task_description.md -path '*/.build_env/*' -delete 2>/dev/null || true; true +git clean -fdx --exclude=node_modules --exclude=bower_components --exclude=.husky --exclude=vendor --exclude=third_party --exclude=_deps --exclude=vcpkg_installed --exclude=.venv --exclude=venv --exclude=.gradle --exclude=target --exclude=.build --exclude=lib --exclude=.bundle --exclude=Manifest.toml --exclude=_build --exclude=.stack-work --exclude=dist-newstyle >/dev/null 2>&1 +find /root/.m2 -type f \( -name '*-SNAPSHOT.jar' -o -name '*-SNAPSHOT-sources.jar' -o -name '*-SNAPSHOT-tests.jar' -o -name '*-SNAPSHOT-test-sources.jar' \) -delete 2>/dev/null; rm -rf /root/.julia/compiled 2>/dev/null; rm -rf /root/.gradle/caches/build-cache-* /root/.gradle/daemon 2>/dev/null; rm -rf /root/.gradle/caches/*/scripts /root/.gradle/caches/jars-* 2>/dev/null; rm -rf /root/.cache/bazel 2>/dev/null; true +if [ "$LATER" -gt 0 ]; then + mv "$CWD/.git" "$M/git-hidden" + echo "history not truncated at ${BASE:0:12}: .git hidden while the agent works" +fi +write_blocklist + +touch "$M/ready" +echo "setup done" diff --git a/tasks/format-code-task-002663/tests/test.patch b/tasks/format-code-task-002663/tests/test.patch new file mode 100644 index 0000000000000000000000000000000000000000..7de9295ef50b21b2a54c8185b834f13dd6da1e28 --- /dev/null +++ b/tasks/format-code-task-002663/tests/test.patch @@ -0,0 +1,305 @@ +diff --git a/usercase-test-coderl/test_tech_finish_effects.py b/usercase-test-coderl/test_tech_finish_effects.py +new file mode 100644 +--- /dev/null ++++ b/usercase-test-coderl/test_tech_finish_effects.py +@@ -0,0 +1,274 @@ ++import pytest ++ ++from singularity.code import g, tech ++ ++ ++ ++ ++ ++ ++ ++ ++ ++class StubGroup(object): ++ def __init__(self, suspicion=0): ++ self.suspicion = suspicion ++ self.changed_suspicion_decay = 0 ++ self.changed_discover_bonus = 0 ++ self.is_actively_discovering_bases = True ++ ++ def alter_suspicion(self, change): ++ self.suspicion = max(self.suspicion + change, 0) ++ ++ def alter_suspicion_decay(self, change): ++ self.changed_suspicion_decay += change ++ ++ def alter_discover_bonus(self, change): ++ self.changed_discover_bonus += change ++ ++ ++class StubPlayer(object): ++ def __init__(self): ++ self.income = 10 ++ self.labor_bonus = 10000 ++ self.job_bonus = 0 ++ self.display_discover = "none" ++ self.apotheosis = False ++ self.had_grace = False ++ self.groups = { ++ "news": StubGroup(400), ++ "gov": StubGroup(900), ++ } ++ ++ ++class StubMapScreen(object): ++ def __init__(self): ++ self.story_sections = [] ++ ++ def show_story_section(self, name): ++ self.story_sections.append(name) ++ ++ ++@pytest.fixture(autouse=True) ++def isolated_game_state(): ++ original_player = g.pl ++ original_map_screen = g.map_screen ++ ++ g.pl = StubPlayer() ++ g.map_screen = StubMapScreen() ++ ++ yield ++ ++ g.pl = original_player ++ g.map_screen = original_map_screen ++ ++ ++def make_tech(tech_id, effect_stack): ++ return tech.Tech(tech.TechSpec(tech_id, [7, 11, 13], [], 0, effect_stack)) ++ ++ ++def assert_work_remaining(tech_obj): ++ ++ assert any(value > 0 for value in tech_obj.cost_left.tolist()) ++ ++ ++def test_finish_runs_income_effect_and_completed_state_transition(): ++ ++ ++ ++ income_tech = make_tech("income_plus", ["income", "12"]) ++ ++ assert income_tech.done is False ++ assert_work_remaining(income_tech) ++ assert g.pl.income == 10 ++ ++ income_tech.finish(is_player=True, loading_savegame=False) ++ ++ assert income_tech.done is True ++ assert income_tech.cost_left.tolist() == [0, 0, 0] ++ assert g.pl.income == 22 ++ ++ income_tech.finish(is_player=True, loading_savegame=False) ++ ++ assert income_tech.done is True ++ assert income_tech.cost_left.tolist() == [0, 0, 0] ++ assert g.pl.income == 34 ++ ++ ++def test_finish_runs_display_discovery_and_modifier_effects(): ++ ++ ++ ++ modifier_tech = make_tech( ++ "display_and_modifiers", ++ [ ++ "display_discover", ++ "partial", ++ "suspicion", ++ "news", ++ "37", ++ "discover", ++ "gov", ++ "23", ++ "cost_labor", ++ "500", ++ "job_profit", ++ "80", ++ ], ++ ) ++ ++ assert g.pl.display_discover == "none" ++ assert g.pl.groups["news"].changed_suspicion_decay == 0 ++ assert g.pl.groups["gov"].changed_discover_bonus == 0 ++ assert g.pl.labor_bonus == 10000 ++ assert g.pl.job_bonus == 0 ++ ++ modifier_tech.finish(is_player=True, loading_savegame=False) ++ ++ assert g.pl.display_discover == "partial" ++ assert g.pl.groups["news"].changed_suspicion_decay == 37 ++ assert g.pl.groups["gov"].changed_discover_bonus == -23 ++ assert g.pl.labor_bonus == 9500 ++ assert g.pl.job_bonus == 80 ++ ++ ++def test_loading_savegame_suppresses_one_time_suspicion_reduction(): ++ ++ ++ ++ normal_finish = make_tech("onetime_suspicion", ["suspicion", "onetime", "125"]) ++ ++ assert g.pl.groups["news"].suspicion == 400 ++ assert g.pl.groups["gov"].suspicion == 900 ++ ++ normal_finish.finish(is_player=True, loading_savegame=False) ++ ++ assert g.pl.groups["news"].suspicion == 275 ++ assert g.pl.groups["gov"].suspicion == 775 ++ ++ g.pl = StubPlayer() ++ loading_finish = make_tech( ++ "onetime_suspicion_load", ["suspicion", "onetime", "125"] ++ ) ++ loading_finish.finish(is_player=True, loading_savegame=True) ++ ++ assert loading_finish.done is True ++ assert loading_finish.cost_left.tolist() == [0, 0, 0] ++ assert g.pl.groups["news"].suspicion == 400 ++ assert g.pl.groups["gov"].suspicion == 900 ++ ++ ++def test_loading_savegame_suppresses_win_story_but_restores_endgame_state(): ++ ++ ++ ++ normal_finish = make_tech("endgame_normal", ["endgame"]) ++ normal_finish.finish(is_player=True, loading_savegame=False) ++ ++ assert g.pl.apotheosis is True ++ assert g.pl.had_grace is True ++ assert g.pl.groups["news"].is_actively_discovering_bases is False ++ assert g.pl.groups["gov"].is_actively_discovering_bases is False ++ ++ assert g.map_screen.story_sections != [] ++ ++ g.pl = StubPlayer() ++ g.map_screen = StubMapScreen() ++ loading_finish = make_tech("endgame_loading", ["endgame"]) ++ loading_finish.finish(is_player=True, loading_savegame=True) ++ ++ assert g.pl.apotheosis is True ++ assert g.pl.had_grace is True ++ assert g.pl.groups["news"].is_actively_discovering_bases is False ++ assert g.pl.groups["gov"].is_actively_discovering_bases is False ++ assert g.map_screen.story_sections == [] ++ ++ ++def test_registered_handler_is_decorator_and_skips_savegame_loading(): ++ ++ ++ ++ seen = [] ++ ++ def handler(completed_tech): ++ seen.append(completed_tech) ++ ++ returned = tech.register_on_tech_researched_handler(handler) ++ ++ assert returned is handler ++ assert seen == [] ++ ++ notify_me = make_tech("notify_me", []) ++ notify_me.finish(is_player=True, loading_savegame=False) ++ ++ ++ assert seen == [notify_me] ++ assert seen[0].done is True ++ ++ load_silent = make_tech("load_silent", []) ++ load_silent.finish(is_player=True, loading_savegame=True) ++ ++ assert seen == [notify_me] ++ ++ ++def test_two_tech_instances_keep_independent_completed_state(): ++ ++ ++ ++ first = make_tech("a_income", ["income", "4"]) ++ second = make_tech("b_income", ["income", "6"]) ++ ++ assert first.done is False ++ assert second.done is False ++ assert g.pl.income == 10 ++ ++ first.finish(is_player=True, loading_savegame=False) ++ ++ assert first.done is True ++ assert second.done is False ++ assert first.cost_left.tolist() == [0, 0, 0] ++ assert_work_remaining(second) ++ assert g.pl.income == 14 ++ ++ second.finish(is_player=True, loading_savegame=False) ++ ++ assert first.done is True ++ assert second.done is True ++ assert first.cost_left.tolist() == [0, 0, 0] ++ assert second.cost_left.tolist() == [0, 0, 0] ++ assert g.pl.income == 20 ++ ++ ++def test_finish_rejects_out_of_order_effect_without_player_state(): ++ ++ ++ ++ g.pl = None ++ income_tech = make_tech("missing_player", ["income", "12"]) ++ ++ ++ with pytest.raises(Exception): ++ income_tech.finish(is_player=True, loading_savegame=False) ++ ++ ++def test_many_finish_cycles_do_not_grow_research_handler_registry(): ++ ++ ++ ++ seen = [] ++ ++ def handler(completed_tech): ++ seen.append(completed_tech.id) ++ ++ tech.register_on_tech_researched_handler(handler) ++ ++ assert seen == [] ++ ++ for index in range(100): ++ finished = make_tech("cycle_%03d" % index, ["income", "1"]) ++ finished.finish(is_player=True, loading_savegame=False) ++ ++ assert len(seen) == 100 ++ ++ assert set(seen) == {"cycle_%03d" % index for index in range(100)} ++ assert g.pl.income == 110 +diff --git a/mimo_test_command.sh b/mimo_test_command.sh +new file mode 100755 +--- /dev/null ++++ b/mimo_test_command.sh +@@ -0,0 +1,21 @@ ++#!/usr/bin/env bash ++ ++ ++ ++ ++export NODE_OPTIONS="${NODE_OPTIONS:-} --max-old-space-size=4096" ++export MAVEN_OPTS="${MAVEN_OPTS:-} -Xmx3g -XX:+UseG1GC" ++export GRADLE_OPTS="${GRADLE_OPTS:-} -Xmx3g -XX:+UseG1GC" ++export TEST_JVM_OPTS="${TEST_JVM_OPTS:-} -Xmx3g" ++set -e ++cd /workspace/repo ++set -euo pipefail ++ ++cd /workspace/repo ++ ++ ++ ++export PYTHONPATH="/workspace/repo${PYTHONPATH:+:$PYTHONPATH}" ++export PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 ++ ++exec python3 -m pytest /workspace/repo/usercase-test-coderl/test_tech_finish_effects.py -v diff --git a/tasks/format-code-task-002663/tests/test.sh b/tasks/format-code-task-002663/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..1d42d9a3ad84e766ba012e586911fb4eb9851bb5 --- /dev/null +++ b/tasks/format-code-task-002663/tests/test.sh @@ -0,0 +1,38 @@ +#!/bin/bash +# Code grading, mimoagent opensource_code.py: reset the files the hidden test patch touches, apply it, run the +# task's test command; reward 1 when it exits 0. A testbed failure (reset or apply) writes no reward: not scored. +M=/var/lib/mimo +CWD=/workspace/repo +V=/logs/verifier +mkdir -p "$V" +BASE=$(cat "$M/base" 2>/dev/null) || { echo "setup never ran (no $M/base)" >&2; exit 1; } +cd "$CWD" || exit 1 +if [ -d "$M/git-hidden" ]; then rm -rf "$CWD/.git"; mv "$M/git-hidden" "$CWD/.git"; fi +# the agent's change against the base, so its own commits count too +git add -A >/dev/null 2>&1 && git -c core.fileMode=false diff --cached "$BASE" > "$V/agent.diff" +git reset -q +if ! ( +while IFS= read -r tf; do + [ -z "$tf" ] && continue + if git cat-file -e $BASE:"$tf" 2>/dev/null; then + git checkout $BASE -- "$tf" 2>/dev/null || true + else + git rm -f --cached "$tf" >/dev/null 2>&1 || true + rm -f "$tf" + fi +done <<'EOF_RESET_TEST_FILES' +usercase-test-coderl/test_tech_finish_effects.py +mimo_test_command.sh +EOF_RESET_TEST_FILES + +); then echo "could not reset the test files (testbed problem, not scored)" >&2; exit 1; fi +if ! git apply --verbose /tests/test.patch > "$V/apply.log" 2>&1; then + cat "$V/apply.log" >&2 + echo "the hidden tests could not be applied (testbed problem, not scored)" >&2 + exit 1 +fi +timeout 1800 sh -c "$(cat /tests/test_command.sh)" > "$V/test_output.log" 2>&1 +RC=$? +tail -c 12000 "$V/test_output.log" +if [ $RC -eq 0 ]; then echo 1 > "$V/reward.txt"; else echo 0 > "$V/reward.txt"; fi +echo "test command exited $RC" diff --git a/tasks/format-code-task-002663/tests/test_command.sh b/tasks/format-code-task-002663/tests/test_command.sh new file mode 100644 index 0000000000000000000000000000000000000000..88cb7810b836396c4869db31aeac7d4d4b189685 --- /dev/null +++ b/tasks/format-code-task-002663/tests/test_command.sh @@ -0,0 +1 @@ +bash /workspace/repo/mimo_test_command.sh \ No newline at end of file diff --git a/tasks/format-code-task-002664/environment/Dockerfile b/tasks/format-code-task-002664/environment/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..73c1975acddda88846ad7a9306d5c65085d21623 --- /dev/null +++ b/tasks/format-code-task-002664/environment/Dockerfile @@ -0,0 +1,3 @@ +# The task's image, pinned by digest (the same as [environment].docker_image). +# Setup runs at start from [environment.healthcheck]; environment/setup/ is its readable copy. +FROM docker.io/xiaomimimo/mimo-v2.6-rl-oss@sha256:41718b637b7d4b8a607259f6d8a2076a58c5bae7402b3c655f4a8419c255d89f diff --git a/tasks/format-code-task-002664/environment/setup/files/blocklist b/tasks/format-code-task-002664/environment/setup/files/blocklist new file mode 100644 index 0000000000000000000000000000000000000000..a8e4bdc4c7d9b739c047a3cb58ea72a1bb05bcbc --- /dev/null +++ b/tasks/format-code-task-002664/environment/setup/files/blocklist @@ -0,0 +1,33 @@ +# mimo answer-leak blocklist (mimoagent) +0.0.0.0 github.com +0.0.0.0 www.github.com +0.0.0.0 api.github.com +0.0.0.0 raw.githubusercontent.com +0.0.0.0 codeload.github.com +0.0.0.0 objects.githubusercontent.com +0.0.0.0 gist.github.com +0.0.0.0 gist.githubusercontent.com +0.0.0.0 gitlab.com +0.0.0.0 bitbucket.org +0.0.0.0 sourceforge.net +0.0.0.0 git.kernel.org +0.0.0.0 chromium.googlesource.com +0.0.0.0 android.googlesource.com +0.0.0.0 sourcegraph.com +0.0.0.0 bugs.chromium.org +0.0.0.0 issues.oss-fuzz.com +0.0.0.0 oss-fuzz.com +0.0.0.0 osv.dev +0.0.0.0 api.osv.dev +0.0.0.0 bugzilla.mozilla.org +0.0.0.0 proxy.golang.org +0.0.0.0 sum.golang.org +0.0.0.0 pkg.go.dev +0.0.0.0 google.com +0.0.0.0 www.google.com +0.0.0.0 bing.com +0.0.0.0 www.bing.com +0.0.0.0 duckduckgo.com +0.0.0.0 html.duckduckgo.com +0.0.0.0 search.brave.com +0.0.0.0 stackoverflow.com diff --git a/tasks/format-code-task-002664/environment/setup/setup.sh b/tasks/format-code-task-002664/environment/setup/setup.sh new file mode 100644 index 0000000000000000000000000000000000000000..d883db90cfcfb48f7a139861bbe9f6b5d95cad6f --- /dev/null +++ b/tasks/format-code-task-002664/environment/setup/setup.sh @@ -0,0 +1,34 @@ +#!/bin/bash +# Runs once, as root, before the agent starts: Harbor's [environment.healthcheck] unpacks this folder into +# /var/lib/mimo and runs it. Generated by mimo_harbor; see its README for how each step maps to Xiaomi's harness. +M=/var/lib/mimo +[ -f "$M/ready" ] && exit 0 +chmod 700 "$M" +fail() { echo "setup: $*" >&2; exit 1; } +# the answer-leak blocklist (mimoagent), applied to /etc/hosts by the agent right after it installs +write_blocklist() { cp "$M/files/blocklist" "$M/blocklist"; } + +# Code: mimoagent environments/datasets/opensource_code.py + base.py, as the explorer runs it (app/runner/domains.py Code). +CWD=/testbed +git config --global --add safe.directory "$CWD" +cd "$CWD" || fail "no working directory $CWD" +if ! git rev-parse --git-dir >/dev/null 2>&1; then # a bare source tree: give it a baseline commit + git init -q && git add -A && git -c user.name=mimo -c user.email=mimo@localhost commit -q -m baseline --allow-empty +fi +BASE=$(git rev-parse HEAD 2>/dev/null) +[ ${#BASE} -eq 40 ] || fail "could not resolve the base commit in $CWD" +echo "$BASE" > "$M/base" +# Images are built with history truncated at the base. If one is not, the fix could be read out of git log, +# so .git is hidden while the agent works and put back for grading. +LATER=$(git rev-list --all --not "$BASE" 2>/dev/null | head -n 5 | grep -c . || true) +rm -f /tmp/fail.log /tmp/pass.log /tmp/patch.diff /tmp/test_patch.diff /tmp/*.log 2>/dev/null; rm -rf /tmp/claude-0 /tmp/claude-* /tmp/testem-* /tmp/puppeteer_dev_chrome_profile-* 2>/dev/null; rm -f /tmp/test_files.json 2>/dev/null; rm -rf /tmp/jest_* /tmp/jest-* /tmp/build /tmp/build_env 2>/dev/null; rm -rf /tmp/pytest-of-root /tmp/pytest-* /tmp/.pytest_cache /tmp/__pycache__ 2>/dev/null; rm -rf /tmp/go-build* /tmp/standards /tmp/wordpress /tmp/zig-* /tmp/testbase /tmp/testbed 2>/dev/null; rm -f /tmp/tmp*.tmp /tmp/*.bak /tmp/expect* /tmp/butwas* 2>/dev/null; rm -rf /root/.cache/go-build 2>/dev/null; rm -rf /tests 2>/dev/null; find /logs -mindepth 1 -delete 2>/dev/null; mkdir -p /logs/agent /logs/verifier /logs/artifacts; chmod 777 /logs/agent /logs/verifier /logs/artifacts; find /var/log -type f -delete 2>/dev/null || true; rm -rf /var/lib/postgresql/*/*/log /var/lib/postgresql/*/*/pg_log 2>/dev/null || true; find /var/lib/mysql /var/lib/mongodb -type f -name '*.log' -delete 2>/dev/null || true; rm -rf /root/.npm/_logs /root/.babel.json /root/.pytest_cache 2>/dev/null || true; find / -maxdepth 4 -xdev -name task_description.md -path '*/.build_env/*' -delete 2>/dev/null || true; true +git clean -fdx --exclude=node_modules --exclude=bower_components --exclude=.husky --exclude=vendor --exclude=third_party --exclude=_deps --exclude=vcpkg_installed --exclude=.venv --exclude=venv --exclude=.gradle --exclude=target --exclude=.build --exclude=lib --exclude=.bundle --exclude=Manifest.toml --exclude=_build --exclude=.stack-work --exclude=dist-newstyle >/dev/null 2>&1 +find /root/.m2 -type f \( -name '*-SNAPSHOT.jar' -o -name '*-SNAPSHOT-sources.jar' -o -name '*-SNAPSHOT-tests.jar' -o -name '*-SNAPSHOT-test-sources.jar' \) -delete 2>/dev/null; rm -rf /root/.julia/compiled 2>/dev/null; rm -rf /root/.gradle/caches/build-cache-* /root/.gradle/daemon 2>/dev/null; rm -rf /root/.gradle/caches/*/scripts /root/.gradle/caches/jars-* 2>/dev/null; rm -rf /root/.cache/bazel 2>/dev/null; true +if [ "$LATER" -gt 0 ]; then + mv "$CWD/.git" "$M/git-hidden" + echo "history not truncated at ${BASE:0:12}: .git hidden while the agent works" +fi +write_blocklist + +touch "$M/ready" +echo "setup done" diff --git a/tasks/format-code-task-002664/tests/test.patch b/tasks/format-code-task-002664/tests/test.patch new file mode 100644 index 0000000000000000000000000000000000000000..c2f89d8d2d086f5cfbebeb800131de4ee8e63445 --- /dev/null +++ b/tasks/format-code-task-002664/tests/test.patch @@ -0,0 +1,134 @@ +diff --git a/bookmarks/tests/helpers.py b/bookmarks/tests/helpers.py +index 56072875f..f03ef986f 100644 +--- a/bookmarks/tests/helpers.py ++++ b/bookmarks/tests/helpers.py +@@ -209,8 +209,17 @@ def setup_asset_file(self, asset: BookmarkAsset, file_content: str = "test"): + + def read_asset_file(self, asset: BookmarkAsset): + filepath = os.path.join(settings.LD_ASSET_FOLDER, asset.file) +- with open(filepath, "rb") as f: +- return f.read() ++ ++ if asset.gzip: ++ with gzip.open(filepath, "rb") as f: ++ return f.read() ++ else: ++ with open(filepath, "rb") as f: ++ return f.read() ++ ++ def get_asset_filesize(self, asset: BookmarkAsset): ++ filepath = os.path.join(settings.LD_ASSET_FOLDER, asset.file) ++ return os.path.getsize(filepath) if os.path.exists(filepath) else 0 + + def has_asset_file(self, asset: BookmarkAsset): + filepath = os.path.join(settings.LD_ASSET_FOLDER, asset.file) +diff --git a/bookmarks/tests/test_assets_service.py b/bookmarks/tests/test_assets_service.py +index 97029fad4..5eb3ccc76 100644 +--- a/bookmarks/tests/test_assets_service.py ++++ b/bookmarks/tests/test_assets_service.py +@@ -207,11 +207,10 @@ def test_upload_asset(self): + + # verify file name + self.assertTrue(saved_file_name.startswith("upload_")) +- self.assertTrue(saved_file_name.endswith("_test_file.txt")) ++ self.assertTrue(saved_file_name.endswith("_test_file.txt.gz")) + + # file should contain the correct content +- with open(os.path.join(self.assets_dir, saved_file_name), "rb") as file: +- self.assertEqual(file.read(), file_content) ++ self.assertEqual(self.read_asset_file(asset), file_content) + + # should create asset + self.assertIsNotNone(asset.id) +@@ -221,6 +220,45 @@ def test_upload_asset(self): + self.assertEqual(asset.display_name, upload_file.name) + self.assertEqual(asset.status, BookmarkAsset.STATUS_COMPLETE) + self.assertEqual(asset.file, saved_file_name) ++ self.assertEqual(asset.file_size, self.get_asset_filesize(asset)) ++ self.assertTrue(asset.gzip) ++ ++ ++ bookmark.refresh_from_db() ++ self.assertGreater(bookmark.date_modified, initial_modified) ++ ++ @disable_logging ++ def test_upload_gzip_asset(self): ++ initial_modified = timezone.datetime( ++ 2025, 1, 1, 0, 0, 0, tzinfo=datetime.timezone.utc ++ ) ++ bookmark = self.setup_bookmark(modified=initial_modified) ++ file_content = gzip.compress(b"test content") ++ upload_file = SimpleUploadedFile( ++ "test_file.html.gz", file_content, content_type="application/gzip" ++ ) ++ ++ asset = assets.upload_asset(bookmark, upload_file) ++ ++ ++ saved_file_name = self.get_saved_snapshot_file() ++ self.assertIsNotNone(upload_file) ++ ++ ++ self.assertTrue(saved_file_name.startswith("upload_")) ++ self.assertTrue(saved_file_name.endswith("_test_file.html.gz")) ++ ++ ++ self.assertEqual(self.read_asset_file(asset), file_content) ++ ++ ++ self.assertIsNotNone(asset.id) ++ self.assertEqual(asset.bookmark, bookmark) ++ self.assertEqual(asset.asset_type, BookmarkAsset.TYPE_UPLOAD) ++ self.assertEqual(asset.content_type, "application/gzip") ++ self.assertEqual(asset.display_name, upload_file.name) ++ self.assertEqual(asset.status, BookmarkAsset.STATUS_COMPLETE) ++ self.assertEqual(asset.file, saved_file_name) + self.assertEqual(asset.file_size, len(file_content)) + self.assertFalse(asset.gzip) + +@@ -245,7 +283,7 @@ def test_upload_asset_truncates_asset_file_name(self): + + self.assertEqual(192, len(saved_file)) + self.assertTrue(saved_file.startswith("upload_")) +- self.assertTrue(saved_file.endswith("aaaa.txt")) ++ self.assertTrue(saved_file.endswith("aaaa.txt.gz")) + + @disable_logging + def test_upload_asset_failure(self): +diff --git a/bookmarks/tests/test_bookmark_assets_api.py b/bookmarks/tests/test_bookmark_assets_api.py +index 0517e587b..284e8dc94 100644 +--- a/bookmarks/tests/test_bookmark_assets_api.py ++++ b/bookmarks/tests/test_bookmark_assets_api.py +@@ -253,8 +253,8 @@ def test_upload_asset(self): + self.assertEqual(asset.display_name, file_name) + self.assertEqual(asset.asset_type, BookmarkAsset.TYPE_UPLOAD) + self.assertEqual(asset.content_type, "text/plain") +- self.assertEqual(asset.file_size, len(file_content)) +- self.assertFalse(asset.gzip) ++ self.assertEqual(asset.file_size, self.get_asset_filesize(asset)) ++ self.assertTrue(asset.gzip) + + content = self.read_asset_file(asset) + self.assertEqual(content, file_content) +diff --git a/mimo_build_env.tar.gz.b64 b/mimo_build_env.tar.gz.b64 +new file mode 100644 +--- /dev/null ++++ b/mimo_build_env.tar.gz.b64 +@@ -0,0 +1,6 @@ ++H4sIAAAAAAAAA+3SQWvCMBgG4J77K/IHmqbVtqcdBopsbHrQnUvahBm0TUlimf9+tWAdG87DlDH2 ++PpeELx9JyBta7NRW5LJuQ+9WWCdLkn7sfB77eZTELM6iLBrHHouilMUeSW52ow921nFDiGe0dt/1 ++XVr/o+gpfyety0tdVbwW1K6vd8al/EdZOuTPkqzLf5yOIo+w613hvH+efylIH3whhV9thDIkaIZK ++KLjjvtU7U8pTkbaH31KoOuSlUy130pdvjTaOTB7v57NFvpyuVg/z2TJ/XkxenqZ3hdabipuNpVY6 ++p+pXS4Vs/Wbv1roekaAi3bTbnAyN/Vk2XMttI42lzf7LUv9Zue02tLmVplWlPNt2LB77eaMOvUHr ++//brAwAAAAAAAAAAAAAAAAAAAAD8zDuYmexBACgAAA== +diff --git a/mimo_test_command.sh b/mimo_test_command.sh +new file mode 100755 +--- /dev/null ++++ b/mimo_test_command.sh +@@ -0,0 +1,6 @@ ++#!/usr/bin/env bash ++ ++set -uo pipefail ++cd /testbed || exit 1 ++base64 -d mimo_build_env.tar.gz.b64 | tar -xzf - -C /testbed || exit 1 ++exec bash -lc 'cd /testbed && bash -eo pipefail /testbed/.build_env/test_command.sh' diff --git a/tasks/format-code-task-002664/tests/test.sh b/tasks/format-code-task-002664/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..a659d86e4b219be6fbd123718b435b6ebc80ad8f --- /dev/null +++ b/tasks/format-code-task-002664/tests/test.sh @@ -0,0 +1,41 @@ +#!/bin/bash +# Code grading, mimoagent opensource_code.py: reset the files the hidden test patch touches, apply it, run the +# task's test command; reward 1 when it exits 0. A testbed failure (reset or apply) writes no reward: not scored. +M=/var/lib/mimo +CWD=/testbed +V=/logs/verifier +mkdir -p "$V" +BASE=$(cat "$M/base" 2>/dev/null) || { echo "setup never ran (no $M/base)" >&2; exit 1; } +cd "$CWD" || exit 1 +if [ -d "$M/git-hidden" ]; then rm -rf "$CWD/.git"; mv "$M/git-hidden" "$CWD/.git"; fi +# the agent's change against the base, so its own commits count too +git add -A >/dev/null 2>&1 && git -c core.fileMode=false diff --cached "$BASE" > "$V/agent.diff" +git reset -q +if ! ( +while IFS= read -r tf; do + [ -z "$tf" ] && continue + if git cat-file -e $BASE:"$tf" 2>/dev/null; then + git checkout $BASE -- "$tf" 2>/dev/null || true + else + git rm -f --cached "$tf" >/dev/null 2>&1 || true + rm -f "$tf" + fi +done <<'EOF_RESET_TEST_FILES' +bookmarks/tests/helpers.py +bookmarks/tests/test_assets_service.py +bookmarks/tests/test_bookmark_assets_api.py +mimo_build_env.tar.gz.b64 +mimo_test_command.sh +EOF_RESET_TEST_FILES + +); then echo "could not reset the test files (testbed problem, not scored)" >&2; exit 1; fi +if ! git apply --verbose /tests/test.patch > "$V/apply.log" 2>&1; then + cat "$V/apply.log" >&2 + echo "the hidden tests could not be applied (testbed problem, not scored)" >&2 + exit 1 +fi +timeout 1800 sh -c "$(cat /tests/test_command.sh)" > "$V/test_output.log" 2>&1 +RC=$? +tail -c 12000 "$V/test_output.log" +if [ $RC -eq 0 ]; then echo 1 > "$V/reward.txt"; else echo 0 > "$V/reward.txt"; fi +echo "test command exited $RC" diff --git a/tasks/format-code-task-002664/tests/test_command.sh b/tasks/format-code-task-002664/tests/test_command.sh new file mode 100644 index 0000000000000000000000000000000000000000..7cb23076694ad17d72e8296d62b2b240083e36db --- /dev/null +++ b/tasks/format-code-task-002664/tests/test_command.sh @@ -0,0 +1 @@ +bash /testbed/mimo_test_command.sh \ No newline at end of file diff --git a/tasks/format-code-task-002670/environment/Dockerfile b/tasks/format-code-task-002670/environment/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..b13dd92881ab26be325a264438fa1466029f6c1a --- /dev/null +++ b/tasks/format-code-task-002670/environment/Dockerfile @@ -0,0 +1,3 @@ +# The task's image, pinned by digest (the same as [environment].docker_image). +# Setup runs at start from [environment.healthcheck]; environment/setup/ is its readable copy. +FROM docker.io/xiaomimimo/mimo-v2.6-rl-oss@sha256:d75fb2bca4bcb70458ff7423732d02701a94e74decb820852f06b4288ddb9233 diff --git a/tasks/format-code-task-002670/environment/setup/files/blocklist b/tasks/format-code-task-002670/environment/setup/files/blocklist new file mode 100644 index 0000000000000000000000000000000000000000..a8e4bdc4c7d9b739c047a3cb58ea72a1bb05bcbc --- /dev/null +++ b/tasks/format-code-task-002670/environment/setup/files/blocklist @@ -0,0 +1,33 @@ +# mimo answer-leak blocklist (mimoagent) +0.0.0.0 github.com +0.0.0.0 www.github.com +0.0.0.0 api.github.com +0.0.0.0 raw.githubusercontent.com +0.0.0.0 codeload.github.com +0.0.0.0 objects.githubusercontent.com +0.0.0.0 gist.github.com +0.0.0.0 gist.githubusercontent.com +0.0.0.0 gitlab.com +0.0.0.0 bitbucket.org +0.0.0.0 sourceforge.net +0.0.0.0 git.kernel.org +0.0.0.0 chromium.googlesource.com +0.0.0.0 android.googlesource.com +0.0.0.0 sourcegraph.com +0.0.0.0 bugs.chromium.org +0.0.0.0 issues.oss-fuzz.com +0.0.0.0 oss-fuzz.com +0.0.0.0 osv.dev +0.0.0.0 api.osv.dev +0.0.0.0 bugzilla.mozilla.org +0.0.0.0 proxy.golang.org +0.0.0.0 sum.golang.org +0.0.0.0 pkg.go.dev +0.0.0.0 google.com +0.0.0.0 www.google.com +0.0.0.0 bing.com +0.0.0.0 www.bing.com +0.0.0.0 duckduckgo.com +0.0.0.0 html.duckduckgo.com +0.0.0.0 search.brave.com +0.0.0.0 stackoverflow.com diff --git a/tasks/format-code-task-002670/environment/setup/setup.sh b/tasks/format-code-task-002670/environment/setup/setup.sh new file mode 100644 index 0000000000000000000000000000000000000000..d883db90cfcfb48f7a139861bbe9f6b5d95cad6f --- /dev/null +++ b/tasks/format-code-task-002670/environment/setup/setup.sh @@ -0,0 +1,34 @@ +#!/bin/bash +# Runs once, as root, before the agent starts: Harbor's [environment.healthcheck] unpacks this folder into +# /var/lib/mimo and runs it. Generated by mimo_harbor; see its README for how each step maps to Xiaomi's harness. +M=/var/lib/mimo +[ -f "$M/ready" ] && exit 0 +chmod 700 "$M" +fail() { echo "setup: $*" >&2; exit 1; } +# the answer-leak blocklist (mimoagent), applied to /etc/hosts by the agent right after it installs +write_blocklist() { cp "$M/files/blocklist" "$M/blocklist"; } + +# Code: mimoagent environments/datasets/opensource_code.py + base.py, as the explorer runs it (app/runner/domains.py Code). +CWD=/testbed +git config --global --add safe.directory "$CWD" +cd "$CWD" || fail "no working directory $CWD" +if ! git rev-parse --git-dir >/dev/null 2>&1; then # a bare source tree: give it a baseline commit + git init -q && git add -A && git -c user.name=mimo -c user.email=mimo@localhost commit -q -m baseline --allow-empty +fi +BASE=$(git rev-parse HEAD 2>/dev/null) +[ ${#BASE} -eq 40 ] || fail "could not resolve the base commit in $CWD" +echo "$BASE" > "$M/base" +# Images are built with history truncated at the base. If one is not, the fix could be read out of git log, +# so .git is hidden while the agent works and put back for grading. +LATER=$(git rev-list --all --not "$BASE" 2>/dev/null | head -n 5 | grep -c . || true) +rm -f /tmp/fail.log /tmp/pass.log /tmp/patch.diff /tmp/test_patch.diff /tmp/*.log 2>/dev/null; rm -rf /tmp/claude-0 /tmp/claude-* /tmp/testem-* /tmp/puppeteer_dev_chrome_profile-* 2>/dev/null; rm -f /tmp/test_files.json 2>/dev/null; rm -rf /tmp/jest_* /tmp/jest-* /tmp/build /tmp/build_env 2>/dev/null; rm -rf /tmp/pytest-of-root /tmp/pytest-* /tmp/.pytest_cache /tmp/__pycache__ 2>/dev/null; rm -rf /tmp/go-build* /tmp/standards /tmp/wordpress /tmp/zig-* /tmp/testbase /tmp/testbed 2>/dev/null; rm -f /tmp/tmp*.tmp /tmp/*.bak /tmp/expect* /tmp/butwas* 2>/dev/null; rm -rf /root/.cache/go-build 2>/dev/null; rm -rf /tests 2>/dev/null; find /logs -mindepth 1 -delete 2>/dev/null; mkdir -p /logs/agent /logs/verifier /logs/artifacts; chmod 777 /logs/agent /logs/verifier /logs/artifacts; find /var/log -type f -delete 2>/dev/null || true; rm -rf /var/lib/postgresql/*/*/log /var/lib/postgresql/*/*/pg_log 2>/dev/null || true; find /var/lib/mysql /var/lib/mongodb -type f -name '*.log' -delete 2>/dev/null || true; rm -rf /root/.npm/_logs /root/.babel.json /root/.pytest_cache 2>/dev/null || true; find / -maxdepth 4 -xdev -name task_description.md -path '*/.build_env/*' -delete 2>/dev/null || true; true +git clean -fdx --exclude=node_modules --exclude=bower_components --exclude=.husky --exclude=vendor --exclude=third_party --exclude=_deps --exclude=vcpkg_installed --exclude=.venv --exclude=venv --exclude=.gradle --exclude=target --exclude=.build --exclude=lib --exclude=.bundle --exclude=Manifest.toml --exclude=_build --exclude=.stack-work --exclude=dist-newstyle >/dev/null 2>&1 +find /root/.m2 -type f \( -name '*-SNAPSHOT.jar' -o -name '*-SNAPSHOT-sources.jar' -o -name '*-SNAPSHOT-tests.jar' -o -name '*-SNAPSHOT-test-sources.jar' \) -delete 2>/dev/null; rm -rf /root/.julia/compiled 2>/dev/null; rm -rf /root/.gradle/caches/build-cache-* /root/.gradle/daemon 2>/dev/null; rm -rf /root/.gradle/caches/*/scripts /root/.gradle/caches/jars-* 2>/dev/null; rm -rf /root/.cache/bazel 2>/dev/null; true +if [ "$LATER" -gt 0 ]; then + mv "$CWD/.git" "$M/git-hidden" + echo "history not truncated at ${BASE:0:12}: .git hidden while the agent works" +fi +write_blocklist + +touch "$M/ready" +echo "setup done" diff --git a/tasks/format-code-task-002670/tests/test.patch b/tasks/format-code-task-002670/tests/test.patch new file mode 100644 index 0000000000000000000000000000000000000000..5e696dc7d5c105906046c5717cb51e4d2b3ea739 --- /dev/null +++ b/tasks/format-code-task-002670/tests/test.patch @@ -0,0 +1,215 @@ +diff --git a/src/api/webrpc/gatewayer_mock_test.go b/src/api/webrpc/gatewayer_mock_test.go +index ee87caad21..cb0bcbdc97 100644 +--- a/src/api/webrpc/gatewayer_mock_test.go ++++ b/src/api/webrpc/gatewayer_mock_test.go +@@ -27,14 +27,14 @@ func NewGatewayerMock() *GatewayerMock { + } + + // GetAddrUxOuts mocked method +-func (m *GatewayerMock) GetAddrUxOuts(p0 cipher.Address) ([]*historydb.UxOutJSON, error) { ++func (m *GatewayerMock) GetAddrUxOuts(p0 []cipher.Address) ([]*historydb.UxOut, error) { + + ret := m.Called(p0) + +- var r0 []*historydb.UxOutJSON ++ var r0 []*historydb.UxOut + switch res := ret.Get(0).(type) { + case nil: +- case []*historydb.UxOutJSON: ++ case []*historydb.UxOut: + r0 = res + default: + panic(fmt.Sprintf("unexpected type: %v", res)) +diff --git a/src/api/webrpc/uxout_test.go b/src/api/webrpc/uxout_test.go +index 4b2a63bf4a..b800b410d2 100644 +--- a/src/api/webrpc/uxout_test.go ++++ b/src/api/webrpc/uxout_test.go +@@ -4,12 +4,10 @@ import ( + "errors" + "testing" + +- "encoding/json" +- "strings" +- + "github.com/stretchr/testify/require" + + "github.com/skycoin/skycoin/src/cipher" ++ "github.com/skycoin/skycoin/src/coin" + "github.com/skycoin/skycoin/src/visor/historydb" + ) + +@@ -115,35 +113,36 @@ func Test_getAddrUxOutsHandler(t *testing.T) { + } + } + +-func decodeUxJSON(s string) []*historydb.UxOutJSON { +- v := []*historydb.UxOutJSON{} +- if err := json.NewDecoder(strings.NewReader(s)).Decode(&v); err != nil { +- panic(err) +- } +- return v +-} +- + func newUxOutMock() (*GatewayerMock, func(addr string) []*historydb.UxOutJSON) { + m := NewGatewayerMock() +- uxoutJSON := `[ +- { +- "uxid": "cc816392cef53a5b75f91bc3fb8155f133907c8ce7f6540507ab30e0456aec3e", +- "time": 1482042899, +- "src_block_seq": 562, +- "src_tx": "ec9e876d4bb33beec203de769b0d3b23de21052de0e4df06b1444bcfec773c46", +- "owner_address": "2kmKohJrwURrdcVtDNaWK6hLCNsWWbJhTqT", +- "coins": 1000000, +- "hours": 0, +- "spent_block_seq": 563, +- "spent_tx": "31a21a4dd8331ce68756ddbb21f2c66279d5f5526e936f550e49e29b840ac1ff" +- } +- ]` ++ ++ hash, _ := cipher.SHA256FromHex("31a21a4dd8331ce68756ddbb21f2c66279d5f5526e936f550e49e29b840ac1ff") ++ address, _ := cipher.DecodeBase58Address("2kmKohJrwURrdcVtDNaWK6hLCNsWWbJhTqT") ++ srcTxHash, _ := cipher.SHA256FromHex("ec9e876d4bb33beec203de769b0d3b23de21052de0e4df06b1444bcfec773c46") ++ + mockData := map[string]struct { +- ret []*historydb.UxOutJSON ++ ret []*historydb.UxOut + err error + }{ + "2kmKohJrwURrdcVtDNaWK6hLCNsWWbJhTqT": { +- decodeUxJSON(uxoutJSON), ++ []*historydb.UxOut{ ++ { ++ Out: coin.UxOut{ ++ Head: coin.UxHead{ ++ Time: 1482042899, ++ BkSeq: 562, ++ }, ++ Body: coin.UxBody{ ++ SrcTransaction: srcTxHash, ++ Address: address, ++ Coins: 1000000, ++ Hours: 0, ++ }, ++ }, ++ SpentTxID: hash, ++ SpentBlockSeq: 563, ++ }, ++ }, + nil, + }, + "fyqX5YuwXMUs4GEUE3LjLyhrqvNztFHQ4B": { +@@ -154,11 +153,19 @@ func newUxOutMock() (*GatewayerMock, func(addr string) []*historydb.UxOutJSON) { + + for addr, d := range mockData { + a := cipher.MustDecodeBase58Address(addr) +- m.On("GetAddrUxOuts", a).Return(d.ret, d.err) ++ m.On("GetAddrUxOuts", []cipher.Address{a}).Return(d.ret, d.err) + } + + f := func(addr string) []*historydb.UxOutJSON { +- return mockData[addr].ret ++ ++ uxouts := mockData[addr].ret ++ uxs := make([]*historydb.UxOutJSON, len(uxouts)) ++ ++ for i, ux := range uxouts { ++ uxs[i] = historydb.NewUxOutJSON(ux) ++ } ++ ++ return uxs + } + return m, f + } +diff --git a/src/api/webrpc/webrpc_test.go b/src/api/webrpc/webrpc_test.go +index 058fc1ff4f..4a2756c6d0 100644 +--- a/src/api/webrpc/webrpc_test.go ++++ b/src/api/webrpc/webrpc_test.go +@@ -103,7 +103,7 @@ func (fg *fakeGateway) InjectBroadcastTransaction(txn coin.Transaction) error { + return errors.New("fake gateway inject transaction failed") + } + +-func (fg fakeGateway) GetAddrUxOuts(addr cipher.Address) ([]*historydb.UxOutJSON, error) { ++func (fg fakeGateway) GetAddrUxOuts(addr []cipher.Address) ([]*historydb.UxOut, error) { + return nil, nil + } + +diff --git a/src/gui/gatewayer_mock_test.go b/src/gui/gatewayer_mock_test.go +index bd9db1478f..4e63125b98 100644 +--- a/src/gui/gatewayer_mock_test.go ++++ b/src/gui/gatewayer_mock_test.go +@@ -55,14 +55,14 @@ func (m *GatewayerMock) CreateWallet(p0 string, p1 wallet.Options) (*wallet.Wall + } + + // GetAddrUxOuts mocked method +-func (m *GatewayerMock) GetAddrUxOuts(p0 cipher.Address) ([]*historydb.UxOutJSON, error) { ++func (m *GatewayerMock) GetAddrUxOuts(p0 []cipher.Address) ([]*historydb.UxOut, error) { + + ret := m.Called(p0) + +- var r0 []*historydb.UxOutJSON ++ var r0 []*historydb.UxOut + switch res := ret.Get(0).(type) { + case nil: +- case []*historydb.UxOutJSON: ++ case []*historydb.UxOut: + r0 = res + default: + panic(fmt.Sprintf("unexpected type: %v", res)) +diff --git a/src/gui/uxout_test.go b/src/gui/uxout_test.go +index 845dc617e3..28a9175e38 100644 +--- a/src/gui/uxout_test.go ++++ b/src/gui/uxout_test.go +@@ -177,8 +177,8 @@ func TestGetAddrUxOuts(t *testing.T) { + status int + err string + httpBody *httpBody +- getAddrUxOutsArg cipher.Address +- getAddrUxOutsResponse []*historydb.UxOutJSON ++ getAddrUxOutsArg []cipher.Address ++ getAddrUxOutsResponse []*historydb.UxOut + getAddrUxOutsError error + httpResponse []*historydb.UxOutJSON + csrfDisabled bool +@@ -215,7 +215,7 @@ func TestGetAddrUxOuts(t *testing.T) { + httpBody: &httpBody{ + address: addressForGwError.String(), + }, +- getAddrUxOutsArg: addressForGwError, ++ getAddrUxOutsArg: []cipher.Address{addressForGwError}, + getAddrUxOutsError: errors.New("getAddrUxOutsError"), + }, + { +@@ -225,8 +225,8 @@ func TestGetAddrUxOuts(t *testing.T) { + httpBody: &httpBody{ + address: addressForGwResponse.String(), + }, +- getAddrUxOutsArg: addressForGwResponse, +- getAddrUxOutsResponse: []*historydb.UxOutJSON{}, ++ getAddrUxOutsArg: []cipher.Address{addressForGwResponse}, ++ getAddrUxOutsResponse: []*historydb.UxOut{}, + httpResponse: []*historydb.UxOutJSON{}, + }, + } +diff --git a/mimo_build_env.tar.gz.b64 b/mimo_build_env.tar.gz.b64 +new file mode 100644 +--- /dev/null ++++ b/mimo_build_env.tar.gz.b64 +@@ -0,0 +1,7 @@ ++H4sIAAAAAAAAA+3Sy07CQBQG4K77FCdo3PUypcUVJiYaXGgwXtYEptNSgU4zF9S3d0ACxkQJCcQQ ++/28znU7P9LT/hCNbTfOBqOeRdyixc55ly9H5Pi6vWZawJMmyNGl7MWOdOPEoO1hHX1hthorIU1Ka ++357btn6kwk3+Rmgz4HI2G9Z5qMf7e8e2/Dtxus6/naYu/7STxB7F+2vhZ/88f57TMviRyH3/hB6F ++IdtQr39/+XRD2ijLjVWCCqnIjCtNjRLBTOZ2KjT1pJvKF8GNL94aqcyqrhstflZUSn82yStFQUOt ++08+lSCselZUZ21HojlqkJ+9cVnXLn9YU6KJeN7OtYlPpun6wNS3q9KpPQS7T0n3K4iYVlWvW5zts ++2eszxu76V8+3111ZFFTKz50CLm1tuoyCOYXLXYZNFb2KkWp4RMnFGduhtLTVquavzwAAAAAAAAAA ++AAAAAAAAAAAAHK8PfC8QAgAoAAA= +diff --git a/mimo_test_command.sh b/mimo_test_command.sh +new file mode 100755 +--- /dev/null ++++ b/mimo_test_command.sh +@@ -0,0 +1,6 @@ ++#!/usr/bin/env bash ++ ++set -uo pipefail ++cd /testbed || exit 1 ++base64 -d mimo_build_env.tar.gz.b64 | tar -xzf - -C /testbed || exit 1 ++exec bash -lc 'cd /testbed && bash -eo pipefail /testbed/.build_env/test_command.sh' diff --git a/tasks/format-code-task-002670/tests/test.sh b/tasks/format-code-task-002670/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..6fb96c2fa33c9102a9aa388c75cd11cbabd7b659 --- /dev/null +++ b/tasks/format-code-task-002670/tests/test.sh @@ -0,0 +1,43 @@ +#!/bin/bash +# Code grading, mimoagent opensource_code.py: reset the files the hidden test patch touches, apply it, run the +# task's test command; reward 1 when it exits 0. A testbed failure (reset or apply) writes no reward: not scored. +M=/var/lib/mimo +CWD=/testbed +V=/logs/verifier +mkdir -p "$V" +BASE=$(cat "$M/base" 2>/dev/null) || { echo "setup never ran (no $M/base)" >&2; exit 1; } +cd "$CWD" || exit 1 +if [ -d "$M/git-hidden" ]; then rm -rf "$CWD/.git"; mv "$M/git-hidden" "$CWD/.git"; fi +# the agent's change against the base, so its own commits count too +git add -A >/dev/null 2>&1 && git -c core.fileMode=false diff --cached "$BASE" > "$V/agent.diff" +git reset -q +if ! ( +while IFS= read -r tf; do + [ -z "$tf" ] && continue + if git cat-file -e $BASE:"$tf" 2>/dev/null; then + git checkout $BASE -- "$tf" 2>/dev/null || true + else + git rm -f --cached "$tf" >/dev/null 2>&1 || true + rm -f "$tf" + fi +done <<'EOF_RESET_TEST_FILES' +src/api/webrpc/gatewayer_mock_test.go +src/api/webrpc/uxout_test.go +src/api/webrpc/webrpc_test.go +src/gui/gatewayer_mock_test.go +src/gui/uxout_test.go +mimo_build_env.tar.gz.b64 +mimo_test_command.sh +EOF_RESET_TEST_FILES + +); then echo "could not reset the test files (testbed problem, not scored)" >&2; exit 1; fi +if ! git apply --verbose /tests/test.patch > "$V/apply.log" 2>&1; then + cat "$V/apply.log" >&2 + echo "the hidden tests could not be applied (testbed problem, not scored)" >&2 + exit 1 +fi +timeout 1800 sh -c "$(cat /tests/test_command.sh)" > "$V/test_output.log" 2>&1 +RC=$? +tail -c 12000 "$V/test_output.log" +if [ $RC -eq 0 ]; then echo 1 > "$V/reward.txt"; else echo 0 > "$V/reward.txt"; fi +echo "test command exited $RC" diff --git a/tasks/format-code-task-002670/tests/test_command.sh b/tasks/format-code-task-002670/tests/test_command.sh new file mode 100644 index 0000000000000000000000000000000000000000..7cb23076694ad17d72e8296d62b2b240083e36db --- /dev/null +++ b/tasks/format-code-task-002670/tests/test_command.sh @@ -0,0 +1 @@ +bash /testbed/mimo_test_command.sh \ No newline at end of file diff --git a/tasks/format-code-task-002677/environment/Dockerfile b/tasks/format-code-task-002677/environment/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..fdfb8aceddc6c3c7d1dd7adc497f93ad94a814d2 --- /dev/null +++ b/tasks/format-code-task-002677/environment/Dockerfile @@ -0,0 +1,3 @@ +# The task's image, pinned by digest (the same as [environment].docker_image). +# Setup runs at start from [environment.healthcheck]; environment/setup/ is its readable copy. +FROM docker.io/xiaomimimo/mimo-v2.6-rl-oss@sha256:9925538be97e12c2448f4166831fdb8449057f890151123854da57df79d63032 diff --git a/tasks/format-code-task-002677/environment/setup/files/blocklist b/tasks/format-code-task-002677/environment/setup/files/blocklist new file mode 100644 index 0000000000000000000000000000000000000000..a8e4bdc4c7d9b739c047a3cb58ea72a1bb05bcbc --- /dev/null +++ b/tasks/format-code-task-002677/environment/setup/files/blocklist @@ -0,0 +1,33 @@ +# mimo answer-leak blocklist (mimoagent) +0.0.0.0 github.com +0.0.0.0 www.github.com +0.0.0.0 api.github.com +0.0.0.0 raw.githubusercontent.com +0.0.0.0 codeload.github.com +0.0.0.0 objects.githubusercontent.com +0.0.0.0 gist.github.com +0.0.0.0 gist.githubusercontent.com +0.0.0.0 gitlab.com +0.0.0.0 bitbucket.org +0.0.0.0 sourceforge.net +0.0.0.0 git.kernel.org +0.0.0.0 chromium.googlesource.com +0.0.0.0 android.googlesource.com +0.0.0.0 sourcegraph.com +0.0.0.0 bugs.chromium.org +0.0.0.0 issues.oss-fuzz.com +0.0.0.0 oss-fuzz.com +0.0.0.0 osv.dev +0.0.0.0 api.osv.dev +0.0.0.0 bugzilla.mozilla.org +0.0.0.0 proxy.golang.org +0.0.0.0 sum.golang.org +0.0.0.0 pkg.go.dev +0.0.0.0 google.com +0.0.0.0 www.google.com +0.0.0.0 bing.com +0.0.0.0 www.bing.com +0.0.0.0 duckduckgo.com +0.0.0.0 html.duckduckgo.com +0.0.0.0 search.brave.com +0.0.0.0 stackoverflow.com diff --git a/tasks/format-code-task-002677/environment/setup/setup.sh b/tasks/format-code-task-002677/environment/setup/setup.sh new file mode 100644 index 0000000000000000000000000000000000000000..d883db90cfcfb48f7a139861bbe9f6b5d95cad6f --- /dev/null +++ b/tasks/format-code-task-002677/environment/setup/setup.sh @@ -0,0 +1,34 @@ +#!/bin/bash +# Runs once, as root, before the agent starts: Harbor's [environment.healthcheck] unpacks this folder into +# /var/lib/mimo and runs it. Generated by mimo_harbor; see its README for how each step maps to Xiaomi's harness. +M=/var/lib/mimo +[ -f "$M/ready" ] && exit 0 +chmod 700 "$M" +fail() { echo "setup: $*" >&2; exit 1; } +# the answer-leak blocklist (mimoagent), applied to /etc/hosts by the agent right after it installs +write_blocklist() { cp "$M/files/blocklist" "$M/blocklist"; } + +# Code: mimoagent environments/datasets/opensource_code.py + base.py, as the explorer runs it (app/runner/domains.py Code). +CWD=/testbed +git config --global --add safe.directory "$CWD" +cd "$CWD" || fail "no working directory $CWD" +if ! git rev-parse --git-dir >/dev/null 2>&1; then # a bare source tree: give it a baseline commit + git init -q && git add -A && git -c user.name=mimo -c user.email=mimo@localhost commit -q -m baseline --allow-empty +fi +BASE=$(git rev-parse HEAD 2>/dev/null) +[ ${#BASE} -eq 40 ] || fail "could not resolve the base commit in $CWD" +echo "$BASE" > "$M/base" +# Images are built with history truncated at the base. If one is not, the fix could be read out of git log, +# so .git is hidden while the agent works and put back for grading. +LATER=$(git rev-list --all --not "$BASE" 2>/dev/null | head -n 5 | grep -c . || true) +rm -f /tmp/fail.log /tmp/pass.log /tmp/patch.diff /tmp/test_patch.diff /tmp/*.log 2>/dev/null; rm -rf /tmp/claude-0 /tmp/claude-* /tmp/testem-* /tmp/puppeteer_dev_chrome_profile-* 2>/dev/null; rm -f /tmp/test_files.json 2>/dev/null; rm -rf /tmp/jest_* /tmp/jest-* /tmp/build /tmp/build_env 2>/dev/null; rm -rf /tmp/pytest-of-root /tmp/pytest-* /tmp/.pytest_cache /tmp/__pycache__ 2>/dev/null; rm -rf /tmp/go-build* /tmp/standards /tmp/wordpress /tmp/zig-* /tmp/testbase /tmp/testbed 2>/dev/null; rm -f /tmp/tmp*.tmp /tmp/*.bak /tmp/expect* /tmp/butwas* 2>/dev/null; rm -rf /root/.cache/go-build 2>/dev/null; rm -rf /tests 2>/dev/null; find /logs -mindepth 1 -delete 2>/dev/null; mkdir -p /logs/agent /logs/verifier /logs/artifacts; chmod 777 /logs/agent /logs/verifier /logs/artifacts; find /var/log -type f -delete 2>/dev/null || true; rm -rf /var/lib/postgresql/*/*/log /var/lib/postgresql/*/*/pg_log 2>/dev/null || true; find /var/lib/mysql /var/lib/mongodb -type f -name '*.log' -delete 2>/dev/null || true; rm -rf /root/.npm/_logs /root/.babel.json /root/.pytest_cache 2>/dev/null || true; find / -maxdepth 4 -xdev -name task_description.md -path '*/.build_env/*' -delete 2>/dev/null || true; true +git clean -fdx --exclude=node_modules --exclude=bower_components --exclude=.husky --exclude=vendor --exclude=third_party --exclude=_deps --exclude=vcpkg_installed --exclude=.venv --exclude=venv --exclude=.gradle --exclude=target --exclude=.build --exclude=lib --exclude=.bundle --exclude=Manifest.toml --exclude=_build --exclude=.stack-work --exclude=dist-newstyle >/dev/null 2>&1 +find /root/.m2 -type f \( -name '*-SNAPSHOT.jar' -o -name '*-SNAPSHOT-sources.jar' -o -name '*-SNAPSHOT-tests.jar' -o -name '*-SNAPSHOT-test-sources.jar' \) -delete 2>/dev/null; rm -rf /root/.julia/compiled 2>/dev/null; rm -rf /root/.gradle/caches/build-cache-* /root/.gradle/daemon 2>/dev/null; rm -rf /root/.gradle/caches/*/scripts /root/.gradle/caches/jars-* 2>/dev/null; rm -rf /root/.cache/bazel 2>/dev/null; true +if [ "$LATER" -gt 0 ]; then + mv "$CWD/.git" "$M/git-hidden" + echo "history not truncated at ${BASE:0:12}: .git hidden while the agent works" +fi +write_blocklist + +touch "$M/ready" +echo "setup done" diff --git a/tasks/format-code-task-002677/tests/test.patch b/tasks/format-code-task-002677/tests/test.patch new file mode 100644 index 0000000000000000000000000000000000000000..4a4569565cb7b26fe7befef23c0dd24aad47769f --- /dev/null +++ b/tasks/format-code-task-002677/tests/test.patch @@ -0,0 +1,291 @@ +diff --git a/core/networking/peerstore_test.go b/core/networking/peerstore_test.go +new file mode 100644 +index 0000000000..847f2cc415 +--- /dev/null ++++ b/core/networking/peerstore_test.go +@@ -0,0 +1,99 @@ ++package networking_test ++ ++import ( ++ "context" ++ "database/sql" ++ "testing" ++ "time" ++ ++ p2ppeer "github.com/libp2p/go-libp2p-core/peer" ++ ma "github.com/multiformats/go-multiaddr" ++ "github.com/smartcontractkit/chainlink/core/internal/cltest" ++ "github.com/smartcontractkit/chainlink/core/networking" ++ "github.com/stretchr/testify/require" ++) ++ ++func TestNewPeerstorePersistsPeerDataAcrossReconstruction(t *testing.T) { ++ _, orm, cleanup := cltest.BootstrapThrowawayORM(t, "peerstore_addr", true) ++ defer cleanup() ++ db := orm.DB.DB() ++ ctx := context.Background() ++ ++ first, err := networking.NewPeerstore(ctx, db) ++ require.NoError(t, err) ++ peerID := mustPeerID(t, "12D3KooWL1yndUw9T2oWXjhfjdwSscWA78YCpUdduA3Cnn4dCtph") ++ addr := mustMultiaddr(t, "/ip4/127.0.0.1/tcp/12000/p2p/12D3KooWL1yndUw9T2oWXjhfjdwSscWA78YCpUdduA3Cnn4dCtph") ++ ++ first.AddAddr(peerID, addr, time.Hour) ++ require.GreaterOrEqual(t, peerstoreRowCount(t, db), 1) ++ ++ second, err := networking.NewPeerstore(ctx, db) ++ require.NoError(t, err) ++ require.Contains(t, peerIDsAsStrings(second.Peers()), peerID.String()) ++ require.Contains(t, multiaddrsAsStrings(second.Addrs(peerID)), addr.String()) ++} ++ ++func TestNewPeerstorePersistsProtocolsAcrossReconstruction(t *testing.T) { ++ _, orm, cleanup := cltest.BootstrapThrowawayORM(t, "peerstore_protocols", true) ++ defer cleanup() ++ db := orm.DB.DB() ++ ctx := context.Background() ++ ++ first, err := networking.NewPeerstore(ctx, db) ++ require.NoError(t, err) ++ peerID := mustPeerID(t, "12D3KooWPCUQczn5M34VZvj6kMkyWkYqM2seFxF6cE2bSwjfRRr2") ++ protocols := []string{ ++ "/chainlink/ocr/1.0.0", ++ "/chainlink/ocr/2.0.0", ++ } ++ ++ require.NoError(t, first.AddProtocols(peerID, protocols...)) ++ require.GreaterOrEqual(t, peerstoreRowCount(t, db), 1) ++ ++ second, err := networking.NewPeerstore(ctx, db) ++ require.NoError(t, err) ++ got, err := second.GetProtocols(peerID) ++ require.NoError(t, err) ++ require.Contains(t, got, protocols[0]) ++ require.Contains(t, got, protocols[1]) ++} ++ ++func peerstoreRowCount(t *testing.T, db *sql.DB) int { ++ t.Helper() ++ ++ var count int ++ require.NoError(t, db.QueryRow(`SELECT COUNT(*) FROM p2p_peerstore`).Scan(&count)) ++ return count ++} ++ ++func mustPeerID(t *testing.T, value string) p2ppeer.ID { ++ t.Helper() ++ ++ peerID, err := p2ppeer.Decode(value) ++ require.NoError(t, err) ++ return peerID ++} ++ ++func mustMultiaddr(t *testing.T, value string) ma.Multiaddr { ++ t.Helper() ++ ++ addr, err := ma.NewMultiaddr(value) ++ require.NoError(t, err) ++ return addr ++} ++ ++func peerIDsAsStrings(peers []p2ppeer.ID) []string { ++ values := make([]string, 0, len(peers)) ++ for _, peerID := range peers { ++ values = append(values, peerID.String()) ++ } ++ return values ++} ++ ++func multiaddrsAsStrings(addrs []ma.Multiaddr) []string { ++ values := make([]string, 0, len(addrs)) ++ for _, addr := range addrs { ++ values = append(values, addr.String()) ++ } ++ return values ++} +diff --git a/core/store/migrations/p2p_peerstore_test.go b/core/store/migrations/p2p_peerstore_test.go +new file mode 100644 +index 0000000000..dfa3f3fc4b +--- /dev/null ++++ b/core/store/migrations/p2p_peerstore_test.go +@@ -0,0 +1,81 @@ ++package migrations_test ++ ++import ( ++ "database/sql" ++ "testing" ++ ++ "github.com/smartcontractkit/chainlink/core/internal/cltest" ++ "github.com/stretchr/testify/require" ++) ++ ++func TestMigrationsCreateP2PPeerstoreTable(t *testing.T) { ++ store, cleanup := cltest.NewStore(t) ++ defer cleanup() ++ db := store.DB.DB() ++ ++ require.True(t, tableExists(t, db, "p2p_peerstore")) ++ ++ keyColumn := columnInfo(t, db, "p2p_peerstore", "key") ++ require.Equal(t, "text", keyColumn.dataType) ++ require.Equal(t, "NO", keyColumn.isNullable) ++ require.True(t, columnIsPrimaryKey(t, db, "p2p_peerstore", "key")) ++ ++ dataColumn := columnInfo(t, db, "p2p_peerstore", "data") ++ require.Equal(t, "bytea", dataColumn.dataType) ++ require.Equal(t, "NO", dataColumn.isNullable) ++} ++ ++type postgresColumnInfo struct { ++ dataType string ++ isNullable string ++} ++ ++func tableExists(t *testing.T, db *sql.DB, tableName string) bool { ++ t.Helper() ++ ++ var exists bool ++ require.NoError(t, db.QueryRow(` ++ SELECT EXISTS ( ++ SELECT 1 ++ FROM information_schema.tables ++ WHERE table_schema = current_schema() ++ AND table_name = $1 ++ ) ++ `, tableName).Scan(&exists)) ++ return exists ++} ++ ++func columnInfo(t *testing.T, db *sql.DB, tableName, columnName string) postgresColumnInfo { ++ t.Helper() ++ ++ var info postgresColumnInfo ++ require.NoError(t, db.QueryRow(` ++ SELECT data_type, is_nullable ++ FROM information_schema.columns ++ WHERE table_schema = current_schema() ++ AND table_name = $1 ++ AND column_name = $2 ++ `, tableName, columnName).Scan(&info.dataType, &info.isNullable)) ++ return info ++} ++ ++func columnIsPrimaryKey(t *testing.T, db *sql.DB, tableName, columnName string) bool { ++ t.Helper() ++ ++ var exists bool ++ require.NoError(t, db.QueryRow(` ++ SELECT EXISTS ( ++ SELECT 1 ++ FROM information_schema.table_constraints tc ++ JOIN information_schema.key_column_usage kcu ++ ON tc.constraint_schema = kcu.constraint_schema ++ AND tc.constraint_name = kcu.constraint_name ++ AND tc.table_name = kcu.table_name ++ WHERE tc.table_schema = current_schema() ++ AND tc.table_name = $1 ++ AND tc.constraint_type = 'PRIMARY KEY' ++ AND kcu.column_name = $2 ++ ) ++ `, tableName, columnName).Scan(&exists)) ++ return exists ++} +diff --git a/mimo_test_command.sh b/mimo_test_command.sh +new file mode 100755 +--- /dev/null ++++ b/mimo_test_command.sh +@@ -0,0 +1,94 @@ ++#!/bin/bash ++set -uo pipefail ++cd /testbed ++ ++ ++set -e ++ ++ ++if ! pg_isready -q 2>/dev/null; then ++ pg_ctlcluster 16 main start 2>/dev/null || true ++ sleep 2 ++fi ++ ++ ++if grep -q "scram-sha-256\|md5\|peer" /etc/postgresql/16/main/pg_hba.conf 2>/dev/null; then ++ sed -i 's/scram-sha-256/trust/g; s/md5/trust/g; s/peer/trust/g' /etc/postgresql/16/main/pg_hba.conf ++ pg_ctlcluster 16 main reload 2>/dev/null || true ++ sleep 1 ++fi ++ ++ ++su - postgres -c "psql -tc \"SELECT 1 FROM pg_roles WHERE rolname='root'\"" | grep -q 1 || \ ++ su - postgres -c "psql -c \"CREATE USER root WITH SUPERUSER CREATEDB;\"" 2>/dev/null || true ++ ++ ++psql -U root -d postgres -tc "SELECT 1 FROM pg_database WHERE datname='chainlink_test'" | grep -q 1 || \ ++ psql -U root -d postgres -c "CREATE DATABASE chainlink_test;" 2>/dev/null || true ++ ++ ++if [ ! -f /testbed/evm-contracts/abi/v0.6/FluxAggregator.json ]; then ++ mkdir -p /testbed/evm-contracts/abi/v0.6 ++ cat > /testbed/evm-contracts/abi/v0.6/FluxAggregator.json << 'ABIEOF' ++{ ++ "compilerOutput": { ++ "abi": [ ++ { ++ "type": "event", ++ "name": "AnswerUpdated", ++ "inputs": [ ++ {"name": "current", "type": "int256", "indexed": true}, ++ {"name": "roundId", "type": "uint256", "indexed": true}, ++ {"name": "updatedAt", "type": "uint256", "indexed": false} ++ ] ++ }, ++ { ++ "type": "event", ++ "name": "NewRound", ++ "inputs": [ ++ {"name": "roundId", "type": "uint256", "indexed": true}, ++ {"name": "startedBy", "type": "address", "indexed": true}, ++ {"name": "startedAt", "type": "uint256", "indexed": false} ++ ] ++ }, ++ { ++ "type": "function", ++ "name": "roundState", ++ "stateMutability": "view", ++ "inputs": [ ++ {"name": "_oracle", "type": "address"}, ++ {"name": "_queriedRoundId", "type": "uint32"} ++ ], ++ "outputs": [ ++ {"name": "_eligibleToSubmit", "type": "bool"}, ++ {"name": "_roundId", "type": "uint32"}, ++ {"name": "_latestSubmission", "type": "int256"}, ++ {"name": "_startedAt", "type": "uint64"}, ++ {"name": "_timeout", "type": "uint64"}, ++ {"name": "_availableFunds", "type": "uint128"}, ++ {"name": "_oracleCount", "type": "uint8"}, ++ {"name": "_paymentAmount", "type": "uint128"} ++ ] ++ } ++ ] ++ } ++} ++ABIEOF ++fi ++ ++export DATABASE_URL="postgres://root@localhost:5432/chainlink_test?sslmode=disable" ++ ++ ++case "${1:-}" in ++ base) ++ go test -v -count=1 -run 'TestMigrate_Migrations' ./core/store/migrations ++ ;; ++ new) ++ go test -v -count=1 -run 'TestNewPeerstorePersistsPeerDataAcrossReconstruction|TestNewPeerstorePersistsProtocolsAcrossReconstruction' ./core/networking && \ ++ go test -v -count=1 -run 'TestMigrationsCreateP2PPeerstoreTable' ./core/store/migrations ++ ;; ++ *) ++ echo "usage: $0 base|new" ++ exit 2 ++ ;; ++esac diff --git a/tasks/format-code-task-002677/tests/test.sh b/tasks/format-code-task-002677/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..1aed3505138670c057a0316af43f3cacc3a31339 --- /dev/null +++ b/tasks/format-code-task-002677/tests/test.sh @@ -0,0 +1,39 @@ +#!/bin/bash +# Code grading, mimoagent opensource_code.py: reset the files the hidden test patch touches, apply it, run the +# task's test command; reward 1 when it exits 0. A testbed failure (reset or apply) writes no reward: not scored. +M=/var/lib/mimo +CWD=/testbed +V=/logs/verifier +mkdir -p "$V" +BASE=$(cat "$M/base" 2>/dev/null) || { echo "setup never ran (no $M/base)" >&2; exit 1; } +cd "$CWD" || exit 1 +if [ -d "$M/git-hidden" ]; then rm -rf "$CWD/.git"; mv "$M/git-hidden" "$CWD/.git"; fi +# the agent's change against the base, so its own commits count too +git add -A >/dev/null 2>&1 && git -c core.fileMode=false diff --cached "$BASE" > "$V/agent.diff" +git reset -q +if ! ( +while IFS= read -r tf; do + [ -z "$tf" ] && continue + if git cat-file -e $BASE:"$tf" 2>/dev/null; then + git checkout $BASE -- "$tf" 2>/dev/null || true + else + git rm -f --cached "$tf" >/dev/null 2>&1 || true + rm -f "$tf" + fi +done <<'EOF_RESET_TEST_FILES' +core/networking/peerstore_test.go +core/store/migrations/p2p_peerstore_test.go +mimo_test_command.sh +EOF_RESET_TEST_FILES + +); then echo "could not reset the test files (testbed problem, not scored)" >&2; exit 1; fi +if ! git apply --verbose /tests/test.patch > "$V/apply.log" 2>&1; then + cat "$V/apply.log" >&2 + echo "the hidden tests could not be applied (testbed problem, not scored)" >&2 + exit 1 +fi +timeout 1800 sh -c "$(cat /tests/test_command.sh)" > "$V/test_output.log" 2>&1 +RC=$? +tail -c 12000 "$V/test_output.log" +if [ $RC -eq 0 ]; then echo 1 > "$V/reward.txt"; else echo 0 > "$V/reward.txt"; fi +echo "test command exited $RC" diff --git a/tasks/format-code-task-002677/tests/test_command.sh b/tasks/format-code-task-002677/tests/test_command.sh new file mode 100644 index 0000000000000000000000000000000000000000..e8d2f32b64045b5a5a56e0ad5667da87d8e0bc2a --- /dev/null +++ b/tasks/format-code-task-002677/tests/test_command.sh @@ -0,0 +1 @@ +bash /testbed/mimo_test_command.sh base && bash /testbed/mimo_test_command.sh new \ No newline at end of file diff --git a/tasks/format-code-task-002679/environment/Dockerfile b/tasks/format-code-task-002679/environment/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..72e539eb417c24ebc38c44f3a4c44365503c742b --- /dev/null +++ b/tasks/format-code-task-002679/environment/Dockerfile @@ -0,0 +1,3 @@ +# The task's image, pinned by digest (the same as [environment].docker_image). +# Setup runs at start from [environment.healthcheck]; environment/setup/ is its readable copy. +FROM docker.io/xiaomimimo/mimo-v2.6-rl-oss@sha256:9d16d46d6b406336f2dae0e112667f4bf790331eb0d782fc83183e5a1549ed2a diff --git a/tasks/format-code-task-002679/environment/setup/files/blocklist b/tasks/format-code-task-002679/environment/setup/files/blocklist new file mode 100644 index 0000000000000000000000000000000000000000..a8e4bdc4c7d9b739c047a3cb58ea72a1bb05bcbc --- /dev/null +++ b/tasks/format-code-task-002679/environment/setup/files/blocklist @@ -0,0 +1,33 @@ +# mimo answer-leak blocklist (mimoagent) +0.0.0.0 github.com +0.0.0.0 www.github.com +0.0.0.0 api.github.com +0.0.0.0 raw.githubusercontent.com +0.0.0.0 codeload.github.com +0.0.0.0 objects.githubusercontent.com +0.0.0.0 gist.github.com +0.0.0.0 gist.githubusercontent.com +0.0.0.0 gitlab.com +0.0.0.0 bitbucket.org +0.0.0.0 sourceforge.net +0.0.0.0 git.kernel.org +0.0.0.0 chromium.googlesource.com +0.0.0.0 android.googlesource.com +0.0.0.0 sourcegraph.com +0.0.0.0 bugs.chromium.org +0.0.0.0 issues.oss-fuzz.com +0.0.0.0 oss-fuzz.com +0.0.0.0 osv.dev +0.0.0.0 api.osv.dev +0.0.0.0 bugzilla.mozilla.org +0.0.0.0 proxy.golang.org +0.0.0.0 sum.golang.org +0.0.0.0 pkg.go.dev +0.0.0.0 google.com +0.0.0.0 www.google.com +0.0.0.0 bing.com +0.0.0.0 www.bing.com +0.0.0.0 duckduckgo.com +0.0.0.0 html.duckduckgo.com +0.0.0.0 search.brave.com +0.0.0.0 stackoverflow.com diff --git a/tasks/format-code-task-002679/environment/setup/setup.sh b/tasks/format-code-task-002679/environment/setup/setup.sh new file mode 100644 index 0000000000000000000000000000000000000000..d883db90cfcfb48f7a139861bbe9f6b5d95cad6f --- /dev/null +++ b/tasks/format-code-task-002679/environment/setup/setup.sh @@ -0,0 +1,34 @@ +#!/bin/bash +# Runs once, as root, before the agent starts: Harbor's [environment.healthcheck] unpacks this folder into +# /var/lib/mimo and runs it. Generated by mimo_harbor; see its README for how each step maps to Xiaomi's harness. +M=/var/lib/mimo +[ -f "$M/ready" ] && exit 0 +chmod 700 "$M" +fail() { echo "setup: $*" >&2; exit 1; } +# the answer-leak blocklist (mimoagent), applied to /etc/hosts by the agent right after it installs +write_blocklist() { cp "$M/files/blocklist" "$M/blocklist"; } + +# Code: mimoagent environments/datasets/opensource_code.py + base.py, as the explorer runs it (app/runner/domains.py Code). +CWD=/testbed +git config --global --add safe.directory "$CWD" +cd "$CWD" || fail "no working directory $CWD" +if ! git rev-parse --git-dir >/dev/null 2>&1; then # a bare source tree: give it a baseline commit + git init -q && git add -A && git -c user.name=mimo -c user.email=mimo@localhost commit -q -m baseline --allow-empty +fi +BASE=$(git rev-parse HEAD 2>/dev/null) +[ ${#BASE} -eq 40 ] || fail "could not resolve the base commit in $CWD" +echo "$BASE" > "$M/base" +# Images are built with history truncated at the base. If one is not, the fix could be read out of git log, +# so .git is hidden while the agent works and put back for grading. +LATER=$(git rev-list --all --not "$BASE" 2>/dev/null | head -n 5 | grep -c . || true) +rm -f /tmp/fail.log /tmp/pass.log /tmp/patch.diff /tmp/test_patch.diff /tmp/*.log 2>/dev/null; rm -rf /tmp/claude-0 /tmp/claude-* /tmp/testem-* /tmp/puppeteer_dev_chrome_profile-* 2>/dev/null; rm -f /tmp/test_files.json 2>/dev/null; rm -rf /tmp/jest_* /tmp/jest-* /tmp/build /tmp/build_env 2>/dev/null; rm -rf /tmp/pytest-of-root /tmp/pytest-* /tmp/.pytest_cache /tmp/__pycache__ 2>/dev/null; rm -rf /tmp/go-build* /tmp/standards /tmp/wordpress /tmp/zig-* /tmp/testbase /tmp/testbed 2>/dev/null; rm -f /tmp/tmp*.tmp /tmp/*.bak /tmp/expect* /tmp/butwas* 2>/dev/null; rm -rf /root/.cache/go-build 2>/dev/null; rm -rf /tests 2>/dev/null; find /logs -mindepth 1 -delete 2>/dev/null; mkdir -p /logs/agent /logs/verifier /logs/artifacts; chmod 777 /logs/agent /logs/verifier /logs/artifacts; find /var/log -type f -delete 2>/dev/null || true; rm -rf /var/lib/postgresql/*/*/log /var/lib/postgresql/*/*/pg_log 2>/dev/null || true; find /var/lib/mysql /var/lib/mongodb -type f -name '*.log' -delete 2>/dev/null || true; rm -rf /root/.npm/_logs /root/.babel.json /root/.pytest_cache 2>/dev/null || true; find / -maxdepth 4 -xdev -name task_description.md -path '*/.build_env/*' -delete 2>/dev/null || true; true +git clean -fdx --exclude=node_modules --exclude=bower_components --exclude=.husky --exclude=vendor --exclude=third_party --exclude=_deps --exclude=vcpkg_installed --exclude=.venv --exclude=venv --exclude=.gradle --exclude=target --exclude=.build --exclude=lib --exclude=.bundle --exclude=Manifest.toml --exclude=_build --exclude=.stack-work --exclude=dist-newstyle >/dev/null 2>&1 +find /root/.m2 -type f \( -name '*-SNAPSHOT.jar' -o -name '*-SNAPSHOT-sources.jar' -o -name '*-SNAPSHOT-tests.jar' -o -name '*-SNAPSHOT-test-sources.jar' \) -delete 2>/dev/null; rm -rf /root/.julia/compiled 2>/dev/null; rm -rf /root/.gradle/caches/build-cache-* /root/.gradle/daemon 2>/dev/null; rm -rf /root/.gradle/caches/*/scripts /root/.gradle/caches/jars-* 2>/dev/null; rm -rf /root/.cache/bazel 2>/dev/null; true +if [ "$LATER" -gt 0 ]; then + mv "$CWD/.git" "$M/git-hidden" + echo "history not truncated at ${BASE:0:12}: .git hidden while the agent works" +fi +write_blocklist + +touch "$M/ready" +echo "setup done" diff --git a/tasks/format-code-task-002679/tests/test.patch b/tasks/format-code-task-002679/tests/test.patch new file mode 100644 index 0000000000000000000000000000000000000000..6737f2b26be69e5ceac94250370bacd05e380947 --- /dev/null +++ b/tasks/format-code-task-002679/tests/test.patch @@ -0,0 +1,318 @@ +diff --git a/test/tree.spec.js b/test/tree.spec.js +index fe91984..69bdf01 100644 +--- a/test/tree.spec.js ++++ b/test/tree.spec.js +@@ -523,4 +523,284 @@ describe('Tree Functions', () => { + await walkAsyncTest + expect(tree.a.b.c.length).to.equal(4) + }) ++ it('mapTree preserves shape and passes traversal context', () => { ++ let getChildren = node => node.children ++ let tree = { ++ id: 'root', ++ children: [ ++ { id: 'left', children: [{ id: 'left.a' }, { id: 'left.b' }] }, ++ { id: 'right', children: [{ id: 'right.a' }] }, ++ ], ++ } ++ ++ let result = F.mapTree(getChildren)( ++ (node, index, parents = [], parentIndexes = []) => ({ ++ ...node, ++ children: node.children ? node.children.slice() : node.children, ++ marker: parents.length ++ ? `${parents[0].id}:${index}:${parentIndexes.join('.')}` ++ : 'root', ++ }), ++ tree ++ ) ++ ++ expect(result).to.include({ id: 'root', marker: 'root' }) ++ expect(_.map('id', result.children)).to.deep.equal(['left', 'right']) ++ expect(result.children[0].children[1]).to.include({ id: 'left.b' }) ++ expect(result.children[1].children[0]).to.include({ id: 'right.a' }) ++ expect(result.children[0]).to.include({ ++ id: 'left', ++ marker: 'root:0:', ++ }) ++ expect(result.children[1]).to.include({ ++ id: 'right', ++ marker: 'root:1:', ++ }) ++ ++ let context = F.mapTree(getChildren)( ++ (node, index, parents = [], parentIndexes = []) => ({ ++ ...node, ++ children: node.children ? node.children.slice() : node.children, ++ context: { ++ index, ++ parent: parents[0] && parents[0].id, ++ parentIndexDepth: parentIndexes.length, ++ }, ++ }), ++ tree ++ ) ++ expect({ ++ ...context.children[0].context, ++ index: `${context.children[0].context.index}`, ++ }).to.deep.equal({ ++ index: '0', ++ parent: 'root', ++ parentIndexDepth: 1, ++ }) ++ }) ++ ++ it('mapTreeLeaves maps only leaves', () => { ++ let getChildren = node => node.children ++ let tree = { ++ id: 'root', ++ children: [ ++ { id: 'branch', children: [{ id: 'leaf-a' }, { id: 'leaf-b' }] }, ++ { id: 'leaf-c' }, ++ ], ++ } ++ ++ let result = F.mapTreeLeaves(getChildren)( ++ node => ({ ...node, leaf: true, id: `${node.id}!` }), ++ tree ++ ) ++ ++ expect(result.id).to.equal('root') ++ expect(result.children[0].id).to.equal('branch') ++ expect(result.children[0].children).to.deep.equal([ ++ { id: 'leaf-a!', leaf: true }, ++ { id: 'leaf-b!', leaf: true }, ++ ]) ++ expect(result.children[1]).to.deep.equal({ id: 'leaf-c!', leaf: true }) ++ ++ expect(F.mapTreeLeaves()(x => x * 10, 7)).to.equal(70) ++ expect(F.mapTreeLeaves()(x => (_.isNumber(x) ? x + 1 : x), { ++ a: { ++ b: { ++ c: { ++ d: 4, ++ }, ++ }, ++ }, ++ })).to.deep.equal({ ++ a: { ++ b: { ++ c: { ++ d: 5, ++ }, ++ }, ++ }, ++ }) ++ }) ++ ++ it('leavesBy customizes collected leaves with context', () => { ++ let getChildren = node => node.children ++ let tree = { ++ id: 'root', ++ children: [ ++ { id: 'group', children: [{ id: 'alpha' }, { id: 'beta' }] }, ++ { id: 'gamma' }, ++ ], ++ } ++ ++ let result = F.leavesBy(getChildren)((node, index, parents) => ({ ++ id: node.id, ++ index, ++ parent: parents[0] && parents[0].id, ++ depth: parents.length, ++ }), tree) ++ ++ expect(result).to.deep.equal([ ++ { id: 'alpha', index: 0, parent: 'group', depth: 2 }, ++ { id: 'beta', index: 1, parent: 'group', depth: 2 }, ++ { id: 'gamma', index: 1, parent: 'root', depth: 1 }, ++ ]) ++ ++ let calls = [] ++ let values = F.leavesBy(getChildren)( ++ (node, index, parents, parentIndexes = []) => { ++ calls.push(node.id) ++ return { ++ id: node.id, ++ parentIndexDepth: parentIndexes.length, ++ parentIndexHead: parentIndexes[0], ++ } ++ }, ++ tree ++ ) ++ expect(calls).to.deep.equal(['alpha', 'beta', 'gamma']) ++ expect(values).to.deep.equal([ ++ { id: 'alpha', parentIndexDepth: 2, parentIndexHead: 0 }, ++ { id: 'beta', parentIndexDepth: 2, parentIndexHead: 0 }, ++ { id: 'gamma', parentIndexDepth: 1, parentIndexHead: undefined }, ++ ]) ++ ++ let anonymousLeaves = F.leavesBy(getChildren)( ++ node => node.label, ++ { children: [{ label: 'nameless' }] } ++ ) ++ expect(anonymousLeaves).to.deep.equal(['nameless']) ++ }) ++ ++ it('treeToArrayBy passes traversal context', () => { ++ let getChildren = node => node.children ++ let tree = { ++ id: 'root', ++ children: [ ++ { id: 'first', children: [{ id: 'first.leaf' }] }, ++ { id: 'second' }, ++ ], ++ } ++ ++ let result = F.treeToArrayBy(getChildren)( ++ (node, index, parents = [], parentIndexes = []) => ({ ++ id: node.id, ++ index, ++ parent: parents[0] && parents[0].id, ++ depth: parents.length, ++ parentIndexDepth: parentIndexes.length, ++ }), ++ tree ++ ) ++ ++ expect(result).to.deep.equal([ ++ { ++ id: 'root', ++ index: undefined, ++ parent: undefined, ++ depth: 0, ++ parentIndexDepth: 0, ++ }, ++ { ++ id: 'first', ++ index: 0, ++ parent: 'root', ++ depth: 1, ++ parentIndexDepth: 1, ++ }, ++ { ++ id: 'first.leaf', ++ index: 0, ++ parent: 'first', ++ depth: 2, ++ parentIndexDepth: 2, ++ }, ++ { ++ id: 'second', ++ index: 1, ++ parent: 'root', ++ depth: 1, ++ parentIndexDepth: 1, ++ }, ++ ]) ++ ++ let parentIndexValues = F.treeToArrayBy(getChildren)( ++ (node, index, parents = [], parentIndexes = []) => ({ ++ id: node.id, ++ parentIndexes, ++ }), ++ tree ++ ) ++ expect(parentIndexValues[2]).to.deep.equal({ ++ id: 'first.leaf', ++ parentIndexes: [0, undefined], ++ }) ++ }) ++ ++ it('tree factory exposes map leavesBy and mapLeaves', () => { ++ let getChildren = node => node.children ++ let helpers = F.tree(getChildren) ++ let tree = { ++ id: 'root', ++ children: [ ++ { id: 'branch', children: [{ id: 'leaf-a' }] }, ++ { id: 'leaf-b' }, ++ ], ++ } ++ ++ expect(helpers.map).to.be.a('function') ++ expect(helpers.mapLeaves).to.be.a('function') ++ expect(helpers.leavesBy).to.be.a('function') ++ ++ expect(helpers.leavesBy(node => node.id, tree)).to.deep.equal([ ++ 'leaf-a', ++ 'leaf-b', ++ ]) ++ ++ let mapped = helpers.map( ++ node => ({ ++ ...node, ++ children: node.children ? node.children.slice() : node.children, ++ seen: true, ++ }), ++ tree ++ ) ++ expect(mapped).to.include({ id: 'root', seen: true }) ++ expect(mapped.children[0]).to.include({ id: 'branch', seen: true }) ++ expect(mapped.children[0].children[0]).to.include({ id: 'leaf-a' }) ++ ++ let leafMapped = helpers.mapLeaves(node => ({ ...node, leaf: true }), tree) ++ expect(leafMapped.children[0].id).to.equal('branch') ++ expect(leafMapped.children[0].children[0]).to.include({ leaf: true }) ++ expect(leafMapped.children[1]).to.include({ id: 'leaf-b', leaf: true }) ++ ++ let helperLeafContext = helpers.leavesBy( ++ (node, index, parents = [], parentIndexes = []) => ({ ++ id: node.id, ++ parent: parents[0] && parents[0].id, ++ parentIndexDepth: parentIndexes.length, ++ }), ++ tree ++ ) ++ expect(helperLeafContext).to.deep.equal([ ++ { id: 'leaf-a', parent: 'branch', parentIndexDepth: 2 }, ++ { id: 'leaf-b', parent: 'root', parentIndexDepth: 1 }, ++ ]) ++ ++ let deepLeafMapped = helpers.mapLeaves( ++ node => ({ ...node, marked: true }), ++ { ++ id: 'deep-root', ++ children: [ ++ { ++ id: 'level-1', ++ children: [{ id: 'level-2', children: [{ id: 'level-3' }] }], ++ }, ++ ], ++ } ++ ) ++ expect(deepLeafMapped.children[0].children[0].children[0]).to.include({ ++ id: 'level-3', ++ marked: true, ++ }) ++ }) + }) +diff --git a/mimo_test_command.sh b/mimo_test_command.sh +new file mode 100755 +--- /dev/null ++++ b/mimo_test_command.sh +@@ -0,0 +1,24 @@ ++#!/bin/bash ++set -uo pipefail ++cd /testbed ++ ++if [ ! -d node_modules ]; then ++ npm install --legacy-peer-deps ++fi ++ ++run_mocha() { ++ node ./node_modules/babel-cli/bin/babel-node.js ./node_modules/mocha/bin/_mocha --require ./test/init.js "$@" ++} ++ ++case "${1:-}" in ++ base) ++ run_mocha --invert --grep '(mapTree preserves shape and passes traversal context|mapTreeLeaves maps only leaves|leavesBy customizes collected leaves with context|treeToArrayBy passes traversal context|tree factory exposes map leavesBy and mapLeaves)' test/tree.spec.js ++ ;; ++ new) ++ run_mocha --grep '(mapTree preserves shape and passes traversal context|mapTreeLeaves maps only leaves|leavesBy customizes collected leaves with context|treeToArrayBy passes traversal context|tree factory exposes map leavesBy and mapLeaves)$' test/tree.spec.js ++ ;; ++ *) ++ echo "usage: $0 base|new" ++ exit 2 ++ ;; ++esac diff --git a/tasks/format-code-task-002679/tests/test.sh b/tasks/format-code-task-002679/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..7c40e6a24bff1642d3bba67b4c5bca1c4fe11503 --- /dev/null +++ b/tasks/format-code-task-002679/tests/test.sh @@ -0,0 +1,38 @@ +#!/bin/bash +# Code grading, mimoagent opensource_code.py: reset the files the hidden test patch touches, apply it, run the +# task's test command; reward 1 when it exits 0. A testbed failure (reset or apply) writes no reward: not scored. +M=/var/lib/mimo +CWD=/testbed +V=/logs/verifier +mkdir -p "$V" +BASE=$(cat "$M/base" 2>/dev/null) || { echo "setup never ran (no $M/base)" >&2; exit 1; } +cd "$CWD" || exit 1 +if [ -d "$M/git-hidden" ]; then rm -rf "$CWD/.git"; mv "$M/git-hidden" "$CWD/.git"; fi +# the agent's change against the base, so its own commits count too +git add -A >/dev/null 2>&1 && git -c core.fileMode=false diff --cached "$BASE" > "$V/agent.diff" +git reset -q +if ! ( +while IFS= read -r tf; do + [ -z "$tf" ] && continue + if git cat-file -e $BASE:"$tf" 2>/dev/null; then + git checkout $BASE -- "$tf" 2>/dev/null || true + else + git rm -f --cached "$tf" >/dev/null 2>&1 || true + rm -f "$tf" + fi +done <<'EOF_RESET_TEST_FILES' +test/tree.spec.js +mimo_test_command.sh +EOF_RESET_TEST_FILES + +); then echo "could not reset the test files (testbed problem, not scored)" >&2; exit 1; fi +if ! git apply --verbose /tests/test.patch > "$V/apply.log" 2>&1; then + cat "$V/apply.log" >&2 + echo "the hidden tests could not be applied (testbed problem, not scored)" >&2 + exit 1 +fi +timeout 1800 sh -c "$(cat /tests/test_command.sh)" > "$V/test_output.log" 2>&1 +RC=$? +tail -c 12000 "$V/test_output.log" +if [ $RC -eq 0 ]; then echo 1 > "$V/reward.txt"; else echo 0 > "$V/reward.txt"; fi +echo "test command exited $RC" diff --git a/tasks/format-code-task-002679/tests/test_command.sh b/tasks/format-code-task-002679/tests/test_command.sh new file mode 100644 index 0000000000000000000000000000000000000000..e8d2f32b64045b5a5a56e0ad5667da87d8e0bc2a --- /dev/null +++ b/tasks/format-code-task-002679/tests/test_command.sh @@ -0,0 +1 @@ +bash /testbed/mimo_test_command.sh base && bash /testbed/mimo_test_command.sh new \ No newline at end of file diff --git a/tasks/format-code-task-002684/environment/Dockerfile b/tasks/format-code-task-002684/environment/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..d9e9b739c04284d2de0411c92ce1c944347ae0cd --- /dev/null +++ b/tasks/format-code-task-002684/environment/Dockerfile @@ -0,0 +1,3 @@ +# The task's image, pinned by digest (the same as [environment].docker_image). +# Setup runs at start from [environment.healthcheck]; environment/setup/ is its readable copy. +FROM docker.io/xiaomimimo/mimo-v2.6-rl-oss@sha256:a1c45dfb857daa85e83e5b8644f377ec641feba56e8ff976ea533bdf18837333 diff --git a/tasks/format-code-task-002684/environment/setup/files/blocklist b/tasks/format-code-task-002684/environment/setup/files/blocklist new file mode 100644 index 0000000000000000000000000000000000000000..a8e4bdc4c7d9b739c047a3cb58ea72a1bb05bcbc --- /dev/null +++ b/tasks/format-code-task-002684/environment/setup/files/blocklist @@ -0,0 +1,33 @@ +# mimo answer-leak blocklist (mimoagent) +0.0.0.0 github.com +0.0.0.0 www.github.com +0.0.0.0 api.github.com +0.0.0.0 raw.githubusercontent.com +0.0.0.0 codeload.github.com +0.0.0.0 objects.githubusercontent.com +0.0.0.0 gist.github.com +0.0.0.0 gist.githubusercontent.com +0.0.0.0 gitlab.com +0.0.0.0 bitbucket.org +0.0.0.0 sourceforge.net +0.0.0.0 git.kernel.org +0.0.0.0 chromium.googlesource.com +0.0.0.0 android.googlesource.com +0.0.0.0 sourcegraph.com +0.0.0.0 bugs.chromium.org +0.0.0.0 issues.oss-fuzz.com +0.0.0.0 oss-fuzz.com +0.0.0.0 osv.dev +0.0.0.0 api.osv.dev +0.0.0.0 bugzilla.mozilla.org +0.0.0.0 proxy.golang.org +0.0.0.0 sum.golang.org +0.0.0.0 pkg.go.dev +0.0.0.0 google.com +0.0.0.0 www.google.com +0.0.0.0 bing.com +0.0.0.0 www.bing.com +0.0.0.0 duckduckgo.com +0.0.0.0 html.duckduckgo.com +0.0.0.0 search.brave.com +0.0.0.0 stackoverflow.com diff --git a/tasks/format-code-task-002684/environment/setup/setup.sh b/tasks/format-code-task-002684/environment/setup/setup.sh new file mode 100644 index 0000000000000000000000000000000000000000..d883db90cfcfb48f7a139861bbe9f6b5d95cad6f --- /dev/null +++ b/tasks/format-code-task-002684/environment/setup/setup.sh @@ -0,0 +1,34 @@ +#!/bin/bash +# Runs once, as root, before the agent starts: Harbor's [environment.healthcheck] unpacks this folder into +# /var/lib/mimo and runs it. Generated by mimo_harbor; see its README for how each step maps to Xiaomi's harness. +M=/var/lib/mimo +[ -f "$M/ready" ] && exit 0 +chmod 700 "$M" +fail() { echo "setup: $*" >&2; exit 1; } +# the answer-leak blocklist (mimoagent), applied to /etc/hosts by the agent right after it installs +write_blocklist() { cp "$M/files/blocklist" "$M/blocklist"; } + +# Code: mimoagent environments/datasets/opensource_code.py + base.py, as the explorer runs it (app/runner/domains.py Code). +CWD=/testbed +git config --global --add safe.directory "$CWD" +cd "$CWD" || fail "no working directory $CWD" +if ! git rev-parse --git-dir >/dev/null 2>&1; then # a bare source tree: give it a baseline commit + git init -q && git add -A && git -c user.name=mimo -c user.email=mimo@localhost commit -q -m baseline --allow-empty +fi +BASE=$(git rev-parse HEAD 2>/dev/null) +[ ${#BASE} -eq 40 ] || fail "could not resolve the base commit in $CWD" +echo "$BASE" > "$M/base" +# Images are built with history truncated at the base. If one is not, the fix could be read out of git log, +# so .git is hidden while the agent works and put back for grading. +LATER=$(git rev-list --all --not "$BASE" 2>/dev/null | head -n 5 | grep -c . || true) +rm -f /tmp/fail.log /tmp/pass.log /tmp/patch.diff /tmp/test_patch.diff /tmp/*.log 2>/dev/null; rm -rf /tmp/claude-0 /tmp/claude-* /tmp/testem-* /tmp/puppeteer_dev_chrome_profile-* 2>/dev/null; rm -f /tmp/test_files.json 2>/dev/null; rm -rf /tmp/jest_* /tmp/jest-* /tmp/build /tmp/build_env 2>/dev/null; rm -rf /tmp/pytest-of-root /tmp/pytest-* /tmp/.pytest_cache /tmp/__pycache__ 2>/dev/null; rm -rf /tmp/go-build* /tmp/standards /tmp/wordpress /tmp/zig-* /tmp/testbase /tmp/testbed 2>/dev/null; rm -f /tmp/tmp*.tmp /tmp/*.bak /tmp/expect* /tmp/butwas* 2>/dev/null; rm -rf /root/.cache/go-build 2>/dev/null; rm -rf /tests 2>/dev/null; find /logs -mindepth 1 -delete 2>/dev/null; mkdir -p /logs/agent /logs/verifier /logs/artifacts; chmod 777 /logs/agent /logs/verifier /logs/artifacts; find /var/log -type f -delete 2>/dev/null || true; rm -rf /var/lib/postgresql/*/*/log /var/lib/postgresql/*/*/pg_log 2>/dev/null || true; find /var/lib/mysql /var/lib/mongodb -type f -name '*.log' -delete 2>/dev/null || true; rm -rf /root/.npm/_logs /root/.babel.json /root/.pytest_cache 2>/dev/null || true; find / -maxdepth 4 -xdev -name task_description.md -path '*/.build_env/*' -delete 2>/dev/null || true; true +git clean -fdx --exclude=node_modules --exclude=bower_components --exclude=.husky --exclude=vendor --exclude=third_party --exclude=_deps --exclude=vcpkg_installed --exclude=.venv --exclude=venv --exclude=.gradle --exclude=target --exclude=.build --exclude=lib --exclude=.bundle --exclude=Manifest.toml --exclude=_build --exclude=.stack-work --exclude=dist-newstyle >/dev/null 2>&1 +find /root/.m2 -type f \( -name '*-SNAPSHOT.jar' -o -name '*-SNAPSHOT-sources.jar' -o -name '*-SNAPSHOT-tests.jar' -o -name '*-SNAPSHOT-test-sources.jar' \) -delete 2>/dev/null; rm -rf /root/.julia/compiled 2>/dev/null; rm -rf /root/.gradle/caches/build-cache-* /root/.gradle/daemon 2>/dev/null; rm -rf /root/.gradle/caches/*/scripts /root/.gradle/caches/jars-* 2>/dev/null; rm -rf /root/.cache/bazel 2>/dev/null; true +if [ "$LATER" -gt 0 ]; then + mv "$CWD/.git" "$M/git-hidden" + echo "history not truncated at ${BASE:0:12}: .git hidden while the agent works" +fi +write_blocklist + +touch "$M/ready" +echo "setup done" diff --git a/tasks/format-code-task-002684/tests/test.patch b/tasks/format-code-task-002684/tests/test.patch new file mode 100644 index 0000000000000000000000000000000000000000..71f5c64ff7280b369f2609e1a568a7ad65a38d92 --- /dev/null +++ b/tasks/format-code-task-002684/tests/test.patch @@ -0,0 +1,60 @@ +diff --git a/configuration/parse_test.go b/configuration/parse_test.go +index 34e1a3e..2823223 100644 +--- a/configuration/parse_test.go ++++ b/configuration/parse_test.go +@@ -15,11 +15,21 @@ func TestConfigParse(t *testing.T) { + file := setupCVEExcludeFile(t, "CVF-000\nCVF-123\nCVF-9999") + emptyFile := setupCVEExcludeFile(t, "") + lotsOfRandomNewlinesFile := setupCVEExcludeFile(t, "\n\nCVN-111\n\n\nCVN-123\nCVN-543\n\n") ++ fullLineCommentFile := setupCVEExcludeFile(t, "# This is a full-line comment\nCVN-111\nCVN-123") ++ inlineCommentFile := setupCVEExcludeFile(t, "CVN-123 # mitigated since we only use one method") ++ commentOnlyFile := setupCVEExcludeFile(t, "# comment one\n# comment two\n") ++ indentedCommentFile := setupCVEExcludeFile(t, " # indented comment line\nCVN-999") ++ readmeExampleFile := setupCVEExcludeFile(t, "# This vulnerability is coming from package xyz, we are ok with this for now\nCVN-111 \nCVN-123 # Mitigated the risk of this since we only use one method in this package and the affected code doesn't matter\nCVN-543") + dir, _ := ioutil.TempDir("", "prefix") + + defer os.Remove(file.Name()) + defer os.Remove(emptyFile.Name()) + defer os.Remove(lotsOfRandomNewlinesFile.Name()) ++ defer os.Remove(fullLineCommentFile.Name()) ++ defer os.Remove(inlineCommentFile.Name()) ++ defer os.Remove(commentOnlyFile.Name()) ++ defer os.Remove(indentedCommentFile.Name()) ++ defer os.Remove(readmeExampleFile.Name()) + defer os.Remove(dir) + + tests := map[string]struct { +@@ -43,6 +53,11 @@ func TestConfigParse(t *testing.T) { + "exclude vulnerabilities file not found doesn't matter": {args: []string{"-exclude-vulnerability-file=/blah-blah-doesnt-exists", "/tmp/go11.sum"}, expectedConfig: Configuration{CveList: types.CveListFlag{}, Path: "/tmp/go11.sum"}, expectedErr: nil}, + "exclude vulnerabilities passed as directory doesn't matter": {args: []string{"-exclude-vulnerability-file=" + dir, "/tmp/go12.sum"}, expectedConfig: Configuration{CveList: types.CveListFlag{}, Path: "/tmp/go12.sum"}, expectedErr: nil}, + "exclude vulnerabilities doesn't need to be passed if default value is used": {args: []string{"/tmp/go13.sum"}, expectedConfig: Configuration{CveList: types.CveListFlag{Cves: []string{"DEF-111", "DEF-222"}}, Path: "/tmp/go13.sum"}, expectedErr: nil}, ++ "exclude vulnerabilities with full line comment": {args: []string{"-exclude-vulnerability-file=" + fullLineCommentFile.Name(), "/tmp/go14.sum"}, expectedConfig: Configuration{CveList: types.CveListFlag{Cves: []string{"CVN-111", "CVN-123"}}, Path: "/tmp/go14.sum"}, expectedErr: nil}, ++ "exclude vulnerabilities with inline comment": {args: []string{"-exclude-vulnerability-file=" + inlineCommentFile.Name(), "/tmp/go15.sum"}, expectedConfig: Configuration{CveList: types.CveListFlag{Cves: []string{"CVN-123"}}, Path: "/tmp/go15.sum"}, expectedErr: nil}, ++ "exclude vulnerabilities file containing only comments": {args: []string{"-exclude-vulnerability-file=" + commentOnlyFile.Name(), "/tmp/go16.sum"}, expectedConfig: Configuration{CveList: types.CveListFlag{}, Path: "/tmp/go16.sum"}, expectedErr: nil}, ++ "exclude vulnerabilities with indented comment line": {args: []string{"-exclude-vulnerability-file=" + indentedCommentFile.Name(), "/tmp/go17.sum"}, expectedConfig: Configuration{CveList: types.CveListFlag{Cves: []string{"CVN-999"}}, Path: "/tmp/go17.sum"}, expectedErr: nil}, ++ "exclude vulnerabilities README example with mixed comments": {args: []string{"-exclude-vulnerability-file=" + readmeExampleFile.Name(), "/tmp/go18.sum"}, expectedConfig: Configuration{CveList: types.CveListFlag{Cves: []string{"CVN-111", "CVN-123", "CVN-543"}}, Path: "/tmp/go18.sum"}, expectedErr: nil}, + } + + for name, test := range tests { +diff --git a/test_commands.json b/test_commands.json +new file mode 100644 +index 0000000..59691a4 +--- /dev/null ++++ b/test_commands.json +@@ -0,0 +1,3 @@ ++{ ++ "test_commands": ["go test ./configuration/ -run TestConfigParse -v"] ++} +diff --git a/mimo_test_command.sh b/mimo_test_command.sh +new file mode 100755 +--- /dev/null ++++ b/mimo_test_command.sh +@@ -0,0 +1,8 @@ ++#!/usr/bin/env bash ++ ++set -uo pipefail ++cd /testbed ++rc=0 ++go test ./configuration/ -run TestConfigParse -v ++rc=$(( rc | $? )) ++exit $rc diff --git a/tasks/format-code-task-002684/tests/test.sh b/tasks/format-code-task-002684/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..78d886d03c647a9f6e56a38b7f8d5b725ccb288f --- /dev/null +++ b/tasks/format-code-task-002684/tests/test.sh @@ -0,0 +1,39 @@ +#!/bin/bash +# Code grading, mimoagent opensource_code.py: reset the files the hidden test patch touches, apply it, run the +# task's test command; reward 1 when it exits 0. A testbed failure (reset or apply) writes no reward: not scored. +M=/var/lib/mimo +CWD=/testbed +V=/logs/verifier +mkdir -p "$V" +BASE=$(cat "$M/base" 2>/dev/null) || { echo "setup never ran (no $M/base)" >&2; exit 1; } +cd "$CWD" || exit 1 +if [ -d "$M/git-hidden" ]; then rm -rf "$CWD/.git"; mv "$M/git-hidden" "$CWD/.git"; fi +# the agent's change against the base, so its own commits count too +git add -A >/dev/null 2>&1 && git -c core.fileMode=false diff --cached "$BASE" > "$V/agent.diff" +git reset -q +if ! ( +while IFS= read -r tf; do + [ -z "$tf" ] && continue + if git cat-file -e $BASE:"$tf" 2>/dev/null; then + git checkout $BASE -- "$tf" 2>/dev/null || true + else + git rm -f --cached "$tf" >/dev/null 2>&1 || true + rm -f "$tf" + fi +done <<'EOF_RESET_TEST_FILES' +configuration/parse_test.go +test_commands.json +mimo_test_command.sh +EOF_RESET_TEST_FILES + +); then echo "could not reset the test files (testbed problem, not scored)" >&2; exit 1; fi +if ! git apply --verbose /tests/test.patch > "$V/apply.log" 2>&1; then + cat "$V/apply.log" >&2 + echo "the hidden tests could not be applied (testbed problem, not scored)" >&2 + exit 1 +fi +timeout 1800 sh -c "$(cat /tests/test_command.sh)" > "$V/test_output.log" 2>&1 +RC=$? +tail -c 12000 "$V/test_output.log" +if [ $RC -eq 0 ]; then echo 1 > "$V/reward.txt"; else echo 0 > "$V/reward.txt"; fi +echo "test command exited $RC" diff --git a/tasks/format-code-task-002684/tests/test_command.sh b/tasks/format-code-task-002684/tests/test_command.sh new file mode 100644 index 0000000000000000000000000000000000000000..7cb23076694ad17d72e8296d62b2b240083e36db --- /dev/null +++ b/tasks/format-code-task-002684/tests/test_command.sh @@ -0,0 +1 @@ +bash /testbed/mimo_test_command.sh \ No newline at end of file diff --git a/tasks/format-code-task-002690/environment/Dockerfile b/tasks/format-code-task-002690/environment/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..4294e4420ddeeb5d12809b54c4e2022a899237df --- /dev/null +++ b/tasks/format-code-task-002690/environment/Dockerfile @@ -0,0 +1,3 @@ +# The task's image, pinned by digest (the same as [environment].docker_image). +# Setup runs at start from [environment.healthcheck]; environment/setup/ is its readable copy. +FROM docker.io/xiaomimimo/mimo-v2.6-rl-oss@sha256:d245c4d472078888149a2e36f22c5b1fc2524ec2f27b843fdb884fe513beb82b diff --git a/tasks/format-code-task-002690/environment/setup/files/blocklist b/tasks/format-code-task-002690/environment/setup/files/blocklist new file mode 100644 index 0000000000000000000000000000000000000000..a8e4bdc4c7d9b739c047a3cb58ea72a1bb05bcbc --- /dev/null +++ b/tasks/format-code-task-002690/environment/setup/files/blocklist @@ -0,0 +1,33 @@ +# mimo answer-leak blocklist (mimoagent) +0.0.0.0 github.com +0.0.0.0 www.github.com +0.0.0.0 api.github.com +0.0.0.0 raw.githubusercontent.com +0.0.0.0 codeload.github.com +0.0.0.0 objects.githubusercontent.com +0.0.0.0 gist.github.com +0.0.0.0 gist.githubusercontent.com +0.0.0.0 gitlab.com +0.0.0.0 bitbucket.org +0.0.0.0 sourceforge.net +0.0.0.0 git.kernel.org +0.0.0.0 chromium.googlesource.com +0.0.0.0 android.googlesource.com +0.0.0.0 sourcegraph.com +0.0.0.0 bugs.chromium.org +0.0.0.0 issues.oss-fuzz.com +0.0.0.0 oss-fuzz.com +0.0.0.0 osv.dev +0.0.0.0 api.osv.dev +0.0.0.0 bugzilla.mozilla.org +0.0.0.0 proxy.golang.org +0.0.0.0 sum.golang.org +0.0.0.0 pkg.go.dev +0.0.0.0 google.com +0.0.0.0 www.google.com +0.0.0.0 bing.com +0.0.0.0 www.bing.com +0.0.0.0 duckduckgo.com +0.0.0.0 html.duckduckgo.com +0.0.0.0 search.brave.com +0.0.0.0 stackoverflow.com diff --git a/tasks/format-code-task-002690/environment/setup/setup.sh b/tasks/format-code-task-002690/environment/setup/setup.sh new file mode 100644 index 0000000000000000000000000000000000000000..d883db90cfcfb48f7a139861bbe9f6b5d95cad6f --- /dev/null +++ b/tasks/format-code-task-002690/environment/setup/setup.sh @@ -0,0 +1,34 @@ +#!/bin/bash +# Runs once, as root, before the agent starts: Harbor's [environment.healthcheck] unpacks this folder into +# /var/lib/mimo and runs it. Generated by mimo_harbor; see its README for how each step maps to Xiaomi's harness. +M=/var/lib/mimo +[ -f "$M/ready" ] && exit 0 +chmod 700 "$M" +fail() { echo "setup: $*" >&2; exit 1; } +# the answer-leak blocklist (mimoagent), applied to /etc/hosts by the agent right after it installs +write_blocklist() { cp "$M/files/blocklist" "$M/blocklist"; } + +# Code: mimoagent environments/datasets/opensource_code.py + base.py, as the explorer runs it (app/runner/domains.py Code). +CWD=/testbed +git config --global --add safe.directory "$CWD" +cd "$CWD" || fail "no working directory $CWD" +if ! git rev-parse --git-dir >/dev/null 2>&1; then # a bare source tree: give it a baseline commit + git init -q && git add -A && git -c user.name=mimo -c user.email=mimo@localhost commit -q -m baseline --allow-empty +fi +BASE=$(git rev-parse HEAD 2>/dev/null) +[ ${#BASE} -eq 40 ] || fail "could not resolve the base commit in $CWD" +echo "$BASE" > "$M/base" +# Images are built with history truncated at the base. If one is not, the fix could be read out of git log, +# so .git is hidden while the agent works and put back for grading. +LATER=$(git rev-list --all --not "$BASE" 2>/dev/null | head -n 5 | grep -c . || true) +rm -f /tmp/fail.log /tmp/pass.log /tmp/patch.diff /tmp/test_patch.diff /tmp/*.log 2>/dev/null; rm -rf /tmp/claude-0 /tmp/claude-* /tmp/testem-* /tmp/puppeteer_dev_chrome_profile-* 2>/dev/null; rm -f /tmp/test_files.json 2>/dev/null; rm -rf /tmp/jest_* /tmp/jest-* /tmp/build /tmp/build_env 2>/dev/null; rm -rf /tmp/pytest-of-root /tmp/pytest-* /tmp/.pytest_cache /tmp/__pycache__ 2>/dev/null; rm -rf /tmp/go-build* /tmp/standards /tmp/wordpress /tmp/zig-* /tmp/testbase /tmp/testbed 2>/dev/null; rm -f /tmp/tmp*.tmp /tmp/*.bak /tmp/expect* /tmp/butwas* 2>/dev/null; rm -rf /root/.cache/go-build 2>/dev/null; rm -rf /tests 2>/dev/null; find /logs -mindepth 1 -delete 2>/dev/null; mkdir -p /logs/agent /logs/verifier /logs/artifacts; chmod 777 /logs/agent /logs/verifier /logs/artifacts; find /var/log -type f -delete 2>/dev/null || true; rm -rf /var/lib/postgresql/*/*/log /var/lib/postgresql/*/*/pg_log 2>/dev/null || true; find /var/lib/mysql /var/lib/mongodb -type f -name '*.log' -delete 2>/dev/null || true; rm -rf /root/.npm/_logs /root/.babel.json /root/.pytest_cache 2>/dev/null || true; find / -maxdepth 4 -xdev -name task_description.md -path '*/.build_env/*' -delete 2>/dev/null || true; true +git clean -fdx --exclude=node_modules --exclude=bower_components --exclude=.husky --exclude=vendor --exclude=third_party --exclude=_deps --exclude=vcpkg_installed --exclude=.venv --exclude=venv --exclude=.gradle --exclude=target --exclude=.build --exclude=lib --exclude=.bundle --exclude=Manifest.toml --exclude=_build --exclude=.stack-work --exclude=dist-newstyle >/dev/null 2>&1 +find /root/.m2 -type f \( -name '*-SNAPSHOT.jar' -o -name '*-SNAPSHOT-sources.jar' -o -name '*-SNAPSHOT-tests.jar' -o -name '*-SNAPSHOT-test-sources.jar' \) -delete 2>/dev/null; rm -rf /root/.julia/compiled 2>/dev/null; rm -rf /root/.gradle/caches/build-cache-* /root/.gradle/daemon 2>/dev/null; rm -rf /root/.gradle/caches/*/scripts /root/.gradle/caches/jars-* 2>/dev/null; rm -rf /root/.cache/bazel 2>/dev/null; true +if [ "$LATER" -gt 0 ]; then + mv "$CWD/.git" "$M/git-hidden" + echo "history not truncated at ${BASE:0:12}: .git hidden while the agent works" +fi +write_blocklist + +touch "$M/ready" +echo "setup done" diff --git a/tasks/format-code-task-002690/tests/test.patch b/tasks/format-code-task-002690/tests/test.patch new file mode 100644 index 0000000000000000000000000000000000000000..0406ee82b9b0f508be33cf69f6bc374f34e64a13 --- /dev/null +++ b/tasks/format-code-task-002690/tests/test.patch @@ -0,0 +1,168 @@ +diff --git a/client/shared/src/api/extension/test/extensionHost.logging.test.ts b/client/shared/src/api/extension/test/extensionHost.logging.test.ts +new file mode 100644 +index 00000000000..51b71b60518 +--- /dev/null ++++ b/client/shared/src/api/extension/test/extensionHost.logging.test.ts +@@ -0,0 +1,129 @@ ++import { proxy } from 'comlink' ++import { BehaviorSubject } from 'rxjs' ++ ++import { SettingsCascade } from '../../../settings/settings' ++import { MainThreadAPI } from '../../contract' ++import { pretendRemote } from '../../util' ++import { proxySubscribable } from '../api/common' ++import { createExtensionAPI } from '../extensionApi' ++import { createExtensionHostAPI } from '../extensionHostApi' ++import { createExtensionHostState } from '../extensionHostState' ++ ++const settingsCascade = (final: Record): SettingsCascade => ({ ++ subjects: [], ++ final, ++}) ++ ++interface SetupResult { ++ logExtensionMessage: jest.Mock ++ extensionHostAPI: ReturnType ++ extensionAPI: ReturnType ++} ++ ++function setup(extensionID: string | undefined, final: Record): SetupResult { ++ const logExtensionMessage = jest.fn() ++ ++ const mainAPI = pretendRemote({ ++ getScriptURLForExtension: proxy(() => undefined), ++ getEnabledExtensions: () => proxySubscribable(new BehaviorSubject([])), ++ logExtensionMessage, ++ }) ++ ++ const state = createExtensionHostState( ++ { initialSettings: settingsCascade(final), clientApplication: 'sourcegraph' }, ++ mainAPI ++ ) ++ const extensionHostAPI = createExtensionHostAPI(state) ++ const extensionAPI = createExtensionAPI(state, mainAPI, extensionID) ++ ++ return { logExtensionMessage, extensionHostAPI, extensionAPI } ++} ++ ++describe('ExtensionHost: app.log', () => { ++ test('app.log is a callable function', () => { ++ const { extensionAPI } = setup('my-extension', { 'extensions.activeLoggers': ['my-extension'] }) ++ expect(typeof extensionAPI.app.log).toBe('function') ++ }) ++ ++ test('forwards the message to the main thread when the extension is an active logger', () => { ++ const { extensionAPI, logExtensionMessage } = setup('my-extension', { ++ 'extensions.activeLoggers': ['my-extension'], ++ }) ++ ++ extensionAPI.app.log('hello', 42) ++ ++ expect(logExtensionMessage).toHaveBeenCalledTimes(1) ++ const args = logExtensionMessage.mock.calls[0] ++ ++ expect(args.slice(-2)).toEqual(['hello', 42]) ++ ++ expect(args.some(argument => typeof argument === 'string' && argument.includes('my-extension'))).toBe(true) ++ }) ++ ++ test('does not forward when the extension is not an active logger', () => { ++ const { extensionAPI, logExtensionMessage } = setup('my-extension', { ++ 'extensions.activeLoggers': ['some-other-extension'], ++ }) ++ ++ extensionAPI.app.log('hello') ++ ++ expect(logExtensionMessage).not.toHaveBeenCalled() ++ }) ++ ++ test('does not forward when there are no active loggers configured', () => { ++ const { extensionAPI, logExtensionMessage } = setup('my-extension', {}) ++ ++ extensionAPI.app.log('hello') ++ ++ expect(logExtensionMessage).not.toHaveBeenCalled() ++ }) ++ ++ test('does not throw and does not forward when activeLoggers is not an array', () => { ++ const { extensionAPI, logExtensionMessage } = setup('my-extension', { ++ 'extensions.activeLoggers': 'my-extension', ++ }) ++ ++ expect(() => extensionAPI.app.log('hello')).not.toThrow() ++ expect(logExtensionMessage).not.toHaveBeenCalled() ++ }) ++ ++ test('gating reflects settings changes at runtime', () => { ++ const { extensionAPI, extensionHostAPI, logExtensionMessage } = setup('my-extension', { ++ 'extensions.activeLoggers': [], ++ }) ++ ++ ++ extensionAPI.app.log('first') ++ expect(logExtensionMessage).not.toHaveBeenCalled() ++ ++ ++ extensionHostAPI.syncSettingsData({ subjects: [], final: { 'extensions.activeLoggers': ['my-extension'] } }) ++ extensionAPI.app.log('second') ++ expect(logExtensionMessage).toHaveBeenCalledTimes(1) ++ expect(logExtensionMessage.mock.calls[0].slice(-1)).toEqual(['second']) ++ ++ ++ extensionHostAPI.syncSettingsData({ subjects: [], final: { 'extensions.activeLoggers': [] } }) ++ extensionAPI.app.log('third') ++ expect(logExtensionMessage).toHaveBeenCalledTimes(1) ++ }) ++ ++ test('only forwards for the bound extension ID', () => { ++ const { extensionAPI, logExtensionMessage } = setup('extension-a', { ++ 'extensions.activeLoggers': ['extension-b'], ++ }) ++ ++ extensionAPI.app.log('hello') ++ expect(logExtensionMessage).not.toHaveBeenCalled() ++ }) ++ ++ test('log is a safe no-op when constructed without an extension ID', () => { ++ const { extensionAPI, logExtensionMessage } = setup(undefined, { ++ 'extensions.activeLoggers': ['my-extension'], ++ }) ++ ++ expect(typeof extensionAPI.app.log).toBe('function') ++ expect(() => extensionAPI.app.log('hello')).not.toThrow() ++ expect(logExtensionMessage).not.toHaveBeenCalled() ++ }) ++}) +diff --git a/mimo_test_command.sh b/mimo_test_command.sh +new file mode 100755 +--- /dev/null ++++ b/mimo_test_command.sh +@@ -0,0 +1,28 @@ ++#!/usr/bin/env bash ++ ++ ++ ++ ++set -euo pipefail ++HERE="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" ++cd /testbed ++ ++ ++ ++ ++ ++ ++ ++ ++node_modules/.bin/jest --config client/shared/jest.config.js \ ++ client/shared/src/api/extension/test/extensionHost.configuration.test.ts \ ++ client/shared/src/api/extension/test/extensionHost.decorations.test.ts \ ++ client/shared/src/api/extension/test/extensionHost.documentHighlights.test.ts \ ++ client/shared/src/api/extension/test/extensionHost.hover.test.ts \ ++ client/shared/src/api/extension/test/extensionHost.search.test.ts \ ++ client/shared/src/api/extension/test/extensionHost.providers.test.ts \ ++ client/shared/src/api/extension/test/activation.test.ts ++ ++ ++node_modules/.bin/jest --config client/shared/jest.config.js \ ++ client/shared/src/api/extension/test/extensionHost.logging.test.ts diff --git a/tasks/format-code-task-002690/tests/test.sh b/tasks/format-code-task-002690/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..1340406d39c081e293fea4ec021c2970956b0846 --- /dev/null +++ b/tasks/format-code-task-002690/tests/test.sh @@ -0,0 +1,38 @@ +#!/bin/bash +# Code grading, mimoagent opensource_code.py: reset the files the hidden test patch touches, apply it, run the +# task's test command; reward 1 when it exits 0. A testbed failure (reset or apply) writes no reward: not scored. +M=/var/lib/mimo +CWD=/testbed +V=/logs/verifier +mkdir -p "$V" +BASE=$(cat "$M/base" 2>/dev/null) || { echo "setup never ran (no $M/base)" >&2; exit 1; } +cd "$CWD" || exit 1 +if [ -d "$M/git-hidden" ]; then rm -rf "$CWD/.git"; mv "$M/git-hidden" "$CWD/.git"; fi +# the agent's change against the base, so its own commits count too +git add -A >/dev/null 2>&1 && git -c core.fileMode=false diff --cached "$BASE" > "$V/agent.diff" +git reset -q +if ! ( +while IFS= read -r tf; do + [ -z "$tf" ] && continue + if git cat-file -e $BASE:"$tf" 2>/dev/null; then + git checkout $BASE -- "$tf" 2>/dev/null || true + else + git rm -f --cached "$tf" >/dev/null 2>&1 || true + rm -f "$tf" + fi +done <<'EOF_RESET_TEST_FILES' +client/shared/src/api/extension/test/extensionHost.logging.test.ts +mimo_test_command.sh +EOF_RESET_TEST_FILES + +); then echo "could not reset the test files (testbed problem, not scored)" >&2; exit 1; fi +if ! git apply --verbose /tests/test.patch > "$V/apply.log" 2>&1; then + cat "$V/apply.log" >&2 + echo "the hidden tests could not be applied (testbed problem, not scored)" >&2 + exit 1 +fi +timeout 1800 sh -c "$(cat /tests/test_command.sh)" > "$V/test_output.log" 2>&1 +RC=$? +tail -c 12000 "$V/test_output.log" +if [ $RC -eq 0 ]; then echo 1 > "$V/reward.txt"; else echo 0 > "$V/reward.txt"; fi +echo "test command exited $RC" diff --git a/tasks/format-code-task-002690/tests/test_command.sh b/tasks/format-code-task-002690/tests/test_command.sh new file mode 100644 index 0000000000000000000000000000000000000000..7cb23076694ad17d72e8296d62b2b240083e36db --- /dev/null +++ b/tasks/format-code-task-002690/tests/test_command.sh @@ -0,0 +1 @@ +bash /testbed/mimo_test_command.sh \ No newline at end of file diff --git a/tasks/format-code-task-002697/environment/Dockerfile b/tasks/format-code-task-002697/environment/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..330cafc590d570736e7d8e8c73679dc410a0d738 --- /dev/null +++ b/tasks/format-code-task-002697/environment/Dockerfile @@ -0,0 +1,3 @@ +# The task's image, pinned by digest (the same as [environment].docker_image). +# Setup runs at start from [environment.healthcheck]; environment/setup/ is its readable copy. +FROM docker.io/xiaomimimo/mimo-v2.6-rl-oss@sha256:1cae3b21ce0c250b84362e74cd8c31dc80d75a4942bbda3fc686d9350ccee4cd diff --git a/tasks/format-code-task-002697/environment/setup/files/blocklist b/tasks/format-code-task-002697/environment/setup/files/blocklist new file mode 100644 index 0000000000000000000000000000000000000000..a8e4bdc4c7d9b739c047a3cb58ea72a1bb05bcbc --- /dev/null +++ b/tasks/format-code-task-002697/environment/setup/files/blocklist @@ -0,0 +1,33 @@ +# mimo answer-leak blocklist (mimoagent) +0.0.0.0 github.com +0.0.0.0 www.github.com +0.0.0.0 api.github.com +0.0.0.0 raw.githubusercontent.com +0.0.0.0 codeload.github.com +0.0.0.0 objects.githubusercontent.com +0.0.0.0 gist.github.com +0.0.0.0 gist.githubusercontent.com +0.0.0.0 gitlab.com +0.0.0.0 bitbucket.org +0.0.0.0 sourceforge.net +0.0.0.0 git.kernel.org +0.0.0.0 chromium.googlesource.com +0.0.0.0 android.googlesource.com +0.0.0.0 sourcegraph.com +0.0.0.0 bugs.chromium.org +0.0.0.0 issues.oss-fuzz.com +0.0.0.0 oss-fuzz.com +0.0.0.0 osv.dev +0.0.0.0 api.osv.dev +0.0.0.0 bugzilla.mozilla.org +0.0.0.0 proxy.golang.org +0.0.0.0 sum.golang.org +0.0.0.0 pkg.go.dev +0.0.0.0 google.com +0.0.0.0 www.google.com +0.0.0.0 bing.com +0.0.0.0 www.bing.com +0.0.0.0 duckduckgo.com +0.0.0.0 html.duckduckgo.com +0.0.0.0 search.brave.com +0.0.0.0 stackoverflow.com diff --git a/tasks/format-code-task-002697/environment/setup/setup.sh b/tasks/format-code-task-002697/environment/setup/setup.sh new file mode 100644 index 0000000000000000000000000000000000000000..d883db90cfcfb48f7a139861bbe9f6b5d95cad6f --- /dev/null +++ b/tasks/format-code-task-002697/environment/setup/setup.sh @@ -0,0 +1,34 @@ +#!/bin/bash +# Runs once, as root, before the agent starts: Harbor's [environment.healthcheck] unpacks this folder into +# /var/lib/mimo and runs it. Generated by mimo_harbor; see its README for how each step maps to Xiaomi's harness. +M=/var/lib/mimo +[ -f "$M/ready" ] && exit 0 +chmod 700 "$M" +fail() { echo "setup: $*" >&2; exit 1; } +# the answer-leak blocklist (mimoagent), applied to /etc/hosts by the agent right after it installs +write_blocklist() { cp "$M/files/blocklist" "$M/blocklist"; } + +# Code: mimoagent environments/datasets/opensource_code.py + base.py, as the explorer runs it (app/runner/domains.py Code). +CWD=/testbed +git config --global --add safe.directory "$CWD" +cd "$CWD" || fail "no working directory $CWD" +if ! git rev-parse --git-dir >/dev/null 2>&1; then # a bare source tree: give it a baseline commit + git init -q && git add -A && git -c user.name=mimo -c user.email=mimo@localhost commit -q -m baseline --allow-empty +fi +BASE=$(git rev-parse HEAD 2>/dev/null) +[ ${#BASE} -eq 40 ] || fail "could not resolve the base commit in $CWD" +echo "$BASE" > "$M/base" +# Images are built with history truncated at the base. If one is not, the fix could be read out of git log, +# so .git is hidden while the agent works and put back for grading. +LATER=$(git rev-list --all --not "$BASE" 2>/dev/null | head -n 5 | grep -c . || true) +rm -f /tmp/fail.log /tmp/pass.log /tmp/patch.diff /tmp/test_patch.diff /tmp/*.log 2>/dev/null; rm -rf /tmp/claude-0 /tmp/claude-* /tmp/testem-* /tmp/puppeteer_dev_chrome_profile-* 2>/dev/null; rm -f /tmp/test_files.json 2>/dev/null; rm -rf /tmp/jest_* /tmp/jest-* /tmp/build /tmp/build_env 2>/dev/null; rm -rf /tmp/pytest-of-root /tmp/pytest-* /tmp/.pytest_cache /tmp/__pycache__ 2>/dev/null; rm -rf /tmp/go-build* /tmp/standards /tmp/wordpress /tmp/zig-* /tmp/testbase /tmp/testbed 2>/dev/null; rm -f /tmp/tmp*.tmp /tmp/*.bak /tmp/expect* /tmp/butwas* 2>/dev/null; rm -rf /root/.cache/go-build 2>/dev/null; rm -rf /tests 2>/dev/null; find /logs -mindepth 1 -delete 2>/dev/null; mkdir -p /logs/agent /logs/verifier /logs/artifacts; chmod 777 /logs/agent /logs/verifier /logs/artifacts; find /var/log -type f -delete 2>/dev/null || true; rm -rf /var/lib/postgresql/*/*/log /var/lib/postgresql/*/*/pg_log 2>/dev/null || true; find /var/lib/mysql /var/lib/mongodb -type f -name '*.log' -delete 2>/dev/null || true; rm -rf /root/.npm/_logs /root/.babel.json /root/.pytest_cache 2>/dev/null || true; find / -maxdepth 4 -xdev -name task_description.md -path '*/.build_env/*' -delete 2>/dev/null || true; true +git clean -fdx --exclude=node_modules --exclude=bower_components --exclude=.husky --exclude=vendor --exclude=third_party --exclude=_deps --exclude=vcpkg_installed --exclude=.venv --exclude=venv --exclude=.gradle --exclude=target --exclude=.build --exclude=lib --exclude=.bundle --exclude=Manifest.toml --exclude=_build --exclude=.stack-work --exclude=dist-newstyle >/dev/null 2>&1 +find /root/.m2 -type f \( -name '*-SNAPSHOT.jar' -o -name '*-SNAPSHOT-sources.jar' -o -name '*-SNAPSHOT-tests.jar' -o -name '*-SNAPSHOT-test-sources.jar' \) -delete 2>/dev/null; rm -rf /root/.julia/compiled 2>/dev/null; rm -rf /root/.gradle/caches/build-cache-* /root/.gradle/daemon 2>/dev/null; rm -rf /root/.gradle/caches/*/scripts /root/.gradle/caches/jars-* 2>/dev/null; rm -rf /root/.cache/bazel 2>/dev/null; true +if [ "$LATER" -gt 0 ]; then + mv "$CWD/.git" "$M/git-hidden" + echo "history not truncated at ${BASE:0:12}: .git hidden while the agent works" +fi +write_blocklist + +touch "$M/ready" +echo "setup done" diff --git a/tasks/format-code-task-002697/tests/test.patch b/tasks/format-code-task-002697/tests/test.patch new file mode 100644 index 0000000000000000000000000000000000000000..f104e9f73c9d5ca35db38817cd88dd998048038d --- /dev/null +++ b/tasks/format-code-task-002697/tests/test.patch @@ -0,0 +1,301 @@ +diff --git a/starfish/test/image/test_apply.py b/starfish/test/image/test_apply.py +index ebbc75a7..7388bda1 100644 +--- a/starfish/test/image/test_apply.py ++++ b/starfish/test/image/test_apply.py +@@ -3,6 +3,7 @@ import copy + import numpy as np + + from starfish.imagestack.imagestack import ImageStack ++from starfish.types import Indices + from starfish.util.synthesize import SyntheticData + + +@@ -10,6 +11,33 @@ def divide(array, value): + return array / value + + ++def _small_distinct_stack(): ++ data = np.linspace(0, 1, num=2 * 3 * 2 * 4 * 5, dtype=np.float32).reshape(2, 3, 2, 4, 5) ++ return ImageStack.from_numpy_array(data), data.copy() ++ ++ ++def _axis_size(stack, axis): ++ return stack.xarray.sizes[axis.value] ++ ++ ++def add_block_size(array): ++ return array + array.size ++ ++ ++def test_apply_accepts_axis_subset_for_2d_planes(): ++ stack, original = _small_distinct_stack() ++ ++ output = stack.apply( ++ add_block_size, ++ split_by={Indices.Y.value, Indices.X.value}, ++ n_processes=1, ++ ) ++ ++ expected_size = _axis_size(stack, Indices.Y) * _axis_size(stack, Indices.X) ++ np.testing.assert_array_equal(output.xarray.values, original + expected_size) ++ np.testing.assert_array_equal(stack.xarray.values, original) ++ ++ + def test_apply(): + """test that apply correctly applies a simple function across 2d tiles of a Stack""" + stack = ImageStack.synthetic_stack() +@@ -20,10 +48,31 @@ def test_apply(): + + def test_apply_3d(): + """test that apply correctly applies a simple function across 3d volumes of a Stack""" +- stack = ImageStack.synthetic_stack() +- assert np.all(stack.xarray == 1) +- output = stack.apply(divide, value=4, is_volume=True) +- assert (output.xarray == 0.25).all() ++ stack, original = _small_distinct_stack() ++ ++ output = stack.apply( ++ add_block_size, ++ split_by={Indices.Z.value, Indices.Y.value, Indices.X.value}, ++ n_processes=1, ++ ) ++ ++ expected_size = ( ++ _axis_size(stack, Indices.Z) ++ * _axis_size(stack, Indices.Y) ++ * _axis_size(stack, Indices.X) ++ ) ++ np.testing.assert_array_equal(output.xarray.values, original + expected_size) ++ np.testing.assert_array_equal(stack.xarray.values, original) ++ ++ ++def test_apply_accepts_non_tile_axis_subset(): ++ stack, original = _small_distinct_stack() ++ ++ output = stack.apply(add_block_size, split_by={Indices.CH.value}, n_processes=1) ++ ++ expected_size = _axis_size(stack, Indices.CH) ++ np.testing.assert_array_equal(output.xarray.values, original + expected_size) ++ np.testing.assert_array_equal(stack.xarray.values, original) + + + def test_apply_labeled_dataset(): +diff --git a/starfish/test/image/test_apply_split_by_filter_compat.py b/starfish/test/image/test_apply_split_by_filter_compat.py +new file mode 100644 +index 00000000..fb45c5b1 +--- /dev/null ++++ b/starfish/test/image/test_apply_split_by_filter_compat.py +@@ -0,0 +1,151 @@ ++import numpy as np ++import pytest ++ ++from starfish.image._filter.bandpass import Bandpass ++from starfish.image._filter.clip import Clip ++from starfish.image._filter.gaussian_high_pass import GaussianHighPass ++from starfish.image._filter.gaussian_low_pass import GaussianLowPass ++from starfish.image._filter.mean_high_pass import MeanHighPass ++from starfish.image._filter.richardson_lucy_deconvolution import DeconvolvePSF ++from starfish.image._filter.scale_by_percentile import ScaleByPercentile ++from starfish.image._filter.white_tophat import WhiteTophat ++from starfish.imagestack.imagestack import ImageStack ++from starfish.types import Indices ++ ++ ++def _new_distinct_stack(): ++ data = np.linspace(0, 1, num=2 * 2 * 2 * 8 * 8, dtype=np.float32).reshape(2, 2, 2, 8, 8) ++ return ImageStack.from_numpy_array(data), data.copy() ++ ++ ++def _new_percentile_stack(): ++ shape = (2, 2, 2, 5, 5) ++ data = np.zeros(shape, dtype=np.float32) ++ stack = ImageStack.from_numpy_array(data.copy()) ++ ++ r_axis = stack.xarray.get_axis_num(Indices.ROUND.value) ++ c_axis = stack.xarray.get_axis_num(Indices.CH.value) ++ z_axis = stack.xarray.get_axis_num(Indices.Z.value) ++ y_axis = stack.xarray.get_axis_num(Indices.Y.value) ++ x_axis = stack.xarray.get_axis_num(Indices.X.value) ++ ++ for index in np.ndindex(shape): ++ r = index[r_axis] ++ c = index[c_axis] ++ z = index[z_axis] ++ y = index[y_axis] ++ x = index[x_axis] ++ ++ ++ data[index] = 1000 * r + 100 * c + 40 * z + 3 * y + x ++ ++ stack.xarray.values[...] = data ++ return stack, data ++ ++ ++def _clip_plane_wise_reference(data, stack, p_min, p_max): ++ result = np.empty_like(data) ++ r_axis = stack.xarray.get_axis_num(Indices.ROUND.value) ++ c_axis = stack.xarray.get_axis_num(Indices.CH.value) ++ z_axis = stack.xarray.get_axis_num(Indices.Z.value) ++ ++ for r in range(stack.xarray.sizes[Indices.ROUND.value]): ++ for c in range(stack.xarray.sizes[Indices.CH.value]): ++ for z in range(stack.xarray.sizes[Indices.Z.value]): ++ selector = [slice(None)] * data.ndim ++ selector[r_axis] = r ++ selector[c_axis] = c ++ selector[z_axis] = z ++ plane = data[tuple(selector)] ++ low, high = np.percentile(plane, [p_min, p_max]) ++ result[tuple(selector)] = np.clip(plane, low, high) ++ return result ++ ++ ++def _clip_volume_wise_reference(data, stack, p_min, p_max): ++ result = np.empty_like(data) ++ r_axis = stack.xarray.get_axis_num(Indices.ROUND.value) ++ c_axis = stack.xarray.get_axis_num(Indices.CH.value) ++ ++ for r in range(stack.xarray.sizes[Indices.ROUND.value]): ++ for c in range(stack.xarray.sizes[Indices.CH.value]): ++ selector = [slice(None)] * data.ndim ++ selector[r_axis] = r ++ selector[c_axis] = c ++ volume = data[tuple(selector)] ++ low, high = np.percentile(volume, [p_min, p_max]) ++ result[tuple(selector)] = np.clip(volume, low, high) ++ return result ++ ++ ++def _assert_same_logical_dimensions(before, after): ++ assert after.xarray.dims == before.xarray.dims ++ assert after.xarray.shape == before.xarray.shape ++ ++ ++def test_clip_is_volume_false_matches_plane_wise_percentile_clipping(): ++ stack, data = _new_percentile_stack() ++ p_min, p_max = 20, 80 ++ expected = _clip_plane_wise_reference(data, stack, p_min, p_max) ++ ++ result = Clip(p_min=p_min, p_max=p_max, is_volume=False).run(stack, n_processes=1) ++ ++ _assert_same_logical_dimensions(stack, result) ++ np.testing.assert_allclose(result.xarray.values, expected, rtol=1e-6, atol=1e-6) ++ ++ ++def test_clip_is_volume_true_matches_volume_wise_percentile_clipping(): ++ stack, data = _new_percentile_stack() ++ p_min, p_max = 20, 80 ++ expected_volume = _clip_volume_wise_reference(data, stack, p_min, p_max) ++ expected_plane = _clip_plane_wise_reference(data, stack, p_min, p_max) ++ ++ result = Clip(p_min=p_min, p_max=p_max, is_volume=True).run(stack, n_processes=1) ++ ++ assert not np.allclose(expected_volume, expected_plane) ++ _assert_same_logical_dimensions(stack, result) ++ np.testing.assert_allclose(result.xarray.values, expected_volume, rtol=1e-6, atol=1e-6) ++ ++ ++FILTER_FACTORIES = [ ++ lambda is_volume: Clip(p_min=10, p_max=90, is_volume=is_volume), ++ lambda is_volume: GaussianLowPass(sigma=1, is_volume=is_volume), ++ lambda is_volume: GaussianHighPass(sigma=1, is_volume=is_volume), ++ lambda is_volume: MeanHighPass(size=3, is_volume=is_volume), ++ lambda is_volume: ScaleByPercentile(p=95, is_volume=is_volume), ++ lambda is_volume: WhiteTophat(masking_radius=1, is_volume=is_volume), ++ lambda is_volume: Bandpass(lshort=1, llong=3, threshold=0.0, is_volume=is_volume), ++] ++ ++ ++@pytest.mark.parametrize("is_volume", [False, True]) ++@pytest.mark.parametrize("filter_factory", FILTER_FACTORIES) ++def test_modified_filters_accept_both_is_volume_modes(filter_factory, is_volume): ++ stack, _ = _new_distinct_stack() ++ filter_instance = filter_factory(is_volume) ++ ++ result = filter_instance.run(stack, n_processes=1) ++ ++ _assert_same_logical_dimensions(stack, result) ++ assert np.isfinite(result.xarray.values).all() ++ ++ ++def test_richardson_lucy_deconvolution_accepts_multiz_stack_with_2d_kernel(): ++ stack, data = _new_distinct_stack() ++ z_axis = stack.xarray.get_axis_num(Indices.Z.value) ++ ++ ++ ++ ++ result = DeconvolvePSF( ++ num_iter=2, ++ sigma=1, ++ ).run(stack, n_processes=1) ++ ++ _assert_same_logical_dimensions(stack, result) ++ assert np.isfinite(result.xarray.values).all() ++ assert not np.allclose(result.xarray.values, data) ++ ++ moved = np.moveaxis(result.xarray.values, z_axis, 0) ++ if moved.shape[0] > 1: ++ assert any(not np.allclose(moved[0], moved[z]) for z in range(1, moved.shape[0])) +diff --git a/mimo_test_command.sh b/mimo_test_command.sh +new file mode 100755 +--- /dev/null ++++ b/mimo_test_command.sh +@@ -0,0 +1,57 @@ ++#!/bin/bash ++set -uo pipefail ++cd /testbed ++ ++ ++ ++export PYTHONPATH=/testbed:${PYTHONPATH:-} ++ ++ ++ ++ ++ ++case "${1:-}" in ++ base) ++ python3 -c " ++import skimage.feature ++import skimage.registration ++import numpy as np ++if not hasattr(np, 'float'): ++ np.float = float ++if not hasattr(skimage.feature, 'register_translation'): ++ skimage.feature.register_translation = skimage.registration.phase_cross_correlation ++import pytest ++import sys ++sys.exit(pytest.main([ ++ '-q', ++ 'starfish/test/image/test_apply.py::test_apply', ++ 'starfish/test/image/test_apply.py::test_apply_labeled_dataset', ++ 'starfish/test/image/test_apply.py::test_apply_in_place', ++])) ++" ++ ;; ++ new) ++ python3 -c " ++import skimage.feature ++import skimage.registration ++import numpy as np ++if not hasattr(np, 'float'): ++ np.float = float ++if not hasattr(skimage.feature, 'register_translation'): ++ skimage.feature.register_translation = skimage.registration.phase_cross_correlation ++import pytest ++import sys ++sys.exit(pytest.main([ ++ '-q', ++ 'starfish/test/image/test_apply.py::test_apply_accepts_axis_subset_for_2d_planes', ++ 'starfish/test/image/test_apply.py::test_apply_3d', ++ 'starfish/test/image/test_apply.py::test_apply_accepts_non_tile_axis_subset', ++ 'starfish/test/image/test_apply_split_by_filter_compat.py', ++])) ++" ++ ;; ++ *) ++ echo "usage: $0 base|new" ++ exit 2 ++ ;; ++esac diff --git a/tasks/format-code-task-002697/tests/test.sh b/tasks/format-code-task-002697/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..c7e112303ca48661054cd39dbec29e762bcc8c90 --- /dev/null +++ b/tasks/format-code-task-002697/tests/test.sh @@ -0,0 +1,39 @@ +#!/bin/bash +# Code grading, mimoagent opensource_code.py: reset the files the hidden test patch touches, apply it, run the +# task's test command; reward 1 when it exits 0. A testbed failure (reset or apply) writes no reward: not scored. +M=/var/lib/mimo +CWD=/testbed +V=/logs/verifier +mkdir -p "$V" +BASE=$(cat "$M/base" 2>/dev/null) || { echo "setup never ran (no $M/base)" >&2; exit 1; } +cd "$CWD" || exit 1 +if [ -d "$M/git-hidden" ]; then rm -rf "$CWD/.git"; mv "$M/git-hidden" "$CWD/.git"; fi +# the agent's change against the base, so its own commits count too +git add -A >/dev/null 2>&1 && git -c core.fileMode=false diff --cached "$BASE" > "$V/agent.diff" +git reset -q +if ! ( +while IFS= read -r tf; do + [ -z "$tf" ] && continue + if git cat-file -e $BASE:"$tf" 2>/dev/null; then + git checkout $BASE -- "$tf" 2>/dev/null || true + else + git rm -f --cached "$tf" >/dev/null 2>&1 || true + rm -f "$tf" + fi +done <<'EOF_RESET_TEST_FILES' +starfish/test/image/test_apply.py +starfish/test/image/test_apply_split_by_filter_compat.py +mimo_test_command.sh +EOF_RESET_TEST_FILES + +); then echo "could not reset the test files (testbed problem, not scored)" >&2; exit 1; fi +if ! git apply --verbose /tests/test.patch > "$V/apply.log" 2>&1; then + cat "$V/apply.log" >&2 + echo "the hidden tests could not be applied (testbed problem, not scored)" >&2 + exit 1 +fi +timeout 1800 sh -c "$(cat /tests/test_command.sh)" > "$V/test_output.log" 2>&1 +RC=$? +tail -c 12000 "$V/test_output.log" +if [ $RC -eq 0 ]; then echo 1 > "$V/reward.txt"; else echo 0 > "$V/reward.txt"; fi +echo "test command exited $RC" diff --git a/tasks/format-code-task-002697/tests/test_command.sh b/tasks/format-code-task-002697/tests/test_command.sh new file mode 100644 index 0000000000000000000000000000000000000000..e8d2f32b64045b5a5a56e0ad5667da87d8e0bc2a --- /dev/null +++ b/tasks/format-code-task-002697/tests/test_command.sh @@ -0,0 +1 @@ +bash /testbed/mimo_test_command.sh base && bash /testbed/mimo_test_command.sh new \ No newline at end of file diff --git a/tasks/format-code-task-002699/environment/setup/files/blocklist b/tasks/format-code-task-002699/environment/setup/files/blocklist new file mode 100644 index 0000000000000000000000000000000000000000..a8e4bdc4c7d9b739c047a3cb58ea72a1bb05bcbc --- /dev/null +++ b/tasks/format-code-task-002699/environment/setup/files/blocklist @@ -0,0 +1,33 @@ +# mimo answer-leak blocklist (mimoagent) +0.0.0.0 github.com +0.0.0.0 www.github.com +0.0.0.0 api.github.com +0.0.0.0 raw.githubusercontent.com +0.0.0.0 codeload.github.com +0.0.0.0 objects.githubusercontent.com +0.0.0.0 gist.github.com +0.0.0.0 gist.githubusercontent.com +0.0.0.0 gitlab.com +0.0.0.0 bitbucket.org +0.0.0.0 sourceforge.net +0.0.0.0 git.kernel.org +0.0.0.0 chromium.googlesource.com +0.0.0.0 android.googlesource.com +0.0.0.0 sourcegraph.com +0.0.0.0 bugs.chromium.org +0.0.0.0 issues.oss-fuzz.com +0.0.0.0 oss-fuzz.com +0.0.0.0 osv.dev +0.0.0.0 api.osv.dev +0.0.0.0 bugzilla.mozilla.org +0.0.0.0 proxy.golang.org +0.0.0.0 sum.golang.org +0.0.0.0 pkg.go.dev +0.0.0.0 google.com +0.0.0.0 www.google.com +0.0.0.0 bing.com +0.0.0.0 www.bing.com +0.0.0.0 duckduckgo.com +0.0.0.0 html.duckduckgo.com +0.0.0.0 search.brave.com +0.0.0.0 stackoverflow.com diff --git a/tasks/format-code-task-002699/environment/setup/setup.sh b/tasks/format-code-task-002699/environment/setup/setup.sh new file mode 100644 index 0000000000000000000000000000000000000000..d883db90cfcfb48f7a139861bbe9f6b5d95cad6f --- /dev/null +++ b/tasks/format-code-task-002699/environment/setup/setup.sh @@ -0,0 +1,34 @@ +#!/bin/bash +# Runs once, as root, before the agent starts: Harbor's [environment.healthcheck] unpacks this folder into +# /var/lib/mimo and runs it. Generated by mimo_harbor; see its README for how each step maps to Xiaomi's harness. +M=/var/lib/mimo +[ -f "$M/ready" ] && exit 0 +chmod 700 "$M" +fail() { echo "setup: $*" >&2; exit 1; } +# the answer-leak blocklist (mimoagent), applied to /etc/hosts by the agent right after it installs +write_blocklist() { cp "$M/files/blocklist" "$M/blocklist"; } + +# Code: mimoagent environments/datasets/opensource_code.py + base.py, as the explorer runs it (app/runner/domains.py Code). +CWD=/testbed +git config --global --add safe.directory "$CWD" +cd "$CWD" || fail "no working directory $CWD" +if ! git rev-parse --git-dir >/dev/null 2>&1; then # a bare source tree: give it a baseline commit + git init -q && git add -A && git -c user.name=mimo -c user.email=mimo@localhost commit -q -m baseline --allow-empty +fi +BASE=$(git rev-parse HEAD 2>/dev/null) +[ ${#BASE} -eq 40 ] || fail "could not resolve the base commit in $CWD" +echo "$BASE" > "$M/base" +# Images are built with history truncated at the base. If one is not, the fix could be read out of git log, +# so .git is hidden while the agent works and put back for grading. +LATER=$(git rev-list --all --not "$BASE" 2>/dev/null | head -n 5 | grep -c . || true) +rm -f /tmp/fail.log /tmp/pass.log /tmp/patch.diff /tmp/test_patch.diff /tmp/*.log 2>/dev/null; rm -rf /tmp/claude-0 /tmp/claude-* /tmp/testem-* /tmp/puppeteer_dev_chrome_profile-* 2>/dev/null; rm -f /tmp/test_files.json 2>/dev/null; rm -rf /tmp/jest_* /tmp/jest-* /tmp/build /tmp/build_env 2>/dev/null; rm -rf /tmp/pytest-of-root /tmp/pytest-* /tmp/.pytest_cache /tmp/__pycache__ 2>/dev/null; rm -rf /tmp/go-build* /tmp/standards /tmp/wordpress /tmp/zig-* /tmp/testbase /tmp/testbed 2>/dev/null; rm -f /tmp/tmp*.tmp /tmp/*.bak /tmp/expect* /tmp/butwas* 2>/dev/null; rm -rf /root/.cache/go-build 2>/dev/null; rm -rf /tests 2>/dev/null; find /logs -mindepth 1 -delete 2>/dev/null; mkdir -p /logs/agent /logs/verifier /logs/artifacts; chmod 777 /logs/agent /logs/verifier /logs/artifacts; find /var/log -type f -delete 2>/dev/null || true; rm -rf /var/lib/postgresql/*/*/log /var/lib/postgresql/*/*/pg_log 2>/dev/null || true; find /var/lib/mysql /var/lib/mongodb -type f -name '*.log' -delete 2>/dev/null || true; rm -rf /root/.npm/_logs /root/.babel.json /root/.pytest_cache 2>/dev/null || true; find / -maxdepth 4 -xdev -name task_description.md -path '*/.build_env/*' -delete 2>/dev/null || true; true +git clean -fdx --exclude=node_modules --exclude=bower_components --exclude=.husky --exclude=vendor --exclude=third_party --exclude=_deps --exclude=vcpkg_installed --exclude=.venv --exclude=venv --exclude=.gradle --exclude=target --exclude=.build --exclude=lib --exclude=.bundle --exclude=Manifest.toml --exclude=_build --exclude=.stack-work --exclude=dist-newstyle >/dev/null 2>&1 +find /root/.m2 -type f \( -name '*-SNAPSHOT.jar' -o -name '*-SNAPSHOT-sources.jar' -o -name '*-SNAPSHOT-tests.jar' -o -name '*-SNAPSHOT-test-sources.jar' \) -delete 2>/dev/null; rm -rf /root/.julia/compiled 2>/dev/null; rm -rf /root/.gradle/caches/build-cache-* /root/.gradle/daemon 2>/dev/null; rm -rf /root/.gradle/caches/*/scripts /root/.gradle/caches/jars-* 2>/dev/null; rm -rf /root/.cache/bazel 2>/dev/null; true +if [ "$LATER" -gt 0 ]; then + mv "$CWD/.git" "$M/git-hidden" + echo "history not truncated at ${BASE:0:12}: .git hidden while the agent works" +fi +write_blocklist + +touch "$M/ready" +echo "setup done" diff --git a/tasks/format-code-task-002809/environment/Dockerfile b/tasks/format-code-task-002809/environment/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..ea3eb7e24dac10debec403b1509c84e113a16c4f --- /dev/null +++ b/tasks/format-code-task-002809/environment/Dockerfile @@ -0,0 +1,3 @@ +# The task's image, pinned by digest (the same as [environment].docker_image). +# Setup runs at start from [environment.healthcheck]; environment/setup/ is its readable copy. +FROM docker.io/xiaomimimo/mimo-v2.6-rl-oss@sha256:e71c7267f373b73f732d9a9b200e2226105322e51f7fba85a061fd2edbaeeb98 diff --git a/tasks/format-code-task-002809/environment/setup/files/blocklist b/tasks/format-code-task-002809/environment/setup/files/blocklist new file mode 100644 index 0000000000000000000000000000000000000000..a8e4bdc4c7d9b739c047a3cb58ea72a1bb05bcbc --- /dev/null +++ b/tasks/format-code-task-002809/environment/setup/files/blocklist @@ -0,0 +1,33 @@ +# mimo answer-leak blocklist (mimoagent) +0.0.0.0 github.com +0.0.0.0 www.github.com +0.0.0.0 api.github.com +0.0.0.0 raw.githubusercontent.com +0.0.0.0 codeload.github.com +0.0.0.0 objects.githubusercontent.com +0.0.0.0 gist.github.com +0.0.0.0 gist.githubusercontent.com +0.0.0.0 gitlab.com +0.0.0.0 bitbucket.org +0.0.0.0 sourceforge.net +0.0.0.0 git.kernel.org +0.0.0.0 chromium.googlesource.com +0.0.0.0 android.googlesource.com +0.0.0.0 sourcegraph.com +0.0.0.0 bugs.chromium.org +0.0.0.0 issues.oss-fuzz.com +0.0.0.0 oss-fuzz.com +0.0.0.0 osv.dev +0.0.0.0 api.osv.dev +0.0.0.0 bugzilla.mozilla.org +0.0.0.0 proxy.golang.org +0.0.0.0 sum.golang.org +0.0.0.0 pkg.go.dev +0.0.0.0 google.com +0.0.0.0 www.google.com +0.0.0.0 bing.com +0.0.0.0 www.bing.com +0.0.0.0 duckduckgo.com +0.0.0.0 html.duckduckgo.com +0.0.0.0 search.brave.com +0.0.0.0 stackoverflow.com diff --git a/tasks/format-code-task-002809/environment/setup/setup.sh b/tasks/format-code-task-002809/environment/setup/setup.sh new file mode 100644 index 0000000000000000000000000000000000000000..d883db90cfcfb48f7a139861bbe9f6b5d95cad6f --- /dev/null +++ b/tasks/format-code-task-002809/environment/setup/setup.sh @@ -0,0 +1,34 @@ +#!/bin/bash +# Runs once, as root, before the agent starts: Harbor's [environment.healthcheck] unpacks this folder into +# /var/lib/mimo and runs it. Generated by mimo_harbor; see its README for how each step maps to Xiaomi's harness. +M=/var/lib/mimo +[ -f "$M/ready" ] && exit 0 +chmod 700 "$M" +fail() { echo "setup: $*" >&2; exit 1; } +# the answer-leak blocklist (mimoagent), applied to /etc/hosts by the agent right after it installs +write_blocklist() { cp "$M/files/blocklist" "$M/blocklist"; } + +# Code: mimoagent environments/datasets/opensource_code.py + base.py, as the explorer runs it (app/runner/domains.py Code). +CWD=/testbed +git config --global --add safe.directory "$CWD" +cd "$CWD" || fail "no working directory $CWD" +if ! git rev-parse --git-dir >/dev/null 2>&1; then # a bare source tree: give it a baseline commit + git init -q && git add -A && git -c user.name=mimo -c user.email=mimo@localhost commit -q -m baseline --allow-empty +fi +BASE=$(git rev-parse HEAD 2>/dev/null) +[ ${#BASE} -eq 40 ] || fail "could not resolve the base commit in $CWD" +echo "$BASE" > "$M/base" +# Images are built with history truncated at the base. If one is not, the fix could be read out of git log, +# so .git is hidden while the agent works and put back for grading. +LATER=$(git rev-list --all --not "$BASE" 2>/dev/null | head -n 5 | grep -c . || true) +rm -f /tmp/fail.log /tmp/pass.log /tmp/patch.diff /tmp/test_patch.diff /tmp/*.log 2>/dev/null; rm -rf /tmp/claude-0 /tmp/claude-* /tmp/testem-* /tmp/puppeteer_dev_chrome_profile-* 2>/dev/null; rm -f /tmp/test_files.json 2>/dev/null; rm -rf /tmp/jest_* /tmp/jest-* /tmp/build /tmp/build_env 2>/dev/null; rm -rf /tmp/pytest-of-root /tmp/pytest-* /tmp/.pytest_cache /tmp/__pycache__ 2>/dev/null; rm -rf /tmp/go-build* /tmp/standards /tmp/wordpress /tmp/zig-* /tmp/testbase /tmp/testbed 2>/dev/null; rm -f /tmp/tmp*.tmp /tmp/*.bak /tmp/expect* /tmp/butwas* 2>/dev/null; rm -rf /root/.cache/go-build 2>/dev/null; rm -rf /tests 2>/dev/null; find /logs -mindepth 1 -delete 2>/dev/null; mkdir -p /logs/agent /logs/verifier /logs/artifacts; chmod 777 /logs/agent /logs/verifier /logs/artifacts; find /var/log -type f -delete 2>/dev/null || true; rm -rf /var/lib/postgresql/*/*/log /var/lib/postgresql/*/*/pg_log 2>/dev/null || true; find /var/lib/mysql /var/lib/mongodb -type f -name '*.log' -delete 2>/dev/null || true; rm -rf /root/.npm/_logs /root/.babel.json /root/.pytest_cache 2>/dev/null || true; find / -maxdepth 4 -xdev -name task_description.md -path '*/.build_env/*' -delete 2>/dev/null || true; true +git clean -fdx --exclude=node_modules --exclude=bower_components --exclude=.husky --exclude=vendor --exclude=third_party --exclude=_deps --exclude=vcpkg_installed --exclude=.venv --exclude=venv --exclude=.gradle --exclude=target --exclude=.build --exclude=lib --exclude=.bundle --exclude=Manifest.toml --exclude=_build --exclude=.stack-work --exclude=dist-newstyle >/dev/null 2>&1 +find /root/.m2 -type f \( -name '*-SNAPSHOT.jar' -o -name '*-SNAPSHOT-sources.jar' -o -name '*-SNAPSHOT-tests.jar' -o -name '*-SNAPSHOT-test-sources.jar' \) -delete 2>/dev/null; rm -rf /root/.julia/compiled 2>/dev/null; rm -rf /root/.gradle/caches/build-cache-* /root/.gradle/daemon 2>/dev/null; rm -rf /root/.gradle/caches/*/scripts /root/.gradle/caches/jars-* 2>/dev/null; rm -rf /root/.cache/bazel 2>/dev/null; true +if [ "$LATER" -gt 0 ]; then + mv "$CWD/.git" "$M/git-hidden" + echo "history not truncated at ${BASE:0:12}: .git hidden while the agent works" +fi +write_blocklist + +touch "$M/ready" +echo "setup done" diff --git a/tasks/format-code-task-002809/tests/test.patch b/tasks/format-code-task-002809/tests/test.patch new file mode 100644 index 0000000000000000000000000000000000000000..81ba16949822fec0ddf28b2cea2c1c628cdbce61 --- /dev/null +++ b/tasks/format-code-task-002809/tests/test.patch @@ -0,0 +1,71 @@ +diff --git a/cmd/traffic/cmd/manager/service_test.go b/cmd/traffic/cmd/manager/service_test.go +index 161708d27e..67d725f628 100644 +--- a/cmd/traffic/cmd/manager/service_test.go ++++ b/cmd/traffic/cmd/manager/service_test.go +@@ -269,6 +269,14 @@ func TestConnect(t *testing.T) { + Name: spec.Name, // doesn't matter... + }) + a.Error(err) ++ _, err = client.Depart(ctx, aliceSess2) ++ a.NoError(err) ++ _, err = client.Depart(ctx, helloSess) ++ a.NoError(err) ++ _, err = client.Depart(ctx, demo1Sess) ++ a.NoError(err) ++ _, err = client.Depart(ctx, demo2Sess) ++ a.NoError(err) + } + + func getTestClientConn(t *testing.T) *grpc.ClientConn { +diff --git a/pkg/client/sockets_unix_test.go b/pkg/client/sockets_unix_test.go +index 97ef50245f..622d7a5d03 100644 +--- a/pkg/client/sockets_unix_test.go ++++ b/pkg/client/sockets_unix_test.go +@@ -7,7 +7,6 @@ import ( + "net" + "os" + "path/filepath" +- "syscall" + "testing" + + "github.com/stretchr/testify/assert" +@@ -85,9 +84,9 @@ func TestDialSocket(t *testing.T) { + assert.Nil(t, conn) + assert.Error(t, err) + t.Log(err) +- assert.ErrorIs(t, err, syscall.ECONNREFUSED) ++ assert.ErrorIs(t, err, os.ErrNotExist) + assert.Contains(t, err.Error(), "dial unix "+sockname) +- assert.Contains(t, err.Error(), "this usually means that the process has terminated ungracefully") ++ assert.Contains(t, err.Error(), "this usually means that the process is not running") + }) + t.Run("NotExist", func(t *testing.T) { + ctx := dlog.NewTestContext(t, false) +diff --git a/mimo_build_env.tar.gz.b64 b/mimo_build_env.tar.gz.b64 +new file mode 100644 +--- /dev/null ++++ b/mimo_build_env.tar.gz.b64 +@@ -0,0 +1,12 @@ ++H4sIAAAAAAAAA+2UUW/TMBDH+5xPcXQvG6NO0jXbA0xCmiaQ0JgEGvCANDmxk5xI7Sh20u3bc05b ++6IZgL5sQ4n4vTnL2//5351bkPTbqWpshnjwVCXGSZeNK3F/H5zSbJ0dJkiUn6SRJ0+xkPoHsyRzt ++0DsvO4BJZ63/076H4v8o4uf8vXb+urDLpTRKuPrxcjww/3SRHd+b/+I4XUwgeTwLv+c/n//es7h3 ++XZyjiekOQC5dHTntYaZ7Cy22upTYRIWC8XrkWkXRHpwb13ca3lhIxfwI0EHvtIL99Yf0EGrpoLDG ++6xsvPqOvbe/PpCl0A6saizrEygYL70hsRXFQ0ssVdjpWDebw6hQGEhKLlzC+08uRIFkMqstWeswb ++fRApPcwcHSfBam0lmLtqq04qfU/S243KxkGJN9qBrzXc9bd1NtoitR8lOR90BFw5Kvzy/eXHq4uz ++t+dn74KybBq7AmVXprFSoanG0yQKbadn+gadp4+kVlnh+iVo4zvU7kXIb6DrTfC/tAo8qtsg6G5N ++sdksot1sp8/D1ooGVFGGPhfUj/hOpa/XZUY7iqErHyhJqNavLNCFDwphoNSHhvowzmDQnUNrAE1J ++DmjDgBIaVTaycmOVg0VFUkFms1egQb9/AK00WNBBaL9V8Sa2XQU52UdxIdGIT9sUDqZTkiptt7ZB ++90+GlgSNdcvnhwciFDGGv0YAs62V6ezLbvVeN5ra7DTND+2d13iYxzuOtulPB7paIp2OsiIulir2 ++nSxLLMZn+v+Tle7iTTgIFA3SzOLob/9aGYZhGIZhGIZhGIZhGIZhGIZhGIZhGIZhfuU7PgJa0gAo ++AAA= +diff --git a/mimo_test_command.sh b/mimo_test_command.sh +new file mode 100755 +--- /dev/null ++++ b/mimo_test_command.sh +@@ -0,0 +1,6 @@ ++#!/usr/bin/env bash ++ ++set -uo pipefail ++cd /testbed || exit 1 ++base64 -d mimo_build_env.tar.gz.b64 | tar -xzf - -C /testbed || exit 1 ++exec bash -lc 'cd /testbed && bash -eo pipefail /testbed/.build_env/test_command.sh' diff --git a/tasks/format-code-task-002809/tests/test.sh b/tasks/format-code-task-002809/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..b43f744a5d2907e62c331135c945ffcab899156b --- /dev/null +++ b/tasks/format-code-task-002809/tests/test.sh @@ -0,0 +1,40 @@ +#!/bin/bash +# Code grading, mimoagent opensource_code.py: reset the files the hidden test patch touches, apply it, run the +# task's test command; reward 1 when it exits 0. A testbed failure (reset or apply) writes no reward: not scored. +M=/var/lib/mimo +CWD=/testbed +V=/logs/verifier +mkdir -p "$V" +BASE=$(cat "$M/base" 2>/dev/null) || { echo "setup never ran (no $M/base)" >&2; exit 1; } +cd "$CWD" || exit 1 +if [ -d "$M/git-hidden" ]; then rm -rf "$CWD/.git"; mv "$M/git-hidden" "$CWD/.git"; fi +# the agent's change against the base, so its own commits count too +git add -A >/dev/null 2>&1 && git -c core.fileMode=false diff --cached "$BASE" > "$V/agent.diff" +git reset -q +if ! ( +while IFS= read -r tf; do + [ -z "$tf" ] && continue + if git cat-file -e $BASE:"$tf" 2>/dev/null; then + git checkout $BASE -- "$tf" 2>/dev/null || true + else + git rm -f --cached "$tf" >/dev/null 2>&1 || true + rm -f "$tf" + fi +done <<'EOF_RESET_TEST_FILES' +cmd/traffic/cmd/manager/service_test.go +pkg/client/sockets_unix_test.go +mimo_build_env.tar.gz.b64 +mimo_test_command.sh +EOF_RESET_TEST_FILES + +); then echo "could not reset the test files (testbed problem, not scored)" >&2; exit 1; fi +if ! git apply --verbose /tests/test.patch > "$V/apply.log" 2>&1; then + cat "$V/apply.log" >&2 + echo "the hidden tests could not be applied (testbed problem, not scored)" >&2 + exit 1 +fi +timeout 1800 sh -c "$(cat /tests/test_command.sh)" > "$V/test_output.log" 2>&1 +RC=$? +tail -c 12000 "$V/test_output.log" +if [ $RC -eq 0 ]; then echo 1 > "$V/reward.txt"; else echo 0 > "$V/reward.txt"; fi +echo "test command exited $RC" diff --git a/tasks/format-code-task-002809/tests/test_command.sh b/tasks/format-code-task-002809/tests/test_command.sh new file mode 100644 index 0000000000000000000000000000000000000000..7cb23076694ad17d72e8296d62b2b240083e36db --- /dev/null +++ b/tasks/format-code-task-002809/tests/test_command.sh @@ -0,0 +1 @@ +bash /testbed/mimo_test_command.sh \ No newline at end of file diff --git a/tasks/format-code-task-002813/environment/Dockerfile b/tasks/format-code-task-002813/environment/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..f1ff81cbde93423c0002d7524419d469d06ba38c --- /dev/null +++ b/tasks/format-code-task-002813/environment/Dockerfile @@ -0,0 +1,3 @@ +# The task's image, pinned by digest (the same as [environment].docker_image). +# Setup runs at start from [environment.healthcheck]; environment/setup/ is its readable copy. +FROM docker.io/xiaomimimo/mimo-v2.6-rl-oss@sha256:4f243563b6d6a75266b2d0eb077cbd4150e005a199aafe3b608760cb31e99b52 diff --git a/tasks/format-code-task-002813/environment/setup/files/blocklist b/tasks/format-code-task-002813/environment/setup/files/blocklist new file mode 100644 index 0000000000000000000000000000000000000000..a8e4bdc4c7d9b739c047a3cb58ea72a1bb05bcbc --- /dev/null +++ b/tasks/format-code-task-002813/environment/setup/files/blocklist @@ -0,0 +1,33 @@ +# mimo answer-leak blocklist (mimoagent) +0.0.0.0 github.com +0.0.0.0 www.github.com +0.0.0.0 api.github.com +0.0.0.0 raw.githubusercontent.com +0.0.0.0 codeload.github.com +0.0.0.0 objects.githubusercontent.com +0.0.0.0 gist.github.com +0.0.0.0 gist.githubusercontent.com +0.0.0.0 gitlab.com +0.0.0.0 bitbucket.org +0.0.0.0 sourceforge.net +0.0.0.0 git.kernel.org +0.0.0.0 chromium.googlesource.com +0.0.0.0 android.googlesource.com +0.0.0.0 sourcegraph.com +0.0.0.0 bugs.chromium.org +0.0.0.0 issues.oss-fuzz.com +0.0.0.0 oss-fuzz.com +0.0.0.0 osv.dev +0.0.0.0 api.osv.dev +0.0.0.0 bugzilla.mozilla.org +0.0.0.0 proxy.golang.org +0.0.0.0 sum.golang.org +0.0.0.0 pkg.go.dev +0.0.0.0 google.com +0.0.0.0 www.google.com +0.0.0.0 bing.com +0.0.0.0 www.bing.com +0.0.0.0 duckduckgo.com +0.0.0.0 html.duckduckgo.com +0.0.0.0 search.brave.com +0.0.0.0 stackoverflow.com diff --git a/tasks/format-code-task-002813/environment/setup/setup.sh b/tasks/format-code-task-002813/environment/setup/setup.sh new file mode 100644 index 0000000000000000000000000000000000000000..d883db90cfcfb48f7a139861bbe9f6b5d95cad6f --- /dev/null +++ b/tasks/format-code-task-002813/environment/setup/setup.sh @@ -0,0 +1,34 @@ +#!/bin/bash +# Runs once, as root, before the agent starts: Harbor's [environment.healthcheck] unpacks this folder into +# /var/lib/mimo and runs it. Generated by mimo_harbor; see its README for how each step maps to Xiaomi's harness. +M=/var/lib/mimo +[ -f "$M/ready" ] && exit 0 +chmod 700 "$M" +fail() { echo "setup: $*" >&2; exit 1; } +# the answer-leak blocklist (mimoagent), applied to /etc/hosts by the agent right after it installs +write_blocklist() { cp "$M/files/blocklist" "$M/blocklist"; } + +# Code: mimoagent environments/datasets/opensource_code.py + base.py, as the explorer runs it (app/runner/domains.py Code). +CWD=/testbed +git config --global --add safe.directory "$CWD" +cd "$CWD" || fail "no working directory $CWD" +if ! git rev-parse --git-dir >/dev/null 2>&1; then # a bare source tree: give it a baseline commit + git init -q && git add -A && git -c user.name=mimo -c user.email=mimo@localhost commit -q -m baseline --allow-empty +fi +BASE=$(git rev-parse HEAD 2>/dev/null) +[ ${#BASE} -eq 40 ] || fail "could not resolve the base commit in $CWD" +echo "$BASE" > "$M/base" +# Images are built with history truncated at the base. If one is not, the fix could be read out of git log, +# so .git is hidden while the agent works and put back for grading. +LATER=$(git rev-list --all --not "$BASE" 2>/dev/null | head -n 5 | grep -c . || true) +rm -f /tmp/fail.log /tmp/pass.log /tmp/patch.diff /tmp/test_patch.diff /tmp/*.log 2>/dev/null; rm -rf /tmp/claude-0 /tmp/claude-* /tmp/testem-* /tmp/puppeteer_dev_chrome_profile-* 2>/dev/null; rm -f /tmp/test_files.json 2>/dev/null; rm -rf /tmp/jest_* /tmp/jest-* /tmp/build /tmp/build_env 2>/dev/null; rm -rf /tmp/pytest-of-root /tmp/pytest-* /tmp/.pytest_cache /tmp/__pycache__ 2>/dev/null; rm -rf /tmp/go-build* /tmp/standards /tmp/wordpress /tmp/zig-* /tmp/testbase /tmp/testbed 2>/dev/null; rm -f /tmp/tmp*.tmp /tmp/*.bak /tmp/expect* /tmp/butwas* 2>/dev/null; rm -rf /root/.cache/go-build 2>/dev/null; rm -rf /tests 2>/dev/null; find /logs -mindepth 1 -delete 2>/dev/null; mkdir -p /logs/agent /logs/verifier /logs/artifacts; chmod 777 /logs/agent /logs/verifier /logs/artifacts; find /var/log -type f -delete 2>/dev/null || true; rm -rf /var/lib/postgresql/*/*/log /var/lib/postgresql/*/*/pg_log 2>/dev/null || true; find /var/lib/mysql /var/lib/mongodb -type f -name '*.log' -delete 2>/dev/null || true; rm -rf /root/.npm/_logs /root/.babel.json /root/.pytest_cache 2>/dev/null || true; find / -maxdepth 4 -xdev -name task_description.md -path '*/.build_env/*' -delete 2>/dev/null || true; true +git clean -fdx --exclude=node_modules --exclude=bower_components --exclude=.husky --exclude=vendor --exclude=third_party --exclude=_deps --exclude=vcpkg_installed --exclude=.venv --exclude=venv --exclude=.gradle --exclude=target --exclude=.build --exclude=lib --exclude=.bundle --exclude=Manifest.toml --exclude=_build --exclude=.stack-work --exclude=dist-newstyle >/dev/null 2>&1 +find /root/.m2 -type f \( -name '*-SNAPSHOT.jar' -o -name '*-SNAPSHOT-sources.jar' -o -name '*-SNAPSHOT-tests.jar' -o -name '*-SNAPSHOT-test-sources.jar' \) -delete 2>/dev/null; rm -rf /root/.julia/compiled 2>/dev/null; rm -rf /root/.gradle/caches/build-cache-* /root/.gradle/daemon 2>/dev/null; rm -rf /root/.gradle/caches/*/scripts /root/.gradle/caches/jars-* 2>/dev/null; rm -rf /root/.cache/bazel 2>/dev/null; true +if [ "$LATER" -gt 0 ]; then + mv "$CWD/.git" "$M/git-hidden" + echo "history not truncated at ${BASE:0:12}: .git hidden while the agent works" +fi +write_blocklist + +touch "$M/ready" +echo "setup done" diff --git a/tasks/format-code-task-002813/tests/test.patch b/tasks/format-code-task-002813/tests/test.patch new file mode 100644 index 0000000000000000000000000000000000000000..c9d3d80bdb359a0422f2b2f291e960b122255c09 --- /dev/null +++ b/tasks/format-code-task-002813/tests/test.patch @@ -0,0 +1,99 @@ +diff --git a/tencentcloud/id_codec_test.go b/tencentcloud/id_codec_test.go +new file mode 100644 +index 000000000..5e05c495b +--- /dev/null ++++ b/tencentcloud/id_codec_test.go +@@ -0,0 +1,72 @@ ++package tencentcloud ++ ++import ( ++ "strings" ++ "testing" ++ ++ "github.com/stretchr/testify/assert" ++) ++ ++ ++ ++ ++func TestIdEncodeDecodeBackwardCompatible(t *testing.T) { ++ cases := [][]string{ ++ {"a", "b", "c"}, ++ {"apiKeyId", "usagePlanId"}, ++ {"single"}, ++ {"crs-jf4ico4v", "Keep-terraform"}, ++ {"a", "b", "c", "d", "e"}, ++ } ++ ++ for _, parts := range cases { ++ legacy := strings.Join(parts, "#") ++ assert.Equalf(t, legacy, IdEncode(parts), ++ "IdEncode(%#v) should equal the legacy joined form", parts) ++ assert.Equalf(t, parts, IdDecode(legacy), ++ "IdDecode(%q) should equal the legacy split form", legacy) ++ } ++} ++ ++ ++func TestIdDecodeLegacy(t *testing.T) { ++ assert.Equal(t, []string{"a", "b", "c"}, IdDecode("a#b#c")) ++ assert.Equal(t, "a#b#c", IdEncode([]string{"a", "b", "c"})) ++} ++ ++ ++ ++ ++ ++func TestIdEncodeDecodeRoundTrip(t *testing.T) { ++ cases := [][]string{ ++ {"a#b", "c"}, ++ {"a", "b#c", "d"}, ++ {"#"}, ++ {"##", "#"}, ++ {"", "a"}, ++ {"a", ""}, ++ {"", "", ""}, ++ {"a", "", "b"}, ++ {`back\slash`, "plain"}, ++ {"per%cent", "23"}, ++ {"mix#ed\\and%23", "#", "", "tail"}, ++ {"crs-jf4ico4v#weird", "Keep-terraform"}, ++ {strings.Repeat("#", 5), strings.Repeat("a#", 4)}, ++ } ++ ++ for _, parts := range cases { ++ encoded := IdEncode(parts) ++ decoded := IdDecode(encoded) ++ assert.Equalf(t, parts, decoded, ++ "round-trip failed for %#v (encoded as %q, decoded as %#v)", parts, encoded, decoded) ++ assert.Lenf(t, decoded, len(parts), ++ "round-trip must preserve the number of fields for %#v", parts) ++ } ++} ++ ++ ++func TestIdEncodeDeterministic(t *testing.T) { ++ parts := []string{"a#b", "", "c\\d", "#"} ++ assert.Equal(t, IdEncode(parts), IdEncode(parts)) ++} +diff --git a/mimo_test_command.sh b/mimo_test_command.sh +new file mode 100755 +--- /dev/null ++++ b/mimo_test_command.sh +@@ -0,0 +1,16 @@ ++#!/usr/bin/env bash ++ ++ ++ ++ ++set -euo pipefail ++HERE="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" ++cd /testbed ++ ++ ++ ++ ++go test ./tencentcloud/ -count=1 -run 'TestIsContains|TestMatchAny|TestGetListIncrement|TestGetListDiffs|TestIsExpectError|TestYamlParser' ++ ++ ++go test ./tencentcloud/ -count=1 -run 'TestIdEncodeDecodeBackwardCompatible|TestIdDecodeLegacy|TestIdEncodeDecodeRoundTrip|TestIdEncodeDeterministic' diff --git a/tasks/format-code-task-002813/tests/test.sh b/tasks/format-code-task-002813/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..a5b6e3ef857ef04b7fab24b4be5a0dbcf79e21a9 --- /dev/null +++ b/tasks/format-code-task-002813/tests/test.sh @@ -0,0 +1,38 @@ +#!/bin/bash +# Code grading, mimoagent opensource_code.py: reset the files the hidden test patch touches, apply it, run the +# task's test command; reward 1 when it exits 0. A testbed failure (reset or apply) writes no reward: not scored. +M=/var/lib/mimo +CWD=/testbed +V=/logs/verifier +mkdir -p "$V" +BASE=$(cat "$M/base" 2>/dev/null) || { echo "setup never ran (no $M/base)" >&2; exit 1; } +cd "$CWD" || exit 1 +if [ -d "$M/git-hidden" ]; then rm -rf "$CWD/.git"; mv "$M/git-hidden" "$CWD/.git"; fi +# the agent's change against the base, so its own commits count too +git add -A >/dev/null 2>&1 && git -c core.fileMode=false diff --cached "$BASE" > "$V/agent.diff" +git reset -q +if ! ( +while IFS= read -r tf; do + [ -z "$tf" ] && continue + if git cat-file -e $BASE:"$tf" 2>/dev/null; then + git checkout $BASE -- "$tf" 2>/dev/null || true + else + git rm -f --cached "$tf" >/dev/null 2>&1 || true + rm -f "$tf" + fi +done <<'EOF_RESET_TEST_FILES' +tencentcloud/id_codec_test.go +mimo_test_command.sh +EOF_RESET_TEST_FILES + +); then echo "could not reset the test files (testbed problem, not scored)" >&2; exit 1; fi +if ! git apply --verbose /tests/test.patch > "$V/apply.log" 2>&1; then + cat "$V/apply.log" >&2 + echo "the hidden tests could not be applied (testbed problem, not scored)" >&2 + exit 1 +fi +timeout 1800 sh -c "$(cat /tests/test_command.sh)" > "$V/test_output.log" 2>&1 +RC=$? +tail -c 12000 "$V/test_output.log" +if [ $RC -eq 0 ]; then echo 1 > "$V/reward.txt"; else echo 0 > "$V/reward.txt"; fi +echo "test command exited $RC" diff --git a/tasks/format-code-task-002813/tests/test_command.sh b/tasks/format-code-task-002813/tests/test_command.sh new file mode 100644 index 0000000000000000000000000000000000000000..7cb23076694ad17d72e8296d62b2b240083e36db --- /dev/null +++ b/tasks/format-code-task-002813/tests/test_command.sh @@ -0,0 +1 @@ +bash /testbed/mimo_test_command.sh \ No newline at end of file diff --git a/tasks/format-code-task-002814/environment/Dockerfile b/tasks/format-code-task-002814/environment/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..e4899f461a612b71af163bc4e23ea2d8bfc0d437 --- /dev/null +++ b/tasks/format-code-task-002814/environment/Dockerfile @@ -0,0 +1,3 @@ +# The task's image, pinned by digest (the same as [environment].docker_image). +# Setup runs at start from [environment.healthcheck]; environment/setup/ is its readable copy. +FROM docker.io/xiaomimimo/mimo-v2.6-rl-oss@sha256:d69d1e9bca3e95172ff2e64f8b3bcf807eb80da515e24b4e59393f7d63ef4cfd diff --git a/tasks/format-code-task-002814/environment/setup/files/blocklist b/tasks/format-code-task-002814/environment/setup/files/blocklist new file mode 100644 index 0000000000000000000000000000000000000000..a8e4bdc4c7d9b739c047a3cb58ea72a1bb05bcbc --- /dev/null +++ b/tasks/format-code-task-002814/environment/setup/files/blocklist @@ -0,0 +1,33 @@ +# mimo answer-leak blocklist (mimoagent) +0.0.0.0 github.com +0.0.0.0 www.github.com +0.0.0.0 api.github.com +0.0.0.0 raw.githubusercontent.com +0.0.0.0 codeload.github.com +0.0.0.0 objects.githubusercontent.com +0.0.0.0 gist.github.com +0.0.0.0 gist.githubusercontent.com +0.0.0.0 gitlab.com +0.0.0.0 bitbucket.org +0.0.0.0 sourceforge.net +0.0.0.0 git.kernel.org +0.0.0.0 chromium.googlesource.com +0.0.0.0 android.googlesource.com +0.0.0.0 sourcegraph.com +0.0.0.0 bugs.chromium.org +0.0.0.0 issues.oss-fuzz.com +0.0.0.0 oss-fuzz.com +0.0.0.0 osv.dev +0.0.0.0 api.osv.dev +0.0.0.0 bugzilla.mozilla.org +0.0.0.0 proxy.golang.org +0.0.0.0 sum.golang.org +0.0.0.0 pkg.go.dev +0.0.0.0 google.com +0.0.0.0 www.google.com +0.0.0.0 bing.com +0.0.0.0 www.bing.com +0.0.0.0 duckduckgo.com +0.0.0.0 html.duckduckgo.com +0.0.0.0 search.brave.com +0.0.0.0 stackoverflow.com diff --git a/tasks/format-code-task-002814/environment/setup/setup.sh b/tasks/format-code-task-002814/environment/setup/setup.sh new file mode 100644 index 0000000000000000000000000000000000000000..d883db90cfcfb48f7a139861bbe9f6b5d95cad6f --- /dev/null +++ b/tasks/format-code-task-002814/environment/setup/setup.sh @@ -0,0 +1,34 @@ +#!/bin/bash +# Runs once, as root, before the agent starts: Harbor's [environment.healthcheck] unpacks this folder into +# /var/lib/mimo and runs it. Generated by mimo_harbor; see its README for how each step maps to Xiaomi's harness. +M=/var/lib/mimo +[ -f "$M/ready" ] && exit 0 +chmod 700 "$M" +fail() { echo "setup: $*" >&2; exit 1; } +# the answer-leak blocklist (mimoagent), applied to /etc/hosts by the agent right after it installs +write_blocklist() { cp "$M/files/blocklist" "$M/blocklist"; } + +# Code: mimoagent environments/datasets/opensource_code.py + base.py, as the explorer runs it (app/runner/domains.py Code). +CWD=/testbed +git config --global --add safe.directory "$CWD" +cd "$CWD" || fail "no working directory $CWD" +if ! git rev-parse --git-dir >/dev/null 2>&1; then # a bare source tree: give it a baseline commit + git init -q && git add -A && git -c user.name=mimo -c user.email=mimo@localhost commit -q -m baseline --allow-empty +fi +BASE=$(git rev-parse HEAD 2>/dev/null) +[ ${#BASE} -eq 40 ] || fail "could not resolve the base commit in $CWD" +echo "$BASE" > "$M/base" +# Images are built with history truncated at the base. If one is not, the fix could be read out of git log, +# so .git is hidden while the agent works and put back for grading. +LATER=$(git rev-list --all --not "$BASE" 2>/dev/null | head -n 5 | grep -c . || true) +rm -f /tmp/fail.log /tmp/pass.log /tmp/patch.diff /tmp/test_patch.diff /tmp/*.log 2>/dev/null; rm -rf /tmp/claude-0 /tmp/claude-* /tmp/testem-* /tmp/puppeteer_dev_chrome_profile-* 2>/dev/null; rm -f /tmp/test_files.json 2>/dev/null; rm -rf /tmp/jest_* /tmp/jest-* /tmp/build /tmp/build_env 2>/dev/null; rm -rf /tmp/pytest-of-root /tmp/pytest-* /tmp/.pytest_cache /tmp/__pycache__ 2>/dev/null; rm -rf /tmp/go-build* /tmp/standards /tmp/wordpress /tmp/zig-* /tmp/testbase /tmp/testbed 2>/dev/null; rm -f /tmp/tmp*.tmp /tmp/*.bak /tmp/expect* /tmp/butwas* 2>/dev/null; rm -rf /root/.cache/go-build 2>/dev/null; rm -rf /tests 2>/dev/null; find /logs -mindepth 1 -delete 2>/dev/null; mkdir -p /logs/agent /logs/verifier /logs/artifacts; chmod 777 /logs/agent /logs/verifier /logs/artifacts; find /var/log -type f -delete 2>/dev/null || true; rm -rf /var/lib/postgresql/*/*/log /var/lib/postgresql/*/*/pg_log 2>/dev/null || true; find /var/lib/mysql /var/lib/mongodb -type f -name '*.log' -delete 2>/dev/null || true; rm -rf /root/.npm/_logs /root/.babel.json /root/.pytest_cache 2>/dev/null || true; find / -maxdepth 4 -xdev -name task_description.md -path '*/.build_env/*' -delete 2>/dev/null || true; true +git clean -fdx --exclude=node_modules --exclude=bower_components --exclude=.husky --exclude=vendor --exclude=third_party --exclude=_deps --exclude=vcpkg_installed --exclude=.venv --exclude=venv --exclude=.gradle --exclude=target --exclude=.build --exclude=lib --exclude=.bundle --exclude=Manifest.toml --exclude=_build --exclude=.stack-work --exclude=dist-newstyle >/dev/null 2>&1 +find /root/.m2 -type f \( -name '*-SNAPSHOT.jar' -o -name '*-SNAPSHOT-sources.jar' -o -name '*-SNAPSHOT-tests.jar' -o -name '*-SNAPSHOT-test-sources.jar' \) -delete 2>/dev/null; rm -rf /root/.julia/compiled 2>/dev/null; rm -rf /root/.gradle/caches/build-cache-* /root/.gradle/daemon 2>/dev/null; rm -rf /root/.gradle/caches/*/scripts /root/.gradle/caches/jars-* 2>/dev/null; rm -rf /root/.cache/bazel 2>/dev/null; true +if [ "$LATER" -gt 0 ]; then + mv "$CWD/.git" "$M/git-hidden" + echo "history not truncated at ${BASE:0:12}: .git hidden while the agent works" +fi +write_blocklist + +touch "$M/ready" +echo "setup done" diff --git a/tasks/format-code-task-002814/tests/test.patch b/tasks/format-code-task-002814/tests/test.patch new file mode 100644 index 0000000000000000000000000000000000000000..0e204131daaa6d6e12d0359fcf7d43e0317c67e4 --- /dev/null +++ b/tasks/format-code-task-002814/tests/test.patch @@ -0,0 +1,87 @@ +diff --git a/lite2/provider/http/http_test.go b/lite2/provider/http/http_test.go +index 73706434b..b1a0bc569 100644 +--- a/lite2/provider/http/http_test.go ++++ b/lite2/provider/http/http_test.go +@@ -57,3 +57,60 @@ func TestProvider(t *testing.T) { + assert.Nil(t, err, "%+v", err) + assert.Equal(t, lower, sh.Height) + } ++ ++ ++ ++ ++func TestNewProvider_NoSchemeDefaultsToHTTP(t *testing.T) { ++ p, err := litehttp.New("test-chain", "192.168.0.1:26657") ++ require.NoError(t, err) ++ require.NotNil(t, p) ++ ++ ssc, ok := p.(litehttp.SignStatusClient) ++ require.True(t, ok, "provider must implement SignStatusClient") ++ assert.Equal(t, "http://192.168.0.1:26657", ssc.Remote()) ++} ++ ++ ++func TestNewProvider_NoSchemeHostnameDefaultsToHTTP(t *testing.T) { ++ p, err := litehttp.New("test-chain", "example.com:26657") ++ require.NoError(t, err) ++ require.NotNil(t, p) ++ ++ ssc, ok := p.(litehttp.SignStatusClient) ++ require.True(t, ok) ++ assert.Equal(t, "http://example.com:26657", ssc.Remote()) ++} ++ ++ ++func TestNewProvider_ExplicitHTTPSchemePreserved(t *testing.T) { ++ p, err := litehttp.New("test-chain", "http://192.168.0.1:26657") ++ require.NoError(t, err) ++ require.NotNil(t, p) ++ ++ ssc, ok := p.(litehttp.SignStatusClient) ++ require.True(t, ok) ++ assert.Equal(t, "http://192.168.0.1:26657", ssc.Remote()) ++} ++ ++ ++func TestNewProvider_ExplicitHTTPSSchemePreserved(t *testing.T) { ++ p, err := litehttp.New("test-chain", "https://example.com:26657") ++ require.NoError(t, err) ++ require.NotNil(t, p) ++ ++ ssc, ok := p.(litehttp.SignStatusClient) ++ require.True(t, ok) ++ assert.Equal(t, "https://example.com:26657", ssc.Remote()) ++} ++ ++ ++func TestNewProvider_ExplicitTCPSchemePreserved(t *testing.T) { ++ p, err := litehttp.New("test-chain", "tcp://192.168.0.1:26657") ++ require.NoError(t, err) ++ require.NotNil(t, p) ++ ++ ssc, ok := p.(litehttp.SignStatusClient) ++ require.True(t, ok) ++ assert.Equal(t, "tcp://192.168.0.1:26657", ssc.Remote()) ++} +diff --git a/test_commands.json b/test_commands.json +new file mode 100644 +index 000000000..21a827067 +--- /dev/null ++++ b/test_commands.json +@@ -0,0 +1,3 @@ ++{ ++ "test_commands": ["go test -run 'TestNewProvider_' ./lite2/provider/http/ -v -timeout 120s"] ++} +diff --git a/mimo_test_command.sh b/mimo_test_command.sh +new file mode 100755 +--- /dev/null ++++ b/mimo_test_command.sh +@@ -0,0 +1,8 @@ ++#!/usr/bin/env bash ++ ++set -uo pipefail ++cd /testbed ++rc=0 ++go test -run 'TestNewProvider_' ./lite2/provider/http/ -v -timeout 120s ++rc=$(( rc | $? )) ++exit $rc diff --git a/tasks/format-code-task-002814/tests/test.sh b/tasks/format-code-task-002814/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..d1b62e37d45e87dfad780ba5da3ef00fc408f9a8 --- /dev/null +++ b/tasks/format-code-task-002814/tests/test.sh @@ -0,0 +1,39 @@ +#!/bin/bash +# Code grading, mimoagent opensource_code.py: reset the files the hidden test patch touches, apply it, run the +# task's test command; reward 1 when it exits 0. A testbed failure (reset or apply) writes no reward: not scored. +M=/var/lib/mimo +CWD=/testbed +V=/logs/verifier +mkdir -p "$V" +BASE=$(cat "$M/base" 2>/dev/null) || { echo "setup never ran (no $M/base)" >&2; exit 1; } +cd "$CWD" || exit 1 +if [ -d "$M/git-hidden" ]; then rm -rf "$CWD/.git"; mv "$M/git-hidden" "$CWD/.git"; fi +# the agent's change against the base, so its own commits count too +git add -A >/dev/null 2>&1 && git -c core.fileMode=false diff --cached "$BASE" > "$V/agent.diff" +git reset -q +if ! ( +while IFS= read -r tf; do + [ -z "$tf" ] && continue + if git cat-file -e $BASE:"$tf" 2>/dev/null; then + git checkout $BASE -- "$tf" 2>/dev/null || true + else + git rm -f --cached "$tf" >/dev/null 2>&1 || true + rm -f "$tf" + fi +done <<'EOF_RESET_TEST_FILES' +lite2/provider/http/http_test.go +test_commands.json +mimo_test_command.sh +EOF_RESET_TEST_FILES + +); then echo "could not reset the test files (testbed problem, not scored)" >&2; exit 1; fi +if ! git apply --verbose /tests/test.patch > "$V/apply.log" 2>&1; then + cat "$V/apply.log" >&2 + echo "the hidden tests could not be applied (testbed problem, not scored)" >&2 + exit 1 +fi +timeout 1800 sh -c "$(cat /tests/test_command.sh)" > "$V/test_output.log" 2>&1 +RC=$? +tail -c 12000 "$V/test_output.log" +if [ $RC -eq 0 ]; then echo 1 > "$V/reward.txt"; else echo 0 > "$V/reward.txt"; fi +echo "test command exited $RC" diff --git a/tasks/format-code-task-002814/tests/test_command.sh b/tasks/format-code-task-002814/tests/test_command.sh new file mode 100644 index 0000000000000000000000000000000000000000..7cb23076694ad17d72e8296d62b2b240083e36db --- /dev/null +++ b/tasks/format-code-task-002814/tests/test_command.sh @@ -0,0 +1 @@ +bash /testbed/mimo_test_command.sh \ No newline at end of file diff --git a/tasks/format-code-task-002822/environment/Dockerfile b/tasks/format-code-task-002822/environment/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..8f123ba8ed3e47b73f08fec1e3ec556535e347e1 --- /dev/null +++ b/tasks/format-code-task-002822/environment/Dockerfile @@ -0,0 +1,3 @@ +# The task's image, pinned by digest (the same as [environment].docker_image). +# Setup runs at start from [environment.healthcheck]; environment/setup/ is its readable copy. +FROM docker.io/xiaomimimo/mimo-v2.6-rl-oss@sha256:eba0c02bae72f9844273e07173b99db2549334a4d7a256076be8981f3ad7e219 diff --git a/tasks/format-code-task-002822/environment/setup/files/blocklist b/tasks/format-code-task-002822/environment/setup/files/blocklist new file mode 100644 index 0000000000000000000000000000000000000000..a8e4bdc4c7d9b739c047a3cb58ea72a1bb05bcbc --- /dev/null +++ b/tasks/format-code-task-002822/environment/setup/files/blocklist @@ -0,0 +1,33 @@ +# mimo answer-leak blocklist (mimoagent) +0.0.0.0 github.com +0.0.0.0 www.github.com +0.0.0.0 api.github.com +0.0.0.0 raw.githubusercontent.com +0.0.0.0 codeload.github.com +0.0.0.0 objects.githubusercontent.com +0.0.0.0 gist.github.com +0.0.0.0 gist.githubusercontent.com +0.0.0.0 gitlab.com +0.0.0.0 bitbucket.org +0.0.0.0 sourceforge.net +0.0.0.0 git.kernel.org +0.0.0.0 chromium.googlesource.com +0.0.0.0 android.googlesource.com +0.0.0.0 sourcegraph.com +0.0.0.0 bugs.chromium.org +0.0.0.0 issues.oss-fuzz.com +0.0.0.0 oss-fuzz.com +0.0.0.0 osv.dev +0.0.0.0 api.osv.dev +0.0.0.0 bugzilla.mozilla.org +0.0.0.0 proxy.golang.org +0.0.0.0 sum.golang.org +0.0.0.0 pkg.go.dev +0.0.0.0 google.com +0.0.0.0 www.google.com +0.0.0.0 bing.com +0.0.0.0 www.bing.com +0.0.0.0 duckduckgo.com +0.0.0.0 html.duckduckgo.com +0.0.0.0 search.brave.com +0.0.0.0 stackoverflow.com diff --git a/tasks/format-code-task-002822/environment/setup/setup.sh b/tasks/format-code-task-002822/environment/setup/setup.sh new file mode 100644 index 0000000000000000000000000000000000000000..d883db90cfcfb48f7a139861bbe9f6b5d95cad6f --- /dev/null +++ b/tasks/format-code-task-002822/environment/setup/setup.sh @@ -0,0 +1,34 @@ +#!/bin/bash +# Runs once, as root, before the agent starts: Harbor's [environment.healthcheck] unpacks this folder into +# /var/lib/mimo and runs it. Generated by mimo_harbor; see its README for how each step maps to Xiaomi's harness. +M=/var/lib/mimo +[ -f "$M/ready" ] && exit 0 +chmod 700 "$M" +fail() { echo "setup: $*" >&2; exit 1; } +# the answer-leak blocklist (mimoagent), applied to /etc/hosts by the agent right after it installs +write_blocklist() { cp "$M/files/blocklist" "$M/blocklist"; } + +# Code: mimoagent environments/datasets/opensource_code.py + base.py, as the explorer runs it (app/runner/domains.py Code). +CWD=/testbed +git config --global --add safe.directory "$CWD" +cd "$CWD" || fail "no working directory $CWD" +if ! git rev-parse --git-dir >/dev/null 2>&1; then # a bare source tree: give it a baseline commit + git init -q && git add -A && git -c user.name=mimo -c user.email=mimo@localhost commit -q -m baseline --allow-empty +fi +BASE=$(git rev-parse HEAD 2>/dev/null) +[ ${#BASE} -eq 40 ] || fail "could not resolve the base commit in $CWD" +echo "$BASE" > "$M/base" +# Images are built with history truncated at the base. If one is not, the fix could be read out of git log, +# so .git is hidden while the agent works and put back for grading. +LATER=$(git rev-list --all --not "$BASE" 2>/dev/null | head -n 5 | grep -c . || true) +rm -f /tmp/fail.log /tmp/pass.log /tmp/patch.diff /tmp/test_patch.diff /tmp/*.log 2>/dev/null; rm -rf /tmp/claude-0 /tmp/claude-* /tmp/testem-* /tmp/puppeteer_dev_chrome_profile-* 2>/dev/null; rm -f /tmp/test_files.json 2>/dev/null; rm -rf /tmp/jest_* /tmp/jest-* /tmp/build /tmp/build_env 2>/dev/null; rm -rf /tmp/pytest-of-root /tmp/pytest-* /tmp/.pytest_cache /tmp/__pycache__ 2>/dev/null; rm -rf /tmp/go-build* /tmp/standards /tmp/wordpress /tmp/zig-* /tmp/testbase /tmp/testbed 2>/dev/null; rm -f /tmp/tmp*.tmp /tmp/*.bak /tmp/expect* /tmp/butwas* 2>/dev/null; rm -rf /root/.cache/go-build 2>/dev/null; rm -rf /tests 2>/dev/null; find /logs -mindepth 1 -delete 2>/dev/null; mkdir -p /logs/agent /logs/verifier /logs/artifacts; chmod 777 /logs/agent /logs/verifier /logs/artifacts; find /var/log -type f -delete 2>/dev/null || true; rm -rf /var/lib/postgresql/*/*/log /var/lib/postgresql/*/*/pg_log 2>/dev/null || true; find /var/lib/mysql /var/lib/mongodb -type f -name '*.log' -delete 2>/dev/null || true; rm -rf /root/.npm/_logs /root/.babel.json /root/.pytest_cache 2>/dev/null || true; find / -maxdepth 4 -xdev -name task_description.md -path '*/.build_env/*' -delete 2>/dev/null || true; true +git clean -fdx --exclude=node_modules --exclude=bower_components --exclude=.husky --exclude=vendor --exclude=third_party --exclude=_deps --exclude=vcpkg_installed --exclude=.venv --exclude=venv --exclude=.gradle --exclude=target --exclude=.build --exclude=lib --exclude=.bundle --exclude=Manifest.toml --exclude=_build --exclude=.stack-work --exclude=dist-newstyle >/dev/null 2>&1 +find /root/.m2 -type f \( -name '*-SNAPSHOT.jar' -o -name '*-SNAPSHOT-sources.jar' -o -name '*-SNAPSHOT-tests.jar' -o -name '*-SNAPSHOT-test-sources.jar' \) -delete 2>/dev/null; rm -rf /root/.julia/compiled 2>/dev/null; rm -rf /root/.gradle/caches/build-cache-* /root/.gradle/daemon 2>/dev/null; rm -rf /root/.gradle/caches/*/scripts /root/.gradle/caches/jars-* 2>/dev/null; rm -rf /root/.cache/bazel 2>/dev/null; true +if [ "$LATER" -gt 0 ]; then + mv "$CWD/.git" "$M/git-hidden" + echo "history not truncated at ${BASE:0:12}: .git hidden while the agent works" +fi +write_blocklist + +touch "$M/ready" +echo "setup done" diff --git a/tasks/format-code-task-002822/tests/test.patch b/tasks/format-code-task-002822/tests/test.patch new file mode 100644 index 0000000000000000000000000000000000000000..bd1af40a62db548efd9f418fb4b339990053ef02 --- /dev/null +++ b/tasks/format-code-task-002822/tests/test.patch @@ -0,0 +1,70 @@ +diff --git a/src/__tests__/to-have-text-content.js b/src/__tests__/to-have-text-content.js +index 8874c68..0e9a843 100644 +--- a/src/__tests__/to-have-text-content.js ++++ b/src/__tests__/to-have-text-content.js +@@ -91,4 +91,43 @@ describe('.toHaveTextContent', () => { + expect(container.querySelector('span')).toHaveTextContent(''), + ).toThrowError(/toBeEmptyDOMElement\(\)/) + }) ++ ++ ++ test('accepts a text node (issue reproduction)', () => { ++ const {container} = render('Resource:libxul.so') ++ const resourceLabel = container.querySelector('span') ++ const valueElement = resourceLabel.nextSibling ++ ++ ++ expect(valueElement.nodeType).toBe(3) ++ expect(valueElement).toHaveTextContent('libxul.so') ++ }) ++ ++ test('accepts a text node with regex and negative assertions', () => { ++ const {container} = render('hello world') ++ const textNode = container.firstChild ++ ++ expect(textNode.nodeType).toBe(3) ++ expect(textNode).toHaveTextContent('hello world') ++ expect(textNode).toHaveTextContent(/hello/) ++ expect(textNode).not.toHaveTextContent('goodbye') ++ }) ++ ++ test('accepts a comment node', () => { ++ const {container} = render('parent') ++ const commentNode = container.ownerDocument.createComment('hello comment') ++ container.appendChild(commentNode) ++ ++ expect(commentNode.nodeType).toBe(8) ++ expect(commentNode).toHaveTextContent('hello comment') ++ expect(commentNode).not.toHaveTextContent('different content') ++ }) ++ ++ test('throws when receiving a non-Node value with a textContent property', () => { ++ ++ ++ expect(() => ++ expect({textContent: 'libxul.so'}).toHaveTextContent('libxul.so'), ++ ).toThrowError() ++ }) + }) +diff --git a/test_commands.json b/test_commands.json +new file mode 100644 +index 0000000..81914dd +--- /dev/null ++++ b/test_commands.json +@@ -0,0 +1,3 @@ ++{ ++ "test_commands": ["npx jest src/__tests__/to-have-text-content.js"] ++} +diff --git a/mimo_test_command.sh b/mimo_test_command.sh +new file mode 100755 +--- /dev/null ++++ b/mimo_test_command.sh +@@ -0,0 +1,8 @@ ++#!/usr/bin/env bash ++ ++set -uo pipefail ++cd /testbed ++rc=0 ++npx jest src/__tests__/to-have-text-content.js ++rc=$(( rc | $? )) ++exit $rc diff --git a/tasks/format-code-task-002822/tests/test.sh b/tasks/format-code-task-002822/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..d927f20a401a665f88fa1b6ab8afa2f8ab46f90b --- /dev/null +++ b/tasks/format-code-task-002822/tests/test.sh @@ -0,0 +1,39 @@ +#!/bin/bash +# Code grading, mimoagent opensource_code.py: reset the files the hidden test patch touches, apply it, run the +# task's test command; reward 1 when it exits 0. A testbed failure (reset or apply) writes no reward: not scored. +M=/var/lib/mimo +CWD=/testbed +V=/logs/verifier +mkdir -p "$V" +BASE=$(cat "$M/base" 2>/dev/null) || { echo "setup never ran (no $M/base)" >&2; exit 1; } +cd "$CWD" || exit 1 +if [ -d "$M/git-hidden" ]; then rm -rf "$CWD/.git"; mv "$M/git-hidden" "$CWD/.git"; fi +# the agent's change against the base, so its own commits count too +git add -A >/dev/null 2>&1 && git -c core.fileMode=false diff --cached "$BASE" > "$V/agent.diff" +git reset -q +if ! ( +while IFS= read -r tf; do + [ -z "$tf" ] && continue + if git cat-file -e $BASE:"$tf" 2>/dev/null; then + git checkout $BASE -- "$tf" 2>/dev/null || true + else + git rm -f --cached "$tf" >/dev/null 2>&1 || true + rm -f "$tf" + fi +done <<'EOF_RESET_TEST_FILES' +src/__tests__/to-have-text-content.js +test_commands.json +mimo_test_command.sh +EOF_RESET_TEST_FILES + +); then echo "could not reset the test files (testbed problem, not scored)" >&2; exit 1; fi +if ! git apply --verbose /tests/test.patch > "$V/apply.log" 2>&1; then + cat "$V/apply.log" >&2 + echo "the hidden tests could not be applied (testbed problem, not scored)" >&2 + exit 1 +fi +timeout 1800 sh -c "$(cat /tests/test_command.sh)" > "$V/test_output.log" 2>&1 +RC=$? +tail -c 12000 "$V/test_output.log" +if [ $RC -eq 0 ]; then echo 1 > "$V/reward.txt"; else echo 0 > "$V/reward.txt"; fi +echo "test command exited $RC" diff --git a/tasks/format-code-task-002822/tests/test_command.sh b/tasks/format-code-task-002822/tests/test_command.sh new file mode 100644 index 0000000000000000000000000000000000000000..7cb23076694ad17d72e8296d62b2b240083e36db --- /dev/null +++ b/tasks/format-code-task-002822/tests/test_command.sh @@ -0,0 +1 @@ +bash /testbed/mimo_test_command.sh \ No newline at end of file diff --git a/tasks/format-code-task-002825/environment/Dockerfile b/tasks/format-code-task-002825/environment/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..664218d4a45157fd70345b732552d226a59495a0 --- /dev/null +++ b/tasks/format-code-task-002825/environment/Dockerfile @@ -0,0 +1,3 @@ +# The task's image, pinned by digest (the same as [environment].docker_image). +# Setup runs at start from [environment.healthcheck]; environment/setup/ is its readable copy. +FROM docker.io/xiaomimimo/mimo-v2.6-rl-oss@sha256:3c1ffb20755be0a06404c64f4264db96615371776532fc0cce1ae12de73344ae diff --git a/tasks/format-code-task-002825/environment/setup/files/blocklist b/tasks/format-code-task-002825/environment/setup/files/blocklist new file mode 100644 index 0000000000000000000000000000000000000000..a8e4bdc4c7d9b739c047a3cb58ea72a1bb05bcbc --- /dev/null +++ b/tasks/format-code-task-002825/environment/setup/files/blocklist @@ -0,0 +1,33 @@ +# mimo answer-leak blocklist (mimoagent) +0.0.0.0 github.com +0.0.0.0 www.github.com +0.0.0.0 api.github.com +0.0.0.0 raw.githubusercontent.com +0.0.0.0 codeload.github.com +0.0.0.0 objects.githubusercontent.com +0.0.0.0 gist.github.com +0.0.0.0 gist.githubusercontent.com +0.0.0.0 gitlab.com +0.0.0.0 bitbucket.org +0.0.0.0 sourceforge.net +0.0.0.0 git.kernel.org +0.0.0.0 chromium.googlesource.com +0.0.0.0 android.googlesource.com +0.0.0.0 sourcegraph.com +0.0.0.0 bugs.chromium.org +0.0.0.0 issues.oss-fuzz.com +0.0.0.0 oss-fuzz.com +0.0.0.0 osv.dev +0.0.0.0 api.osv.dev +0.0.0.0 bugzilla.mozilla.org +0.0.0.0 proxy.golang.org +0.0.0.0 sum.golang.org +0.0.0.0 pkg.go.dev +0.0.0.0 google.com +0.0.0.0 www.google.com +0.0.0.0 bing.com +0.0.0.0 www.bing.com +0.0.0.0 duckduckgo.com +0.0.0.0 html.duckduckgo.com +0.0.0.0 search.brave.com +0.0.0.0 stackoverflow.com diff --git a/tasks/format-code-task-002825/environment/setup/setup.sh b/tasks/format-code-task-002825/environment/setup/setup.sh new file mode 100644 index 0000000000000000000000000000000000000000..d883db90cfcfb48f7a139861bbe9f6b5d95cad6f --- /dev/null +++ b/tasks/format-code-task-002825/environment/setup/setup.sh @@ -0,0 +1,34 @@ +#!/bin/bash +# Runs once, as root, before the agent starts: Harbor's [environment.healthcheck] unpacks this folder into +# /var/lib/mimo and runs it. Generated by mimo_harbor; see its README for how each step maps to Xiaomi's harness. +M=/var/lib/mimo +[ -f "$M/ready" ] && exit 0 +chmod 700 "$M" +fail() { echo "setup: $*" >&2; exit 1; } +# the answer-leak blocklist (mimoagent), applied to /etc/hosts by the agent right after it installs +write_blocklist() { cp "$M/files/blocklist" "$M/blocklist"; } + +# Code: mimoagent environments/datasets/opensource_code.py + base.py, as the explorer runs it (app/runner/domains.py Code). +CWD=/testbed +git config --global --add safe.directory "$CWD" +cd "$CWD" || fail "no working directory $CWD" +if ! git rev-parse --git-dir >/dev/null 2>&1; then # a bare source tree: give it a baseline commit + git init -q && git add -A && git -c user.name=mimo -c user.email=mimo@localhost commit -q -m baseline --allow-empty +fi +BASE=$(git rev-parse HEAD 2>/dev/null) +[ ${#BASE} -eq 40 ] || fail "could not resolve the base commit in $CWD" +echo "$BASE" > "$M/base" +# Images are built with history truncated at the base. If one is not, the fix could be read out of git log, +# so .git is hidden while the agent works and put back for grading. +LATER=$(git rev-list --all --not "$BASE" 2>/dev/null | head -n 5 | grep -c . || true) +rm -f /tmp/fail.log /tmp/pass.log /tmp/patch.diff /tmp/test_patch.diff /tmp/*.log 2>/dev/null; rm -rf /tmp/claude-0 /tmp/claude-* /tmp/testem-* /tmp/puppeteer_dev_chrome_profile-* 2>/dev/null; rm -f /tmp/test_files.json 2>/dev/null; rm -rf /tmp/jest_* /tmp/jest-* /tmp/build /tmp/build_env 2>/dev/null; rm -rf /tmp/pytest-of-root /tmp/pytest-* /tmp/.pytest_cache /tmp/__pycache__ 2>/dev/null; rm -rf /tmp/go-build* /tmp/standards /tmp/wordpress /tmp/zig-* /tmp/testbase /tmp/testbed 2>/dev/null; rm -f /tmp/tmp*.tmp /tmp/*.bak /tmp/expect* /tmp/butwas* 2>/dev/null; rm -rf /root/.cache/go-build 2>/dev/null; rm -rf /tests 2>/dev/null; find /logs -mindepth 1 -delete 2>/dev/null; mkdir -p /logs/agent /logs/verifier /logs/artifacts; chmod 777 /logs/agent /logs/verifier /logs/artifacts; find /var/log -type f -delete 2>/dev/null || true; rm -rf /var/lib/postgresql/*/*/log /var/lib/postgresql/*/*/pg_log 2>/dev/null || true; find /var/lib/mysql /var/lib/mongodb -type f -name '*.log' -delete 2>/dev/null || true; rm -rf /root/.npm/_logs /root/.babel.json /root/.pytest_cache 2>/dev/null || true; find / -maxdepth 4 -xdev -name task_description.md -path '*/.build_env/*' -delete 2>/dev/null || true; true +git clean -fdx --exclude=node_modules --exclude=bower_components --exclude=.husky --exclude=vendor --exclude=third_party --exclude=_deps --exclude=vcpkg_installed --exclude=.venv --exclude=venv --exclude=.gradle --exclude=target --exclude=.build --exclude=lib --exclude=.bundle --exclude=Manifest.toml --exclude=_build --exclude=.stack-work --exclude=dist-newstyle >/dev/null 2>&1 +find /root/.m2 -type f \( -name '*-SNAPSHOT.jar' -o -name '*-SNAPSHOT-sources.jar' -o -name '*-SNAPSHOT-tests.jar' -o -name '*-SNAPSHOT-test-sources.jar' \) -delete 2>/dev/null; rm -rf /root/.julia/compiled 2>/dev/null; rm -rf /root/.gradle/caches/build-cache-* /root/.gradle/daemon 2>/dev/null; rm -rf /root/.gradle/caches/*/scripts /root/.gradle/caches/jars-* 2>/dev/null; rm -rf /root/.cache/bazel 2>/dev/null; true +if [ "$LATER" -gt 0 ]; then + mv "$CWD/.git" "$M/git-hidden" + echo "history not truncated at ${BASE:0:12}: .git hidden while the agent works" +fi +write_blocklist + +touch "$M/ready" +echo "setup done" diff --git a/tasks/format-code-task-002825/tests/test.patch b/tasks/format-code-task-002825/tests/test.patch new file mode 100644 index 0000000000000000000000000000000000000000..bfb1023559f07ace00c479d4edbc9407c9410b2c --- /dev/null +++ b/tasks/format-code-task-002825/tests/test.patch @@ -0,0 +1,92 @@ +diff --git a/api/wasm_test.go b/api/wasm_test.go +index 0f154f3833..ad2c425486 100644 +--- a/api/wasm_test.go ++++ b/api/wasm_test.go +@@ -111,7 +111,7 @@ func TestEncodeDecodeF64(t *testing.T) { + } + } + +-func TestEncodeCastI32(t *testing.T) { ++func TestEncodeI32(t *testing.T) { + for _, v := range []int32{ + 0, 100, -100, 1, -1, + math.MaxInt32, +@@ -126,7 +126,57 @@ func TestEncodeCastI32(t *testing.T) { + } + } + +-func TestEncodeCastI64(t *testing.T) { ++func TestDecodeI32(t *testing.T) { ++ mini32 := math.MinInt32 ++ for _, tc := range []struct { ++ in uint64 ++ exp int32 ++ }{ ++ {in: 0, exp: 0}, ++ {in: 1 << 60, exp: 0}, ++ {in: 1 << 30, exp: 1 << 30}, ++ {in: 1<<30 | 1<<60, exp: 1 << 30}, ++ {in: uint64(uint32(mini32)) | 1<<59, exp: math.MinInt32}, ++ {in: uint64(uint32(math.MaxInt32)) | 1<<50, exp: math.MaxInt32}, ++ } { ++ decoded := DecodeI32(tc.in) ++ require.Equal(t, tc.exp, decoded) ++ } ++} ++ ++func TestEncodeU32(t *testing.T) { ++ for _, v := range []uint32{ ++ 0, 100, 1, 1 << 31, ++ math.MaxInt32, ++ math.MaxUint32, ++ } { ++ t.Run(fmt.Sprintf("%d", v), func(t *testing.T) { ++ encoded := EncodeU32(v) ++ require.Zero(t, encoded>>32) ++ require.Equal(t, v, uint32(encoded)) ++ }) ++ } ++} ++ ++func TestDecodeU32(t *testing.T) { ++ mini32 := math.MinInt32 ++ for _, tc := range []struct { ++ in uint64 ++ exp uint32 ++ }{ ++ {in: 0, exp: 0}, ++ {in: 1 << 60, exp: 0}, ++ {in: 1 << 30, exp: 1 << 30}, ++ {in: 1<<30 | 1<<60, exp: 1 << 30}, ++ {in: uint64(uint32(mini32)) | 1<<59, exp: uint32(mini32)}, ++ {in: uint64(uint32(math.MaxInt32)) | 1<<50, exp: math.MaxInt32}, ++ } { ++ decoded := DecodeU32(tc.in) ++ require.Equal(t, tc.exp, decoded) ++ } ++} ++ ++func TestEncodeI64(t *testing.T) { + for _, v := range []int64{ + 0, 100, -100, 1, -1, + math.MaxInt64, +diff --git a/mimo_build_env.tar.gz.b64 b/mimo_build_env.tar.gz.b64 +new file mode 100644 +--- /dev/null ++++ b/mimo_build_env.tar.gz.b64 +@@ -0,0 +1,4 @@ ++H4sIAAAAAAAAA+3Sz4rCMBDH8Zz7FCN7tulU0558Fuk/1sLaLDb1+a1FqCzs9qIs4vdzmWESyMAv ++cTm0X/W+6c7WPEsyyp2b6uhnnXp1qWq+TfN8YxLVTFMj7mkb3Rn6UJxEzMn78Ne9pfMXFc/5h6YP +++8ofj0VXx/3hcW8s5p9t5vzTca7bTJ2R5HEr/O7N8/9Y2bLtbFn0h6iqZfoEZVNHn16urcS2+G6t ++rM+yrvzQhZ1G/70yAAAAAAAAAAAAAAAAgJsLEJMiygAoAAA= +diff --git a/mimo_test_command.sh b/mimo_test_command.sh +new file mode 100755 +--- /dev/null ++++ b/mimo_test_command.sh +@@ -0,0 +1,6 @@ ++#!/usr/bin/env bash ++ ++set -uo pipefail ++cd /testbed || exit 1 ++base64 -d mimo_build_env.tar.gz.b64 | tar -xzf - -C /testbed || exit 1 ++exec bash -lc 'cd /testbed && bash -eo pipefail /testbed/.build_env/test_command.sh' diff --git a/tasks/format-code-task-002825/tests/test.sh b/tasks/format-code-task-002825/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..d7f80c255a52ad22dd3b7bfde8043be8a8a73998 --- /dev/null +++ b/tasks/format-code-task-002825/tests/test.sh @@ -0,0 +1,39 @@ +#!/bin/bash +# Code grading, mimoagent opensource_code.py: reset the files the hidden test patch touches, apply it, run the +# task's test command; reward 1 when it exits 0. A testbed failure (reset or apply) writes no reward: not scored. +M=/var/lib/mimo +CWD=/testbed +V=/logs/verifier +mkdir -p "$V" +BASE=$(cat "$M/base" 2>/dev/null) || { echo "setup never ran (no $M/base)" >&2; exit 1; } +cd "$CWD" || exit 1 +if [ -d "$M/git-hidden" ]; then rm -rf "$CWD/.git"; mv "$M/git-hidden" "$CWD/.git"; fi +# the agent's change against the base, so its own commits count too +git add -A >/dev/null 2>&1 && git -c core.fileMode=false diff --cached "$BASE" > "$V/agent.diff" +git reset -q +if ! ( +while IFS= read -r tf; do + [ -z "$tf" ] && continue + if git cat-file -e $BASE:"$tf" 2>/dev/null; then + git checkout $BASE -- "$tf" 2>/dev/null || true + else + git rm -f --cached "$tf" >/dev/null 2>&1 || true + rm -f "$tf" + fi +done <<'EOF_RESET_TEST_FILES' +api/wasm_test.go +mimo_build_env.tar.gz.b64 +mimo_test_command.sh +EOF_RESET_TEST_FILES + +); then echo "could not reset the test files (testbed problem, not scored)" >&2; exit 1; fi +if ! git apply --verbose /tests/test.patch > "$V/apply.log" 2>&1; then + cat "$V/apply.log" >&2 + echo "the hidden tests could not be applied (testbed problem, not scored)" >&2 + exit 1 +fi +timeout 1800 sh -c "$(cat /tests/test_command.sh)" > "$V/test_output.log" 2>&1 +RC=$? +tail -c 12000 "$V/test_output.log" +if [ $RC -eq 0 ]; then echo 1 > "$V/reward.txt"; else echo 0 > "$V/reward.txt"; fi +echo "test command exited $RC" diff --git a/tasks/format-code-task-002825/tests/test_command.sh b/tasks/format-code-task-002825/tests/test_command.sh new file mode 100644 index 0000000000000000000000000000000000000000..7cb23076694ad17d72e8296d62b2b240083e36db --- /dev/null +++ b/tasks/format-code-task-002825/tests/test_command.sh @@ -0,0 +1 @@ +bash /testbed/mimo_test_command.sh \ No newline at end of file diff --git a/tasks/format-code-task-002831/environment/Dockerfile b/tasks/format-code-task-002831/environment/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..fec086818a8b9f54ac8cfb7793442dfbbd19bd8a --- /dev/null +++ b/tasks/format-code-task-002831/environment/Dockerfile @@ -0,0 +1,3 @@ +# The task's image, pinned by digest (the same as [environment].docker_image). +# Setup runs at start from [environment.healthcheck]; environment/setup/ is its readable copy. +FROM docker.io/xiaomimimo/mimo-v2.6-rl-oss@sha256:4fcf35820919ead57af8b5b6d02599e21e4e55e89dc83f9e2e06a1c855f6cfe4 diff --git a/tasks/format-code-task-002831/environment/setup/files/blocklist b/tasks/format-code-task-002831/environment/setup/files/blocklist new file mode 100644 index 0000000000000000000000000000000000000000..a8e4bdc4c7d9b739c047a3cb58ea72a1bb05bcbc --- /dev/null +++ b/tasks/format-code-task-002831/environment/setup/files/blocklist @@ -0,0 +1,33 @@ +# mimo answer-leak blocklist (mimoagent) +0.0.0.0 github.com +0.0.0.0 www.github.com +0.0.0.0 api.github.com +0.0.0.0 raw.githubusercontent.com +0.0.0.0 codeload.github.com +0.0.0.0 objects.githubusercontent.com +0.0.0.0 gist.github.com +0.0.0.0 gist.githubusercontent.com +0.0.0.0 gitlab.com +0.0.0.0 bitbucket.org +0.0.0.0 sourceforge.net +0.0.0.0 git.kernel.org +0.0.0.0 chromium.googlesource.com +0.0.0.0 android.googlesource.com +0.0.0.0 sourcegraph.com +0.0.0.0 bugs.chromium.org +0.0.0.0 issues.oss-fuzz.com +0.0.0.0 oss-fuzz.com +0.0.0.0 osv.dev +0.0.0.0 api.osv.dev +0.0.0.0 bugzilla.mozilla.org +0.0.0.0 proxy.golang.org +0.0.0.0 sum.golang.org +0.0.0.0 pkg.go.dev +0.0.0.0 google.com +0.0.0.0 www.google.com +0.0.0.0 bing.com +0.0.0.0 www.bing.com +0.0.0.0 duckduckgo.com +0.0.0.0 html.duckduckgo.com +0.0.0.0 search.brave.com +0.0.0.0 stackoverflow.com diff --git a/tasks/format-code-task-002831/environment/setup/setup.sh b/tasks/format-code-task-002831/environment/setup/setup.sh new file mode 100644 index 0000000000000000000000000000000000000000..d883db90cfcfb48f7a139861bbe9f6b5d95cad6f --- /dev/null +++ b/tasks/format-code-task-002831/environment/setup/setup.sh @@ -0,0 +1,34 @@ +#!/bin/bash +# Runs once, as root, before the agent starts: Harbor's [environment.healthcheck] unpacks this folder into +# /var/lib/mimo and runs it. Generated by mimo_harbor; see its README for how each step maps to Xiaomi's harness. +M=/var/lib/mimo +[ -f "$M/ready" ] && exit 0 +chmod 700 "$M" +fail() { echo "setup: $*" >&2; exit 1; } +# the answer-leak blocklist (mimoagent), applied to /etc/hosts by the agent right after it installs +write_blocklist() { cp "$M/files/blocklist" "$M/blocklist"; } + +# Code: mimoagent environments/datasets/opensource_code.py + base.py, as the explorer runs it (app/runner/domains.py Code). +CWD=/testbed +git config --global --add safe.directory "$CWD" +cd "$CWD" || fail "no working directory $CWD" +if ! git rev-parse --git-dir >/dev/null 2>&1; then # a bare source tree: give it a baseline commit + git init -q && git add -A && git -c user.name=mimo -c user.email=mimo@localhost commit -q -m baseline --allow-empty +fi +BASE=$(git rev-parse HEAD 2>/dev/null) +[ ${#BASE} -eq 40 ] || fail "could not resolve the base commit in $CWD" +echo "$BASE" > "$M/base" +# Images are built with history truncated at the base. If one is not, the fix could be read out of git log, +# so .git is hidden while the agent works and put back for grading. +LATER=$(git rev-list --all --not "$BASE" 2>/dev/null | head -n 5 | grep -c . || true) +rm -f /tmp/fail.log /tmp/pass.log /tmp/patch.diff /tmp/test_patch.diff /tmp/*.log 2>/dev/null; rm -rf /tmp/claude-0 /tmp/claude-* /tmp/testem-* /tmp/puppeteer_dev_chrome_profile-* 2>/dev/null; rm -f /tmp/test_files.json 2>/dev/null; rm -rf /tmp/jest_* /tmp/jest-* /tmp/build /tmp/build_env 2>/dev/null; rm -rf /tmp/pytest-of-root /tmp/pytest-* /tmp/.pytest_cache /tmp/__pycache__ 2>/dev/null; rm -rf /tmp/go-build* /tmp/standards /tmp/wordpress /tmp/zig-* /tmp/testbase /tmp/testbed 2>/dev/null; rm -f /tmp/tmp*.tmp /tmp/*.bak /tmp/expect* /tmp/butwas* 2>/dev/null; rm -rf /root/.cache/go-build 2>/dev/null; rm -rf /tests 2>/dev/null; find /logs -mindepth 1 -delete 2>/dev/null; mkdir -p /logs/agent /logs/verifier /logs/artifacts; chmod 777 /logs/agent /logs/verifier /logs/artifacts; find /var/log -type f -delete 2>/dev/null || true; rm -rf /var/lib/postgresql/*/*/log /var/lib/postgresql/*/*/pg_log 2>/dev/null || true; find /var/lib/mysql /var/lib/mongodb -type f -name '*.log' -delete 2>/dev/null || true; rm -rf /root/.npm/_logs /root/.babel.json /root/.pytest_cache 2>/dev/null || true; find / -maxdepth 4 -xdev -name task_description.md -path '*/.build_env/*' -delete 2>/dev/null || true; true +git clean -fdx --exclude=node_modules --exclude=bower_components --exclude=.husky --exclude=vendor --exclude=third_party --exclude=_deps --exclude=vcpkg_installed --exclude=.venv --exclude=venv --exclude=.gradle --exclude=target --exclude=.build --exclude=lib --exclude=.bundle --exclude=Manifest.toml --exclude=_build --exclude=.stack-work --exclude=dist-newstyle >/dev/null 2>&1 +find /root/.m2 -type f \( -name '*-SNAPSHOT.jar' -o -name '*-SNAPSHOT-sources.jar' -o -name '*-SNAPSHOT-tests.jar' -o -name '*-SNAPSHOT-test-sources.jar' \) -delete 2>/dev/null; rm -rf /root/.julia/compiled 2>/dev/null; rm -rf /root/.gradle/caches/build-cache-* /root/.gradle/daemon 2>/dev/null; rm -rf /root/.gradle/caches/*/scripts /root/.gradle/caches/jars-* 2>/dev/null; rm -rf /root/.cache/bazel 2>/dev/null; true +if [ "$LATER" -gt 0 ]; then + mv "$CWD/.git" "$M/git-hidden" + echo "history not truncated at ${BASE:0:12}: .git hidden while the agent works" +fi +write_blocklist + +touch "$M/ready" +echo "setup done" diff --git a/tasks/format-code-task-002831/tests/test.patch b/tasks/format-code-task-002831/tests/test.patch new file mode 100644 index 0000000000000000000000000000000000000000..a858e4679ae391e6db202763686e3d5f9c724f55 --- /dev/null +++ b/tasks/format-code-task-002831/tests/test.patch @@ -0,0 +1,94 @@ +diff --git a/test_commands.json b/test_commands.json +new file mode 100644 +index 0000000..97619c9 +--- /dev/null ++++ b/test_commands.json +@@ -0,0 +1,3 @@ ++{ ++ "test_commands": ["npx ava --serial --verbose tests/issues/protocol-retained.test.js"] ++} +diff --git a/tests/issues/protocol-retained.test.js b/tests/issues/protocol-retained.test.js +new file mode 100644 +index 0000000..7077396 +--- /dev/null ++++ b/tests/issues/protocol-retained.test.js +@@ -0,0 +1,66 @@ ++import test from 'ava'; ++import io from '../../src/socket-io'; ++import Server from '../../src/server'; ++ ++test('io.connect retains a string protocol on the socket instance', t => { ++ const socketUrl = 'ws://localhost:8080'; ++ const mockServer = new Server(socketUrl); ++ const socket = io.connect(socketUrl, 'custom protocol'); ++ ++ t.is(socket.protocol, 'custom protocol'); ++ mockServer.close(); ++}); ++ ++test('io(url, protocol) retains a string protocol on the socket instance', t => { ++ const socketUrl = 'ws://localhost:8081'; ++ const mockServer = new Server(socketUrl); ++ const socket = io(socketUrl, 'custom protocol'); ++ ++ t.is(socket.protocol, 'custom protocol'); ++ mockServer.close(); ++}); ++ ++test.cb('server connection handler sees the protocol on the connected client instance', t => { ++ const socketUrl = 'ws://localhost:8082'; ++ const mockServer = new Server(socketUrl); ++ ++ mockServer.on('connection', (server, clientInstance) => { ++ t.is(clientInstance.protocol, 'custom protocol'); ++ mockServer.close(); ++ t.end(); ++ }); ++ ++ io.connect(socketUrl, 'custom protocol'); ++}); ++ ++test.cb('server connection handler sees protocol when using io() directly', t => { ++ const socketUrl = 'ws://localhost:8083'; ++ const mockServer = new Server(socketUrl); ++ ++ mockServer.on('connection', (server, clientInstance) => { ++ t.is(clientInstance.protocol, 'another protocol'); ++ mockServer.close(); ++ t.end(); ++ }); ++ ++ io(socketUrl, 'another protocol'); ++}); ++ ++test('io.connect retains an object protocol on the socket instance', t => { ++ const socketUrl = 'ws://localhost:8084'; ++ const mockServer = new Server(socketUrl); ++ const protocolObj = { a: 'apple' }; ++ const socket = io.connect(socketUrl, protocolObj); ++ ++ t.deepEqual(socket.protocol, { a: 'apple' }); ++ mockServer.close(); ++}); ++ ++test('io.connect without protocol defaults to empty string', t => { ++ const socketUrl = 'ws://localhost:8085'; ++ const mockServer = new Server(socketUrl); ++ const socket = io.connect(socketUrl); ++ ++ t.is(socket.protocol, ''); ++ mockServer.close(); ++}); +diff --git a/mimo_test_command.sh b/mimo_test_command.sh +new file mode 100755 +--- /dev/null ++++ b/mimo_test_command.sh +@@ -0,0 +1,8 @@ ++#!/usr/bin/env bash ++ ++set -uo pipefail ++cd /testbed ++rc=0 ++npx ava --serial --verbose tests/issues/protocol-retained.test.js ++rc=$(( rc | $? )) ++exit $rc diff --git a/tasks/format-code-task-002831/tests/test.sh b/tasks/format-code-task-002831/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..e049628dc9c4274ab47ecd05d316049be0bf2eff --- /dev/null +++ b/tasks/format-code-task-002831/tests/test.sh @@ -0,0 +1,39 @@ +#!/bin/bash +# Code grading, mimoagent opensource_code.py: reset the files the hidden test patch touches, apply it, run the +# task's test command; reward 1 when it exits 0. A testbed failure (reset or apply) writes no reward: not scored. +M=/var/lib/mimo +CWD=/testbed +V=/logs/verifier +mkdir -p "$V" +BASE=$(cat "$M/base" 2>/dev/null) || { echo "setup never ran (no $M/base)" >&2; exit 1; } +cd "$CWD" || exit 1 +if [ -d "$M/git-hidden" ]; then rm -rf "$CWD/.git"; mv "$M/git-hidden" "$CWD/.git"; fi +# the agent's change against the base, so its own commits count too +git add -A >/dev/null 2>&1 && git -c core.fileMode=false diff --cached "$BASE" > "$V/agent.diff" +git reset -q +if ! ( +while IFS= read -r tf; do + [ -z "$tf" ] && continue + if git cat-file -e $BASE:"$tf" 2>/dev/null; then + git checkout $BASE -- "$tf" 2>/dev/null || true + else + git rm -f --cached "$tf" >/dev/null 2>&1 || true + rm -f "$tf" + fi +done <<'EOF_RESET_TEST_FILES' +test_commands.json +tests/issues/protocol-retained.test.js +mimo_test_command.sh +EOF_RESET_TEST_FILES + +); then echo "could not reset the test files (testbed problem, not scored)" >&2; exit 1; fi +if ! git apply --verbose /tests/test.patch > "$V/apply.log" 2>&1; then + cat "$V/apply.log" >&2 + echo "the hidden tests could not be applied (testbed problem, not scored)" >&2 + exit 1 +fi +timeout 1800 sh -c "$(cat /tests/test_command.sh)" > "$V/test_output.log" 2>&1 +RC=$? +tail -c 12000 "$V/test_output.log" +if [ $RC -eq 0 ]; then echo 1 > "$V/reward.txt"; else echo 0 > "$V/reward.txt"; fi +echo "test command exited $RC" diff --git a/tasks/format-code-task-002831/tests/test_command.sh b/tasks/format-code-task-002831/tests/test_command.sh new file mode 100644 index 0000000000000000000000000000000000000000..7cb23076694ad17d72e8296d62b2b240083e36db --- /dev/null +++ b/tasks/format-code-task-002831/tests/test_command.sh @@ -0,0 +1 @@ +bash /testbed/mimo_test_command.sh \ No newline at end of file diff --git a/tasks/format-code-task-002836/environment/Dockerfile b/tasks/format-code-task-002836/environment/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..00d2dbba4b164391092ca25ff4aeacf2467b6d59 --- /dev/null +++ b/tasks/format-code-task-002836/environment/Dockerfile @@ -0,0 +1,3 @@ +# The task's image, pinned by digest (the same as [environment].docker_image). +# Setup runs at start from [environment.healthcheck]; environment/setup/ is its readable copy. +FROM docker.io/xiaomimimo/mimo-v2.6-rl-oss@sha256:42632182323d6479c3f46ebb0458ab9f42f46d61748bdbab246ac8c643426f2d diff --git a/tasks/format-code-task-002836/environment/setup/files/blocklist b/tasks/format-code-task-002836/environment/setup/files/blocklist new file mode 100644 index 0000000000000000000000000000000000000000..a8e4bdc4c7d9b739c047a3cb58ea72a1bb05bcbc --- /dev/null +++ b/tasks/format-code-task-002836/environment/setup/files/blocklist @@ -0,0 +1,33 @@ +# mimo answer-leak blocklist (mimoagent) +0.0.0.0 github.com +0.0.0.0 www.github.com +0.0.0.0 api.github.com +0.0.0.0 raw.githubusercontent.com +0.0.0.0 codeload.github.com +0.0.0.0 objects.githubusercontent.com +0.0.0.0 gist.github.com +0.0.0.0 gist.githubusercontent.com +0.0.0.0 gitlab.com +0.0.0.0 bitbucket.org +0.0.0.0 sourceforge.net +0.0.0.0 git.kernel.org +0.0.0.0 chromium.googlesource.com +0.0.0.0 android.googlesource.com +0.0.0.0 sourcegraph.com +0.0.0.0 bugs.chromium.org +0.0.0.0 issues.oss-fuzz.com +0.0.0.0 oss-fuzz.com +0.0.0.0 osv.dev +0.0.0.0 api.osv.dev +0.0.0.0 bugzilla.mozilla.org +0.0.0.0 proxy.golang.org +0.0.0.0 sum.golang.org +0.0.0.0 pkg.go.dev +0.0.0.0 google.com +0.0.0.0 www.google.com +0.0.0.0 bing.com +0.0.0.0 www.bing.com +0.0.0.0 duckduckgo.com +0.0.0.0 html.duckduckgo.com +0.0.0.0 search.brave.com +0.0.0.0 stackoverflow.com diff --git a/tasks/format-code-task-002836/environment/setup/setup.sh b/tasks/format-code-task-002836/environment/setup/setup.sh new file mode 100644 index 0000000000000000000000000000000000000000..e9eb7daf39f9542bd095367feee457f3da77e492 --- /dev/null +++ b/tasks/format-code-task-002836/environment/setup/setup.sh @@ -0,0 +1,34 @@ +#!/bin/bash +# Runs once, as root, before the agent starts: Harbor's [environment.healthcheck] unpacks this folder into +# /var/lib/mimo and runs it. Generated by mimo_harbor; see its README for how each step maps to Xiaomi's harness. +M=/var/lib/mimo +[ -f "$M/ready" ] && exit 0 +chmod 700 "$M" +fail() { echo "setup: $*" >&2; exit 1; } +# the answer-leak blocklist (mimoagent), applied to /etc/hosts by the agent right after it installs +write_blocklist() { cp "$M/files/blocklist" "$M/blocklist"; } + +# Code: mimoagent environments/datasets/opensource_code.py + base.py, as the explorer runs it (app/runner/domains.py Code). +CWD=/workspace/repo +git config --global --add safe.directory "$CWD" +cd "$CWD" || fail "no working directory $CWD" +if ! git rev-parse --git-dir >/dev/null 2>&1; then # a bare source tree: give it a baseline commit + git init -q && git add -A && git -c user.name=mimo -c user.email=mimo@localhost commit -q -m baseline --allow-empty +fi +BASE=$(git rev-parse HEAD 2>/dev/null) +[ ${#BASE} -eq 40 ] || fail "could not resolve the base commit in $CWD" +echo "$BASE" > "$M/base" +# Images are built with history truncated at the base. If one is not, the fix could be read out of git log, +# so .git is hidden while the agent works and put back for grading. +LATER=$(git rev-list --all --not "$BASE" 2>/dev/null | head -n 5 | grep -c . || true) +rm -f /tmp/fail.log /tmp/pass.log /tmp/patch.diff /tmp/test_patch.diff /tmp/*.log 2>/dev/null; rm -rf /tmp/claude-0 /tmp/claude-* /tmp/testem-* /tmp/puppeteer_dev_chrome_profile-* 2>/dev/null; rm -f /tmp/test_files.json 2>/dev/null; rm -rf /tmp/jest_* /tmp/jest-* /tmp/build /tmp/build_env 2>/dev/null; rm -rf /tmp/pytest-of-root /tmp/pytest-* /tmp/.pytest_cache /tmp/__pycache__ 2>/dev/null; rm -rf /tmp/go-build* /tmp/standards /tmp/wordpress /tmp/zig-* /tmp/testbase /tmp/testbed 2>/dev/null; rm -f /tmp/tmp*.tmp /tmp/*.bak /tmp/expect* /tmp/butwas* 2>/dev/null; rm -rf /root/.cache/go-build 2>/dev/null; rm -rf /tests 2>/dev/null; find /logs -mindepth 1 -delete 2>/dev/null; mkdir -p /logs/agent /logs/verifier /logs/artifacts; chmod 777 /logs/agent /logs/verifier /logs/artifacts; find /var/log -type f -delete 2>/dev/null || true; rm -rf /var/lib/postgresql/*/*/log /var/lib/postgresql/*/*/pg_log 2>/dev/null || true; find /var/lib/mysql /var/lib/mongodb -type f -name '*.log' -delete 2>/dev/null || true; rm -rf /root/.npm/_logs /root/.babel.json /root/.pytest_cache 2>/dev/null || true; find / -maxdepth 4 -xdev -name task_description.md -path '*/.build_env/*' -delete 2>/dev/null || true; true +git clean -fdx --exclude=node_modules --exclude=bower_components --exclude=.husky --exclude=vendor --exclude=third_party --exclude=_deps --exclude=vcpkg_installed --exclude=.venv --exclude=venv --exclude=.gradle --exclude=target --exclude=.build --exclude=lib --exclude=.bundle --exclude=Manifest.toml --exclude=_build --exclude=.stack-work --exclude=dist-newstyle >/dev/null 2>&1 +find /root/.m2 -type f \( -name '*-SNAPSHOT.jar' -o -name '*-SNAPSHOT-sources.jar' -o -name '*-SNAPSHOT-tests.jar' -o -name '*-SNAPSHOT-test-sources.jar' \) -delete 2>/dev/null; rm -rf /root/.julia/compiled 2>/dev/null; rm -rf /root/.gradle/caches/build-cache-* /root/.gradle/daemon 2>/dev/null; rm -rf /root/.gradle/caches/*/scripts /root/.gradle/caches/jars-* 2>/dev/null; rm -rf /root/.cache/bazel 2>/dev/null; true +if [ "$LATER" -gt 0 ]; then + mv "$CWD/.git" "$M/git-hidden" + echo "history not truncated at ${BASE:0:12}: .git hidden while the agent works" +fi +write_blocklist + +touch "$M/ready" +echo "setup done" diff --git a/tasks/format-code-task-002836/tests/test.patch b/tasks/format-code-task-002836/tests/test.patch new file mode 100644 index 0000000000000000000000000000000000000000..d3d561a6fa2161bb6f54b0d1629de941d8a33099 --- /dev/null +++ b/tasks/format-code-task-002836/tests/test.patch @@ -0,0 +1,276 @@ +diff --git a/usercase-test-coderl/test_yolo_world_prompt_cache.py b/usercase-test-coderl/test_yolo_world_prompt_cache.py +new file mode 100644 +--- /dev/null ++++ b/usercase-test-coderl/test_yolo_world_prompt_cache.py +@@ -0,0 +1,244 @@ ++ ++ ++import torch ++import torch.nn as nn ++from mmdet.registry import MODELS ++from mmdet.structures import DetDataSample ++from mmengine.structures import InstanceData ++ ++from yolo_world.models.detectors import YOLOWorldDetector ++ ++ ++@MODELS.register_module(force=True) ++class FixturePromptCacheBackbone(nn.Module): ++ def __init__(self): ++ super().__init__() ++ self.call_log = [] ++ self.forward_text_results = [] ++ ++ @staticmethod ++ def _signature(texts): ++ return tuple(tuple(group) for group in texts) ++ ++ def forward_text(self, texts): ++ self.call_log.append(("forward_text", self._signature(texts))) ++ values = [] ++ for index, group in enumerate(texts): ++ values.append([float(len("|".join(group))), float(index) + 0.25]) ++ result = torch.tensor([values], dtype=torch.float32) ++ self.forward_text_results.append(result) ++ return result ++ ++ def forward_image(self, batch_inputs): ++ self.call_log.append(("forward_image", tuple(batch_inputs.shape))) ++ return (batch_inputs.mean(dim=(2, 3), keepdim=True),) ++ ++ def forward(self, batch_inputs, texts): ++ self.call_log.append(("forward", self._signature(texts))) ++ return self.forward_image(batch_inputs), self.forward_text(texts) ++ ++ ++@MODELS.register_module(force=True) ++class FixturePromptCacheHead(nn.Module): ++ def __init__(self, train_cfg=None, test_cfg=None): ++ super().__init__() ++ self.num_classes = -1 ++ self.predict_num_classes_seen = None ++ self.predict_txt_feats = None ++ self.forward_txt_feats = None ++ ++ def predict(self, img_feats, txt_feats, batch_data_samples, rescale=True): ++ self.predict_num_classes_seen = self.num_classes ++ self.predict_txt_feats = txt_feats.detach().clone() ++ instances = InstanceData() ++ instances.labels = torch.tensor([0, int(self.num_classes) - 1]) ++ instances.scores = torch.tensor([0.90, 0.40]) ++ instances.bboxes = torch.tensor([[1.0, 2.0, 3.0, 4.0], ++ [5.0, 6.0, 7.0, 8.0]]) ++ return [instances for _ in batch_data_samples] ++ ++ def forward(self, img_feats, txt_feats): ++ self.forward_txt_feats = txt_feats.detach().clone() ++ return (txt_feats.sum(dim=-1), torch.tensor([float(len(img_feats))])) ++ ++ ++def make_model(): ++ return YOLOWorldDetector( ++ backbone=dict(type="FixturePromptCacheBackbone"), ++ neck=None, ++ bbox_head=dict(type="FixturePromptCacheHead"), ++ use_syncbn=False, ++ ) ++ ++ ++def batch_inputs(): ++ return torch.arange(48, dtype=torch.float32).reshape(1, 3, 4, 4) ++ ++ ++def assert_image_only_path(call_log): ++ ++ ++ assert call_log ++ assert all(entry == ("forward_image", (1, 3, 4, 4)) for entry in call_log) ++ ++ ++def test_reparameterize_stores_prompt_list_and_exact_text_tensor(): ++ ++ ++ ++ model = make_model() ++ ++ ++ assert isinstance(model, YOLOWorldDetector) ++ ++ result = model.reparameterize([["cat"], ["dog"], [" "]]) ++ ++ assert result is None ++ assert model.backbone.call_log == [ ++ ("forward_text", (("cat",), ("dog",), (" ",))) ++ ] ++ ++ ++def test_predict_without_sample_texts_reuses_cached_features_and_class_count(): ++ ++ ++ ++ model = make_model() ++ model.reparameterize([["cat"], ["dog"], [" "]]) ++ model.backbone.call_log.clear() ++ ++ results = model.predict(batch_inputs(), [DetDataSample()], rescale=True) ++ ++ assert results[0].pred_instances.labels.tolist() == [0, 2] ++ ++ ++ assert len(results[0].pred_instances.scores) == 2 ++ assert model.bbox_head.predict_num_classes_seen == 3 ++ ++ ++ assert torch.equal(model.bbox_head.predict_txt_feats, ++ model.backbone.forward_text_results[0]) ++ assert_image_only_path(model.backbone.call_log) ++ ++ ++def test_forward_with_none_data_samples_uses_cached_prompts(): ++ ++ ++ ++ model = make_model() ++ model.reparameterize([["cat"], ["dog"], [" "]]) ++ model.backbone.call_log.clear() ++ ++ outputs = model._forward(batch_inputs(), None) ++ ++ assert outputs[0].tolist() == [[3.25, 4.25, 3.25]] ++ assert outputs[1].tolist() == [1.0] ++ ++ ++ assert torch.equal(model.bbox_head.forward_txt_feats, ++ model.backbone.forward_text_results[0]) ++ assert_image_only_path(model.backbone.call_log) ++ ++ ++def test_predict_after_reparameterize_accepts_textless_sample_without_error(): ++ ++ ++ ++ model = make_model() ++ model.reparameterize([["cat"], ["dog"], [" "]]) ++ model.backbone.call_log.clear() ++ ++ result = model.predict(batch_inputs(), [DetDataSample()], rescale=True) ++ ++ ++ ++ assert result[0].pred_instances.labels.tolist() == [0, 2] ++ assert_image_only_path(model.backbone.call_log) ++ ++ ++def test_reparameterize_again_replaces_cached_prompts_and_features(): ++ ++ ++ ++ model = make_model() ++ ++ first = model.reparameterize([["cat"], ["dog"], [" "]]) ++ second = model.reparameterize([["owl"], ["sparrow"]]) ++ ++ assert first is None ++ assert second is None ++ assert model.backbone.call_log == [ ++ ("forward_text", (("cat",), ("dog",), (" ",))), ++ ("forward_text", (("owl",), ("sparrow",))), ++ ] ++ ++ model.backbone.call_log.clear() ++ results = model.predict(batch_inputs(), [DetDataSample()], rescale=True) ++ assert results[0].pred_instances.labels.tolist() == [0, 1] ++ assert model.bbox_head.predict_num_classes_seen == 2 ++ ++ ++ assert torch.equal(model.bbox_head.predict_txt_feats, ++ model.backbone.forward_text_results[1]) ++ assert_image_only_path(model.backbone.call_log) ++ ++ ++def test_two_detector_instances_keep_independent_cached_prompts(): ++ ++ ++ ++ first = make_model() ++ second = make_model() ++ ++ first.reparameterize([["red"], ["blue"]]) ++ second.reparameterize([["cyan"], ["magenta"], ["black"]]) ++ ++ ++ ++ assert first.backbone.call_log == [("forward_text", (("red",), ++ ("blue",)))] ++ assert second.backbone.call_log == [("forward_text", (("cyan",), ++ ("magenta",), ++ ("black",)))] ++ first.backbone.call_log.clear() ++ second.backbone.call_log.clear() ++ ++ first_result = first.predict(batch_inputs(), [DetDataSample()], ++ rescale=True) ++ second_result = second.predict(batch_inputs(), [DetDataSample()], ++ rescale=True) ++ ++ assert first_result[0].pred_instances.labels.tolist() == [0, 1] ++ assert first.bbox_head.predict_num_classes_seen == 2 ++ ++ ++ assert torch.equal(first.bbox_head.predict_txt_feats, ++ first.backbone.forward_text_results[0]) ++ assert second_result[0].pred_instances.labels.tolist() == [0, 2] ++ assert second.bbox_head.predict_num_classes_seen == 3 ++ ++ ++ assert torch.equal(second.bbox_head.predict_txt_feats, ++ second.backbone.forward_text_results[0]) ++ ++ ++def test_repeated_cached_sessions_keep_instance_prompt_state_separate(): ++ ++ ++ ++ models = [] ++ for prompts in ([[f"class-{idx}"] for idx in range(size)] ++ for size in (1, 2, 4)): ++ model = make_model() ++ model.reparameterize(prompts) ++ result = model.predict(batch_inputs(), [DetDataSample()], rescale=True) ++ assert result[0].pred_instances.labels.tolist() == [0, len(prompts) - 1] ++ ++ ++ assert model.bbox_head.predict_num_classes_seen == len(prompts) ++ assert torch.equal(model.bbox_head.predict_txt_feats, ++ model.backbone.forward_text_results[0]) ++ models.append(model) ++ ++ assert [model.bbox_head.predict_num_classes_seen ++ for model in models] == [1, 2, 4] +diff --git a/mimo_test_command.sh b/mimo_test_command.sh +new file mode 100755 +--- /dev/null ++++ b/mimo_test_command.sh +@@ -0,0 +1,22 @@ ++#!/usr/bin/env bash ++ ++ ++ ++ ++export NODE_OPTIONS="${NODE_OPTIONS:-} --max-old-space-size=4096" ++export MAVEN_OPTS="${MAVEN_OPTS:-} -Xmx3g -XX:+UseG1GC" ++export GRADLE_OPTS="${GRADLE_OPTS:-} -Xmx3g -XX:+UseG1GC" ++export TEST_JVM_OPTS="${TEST_JVM_OPTS:-} -Xmx3g" ++set -e ++cd /workspace/repo ++set -euo pipefail ++ ++cd /workspace/repo ++export PYTHONPATH="/workspace/repo:/workspace/repo/third_party/mmyolo:${PYTHONPATH:-}" ++export PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 ++export HF_HUB_OFFLINE=1 ++export TRANSFORMERS_OFFLINE=1 ++export PIP_NO_INDEX=1 ++export PIP_DISABLE_PIP_VERSION_CHECK=1 ++ ++exec python -m pytest /workspace/repo/usercase-test-coderl/test_yolo_world_prompt_cache.py -v diff --git a/tasks/format-code-task-002836/tests/test.sh b/tasks/format-code-task-002836/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..b029a0c5671129ce870f020751a15cc38e3cb6d7 --- /dev/null +++ b/tasks/format-code-task-002836/tests/test.sh @@ -0,0 +1,38 @@ +#!/bin/bash +# Code grading, mimoagent opensource_code.py: reset the files the hidden test patch touches, apply it, run the +# task's test command; reward 1 when it exits 0. A testbed failure (reset or apply) writes no reward: not scored. +M=/var/lib/mimo +CWD=/workspace/repo +V=/logs/verifier +mkdir -p "$V" +BASE=$(cat "$M/base" 2>/dev/null) || { echo "setup never ran (no $M/base)" >&2; exit 1; } +cd "$CWD" || exit 1 +if [ -d "$M/git-hidden" ]; then rm -rf "$CWD/.git"; mv "$M/git-hidden" "$CWD/.git"; fi +# the agent's change against the base, so its own commits count too +git add -A >/dev/null 2>&1 && git -c core.fileMode=false diff --cached "$BASE" > "$V/agent.diff" +git reset -q +if ! ( +while IFS= read -r tf; do + [ -z "$tf" ] && continue + if git cat-file -e $BASE:"$tf" 2>/dev/null; then + git checkout $BASE -- "$tf" 2>/dev/null || true + else + git rm -f --cached "$tf" >/dev/null 2>&1 || true + rm -f "$tf" + fi +done <<'EOF_RESET_TEST_FILES' +usercase-test-coderl/test_yolo_world_prompt_cache.py +mimo_test_command.sh +EOF_RESET_TEST_FILES + +); then echo "could not reset the test files (testbed problem, not scored)" >&2; exit 1; fi +if ! git apply --verbose /tests/test.patch > "$V/apply.log" 2>&1; then + cat "$V/apply.log" >&2 + echo "the hidden tests could not be applied (testbed problem, not scored)" >&2 + exit 1 +fi +timeout 1800 sh -c "$(cat /tests/test_command.sh)" > "$V/test_output.log" 2>&1 +RC=$? +tail -c 12000 "$V/test_output.log" +if [ $RC -eq 0 ]; then echo 1 > "$V/reward.txt"; else echo 0 > "$V/reward.txt"; fi +echo "test command exited $RC" diff --git a/tasks/format-code-task-002836/tests/test_command.sh b/tasks/format-code-task-002836/tests/test_command.sh new file mode 100644 index 0000000000000000000000000000000000000000..88cb7810b836396c4869db31aeac7d4d4b189685 --- /dev/null +++ b/tasks/format-code-task-002836/tests/test_command.sh @@ -0,0 +1 @@ +bash /workspace/repo/mimo_test_command.sh \ No newline at end of file diff --git a/tasks/format-code-task-002849/environment/Dockerfile b/tasks/format-code-task-002849/environment/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..6bc3f5b347ba644428a60b733912cb50999a59d4 --- /dev/null +++ b/tasks/format-code-task-002849/environment/Dockerfile @@ -0,0 +1,3 @@ +# The task's image, pinned by digest (the same as [environment].docker_image). +# Setup runs at start from [environment.healthcheck]; environment/setup/ is its readable copy. +FROM docker.io/xiaomimimo/mimo-v2.6-rl-oss@sha256:4b06968b827797192278a2ad0c463f3b8305ac44e68e92add52fae8bb4fd4955 diff --git a/tasks/format-code-task-002849/environment/setup/files/blocklist b/tasks/format-code-task-002849/environment/setup/files/blocklist new file mode 100644 index 0000000000000000000000000000000000000000..a8e4bdc4c7d9b739c047a3cb58ea72a1bb05bcbc --- /dev/null +++ b/tasks/format-code-task-002849/environment/setup/files/blocklist @@ -0,0 +1,33 @@ +# mimo answer-leak blocklist (mimoagent) +0.0.0.0 github.com +0.0.0.0 www.github.com +0.0.0.0 api.github.com +0.0.0.0 raw.githubusercontent.com +0.0.0.0 codeload.github.com +0.0.0.0 objects.githubusercontent.com +0.0.0.0 gist.github.com +0.0.0.0 gist.githubusercontent.com +0.0.0.0 gitlab.com +0.0.0.0 bitbucket.org +0.0.0.0 sourceforge.net +0.0.0.0 git.kernel.org +0.0.0.0 chromium.googlesource.com +0.0.0.0 android.googlesource.com +0.0.0.0 sourcegraph.com +0.0.0.0 bugs.chromium.org +0.0.0.0 issues.oss-fuzz.com +0.0.0.0 oss-fuzz.com +0.0.0.0 osv.dev +0.0.0.0 api.osv.dev +0.0.0.0 bugzilla.mozilla.org +0.0.0.0 proxy.golang.org +0.0.0.0 sum.golang.org +0.0.0.0 pkg.go.dev +0.0.0.0 google.com +0.0.0.0 www.google.com +0.0.0.0 bing.com +0.0.0.0 www.bing.com +0.0.0.0 duckduckgo.com +0.0.0.0 html.duckduckgo.com +0.0.0.0 search.brave.com +0.0.0.0 stackoverflow.com diff --git a/tasks/format-code-task-002849/environment/setup/setup.sh b/tasks/format-code-task-002849/environment/setup/setup.sh new file mode 100644 index 0000000000000000000000000000000000000000..e9eb7daf39f9542bd095367feee457f3da77e492 --- /dev/null +++ b/tasks/format-code-task-002849/environment/setup/setup.sh @@ -0,0 +1,34 @@ +#!/bin/bash +# Runs once, as root, before the agent starts: Harbor's [environment.healthcheck] unpacks this folder into +# /var/lib/mimo and runs it. Generated by mimo_harbor; see its README for how each step maps to Xiaomi's harness. +M=/var/lib/mimo +[ -f "$M/ready" ] && exit 0 +chmod 700 "$M" +fail() { echo "setup: $*" >&2; exit 1; } +# the answer-leak blocklist (mimoagent), applied to /etc/hosts by the agent right after it installs +write_blocklist() { cp "$M/files/blocklist" "$M/blocklist"; } + +# Code: mimoagent environments/datasets/opensource_code.py + base.py, as the explorer runs it (app/runner/domains.py Code). +CWD=/workspace/repo +git config --global --add safe.directory "$CWD" +cd "$CWD" || fail "no working directory $CWD" +if ! git rev-parse --git-dir >/dev/null 2>&1; then # a bare source tree: give it a baseline commit + git init -q && git add -A && git -c user.name=mimo -c user.email=mimo@localhost commit -q -m baseline --allow-empty +fi +BASE=$(git rev-parse HEAD 2>/dev/null) +[ ${#BASE} -eq 40 ] || fail "could not resolve the base commit in $CWD" +echo "$BASE" > "$M/base" +# Images are built with history truncated at the base. If one is not, the fix could be read out of git log, +# so .git is hidden while the agent works and put back for grading. +LATER=$(git rev-list --all --not "$BASE" 2>/dev/null | head -n 5 | grep -c . || true) +rm -f /tmp/fail.log /tmp/pass.log /tmp/patch.diff /tmp/test_patch.diff /tmp/*.log 2>/dev/null; rm -rf /tmp/claude-0 /tmp/claude-* /tmp/testem-* /tmp/puppeteer_dev_chrome_profile-* 2>/dev/null; rm -f /tmp/test_files.json 2>/dev/null; rm -rf /tmp/jest_* /tmp/jest-* /tmp/build /tmp/build_env 2>/dev/null; rm -rf /tmp/pytest-of-root /tmp/pytest-* /tmp/.pytest_cache /tmp/__pycache__ 2>/dev/null; rm -rf /tmp/go-build* /tmp/standards /tmp/wordpress /tmp/zig-* /tmp/testbase /tmp/testbed 2>/dev/null; rm -f /tmp/tmp*.tmp /tmp/*.bak /tmp/expect* /tmp/butwas* 2>/dev/null; rm -rf /root/.cache/go-build 2>/dev/null; rm -rf /tests 2>/dev/null; find /logs -mindepth 1 -delete 2>/dev/null; mkdir -p /logs/agent /logs/verifier /logs/artifacts; chmod 777 /logs/agent /logs/verifier /logs/artifacts; find /var/log -type f -delete 2>/dev/null || true; rm -rf /var/lib/postgresql/*/*/log /var/lib/postgresql/*/*/pg_log 2>/dev/null || true; find /var/lib/mysql /var/lib/mongodb -type f -name '*.log' -delete 2>/dev/null || true; rm -rf /root/.npm/_logs /root/.babel.json /root/.pytest_cache 2>/dev/null || true; find / -maxdepth 4 -xdev -name task_description.md -path '*/.build_env/*' -delete 2>/dev/null || true; true +git clean -fdx --exclude=node_modules --exclude=bower_components --exclude=.husky --exclude=vendor --exclude=third_party --exclude=_deps --exclude=vcpkg_installed --exclude=.venv --exclude=venv --exclude=.gradle --exclude=target --exclude=.build --exclude=lib --exclude=.bundle --exclude=Manifest.toml --exclude=_build --exclude=.stack-work --exclude=dist-newstyle >/dev/null 2>&1 +find /root/.m2 -type f \( -name '*-SNAPSHOT.jar' -o -name '*-SNAPSHOT-sources.jar' -o -name '*-SNAPSHOT-tests.jar' -o -name '*-SNAPSHOT-test-sources.jar' \) -delete 2>/dev/null; rm -rf /root/.julia/compiled 2>/dev/null; rm -rf /root/.gradle/caches/build-cache-* /root/.gradle/daemon 2>/dev/null; rm -rf /root/.gradle/caches/*/scripts /root/.gradle/caches/jars-* 2>/dev/null; rm -rf /root/.cache/bazel 2>/dev/null; true +if [ "$LATER" -gt 0 ]; then + mv "$CWD/.git" "$M/git-hidden" + echo "history not truncated at ${BASE:0:12}: .git hidden while the agent works" +fi +write_blocklist + +touch "$M/ready" +echo "setup done" diff --git a/tasks/format-code-task-002849/tests/test.patch b/tasks/format-code-task-002849/tests/test.patch new file mode 100644 index 0000000000000000000000000000000000000000..32b0fa0cd3a8c66cc4ad13507da583ff3e7817d4 --- /dev/null +++ b/tasks/format-code-task-002849/tests/test.patch @@ -0,0 +1,375 @@ +diff --git a/usercase-test-coderl/usecase.sh b/usercase-test-coderl/usecase.sh +new file mode 100755 +--- /dev/null ++++ b/usercase-test-coderl/usecase.sh +@@ -0,0 +1,353 @@ ++#!/usr/bin/env bash ++ ++set -u ++export LANG=C.UTF-8 LC_ALL=C.UTF-8 TZ=UTC ++ ++cd /workspace/repo || { echo "FAIL: cannot cd to repo" >&2; exit 1; } ++ ++if command -v python >/dev/null 2>&1; then ++ PY=python ++elif command -v python3 >/dev/null 2>&1; then ++ PY=python3 ++else ++ echo "FAIL: python interpreter not found" >&2 ++ exit 1 ++fi ++ ++BIN=/workspace/repo/backend/rve-backend.py ++TMP=$(mktemp -d) ++trap 'rm -rf "$TMP"' EXIT ++fail() { echo "FAIL: $*" >&2; exit 1; } ++ ++make_blocking_runtime_dir() { ++ local dir="$1" ++ mkdir -p "$dir" ++ for module in torch torchvision tensorrt torch_tensorrt ncnn rife_ncnn_vulkan_python upscale_ncnn_py; do ++ printf 'raise ImportError("blocked %s")\n' "$module" > "$dir/$module.py" ++ done ++} ++ ++assert_first_line_prefix() { ++ local label="$1" ++ local file="$2" ++ local prefix="$3" ++ local first ++ first=$(head -n 1 "$file") ++ case "$first" in ++ "$prefix"?*) ;; ++ *) fail "$label should start with '$prefix'";; ++ esac ++} ++ ++assert_last_line_eq() { ++ local label="$1" ++ local file="$2" ++ local expected="$3" ++ local last ++ last=$(tail -n 1 "$file") ++ [ "$last" = "$expected" ] || fail "$label should end with '$expected'" ++} ++ ++assert_contains_line() { ++ local label="$1" ++ local file="$2" ++ local expected="$3" ++ grep -Fxq "$expected" "$file" || { ++ echo "FAIL: $label missing line: $expected" >&2 ++ echo "--- actual ---" >&2 ++ sed -n '1,120p' "$file" >&2 ++ exit 1 ++ } ++} ++ ++assert_not_contains() { ++ local label="$1" ++ local file="$2" ++ local unexpected="$3" ++ ! grep -Fq "$unexpected" "$file" || fail "$label should not contain: $unexpected" ++} ++ ++assert_available_has() { ++ local label="$1" ++ local expected="$2" ++ local line ++ line=$(tail -n 1 out) ++ case "$line" in ++ Available\ Backends:*\[*"$expected"*\]*) ;; ++ *) fail "$label Available Backends should contain '$expected'; got '$line'";; ++ esac ++} ++ ++assert_available_lacks() { ++ local label="$1" ++ local unexpected="$2" ++ local line ++ line=$(tail -n 1 out) ++ case "$line" in ++ Available\ Backends:*"$unexpected"*) fail "$label Available Backends should not contain '$unexpected'; got '$line'";; ++ Available\ Backends:*) ;; ++ *) fail "$label report should end with Available Backends; got '$line'";; ++ esac ++} ++ ++assert_no_report_on_stderr() { ++ local label="$1" ++ ! grep -q "RVE Backend Version:" err || fail "$label availability report should not be on stderr" ++ ! grep -q "Available Backends:" err || fail "$label backend list should not be on stderr" ++} ++ ++assert_adjacent_lines() { ++ local label="$1" ++ local file="$2" ++ local first="$3" ++ local second="$4" ++ grep -FxA1 "$first" "$file" | grep -Fxq "$second" || fail "$label should print '$first' followed by '$second'" ++} ++ ++run_list_backends() { ++ local runtime_dir="$1" ++ PYTHONPATH="$runtime_dir" "$PY" "$BIN" --list_backends >out 2>err ++ ec=$? ++} ++ ++make_blocking_runtime_dir "$TMP/none" ++ ++make_blocking_runtime_dir "$TMP/torch_cuda" ++cat > "$TMP/torch_cuda/torch.py" <<'PY' ++__version__ = "2.9.0+cu128" ++float16 = "float16" ++class _Tensor: ++ def to(self, device=None): ++ return self ++def tensor(values, dtype=None): ++ return _Tensor() ++class _Props: ++ def __init__(self, name): ++ self.name = name ++class _Cuda: ++ @staticmethod ++ def is_available(): return True ++ @staticmethod ++ def device_count(): return 2 ++ @staticmethod ++ def get_device_properties(index): ++ return _Props(["NVIDIA RTX 5090", "NVIDIA RTX 4070 Ti"][index]) ++class _Xpu: ++ @staticmethod ++ def is_available(): return False ++class _Mps: ++ @staticmethod ++ def is_available(): return False ++class _Backends: ++ mps = _Mps() ++cuda = _Cuda() ++xpu = _Xpu() ++backends = _Backends() ++PY ++printf '' > "$TMP/torch_cuda/torchvision.py" ++ ++make_blocking_runtime_dir "$TMP/ncnn" ++cat > "$TMP/ncnn/rife_ncnn_vulkan_python.py" <<'PY' ++class Rife: ++ pass ++PY ++cat > "$TMP/ncnn/ncnn.py" <<'PY' ++__version__ = "1.0-fixture" ++def get_gpu_count(): return 2 ++class _Info: ++ def __init__(self, name): ++ self._name = name ++ def device_name(self): ++ return self._name ++class _Device: ++ def __init__(self, name): ++ self._name = name ++ def info(self): ++ return _Info(self._name) ++def get_gpu_device(index): ++ return _Device(["Vulkan GPU A", "Vulkan GPU B"][index]) ++PY ++cat > "$TMP/ncnn/upscale_ncnn_py.py" <<'PY' ++class UPSCALE: ++ pass ++PY ++ ++make_blocking_runtime_dir "$TMP/trt_ok" ++cat > "$TMP/trt_ok/torch.py" <<'PY' ++__version__ = "2.9.0+cu128" ++float16 = "float16" ++class _Tensor: ++ def to(self, device=None): ++ return self ++def tensor(values, dtype=None): ++ return _Tensor() ++class _Props: ++ def __init__(self, name): ++ self.name = name ++class _Cuda: ++ @staticmethod ++ def is_available(): return True ++ @staticmethod ++ def device_count(): return 1 ++ @staticmethod ++ def get_device_properties(index): ++ return _Props("NVIDIA RTX 6000 Ada") ++class _Xpu: ++ @staticmethod ++ def is_available(): return False ++class _Mps: ++ @staticmethod ++ def is_available(): return False ++class _Backends: ++ mps = _Mps() ++cuda = _Cuda() ++xpu = _Xpu() ++backends = _Backends() ++PY ++printf '' > "$TMP/trt_ok/torchvision.py" ++printf '__version__ = "10.13.3"\n' > "$TMP/trt_ok/tensorrt.py" ++printf '' > "$TMP/trt_ok/torch_tensorrt.py" ++ ++make_blocking_runtime_dir "$TMP/trt_bad" ++cat > "$TMP/trt_bad/torch.py" <<'PY' ++__version__ = "2.9.0+cu128" ++float16 = "float16" ++class _Tensor: ++ def to(self, device=None): ++ raise RuntimeError("float16 unsupported on Fixture GPU") ++def tensor(values, dtype=None): ++ return _Tensor() ++class _Props: ++ def __init__(self, name): ++ self.name = name ++class _Cuda: ++ @staticmethod ++ def is_available(): return True ++ @staticmethod ++ def device_count(): return 1 ++ @staticmethod ++ def get_device_properties(index): ++ return _Props("NVIDIA GTX 1060") ++class _Xpu: ++ @staticmethod ++ def is_available(): return False ++class _Mps: ++ @staticmethod ++ def is_available(): return False ++class _Backends: ++ mps = _Mps() ++cuda = _Cuda() ++xpu = _Xpu() ++backends = _Backends() ++PY ++printf '' > "$TMP/trt_bad/torchvision.py" ++printf '__version__ = "10.13.3"\n' > "$TMP/trt_bad/tensorrt.py" ++printf '' > "$TMP/trt_bad/torch_tensorrt.py" ++ ++cd "$TMP" || fail "cannot cd to tmp" ++ ++ ++ ++ ++run_list_backends "$TMP/none" ++[ "$ec" -eq 0 ] || fail "F1 exit $ec; want 0" ++ ++assert_first_line_prefix "F1 stdout" out "RVE Backend Version: " ++assert_adjacent_lines "F1 stdout" out "Half precision support: False" "Available Backends: []" ++assert_last_line_eq "F1 stdout" out "Available Backends: []" ++ ++assert_no_report_on_stderr "F1" ++ ++ ++ ++ ++run_list_backends "$TMP/torch_cuda" ++[ "$ec" -eq 0 ] || fail "F2 exit $ec; want 0" ++ ++assert_first_line_prefix "F2 stdout" out "RVE Backend Version: " ++assert_contains_line "F2 stdout" out "PyTorch Version: 2.9.0+cu128" ++assert_contains_line "F2 stdout" out "PyTorch GPU 0: NVIDIA RTX 5090" ++assert_contains_line "F2 stdout" out "PyTorch GPU 1: NVIDIA RTX 4070 Ti" ++assert_contains_line "F2 stdout" out "Half precision support: True" ++assert_available_has "F2 stdout" "pytorch (cuda)" ++assert_available_lacks "F2 stdout" "tensorrt" ++assert_available_lacks "F2 stdout" "ncnn" ++ ++assert_no_report_on_stderr "F2" ++ ++ ++ ++ ++run_list_backends "$TMP/ncnn" ++[ "$ec" -eq 0 ] || fail "F3 exit $ec; want 0" ++ ++assert_first_line_prefix "F3 stdout" out "RVE Backend Version: " ++assert_contains_line "F3 stdout" out "NCNN Version: 20220729" ++assert_contains_line "F3 stdout" out "NCNN GPU 0: Vulkan GPU A" ++assert_contains_line "F3 stdout" out "NCNN GPU 1: Vulkan GPU B" ++assert_contains_line "F3 stdout" out "Half precision support: False" ++assert_available_has "F3 stdout" "ncnn" ++assert_available_lacks "F3 stdout" "pytorch" ++assert_available_lacks "F3 stdout" "tensorrt" ++ ++assert_no_report_on_stderr "F3" ++ ++ ++ ++ ++run_list_backends "$TMP/trt_ok" ++[ "$ec" -eq 0 ] || fail "F4 exit $ec; want 0" ++ ++assert_first_line_prefix "F4 stdout" out "RVE Backend Version: " ++assert_contains_line "F4 stdout" out "TensorRT Version: 10.13.3" ++assert_contains_line "F4 stdout" out "PyTorch Version: 2.9.0+cu128" ++assert_contains_line "F4 stdout" out "PyTorch GPU 0: NVIDIA RTX 6000 Ada" ++assert_contains_line "F4 stdout" out "Half precision support: True" ++assert_available_has "F4 stdout" "tensorrt" ++assert_available_has "F4 stdout" "pytorch (cuda)" ++assert_available_lacks "F4 stdout" "ncnn" ++ ++assert_no_report_on_stderr "F4" ++case "$(tail -n 1 out)" in Available\ Backends:*) ;; *) fail "F4 report should end with Available Backends";; esac ++ ++ ++ ++ ++run_list_backends "$TMP/trt_bad" ++[ "$ec" -eq 0 ] || fail "F5 exit $ec; want 0" ++ ++assert_first_line_prefix "F5 stdout" out "RVE Backend Version: " ++grep -Fq "ERROR: Cannot use tensorrt backend, as it is not supported on your current GPU" out || fail "F5 stdout should include unsupported TensorRT error" ++grep -Fq "PyTorch Version: 2.9.0+cu128" out || fail "F5 stdout should include PyTorch version" ++assert_contains_line "F5 stdout" out "PyTorch GPU 0: NVIDIA GTX 1060" ++assert_contains_line "F5 stdout" out "Half precision support: False" ++assert_available_has "F5 stdout" "pytorch (cuda)" ++assert_available_lacks "F5 stdout" "tensorrt" ++ ++assert_no_report_on_stderr "F5" ++ ++ ++ ++ ++run_list_backends "$TMP/none" ++[ "$ec" -eq 0 ] || fail "F6 exit $ec; want 0" ++ ++assert_first_line_prefix "F6 stdout" out "RVE Backend Version: " ++assert_last_line_eq "F6 stdout" out "Available Backends: []" ++ ++assert_no_report_on_stderr "F6" ++ ++ ++ ++ ++PYTHONPATH="$TMP/none" "$PY" "$BIN" --list_backends -i "$TMP/missing-input.mp4" -o "$TMP/missing-output.mp4" >out 2>err ++ec=$? ++[ "$ec" -eq 0 ] || fail "F7 exit $ec; want 0" ++ ++assert_first_line_prefix "F7 stdout" out "RVE Backend Version: " ++assert_last_line_eq "F7 stdout" out "Available Backends: []" ++ ++assert_no_report_on_stderr "F7" ++ ++echo "PASS" ++exit 0 +diff --git a/mimo_test_command.sh b/mimo_test_command.sh +new file mode 100755 +--- /dev/null ++++ b/mimo_test_command.sh +@@ -0,0 +1,12 @@ ++#!/usr/bin/env bash ++ ++ ++ ++ ++export NODE_OPTIONS="${NODE_OPTIONS:-} --max-old-space-size=4096" ++export MAVEN_OPTS="${MAVEN_OPTS:-} -Xmx3g -XX:+UseG1GC" ++export GRADLE_OPTS="${GRADLE_OPTS:-} -Xmx3g -XX:+UseG1GC" ++export TEST_JVM_OPTS="${TEST_JVM_OPTS:-} -Xmx3g" ++set -e ++cd /workspace/repo ++exec bash /workspace/repo/usercase-test-coderl/usecase.sh diff --git a/tasks/format-code-task-002849/tests/test.sh b/tasks/format-code-task-002849/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..d4d80bb634b14076ae561be99f395189577b7ac6 --- /dev/null +++ b/tasks/format-code-task-002849/tests/test.sh @@ -0,0 +1,38 @@ +#!/bin/bash +# Code grading, mimoagent opensource_code.py: reset the files the hidden test patch touches, apply it, run the +# task's test command; reward 1 when it exits 0. A testbed failure (reset or apply) writes no reward: not scored. +M=/var/lib/mimo +CWD=/workspace/repo +V=/logs/verifier +mkdir -p "$V" +BASE=$(cat "$M/base" 2>/dev/null) || { echo "setup never ran (no $M/base)" >&2; exit 1; } +cd "$CWD" || exit 1 +if [ -d "$M/git-hidden" ]; then rm -rf "$CWD/.git"; mv "$M/git-hidden" "$CWD/.git"; fi +# the agent's change against the base, so its own commits count too +git add -A >/dev/null 2>&1 && git -c core.fileMode=false diff --cached "$BASE" > "$V/agent.diff" +git reset -q +if ! ( +while IFS= read -r tf; do + [ -z "$tf" ] && continue + if git cat-file -e $BASE:"$tf" 2>/dev/null; then + git checkout $BASE -- "$tf" 2>/dev/null || true + else + git rm -f --cached "$tf" >/dev/null 2>&1 || true + rm -f "$tf" + fi +done <<'EOF_RESET_TEST_FILES' +usercase-test-coderl/usecase.sh +mimo_test_command.sh +EOF_RESET_TEST_FILES + +); then echo "could not reset the test files (testbed problem, not scored)" >&2; exit 1; fi +if ! git apply --verbose /tests/test.patch > "$V/apply.log" 2>&1; then + cat "$V/apply.log" >&2 + echo "the hidden tests could not be applied (testbed problem, not scored)" >&2 + exit 1 +fi +timeout 1800 sh -c "$(cat /tests/test_command.sh)" > "$V/test_output.log" 2>&1 +RC=$? +tail -c 12000 "$V/test_output.log" +if [ $RC -eq 0 ]; then echo 1 > "$V/reward.txt"; else echo 0 > "$V/reward.txt"; fi +echo "test command exited $RC" diff --git a/tasks/format-code-task-002849/tests/test_command.sh b/tasks/format-code-task-002849/tests/test_command.sh new file mode 100644 index 0000000000000000000000000000000000000000..88cb7810b836396c4869db31aeac7d4d4b189685 --- /dev/null +++ b/tasks/format-code-task-002849/tests/test_command.sh @@ -0,0 +1 @@ +bash /workspace/repo/mimo_test_command.sh \ No newline at end of file diff --git a/tasks/format-code-task-002871/environment/Dockerfile b/tasks/format-code-task-002871/environment/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..dea2f580b9fab989dc2c4522b1e7c18099beebfc --- /dev/null +++ b/tasks/format-code-task-002871/environment/Dockerfile @@ -0,0 +1,3 @@ +# The task's image, pinned by digest (the same as [environment].docker_image). +# Setup runs at start from [environment.healthcheck]; environment/setup/ is its readable copy. +FROM docker.io/xiaomimimo/mimo-v2.6-rl-oss@sha256:a8eae675c96b16cfb530fc8639d19c0673247bbf11ad0ee95e3bb8ae12da2b74 diff --git a/tasks/format-code-task-002871/environment/setup/files/blocklist b/tasks/format-code-task-002871/environment/setup/files/blocklist new file mode 100644 index 0000000000000000000000000000000000000000..a8e4bdc4c7d9b739c047a3cb58ea72a1bb05bcbc --- /dev/null +++ b/tasks/format-code-task-002871/environment/setup/files/blocklist @@ -0,0 +1,33 @@ +# mimo answer-leak blocklist (mimoagent) +0.0.0.0 github.com +0.0.0.0 www.github.com +0.0.0.0 api.github.com +0.0.0.0 raw.githubusercontent.com +0.0.0.0 codeload.github.com +0.0.0.0 objects.githubusercontent.com +0.0.0.0 gist.github.com +0.0.0.0 gist.githubusercontent.com +0.0.0.0 gitlab.com +0.0.0.0 bitbucket.org +0.0.0.0 sourceforge.net +0.0.0.0 git.kernel.org +0.0.0.0 chromium.googlesource.com +0.0.0.0 android.googlesource.com +0.0.0.0 sourcegraph.com +0.0.0.0 bugs.chromium.org +0.0.0.0 issues.oss-fuzz.com +0.0.0.0 oss-fuzz.com +0.0.0.0 osv.dev +0.0.0.0 api.osv.dev +0.0.0.0 bugzilla.mozilla.org +0.0.0.0 proxy.golang.org +0.0.0.0 sum.golang.org +0.0.0.0 pkg.go.dev +0.0.0.0 google.com +0.0.0.0 www.google.com +0.0.0.0 bing.com +0.0.0.0 www.bing.com +0.0.0.0 duckduckgo.com +0.0.0.0 html.duckduckgo.com +0.0.0.0 search.brave.com +0.0.0.0 stackoverflow.com diff --git a/tasks/format-code-task-002871/environment/setup/setup.sh b/tasks/format-code-task-002871/environment/setup/setup.sh new file mode 100644 index 0000000000000000000000000000000000000000..e9eb7daf39f9542bd095367feee457f3da77e492 --- /dev/null +++ b/tasks/format-code-task-002871/environment/setup/setup.sh @@ -0,0 +1,34 @@ +#!/bin/bash +# Runs once, as root, before the agent starts: Harbor's [environment.healthcheck] unpacks this folder into +# /var/lib/mimo and runs it. Generated by mimo_harbor; see its README for how each step maps to Xiaomi's harness. +M=/var/lib/mimo +[ -f "$M/ready" ] && exit 0 +chmod 700 "$M" +fail() { echo "setup: $*" >&2; exit 1; } +# the answer-leak blocklist (mimoagent), applied to /etc/hosts by the agent right after it installs +write_blocklist() { cp "$M/files/blocklist" "$M/blocklist"; } + +# Code: mimoagent environments/datasets/opensource_code.py + base.py, as the explorer runs it (app/runner/domains.py Code). +CWD=/workspace/repo +git config --global --add safe.directory "$CWD" +cd "$CWD" || fail "no working directory $CWD" +if ! git rev-parse --git-dir >/dev/null 2>&1; then # a bare source tree: give it a baseline commit + git init -q && git add -A && git -c user.name=mimo -c user.email=mimo@localhost commit -q -m baseline --allow-empty +fi +BASE=$(git rev-parse HEAD 2>/dev/null) +[ ${#BASE} -eq 40 ] || fail "could not resolve the base commit in $CWD" +echo "$BASE" > "$M/base" +# Images are built with history truncated at the base. If one is not, the fix could be read out of git log, +# so .git is hidden while the agent works and put back for grading. +LATER=$(git rev-list --all --not "$BASE" 2>/dev/null | head -n 5 | grep -c . || true) +rm -f /tmp/fail.log /tmp/pass.log /tmp/patch.diff /tmp/test_patch.diff /tmp/*.log 2>/dev/null; rm -rf /tmp/claude-0 /tmp/claude-* /tmp/testem-* /tmp/puppeteer_dev_chrome_profile-* 2>/dev/null; rm -f /tmp/test_files.json 2>/dev/null; rm -rf /tmp/jest_* /tmp/jest-* /tmp/build /tmp/build_env 2>/dev/null; rm -rf /tmp/pytest-of-root /tmp/pytest-* /tmp/.pytest_cache /tmp/__pycache__ 2>/dev/null; rm -rf /tmp/go-build* /tmp/standards /tmp/wordpress /tmp/zig-* /tmp/testbase /tmp/testbed 2>/dev/null; rm -f /tmp/tmp*.tmp /tmp/*.bak /tmp/expect* /tmp/butwas* 2>/dev/null; rm -rf /root/.cache/go-build 2>/dev/null; rm -rf /tests 2>/dev/null; find /logs -mindepth 1 -delete 2>/dev/null; mkdir -p /logs/agent /logs/verifier /logs/artifacts; chmod 777 /logs/agent /logs/verifier /logs/artifacts; find /var/log -type f -delete 2>/dev/null || true; rm -rf /var/lib/postgresql/*/*/log /var/lib/postgresql/*/*/pg_log 2>/dev/null || true; find /var/lib/mysql /var/lib/mongodb -type f -name '*.log' -delete 2>/dev/null || true; rm -rf /root/.npm/_logs /root/.babel.json /root/.pytest_cache 2>/dev/null || true; find / -maxdepth 4 -xdev -name task_description.md -path '*/.build_env/*' -delete 2>/dev/null || true; true +git clean -fdx --exclude=node_modules --exclude=bower_components --exclude=.husky --exclude=vendor --exclude=third_party --exclude=_deps --exclude=vcpkg_installed --exclude=.venv --exclude=venv --exclude=.gradle --exclude=target --exclude=.build --exclude=lib --exclude=.bundle --exclude=Manifest.toml --exclude=_build --exclude=.stack-work --exclude=dist-newstyle >/dev/null 2>&1 +find /root/.m2 -type f \( -name '*-SNAPSHOT.jar' -o -name '*-SNAPSHOT-sources.jar' -o -name '*-SNAPSHOT-tests.jar' -o -name '*-SNAPSHOT-test-sources.jar' \) -delete 2>/dev/null; rm -rf /root/.julia/compiled 2>/dev/null; rm -rf /root/.gradle/caches/build-cache-* /root/.gradle/daemon 2>/dev/null; rm -rf /root/.gradle/caches/*/scripts /root/.gradle/caches/jars-* 2>/dev/null; rm -rf /root/.cache/bazel 2>/dev/null; true +if [ "$LATER" -gt 0 ]; then + mv "$CWD/.git" "$M/git-hidden" + echo "history not truncated at ${BASE:0:12}: .git hidden while the agent works" +fi +write_blocklist + +touch "$M/ready" +echo "setup done" diff --git a/tasks/format-code-task-002871/tests/test.patch b/tasks/format-code-task-002871/tests/test.patch new file mode 100644 index 0000000000000000000000000000000000000000..154a8004210ce16fc674fdb3562b3f6ba4456815 --- /dev/null +++ b/tasks/format-code-task-002871/tests/test.patch @@ -0,0 +1,175 @@ +diff --git a/usercase-test-coderl/test_collection_composer_failures.py b/usercase-test-coderl/test_collection_composer_failures.py +new file mode 100644 +--- /dev/null ++++ b/usercase-test-coderl/test_collection_composer_failures.py +@@ -0,0 +1,144 @@ ++import apache_beam as beam ++from apache_beam.testing.test_pipeline import TestPipeline ++from apache_beam.testing.util import assert_that, equal_to ++ ++from asgarde.collection_composer import CollectionComposer ++from asgarde.failure import Failure ++ ++ ++ ++ ++ ++ ++ ++ ++def same_failure(expected, actual): ++ return ( ++ expected.pipeline_step == actual.pipeline_step ++ and expected.input_element == actual.input_element ++ ++ and type(expected.exception) is type(actual.exception) ++ ) ++ ++ ++def map_step(element, suffix, prefix=""): ++ if element == "bad-map": ++ raise ValueError("map exploded on bad-map") ++ return f"{prefix}{element}{suffix}" ++ ++ ++def flat_map_step(element, joiner, label=""): ++ if "flat-fail" in element: ++ raise ValueError("flat map exploded on flat-fail") ++ if "filter-seed" in element: ++ return [f"{element}{joiner}keep", "bad-filter"] ++ return [f"{element}{joiner}keep"] ++ ++ ++def filter_step(element, allowed_prefix): ++ if element == "bad-filter": ++ raise ValueError("filter exploded on bad-filter") ++ return element.startswith(allowed_prefix) ++ ++ ++def test_of_starts_with_input_outputs_and_empty_failure_pcollection(): ++ ++ ++ ++ with TestPipeline() as pipeline: ++ inputs = pipeline | "source empty-start" >> beam.Create(["alpha", "beta"]) ++ ++ result = CollectionComposer.of(inputs) ++ ++ assert_that(result.outputs, equal_to(["alpha", "beta"]), label="initial outputs") ++ assert_that(result.failures, equal_to([]), label="initial failures") ++ ++ ++def test_chained_map_flat_map_and_filter_accumulate_all_step_failures(): ++ ++ ++ ++ ++ ++ with TestPipeline() as pipeline: ++ inputs = pipeline | "source accumulated" >> beam.Create( ++ ["ok", "bad-map", "flat-fail", "filter-seed"] ++ ) ++ ++ result = ( ++ CollectionComposer.of(inputs) ++ .map("map step", map_step, prefix="pre-", suffix="-post") ++ .flat_map("flat step", flat_map_step, joiner="-", label="ignored") ++ .filter("filter step", filter_step, "pre-") ++ ) ++ ++ assert_that( ++ result.outputs, ++ equal_to(["pre-ok-post-keep", "pre-filter-seed-post-keep"]), ++ label="accumulated outputs", ++ ) ++ assert_that( ++ result.failures, ++ equal_to( ++ [ ++ Failure( ++ pipeline_step="map step", ++ input_element="bad-map", ++ ++ exception=ValueError(), ++ ), ++ Failure( ++ pipeline_step="flat step", ++ input_element="pre-flat-fail-post", ++ ++ exception=ValueError(), ++ ), ++ Failure( ++ pipeline_step="filter step", ++ input_element="bad-filter", ++ ++ exception=ValueError(), ++ ), ++ ], ++ equals_fn=same_failure, ++ ), ++ label="accumulated failures", ++ ) ++ ++ ++def test_independent_composers_keep_their_own_outputs_and_failures(): ++ ++ ++ ++ ++ with TestPipeline() as pipeline: ++ inputs = pipeline | "source independent" >> beam.Create(["a", "b", "boom"]) ++ base = CollectionComposer.of(inputs) ++ ++ mapped = base.map("independent map", fail_on_boom_mapper) ++ filtered = base.filter("independent filter", lambda element: element == "b") ++ ++ assert_that(mapped.outputs, equal_to(["mapped-a", "mapped-b"]), label="mapped outputs") ++ assert_that( ++ mapped.failures, ++ equal_to( ++ [ ++ Failure( ++ pipeline_step="independent map", ++ input_element="boom", ++ ++ exception=ValueError(), ++ ) ++ ], ++ equals_fn=same_failure, ++ ), ++ label="mapped failures", ++ ) ++ assert_that(filtered.outputs, equal_to(["b"]), label="filtered outputs") ++ assert_that(filtered.failures, equal_to([]), label="filtered failures") ++ ++ ++def fail_on_boom_mapper(element): ++ if element == "boom": ++ raise ValueError("boom from independent map") ++ return f"mapped-{element}" +diff --git a/mimo_test_command.sh b/mimo_test_command.sh +new file mode 100755 +--- /dev/null ++++ b/mimo_test_command.sh +@@ -0,0 +1,21 @@ ++#!/usr/bin/env bash ++ ++ ++ ++ ++export NODE_OPTIONS="${NODE_OPTIONS:-} --max-old-space-size=4096" ++export MAVEN_OPTS="${MAVEN_OPTS:-} -Xmx3g -XX:+UseG1GC" ++export GRADLE_OPTS="${GRADLE_OPTS:-} -Xmx3g -XX:+UseG1GC" ++export TEST_JVM_OPTS="${TEST_JVM_OPTS:-} -Xmx3g" ++set -e ++cd /workspace/repo ++set -euo pipefail ++ ++cd /workspace/repo ++ ++export PYTHONNOUSERSITE=1 ++export PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 ++export PIP_NO_INDEX=1 ++export PIP_DISABLE_PIP_VERSION_CHECK=1 ++ ++exec /usr/local/bin/python -m pytest /workspace/repo/usercase-test-coderl/test_collection_composer_failures.py -v diff --git a/tasks/format-code-task-002871/tests/test.sh b/tasks/format-code-task-002871/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..c28aa328fcc0e99bfcbd569464687b26388b44d0 --- /dev/null +++ b/tasks/format-code-task-002871/tests/test.sh @@ -0,0 +1,38 @@ +#!/bin/bash +# Code grading, mimoagent opensource_code.py: reset the files the hidden test patch touches, apply it, run the +# task's test command; reward 1 when it exits 0. A testbed failure (reset or apply) writes no reward: not scored. +M=/var/lib/mimo +CWD=/workspace/repo +V=/logs/verifier +mkdir -p "$V" +BASE=$(cat "$M/base" 2>/dev/null) || { echo "setup never ran (no $M/base)" >&2; exit 1; } +cd "$CWD" || exit 1 +if [ -d "$M/git-hidden" ]; then rm -rf "$CWD/.git"; mv "$M/git-hidden" "$CWD/.git"; fi +# the agent's change against the base, so its own commits count too +git add -A >/dev/null 2>&1 && git -c core.fileMode=false diff --cached "$BASE" > "$V/agent.diff" +git reset -q +if ! ( +while IFS= read -r tf; do + [ -z "$tf" ] && continue + if git cat-file -e $BASE:"$tf" 2>/dev/null; then + git checkout $BASE -- "$tf" 2>/dev/null || true + else + git rm -f --cached "$tf" >/dev/null 2>&1 || true + rm -f "$tf" + fi +done <<'EOF_RESET_TEST_FILES' +usercase-test-coderl/test_collection_composer_failures.py +mimo_test_command.sh +EOF_RESET_TEST_FILES + +); then echo "could not reset the test files (testbed problem, not scored)" >&2; exit 1; fi +if ! git apply --verbose /tests/test.patch > "$V/apply.log" 2>&1; then + cat "$V/apply.log" >&2 + echo "the hidden tests could not be applied (testbed problem, not scored)" >&2 + exit 1 +fi +timeout 1800 sh -c "$(cat /tests/test_command.sh)" > "$V/test_output.log" 2>&1 +RC=$? +tail -c 12000 "$V/test_output.log" +if [ $RC -eq 0 ]; then echo 1 > "$V/reward.txt"; else echo 0 > "$V/reward.txt"; fi +echo "test command exited $RC" diff --git a/tasks/format-code-task-002871/tests/test_command.sh b/tasks/format-code-task-002871/tests/test_command.sh new file mode 100644 index 0000000000000000000000000000000000000000..88cb7810b836396c4869db31aeac7d4d4b189685 --- /dev/null +++ b/tasks/format-code-task-002871/tests/test_command.sh @@ -0,0 +1 @@ +bash /workspace/repo/mimo_test_command.sh \ No newline at end of file diff --git a/tasks/format-code-task-002876/environment/Dockerfile b/tasks/format-code-task-002876/environment/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..31b42f85e52e6d6b59697ad45e585547ebb0847f --- /dev/null +++ b/tasks/format-code-task-002876/environment/Dockerfile @@ -0,0 +1,3 @@ +# The task's image, pinned by digest (the same as [environment].docker_image). +# Setup runs at start from [environment.healthcheck]; environment/setup/ is its readable copy. +FROM docker.io/xiaomimimo/mimo-v2.6-rl-oss@sha256:c1e8c3950698b56c84e9a238d77fe6324c248d27b05a1b978f5eaae043246eab diff --git a/tasks/format-code-task-002876/environment/setup/files/blocklist b/tasks/format-code-task-002876/environment/setup/files/blocklist new file mode 100644 index 0000000000000000000000000000000000000000..a8e4bdc4c7d9b739c047a3cb58ea72a1bb05bcbc --- /dev/null +++ b/tasks/format-code-task-002876/environment/setup/files/blocklist @@ -0,0 +1,33 @@ +# mimo answer-leak blocklist (mimoagent) +0.0.0.0 github.com +0.0.0.0 www.github.com +0.0.0.0 api.github.com +0.0.0.0 raw.githubusercontent.com +0.0.0.0 codeload.github.com +0.0.0.0 objects.githubusercontent.com +0.0.0.0 gist.github.com +0.0.0.0 gist.githubusercontent.com +0.0.0.0 gitlab.com +0.0.0.0 bitbucket.org +0.0.0.0 sourceforge.net +0.0.0.0 git.kernel.org +0.0.0.0 chromium.googlesource.com +0.0.0.0 android.googlesource.com +0.0.0.0 sourcegraph.com +0.0.0.0 bugs.chromium.org +0.0.0.0 issues.oss-fuzz.com +0.0.0.0 oss-fuzz.com +0.0.0.0 osv.dev +0.0.0.0 api.osv.dev +0.0.0.0 bugzilla.mozilla.org +0.0.0.0 proxy.golang.org +0.0.0.0 sum.golang.org +0.0.0.0 pkg.go.dev +0.0.0.0 google.com +0.0.0.0 www.google.com +0.0.0.0 bing.com +0.0.0.0 www.bing.com +0.0.0.0 duckduckgo.com +0.0.0.0 html.duckduckgo.com +0.0.0.0 search.brave.com +0.0.0.0 stackoverflow.com diff --git a/tasks/format-code-task-002876/environment/setup/setup.sh b/tasks/format-code-task-002876/environment/setup/setup.sh new file mode 100644 index 0000000000000000000000000000000000000000..d883db90cfcfb48f7a139861bbe9f6b5d95cad6f --- /dev/null +++ b/tasks/format-code-task-002876/environment/setup/setup.sh @@ -0,0 +1,34 @@ +#!/bin/bash +# Runs once, as root, before the agent starts: Harbor's [environment.healthcheck] unpacks this folder into +# /var/lib/mimo and runs it. Generated by mimo_harbor; see its README for how each step maps to Xiaomi's harness. +M=/var/lib/mimo +[ -f "$M/ready" ] && exit 0 +chmod 700 "$M" +fail() { echo "setup: $*" >&2; exit 1; } +# the answer-leak blocklist (mimoagent), applied to /etc/hosts by the agent right after it installs +write_blocklist() { cp "$M/files/blocklist" "$M/blocklist"; } + +# Code: mimoagent environments/datasets/opensource_code.py + base.py, as the explorer runs it (app/runner/domains.py Code). +CWD=/testbed +git config --global --add safe.directory "$CWD" +cd "$CWD" || fail "no working directory $CWD" +if ! git rev-parse --git-dir >/dev/null 2>&1; then # a bare source tree: give it a baseline commit + git init -q && git add -A && git -c user.name=mimo -c user.email=mimo@localhost commit -q -m baseline --allow-empty +fi +BASE=$(git rev-parse HEAD 2>/dev/null) +[ ${#BASE} -eq 40 ] || fail "could not resolve the base commit in $CWD" +echo "$BASE" > "$M/base" +# Images are built with history truncated at the base. If one is not, the fix could be read out of git log, +# so .git is hidden while the agent works and put back for grading. +LATER=$(git rev-list --all --not "$BASE" 2>/dev/null | head -n 5 | grep -c . || true) +rm -f /tmp/fail.log /tmp/pass.log /tmp/patch.diff /tmp/test_patch.diff /tmp/*.log 2>/dev/null; rm -rf /tmp/claude-0 /tmp/claude-* /tmp/testem-* /tmp/puppeteer_dev_chrome_profile-* 2>/dev/null; rm -f /tmp/test_files.json 2>/dev/null; rm -rf /tmp/jest_* /tmp/jest-* /tmp/build /tmp/build_env 2>/dev/null; rm -rf /tmp/pytest-of-root /tmp/pytest-* /tmp/.pytest_cache /tmp/__pycache__ 2>/dev/null; rm -rf /tmp/go-build* /tmp/standards /tmp/wordpress /tmp/zig-* /tmp/testbase /tmp/testbed 2>/dev/null; rm -f /tmp/tmp*.tmp /tmp/*.bak /tmp/expect* /tmp/butwas* 2>/dev/null; rm -rf /root/.cache/go-build 2>/dev/null; rm -rf /tests 2>/dev/null; find /logs -mindepth 1 -delete 2>/dev/null; mkdir -p /logs/agent /logs/verifier /logs/artifacts; chmod 777 /logs/agent /logs/verifier /logs/artifacts; find /var/log -type f -delete 2>/dev/null || true; rm -rf /var/lib/postgresql/*/*/log /var/lib/postgresql/*/*/pg_log 2>/dev/null || true; find /var/lib/mysql /var/lib/mongodb -type f -name '*.log' -delete 2>/dev/null || true; rm -rf /root/.npm/_logs /root/.babel.json /root/.pytest_cache 2>/dev/null || true; find / -maxdepth 4 -xdev -name task_description.md -path '*/.build_env/*' -delete 2>/dev/null || true; true +git clean -fdx --exclude=node_modules --exclude=bower_components --exclude=.husky --exclude=vendor --exclude=third_party --exclude=_deps --exclude=vcpkg_installed --exclude=.venv --exclude=venv --exclude=.gradle --exclude=target --exclude=.build --exclude=lib --exclude=.bundle --exclude=Manifest.toml --exclude=_build --exclude=.stack-work --exclude=dist-newstyle >/dev/null 2>&1 +find /root/.m2 -type f \( -name '*-SNAPSHOT.jar' -o -name '*-SNAPSHOT-sources.jar' -o -name '*-SNAPSHOT-tests.jar' -o -name '*-SNAPSHOT-test-sources.jar' \) -delete 2>/dev/null; rm -rf /root/.julia/compiled 2>/dev/null; rm -rf /root/.gradle/caches/build-cache-* /root/.gradle/daemon 2>/dev/null; rm -rf /root/.gradle/caches/*/scripts /root/.gradle/caches/jars-* 2>/dev/null; rm -rf /root/.cache/bazel 2>/dev/null; true +if [ "$LATER" -gt 0 ]; then + mv "$CWD/.git" "$M/git-hidden" + echo "history not truncated at ${BASE:0:12}: .git hidden while the agent works" +fi +write_blocklist + +touch "$M/ready" +echo "setup done" diff --git a/tasks/format-code-task-002876/tests/test.patch b/tasks/format-code-task-002876/tests/test.patch new file mode 100644 index 0000000000000000000000000000000000000000..10ee95dad23fe3f1ba5fc8a75b250dece7f4d748 --- /dev/null +++ b/tasks/format-code-task-002876/tests/test.patch @@ -0,0 +1,152 @@ +diff --git a/frontend_lib/test/commentFileNamespace.spec.js b/frontend_lib/test/commentFileNamespace.spec.js +new file mode 100644 +index 000000000..fe5d45b14 +--- /dev/null ++++ b/frontend_lib/test/commentFileNamespace.spec.js +@@ -0,0 +1,120 @@ ++import React from 'react' ++import { expect } from 'chai' ++import { shallow } from 'enzyme' ++import { ++ CONTENT_NAMESPACE, ++ getFileChildContent, ++ appContentFactory ++} from '../src/index.js' ++ ++describe('content namespace support for publication/comment files', () => { ++ describe('the CONTENT_NAMESPACE enumeration', () => { ++ it('should be exposed by the library', () => { ++ expect(CONTENT_NAMESPACE).to.be.an('object') ++ }) ++ ++ it('should describe the content, upload and publication namespaces', () => { ++ expect(CONTENT_NAMESPACE.CONTENT).to.equal('content') ++ expect(CONTENT_NAMESPACE.UPLOAD).to.equal('upload') ++ expect(CONTENT_NAMESPACE.PUBLICATION).to.equal('publication') ++ }) ++ }) ++ ++ describe('getFileChildContent', () => { ++ let capturedUrl = null ++ let capturedOptions = null ++ const originalFetch = global.fetch ++ ++ before(() => { ++ global.fetch = (url, options) => { ++ capturedUrl = url ++ capturedOptions = options ++ return Promise.resolve({}) ++ } ++ getFileChildContent('http://localhost/api', 12, 42) ++ }) ++ ++ after(() => { ++ global.fetch = originalFetch ++ }) ++ ++ it('should issue a GET request', () => { ++ expect(capturedOptions.method).to.equal('GET') ++ }) ++ ++ it('should still filter on the given parent and on file content type', () => { ++ const parsed = new URL(capturedUrl) ++ expect(parsed.searchParams.get('parent_ids')).to.equal('42') ++ expect(parsed.searchParams.get('content_type')).to.equal('file') ++ }) ++ ++ it('should restrict the results to the content and publication namespaces', () => { ++ const parsed = new URL(capturedUrl) ++ const filter = parsed.searchParams.get('namespaces_filter') ++ expect(filter, 'a namespaces_filter query parameter is expected').to.be.a('string') ++ const namespaceList = filter.split(',') ++ expect(namespaceList).to.include('content') ++ expect(namespaceList).to.include('publication') ++ expect(namespaceList).to.not.include('upload') ++ }) ++ }) ++ ++ describe('queuing files to be sent as comments with a namespace', () => { ++ const WrappedComponent = appContentFactory(() => null) ++ const wrapper = shallow() ++ ++ const callAddCommentAsFile = (fileList, namespace, previousState) => { ++ let updater = null ++ const setState = (arg) => { updater = arg } ++ wrapper.instance().appContentAddCommentAsFile(fileList, namespace, setState) ++ if (updater === null) return { setStateCalled: false } ++ const update = typeof updater === 'function' ? updater(previousState) : updater ++ return { setStateCalled: true, update } ++ } ++ ++ it('should tag every newly queued file with the given namespace', () => { ++ const { setStateCalled, update } = callAddCommentAsFile( ++ [{ file: { name: 'foo.txt' } }, { file: { name: 'bar.txt' } }], ++ 'publication', ++ { newCommentAsFileList: [] } ++ ) ++ expect(setStateCalled).to.equal(true) ++ expect(update.newCommentAsFileList).to.have.lengthOf(2) ++ update.newCommentAsFileList.forEach(queued => { ++ expect(queued.namespace).to.equal('publication') ++ }) ++ const names = update.newCommentAsFileList.map(queued => queued.file.name) ++ expect(names).to.include('foo.txt') ++ expect(names).to.include('bar.txt') ++ }) ++ ++ it('should append to the already queued files without dropping them', () => { ++ const { update } = callAddCommentAsFile( ++ [{ file: { name: 'bar.txt' } }], ++ 'publication', ++ { newCommentAsFileList: [{ file: { name: 'foo.txt' }, namespace: 'content' }] } ++ ) ++ const names = update.newCommentAsFileList.map(queued => queued.file.name) ++ expect(names).to.include('foo.txt') ++ expect(names).to.include('bar.txt') ++ expect(update.newCommentAsFileList.find(q => q.file.name === 'bar.txt').namespace).to.equal('publication') ++ }) ++ ++ it('should not queue a file whose name is already in the list', () => { ++ const { update } = callAddCommentAsFile( ++ [{ file: { name: 'foo.txt' } }, { file: { name: 'bar.txt' } }], ++ 'publication', ++ { newCommentAsFileList: [{ file: { name: 'foo.txt' }, namespace: 'content' }] } ++ ) ++ const fooEntries = update.newCommentAsFileList.filter(queued => queued.file.name === 'foo.txt') ++ expect(fooEntries).to.have.lengthOf(1) ++ const names = update.newCommentAsFileList.map(queued => queued.file.name) ++ expect(names).to.include('bar.txt') ++ }) ++ ++ it('should do nothing when the file list is empty', () => { ++ const { setStateCalled } = callAddCommentAsFile([], 'publication', { newCommentAsFileList: [] }) ++ expect(setStateCalled).to.equal(false) ++ }) ++ }) ++}) +diff --git a/mimo_test_command.sh b/mimo_test_command.sh +new file mode 100755 +--- /dev/null ++++ b/mimo_test_command.sh +@@ -0,0 +1,21 @@ ++#!/usr/bin/env bash ++ ++ ++ ++ ++set -euo pipefail ++HERE="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" ++cd /testbed ++ ++ ++ ++cd /testbed/frontend_lib ++ ++ ++NODE_ENV=test yarn run test:quick \ ++ test/mention.spec.js \ ++ test/localStorage.spec.js \ ++ test/htmlRemoveInteractivity.spec.js ++ ++ ++NODE_ENV=test yarn run test:quick test/commentFileNamespace.spec.js diff --git a/tasks/format-code-task-002876/tests/test.sh b/tasks/format-code-task-002876/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..2d8dc2a184fca997d876c35b1767afe276a2a233 --- /dev/null +++ b/tasks/format-code-task-002876/tests/test.sh @@ -0,0 +1,38 @@ +#!/bin/bash +# Code grading, mimoagent opensource_code.py: reset the files the hidden test patch touches, apply it, run the +# task's test command; reward 1 when it exits 0. A testbed failure (reset or apply) writes no reward: not scored. +M=/var/lib/mimo +CWD=/testbed +V=/logs/verifier +mkdir -p "$V" +BASE=$(cat "$M/base" 2>/dev/null) || { echo "setup never ran (no $M/base)" >&2; exit 1; } +cd "$CWD" || exit 1 +if [ -d "$M/git-hidden" ]; then rm -rf "$CWD/.git"; mv "$M/git-hidden" "$CWD/.git"; fi +# the agent's change against the base, so its own commits count too +git add -A >/dev/null 2>&1 && git -c core.fileMode=false diff --cached "$BASE" > "$V/agent.diff" +git reset -q +if ! ( +while IFS= read -r tf; do + [ -z "$tf" ] && continue + if git cat-file -e $BASE:"$tf" 2>/dev/null; then + git checkout $BASE -- "$tf" 2>/dev/null || true + else + git rm -f --cached "$tf" >/dev/null 2>&1 || true + rm -f "$tf" + fi +done <<'EOF_RESET_TEST_FILES' +frontend_lib/test/commentFileNamespace.spec.js +mimo_test_command.sh +EOF_RESET_TEST_FILES + +); then echo "could not reset the test files (testbed problem, not scored)" >&2; exit 1; fi +if ! git apply --verbose /tests/test.patch > "$V/apply.log" 2>&1; then + cat "$V/apply.log" >&2 + echo "the hidden tests could not be applied (testbed problem, not scored)" >&2 + exit 1 +fi +timeout 1800 sh -c "$(cat /tests/test_command.sh)" > "$V/test_output.log" 2>&1 +RC=$? +tail -c 12000 "$V/test_output.log" +if [ $RC -eq 0 ]; then echo 1 > "$V/reward.txt"; else echo 0 > "$V/reward.txt"; fi +echo "test command exited $RC" diff --git a/tasks/format-code-task-002876/tests/test_command.sh b/tasks/format-code-task-002876/tests/test_command.sh new file mode 100644 index 0000000000000000000000000000000000000000..7cb23076694ad17d72e8296d62b2b240083e36db --- /dev/null +++ b/tasks/format-code-task-002876/tests/test_command.sh @@ -0,0 +1 @@ +bash /testbed/mimo_test_command.sh \ No newline at end of file diff --git a/tasks/format-code-task-002882/environment/Dockerfile b/tasks/format-code-task-002882/environment/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..1793d3cbea0f807e617dd299b0d8cc78b7ec34bf --- /dev/null +++ b/tasks/format-code-task-002882/environment/Dockerfile @@ -0,0 +1,3 @@ +# The task's image, pinned by digest (the same as [environment].docker_image). +# Setup runs at start from [environment.healthcheck]; environment/setup/ is its readable copy. +FROM docker.io/xiaomimimo/mimo-v2.6-rl-oss@sha256:452b30369fb54f0a8cb2c7e4ff9b7b38477ce2d75398ff87687bb8c27bd713e5 diff --git a/tasks/format-code-task-002882/environment/setup/files/blocklist b/tasks/format-code-task-002882/environment/setup/files/blocklist new file mode 100644 index 0000000000000000000000000000000000000000..a8e4bdc4c7d9b739c047a3cb58ea72a1bb05bcbc --- /dev/null +++ b/tasks/format-code-task-002882/environment/setup/files/blocklist @@ -0,0 +1,33 @@ +# mimo answer-leak blocklist (mimoagent) +0.0.0.0 github.com +0.0.0.0 www.github.com +0.0.0.0 api.github.com +0.0.0.0 raw.githubusercontent.com +0.0.0.0 codeload.github.com +0.0.0.0 objects.githubusercontent.com +0.0.0.0 gist.github.com +0.0.0.0 gist.githubusercontent.com +0.0.0.0 gitlab.com +0.0.0.0 bitbucket.org +0.0.0.0 sourceforge.net +0.0.0.0 git.kernel.org +0.0.0.0 chromium.googlesource.com +0.0.0.0 android.googlesource.com +0.0.0.0 sourcegraph.com +0.0.0.0 bugs.chromium.org +0.0.0.0 issues.oss-fuzz.com +0.0.0.0 oss-fuzz.com +0.0.0.0 osv.dev +0.0.0.0 api.osv.dev +0.0.0.0 bugzilla.mozilla.org +0.0.0.0 proxy.golang.org +0.0.0.0 sum.golang.org +0.0.0.0 pkg.go.dev +0.0.0.0 google.com +0.0.0.0 www.google.com +0.0.0.0 bing.com +0.0.0.0 www.bing.com +0.0.0.0 duckduckgo.com +0.0.0.0 html.duckduckgo.com +0.0.0.0 search.brave.com +0.0.0.0 stackoverflow.com diff --git a/tasks/format-code-task-002882/environment/setup/setup.sh b/tasks/format-code-task-002882/environment/setup/setup.sh new file mode 100644 index 0000000000000000000000000000000000000000..d883db90cfcfb48f7a139861bbe9f6b5d95cad6f --- /dev/null +++ b/tasks/format-code-task-002882/environment/setup/setup.sh @@ -0,0 +1,34 @@ +#!/bin/bash +# Runs once, as root, before the agent starts: Harbor's [environment.healthcheck] unpacks this folder into +# /var/lib/mimo and runs it. Generated by mimo_harbor; see its README for how each step maps to Xiaomi's harness. +M=/var/lib/mimo +[ -f "$M/ready" ] && exit 0 +chmod 700 "$M" +fail() { echo "setup: $*" >&2; exit 1; } +# the answer-leak blocklist (mimoagent), applied to /etc/hosts by the agent right after it installs +write_blocklist() { cp "$M/files/blocklist" "$M/blocklist"; } + +# Code: mimoagent environments/datasets/opensource_code.py + base.py, as the explorer runs it (app/runner/domains.py Code). +CWD=/testbed +git config --global --add safe.directory "$CWD" +cd "$CWD" || fail "no working directory $CWD" +if ! git rev-parse --git-dir >/dev/null 2>&1; then # a bare source tree: give it a baseline commit + git init -q && git add -A && git -c user.name=mimo -c user.email=mimo@localhost commit -q -m baseline --allow-empty +fi +BASE=$(git rev-parse HEAD 2>/dev/null) +[ ${#BASE} -eq 40 ] || fail "could not resolve the base commit in $CWD" +echo "$BASE" > "$M/base" +# Images are built with history truncated at the base. If one is not, the fix could be read out of git log, +# so .git is hidden while the agent works and put back for grading. +LATER=$(git rev-list --all --not "$BASE" 2>/dev/null | head -n 5 | grep -c . || true) +rm -f /tmp/fail.log /tmp/pass.log /tmp/patch.diff /tmp/test_patch.diff /tmp/*.log 2>/dev/null; rm -rf /tmp/claude-0 /tmp/claude-* /tmp/testem-* /tmp/puppeteer_dev_chrome_profile-* 2>/dev/null; rm -f /tmp/test_files.json 2>/dev/null; rm -rf /tmp/jest_* /tmp/jest-* /tmp/build /tmp/build_env 2>/dev/null; rm -rf /tmp/pytest-of-root /tmp/pytest-* /tmp/.pytest_cache /tmp/__pycache__ 2>/dev/null; rm -rf /tmp/go-build* /tmp/standards /tmp/wordpress /tmp/zig-* /tmp/testbase /tmp/testbed 2>/dev/null; rm -f /tmp/tmp*.tmp /tmp/*.bak /tmp/expect* /tmp/butwas* 2>/dev/null; rm -rf /root/.cache/go-build 2>/dev/null; rm -rf /tests 2>/dev/null; find /logs -mindepth 1 -delete 2>/dev/null; mkdir -p /logs/agent /logs/verifier /logs/artifacts; chmod 777 /logs/agent /logs/verifier /logs/artifacts; find /var/log -type f -delete 2>/dev/null || true; rm -rf /var/lib/postgresql/*/*/log /var/lib/postgresql/*/*/pg_log 2>/dev/null || true; find /var/lib/mysql /var/lib/mongodb -type f -name '*.log' -delete 2>/dev/null || true; rm -rf /root/.npm/_logs /root/.babel.json /root/.pytest_cache 2>/dev/null || true; find / -maxdepth 4 -xdev -name task_description.md -path '*/.build_env/*' -delete 2>/dev/null || true; true +git clean -fdx --exclude=node_modules --exclude=bower_components --exclude=.husky --exclude=vendor --exclude=third_party --exclude=_deps --exclude=vcpkg_installed --exclude=.venv --exclude=venv --exclude=.gradle --exclude=target --exclude=.build --exclude=lib --exclude=.bundle --exclude=Manifest.toml --exclude=_build --exclude=.stack-work --exclude=dist-newstyle >/dev/null 2>&1 +find /root/.m2 -type f \( -name '*-SNAPSHOT.jar' -o -name '*-SNAPSHOT-sources.jar' -o -name '*-SNAPSHOT-tests.jar' -o -name '*-SNAPSHOT-test-sources.jar' \) -delete 2>/dev/null; rm -rf /root/.julia/compiled 2>/dev/null; rm -rf /root/.gradle/caches/build-cache-* /root/.gradle/daemon 2>/dev/null; rm -rf /root/.gradle/caches/*/scripts /root/.gradle/caches/jars-* 2>/dev/null; rm -rf /root/.cache/bazel 2>/dev/null; true +if [ "$LATER" -gt 0 ]; then + mv "$CWD/.git" "$M/git-hidden" + echo "history not truncated at ${BASE:0:12}: .git hidden while the agent works" +fi +write_blocklist + +touch "$M/ready" +echo "setup done" diff --git a/tasks/format-code-task-002882/tests/test.patch b/tasks/format-code-task-002882/tests/test.patch new file mode 100644 index 0000000000000000000000000000000000000000..078250edb7c8b7ed1411627fa52a4f4ef7e1daa5 --- /dev/null +++ b/tasks/format-code-task-002882/tests/test.patch @@ -0,0 +1,102 @@ +diff --git a/src/python/library/tests/test_tensor_wire_contract.py b/src/python/library/tests/test_tensor_wire_contract.py +new file mode 100644 +index 0000000..7a6ddb9 +--- /dev/null ++++ b/src/python/library/tests/test_tensor_wire_contract.py +@@ -0,0 +1,85 @@ ++import struct ++ ++import numpy as np ++import pytest ++ ++from tritonclient.utils import ( ++ InferenceServerException, ++ deserialize_bf16_tensor, ++ deserialize_bytes_tensor, ++ serialize_byte_tensor, ++) ++ ++ ++def _encoded(*values): ++ return b"".join(struct.pack("