#!/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 26cfe23985106e7cda32c80458f38d67a0d1e9e9 > /logs/artifacts/model.patch 2>/dev/null || true if [ ! -s /logs/artifacts/model.patch ]; then git diff --binary 26cfe23985106e7cda32c80458f38d67a0d1e9e9 HEAD > /logs/artifacts/model.patch 2>/dev/null || true fi echo "[pre_artifacts] captured $(wc -c < /logs/artifacts/model.patch) bytes"