dannylev123's picture
SWE-Race v0.1 public split (95 tasks)
4e3f22a verified
Raw History Blame Contribute Delete
1.02 kB
#!/bin/bash
# Capture the agent's work as the submission artifact.
#
# Diffing {base}..HEAD alone captures only COMMITTED work, and agents routinely
# edit files without committing — that silently submits an empty patch and the
# grader scores the pristine base repo (indistinguishable from a no-op agent).
# So stage everything first and diff the INDEX against the base commit, which
# picks up committed and uncommitted changes alike. Same approach the benchmark's own
# sandbox uses in submit_diff().
set -uo pipefail
cd /app || exit 0
mkdir -p /logs/artifacts
git config --global --add safe.directory /app 2>/dev/null || true
git add -A 2>/dev/null || true
git diff --binary --cached 6d0ef593adaa22b2af0a5dd1a186646c180e3f8c > /logs/artifacts/model.patch 2>/dev/null || true
if [ ! -s /logs/artifacts/model.patch ]; then
git diff --binary 6d0ef593adaa22b2af0a5dd1a186646c180e3f8c HEAD > /logs/artifacts/model.patch 2>/dev/null || true
fi
echo "[pre_artifacts] captured $(wc -c < /logs/artifacts/model.patch) bytes"