#!/usr/bin/env bash # One task: boot -> Stage 02 flight -> fly the survival pilot -> hunt for # REMAINING OB in RAM against the HUD. # # The pilot is not decoration. An unattended craft is dead in about a minute # (upstream-baseline.md), and a dead craft produces no transitions, which is # exactly the evidence ob_hunt.py needs. Conversely the hunt does NOT depend on # the pilot doing well: the counter climbs on its own as waves spawn in the first # minutes of the stage, which is where both filters should land. set -u export HOME=/sylph-home/re SDL_AUDIODRIVER=dummy DISPLAY=:98 export PYTHONPATH=/sylph-home/.local/lib/python3.12/site-packages SD="$(cd "$(dirname "$0")" && pwd)" SECS="${1:-600}" TAG="${2:-ob}" SHOTS=/sylph-home/re/shots/$TAG CFG=/tmp/nav-live.json "$SD/launch_mission.sh" fly || { echo "BOOT FAILED"; exit 1; } mkdir -p "$SHOTS" if python3 "$SD/entities2.py" self 0x130 "$CFG" >/dev/null; then echo "--- config: $(cat "$CFG")" nohup python3 "$SD/pilot.py" "$CFG" "$SECS" "/tmp/$TAG-pilot.log" 2>&1 & PILOT=$! else echo "BIND FAILED -- hunting an unattended craft, expect a short run" PILOT="" fi python3 "$SD/ob_hunt.py" "$SHOTS" "${OB_TRANSITIONS:-3}" "$SECS" rc=$? [ -n "$PILOT" ] && kill "$PILOT" 2>/dev/null echo "SESSION DONE (hunt rc=$rc)"