#!/bin/sh
# IO-PARSER W1 gate battery — lane worktree, own pool. One exit FILE per leg.
cd "$(dirname "$0")" || exit 9
ROOT_XTASK="../../target/debug/xtask.exe"
"$ROOT_XTASK" pool-claim --pool target --label gate-w1-162 > GW1_claim.raw 2>&1
echo $? > GW1_claim.exit

cargo build -p mock-adapter --bin capture-player > GW1_fixture.raw 2>&1
echo $? > GW1_fixture.exit

cargo nextest run -p spt-proto -p spt-daemon --no-fail-fast > GW1_protodaemon.raw 2>&1
echo $? > GW1_protodaemon.exit

cargo nextest run -p spt --test io_state_payload_e2e > GW1_ioe2e.raw 2>&1
echo $? > GW1_ioe2e.exit

cargo clippy --workspace --all-targets -- -D warnings > GW1_clippy.raw 2>&1
echo $? > GW1_clippy.exit

traceable-reqs check > GW1_treqs.raw 2>&1
echo $? > GW1_treqs.exit

cargo run -p xtask -- check > GW1_xtask.raw 2>&1
echo $? > GW1_xtask.exit

"$ROOT_XTASK" pool-release --pool target > GW1_release.raw 2>&1
echo $? > GW1_release.exit
echo DONE > GW1.done
