| set -euo pipefail | |
| workspace="/mnt/pvc/users/simon/agentptb/runs/sol-max-s1/workspace" | |
| preserve_session="agentptb-preserve-final" | |
| while [[ ! -f "$workspace/state/continuation-launched" ]]; do | |
| sleep 30 | |
| done | |
| target_steps="$(awk -F= '$1 == "max_steps" { print $2 }' \ | |
| "$workspace/state/continuation-config.txt")" | |
| [[ "$target_steps" =~ ^[0-9]+$ ]] | |
| while [[ ! -f "$workspace/state/step${target_steps}-stable" ]]; do | |
| sleep 30 | |
| done | |
| while tmux has-session -t "$preserve_session" 2>/dev/null; do | |
| sleep 10 | |
| done | |
| while [[ ! -f "$workspace/state/harness-hardening-applied" ]]; do | |
| sleep 30 | |
| done | |
| cd "$workspace" | |
| scripts/package_submission.sh "$target_steps" | |
| scripts/run_selected_final_pipeline.sh | |
| touch state/final-pipeline-complete | |