#!/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"; } # Terminal-Bench rows (in the General domain): the Harbor convention itself. Scrub test leftovers from the image and # remember what was in the workspace, so harness residue can be told apart from the agent's work at grading time. rm -rf /tests find /logs/verifier -mindepth 1 -delete 2>/dev/null || true ls -A /app 2>/dev/null > "$M/before" || true touch "$M/ready" echo "setup done"