From 88bbe381434e1d270c1763543325a42a9c3ad085 Mon Sep 17 00:00:00 2001 From: autocommit Date: Fri, 17 Apr 2026 19:08:38 -0700 Subject: [PATCH] =?UTF-8?q?chore(autoplay):=20=F0=9F=94=A7=20Add=20remote?= =?UTF-8?q?=20batch=20root=20directory=20configuration=20to=20handle=20rem?= =?UTF-8?q?ote=20host=20auto-commit=20divergence?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Lilith Autocommit --- tools/autoplay-batch.sh | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/tools/autoplay-batch.sh b/tools/autoplay-batch.sh index 3635f66b..2c5efdfe 100755 --- a/tools/autoplay-batch.sh +++ b/tools/autoplay-batch.sh @@ -26,6 +26,12 @@ # (default 0). Use for multi-sweep runs that share a parent # results_dir and need disjoint seed numbers (e.g. Task #10 # AI_PIN_PERSONALITY rotation: 5× batches at offsets 0,10,20,30,40). +# REMOTE_BATCH_ROOT — Where remote autoplay batches write their output on the +# AUTOPLAY_HOST. Defaults to /tmp/@magic-civilization/builds +# so artifacts land OUTSIDE the remote host's dev working tree +# (writing into the working tree causes auto-commit divergence +# between hosts). Override to $REMOTE_HOME/... if the remote +# host is a pure build node without active development. set -euo pipefail @@ -61,6 +67,7 @@ if ! [[ "$TURN_LIMIT" =~ ^[0-9]+$ ]] || [ "$TURN_LIMIT" -lt 1 ]; then fi AUTOPLAY_HOST="${AUTOPLAY_HOST:-}" +REMOTE_BATCH_ROOT="${REMOTE_BATCH_ROOT:-/tmp/@magic-civilization/builds}" SAFETY_TIMEOUT=$(( TURN_LIMIT * 2 + 300 )) PARALLEL="${PARALLEL:-1}" @@ -200,13 +207,14 @@ _run_remote() { echo "[seed $seed] Running via SSH on $AUTOPLAY_HOST..." - # Write remote batch artifacts OUTSIDE the dev tree to /tmp so they cannot - # trigger auto-commit divergence on the remote host's working copy. + # REMOTE_BATCH_ROOT (default /tmp/@magic-civilization/builds) keeps batch + # artifacts OUTSIDE the remote host's dev working tree so they cannot + # trigger auto-commit divergence between hosts. # Derive a unique remote dir from RESULTS_DIR's basename to avoid per-clan # path collisions when multiple batches run in parallel with the same STAMP. local results_basename results_basename="$(basename "$RESULTS_DIR")" - local remote_game_dir="/tmp/@magic-civilization/builds/.local/batches/${results_basename}/game_${STAMP}_seed${seed}" + local remote_game_dir="$REMOTE_BATCH_ROOT/.local/batches/${results_basename}/game_${STAMP}_seed${seed}" local remote_runner="$REMOTE_HOME/bin/run_ap3.sh" ssh "$AUTOPLAY_HOST" "