+@@ -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('