#!/usr/bin/env bash
# Row-46 lane gate. Every leg writes its OWN exit file — a wrapper exit and a
# leg exit are different numbers.
set -u
R=/c/Users/decid/Documents/projects/spt-core
P="$R/.spt"
cd "$R" || exit 99
date -u +%Y-%m-%dT%H:%M:%SZ > "$P/r46_START.ts"

cargo run -q -p xtask -- pool-claim --pool "$R/target" --label row46-viewer-attach \
  > "$P/r46_claim.raw" 2>&1; echo $? > "$P/r46_claim.exit"

cargo nextest run -p spt-daemon --test brain_resume_conn_deadlock \
  > "$P/r46_nextest.raw" 2>&1; echo $? > "$P/r46_nextest.exit"

cargo clippy -p spt-daemon --all-targets -- -D warnings \
  > "$P/r46_clippy.raw" 2>&1; echo $? > "$P/r46_clippy.exit"

traceable-reqs check > "$P/r46_treqs.raw" 2>&1; echo $? > "$P/r46_treqs.exit"

date -u +%Y-%m-%dT%H:%M:%SZ > "$P/r46_END.ts"
