#!/bin/bash
# ASM #241 gate — Windows arm at assembled head 1f97b73d (asm/241-emission).
# Pool: gate-w1-786d2381/target (claimed asm-241). Leg-0 reap by PATH, env-scrubbed legs.
cd "$(dirname "$0")" || exit 9
export CARGO_TARGET_DIR="C:/Users/decid/Documents/projects/spt-core/.worktrees/gate-w1-786d2381/target"
RIG_EXE='C:\Users\decid\Documents\projects\spt-core\.worktrees\gate-w1-786d2381\target\debug\spt.exe'
reap() { powershell -NoProfile -Command "Get-Process spt -ErrorAction SilentlyContinue | Where-Object { \$_.Path -eq '$RIG_EXE' } | ForEach-Object { Stop-Process -Id \$_.Id -Force; 'reaped ' + \$_.Id } " >> ASM_driver.log 2>&1; }
run() { name=$1; shift; echo "=== asm $name: $*" >> ASM_driver.log; env -u OWL_SESSION_ID -u SPT_AGENT_ID -u SPT_ENDPOINT_ID "$@" > "ASM_${name}.raw" 2>&1; echo $? > "ASM_${name}.exit"; }
git log --oneline -1 >> ASM_driver.log
reap
run fixtures cargo build -p mock-adapter --bins
run treqs traceable-reqs check
run units cargo nextest run --workspace --lib --no-fail-fast
run store cargo nextest run -p spt-store
run live cargo nextest run -p spt-live
run net cargo nextest run -p spt-net
run proto cargo nextest run -p spt-proto
run runtime cargo nextest run -p spt-runtime
reap
run daemon cargo nextest run -p spt-daemon --no-fail-fast
reap
run autostart cargo nextest run -p spt --test endpoint_autostart_e2e --test-threads 1
reap
run xtaskcheck cargo run -p xtask -- check
reap
echo asm DONE >> ASM_driver.log
