#!/usr/bin/env bash
# 185a attribution-control proof rig (doyle TDWISHTX window). hertz 2026-09-24.
set -u
[ -f ~/.cargo/env ] && . ~/.cargo/env
REPO=/home/reavus/projects/spt-core/spt-core
RIG=$REPO/.worktrees/hertz-185a-rig
cd $REPO || exit 9
echo "START $(date -u +%T) writers: $(ps -eo comm= | grep -cE '^(cargo|rustc|cargo-nextest|Runner.Worker)$')"
git fetch -q /tmp/hertz-185a-b.bundle ci/185a-census-test-attribution:refs/heads/hertz/185a || { echo FETCH_FAIL; exit 2; }
git worktree add -q $RIG hertz/185a || { echo WT_FAIL; exit 3; }
cd $RIG && echo "HEAD=$(git rev-parse HEAD)"
t0=$(date +%s); cargo run -q -p xtask -- pool-claim --pool $RIG/target --label hertz-185a-rig; echo "claim_rc=$? ($(( $(date +%s)-t0 ))s)"
t0=$(date +%s); cargo build -q -p spt; echo "build_rc=$? ($(( $(date +%s)-t0 ))s)"
ls -la target/debug/spt | cut -c1-80
mkdir -p /tmp/hertz-185a-rt
GITHUB_WORKSPACE=$RIG RUNNER_TEMP=/tmp/hertz-185a-rt bash .github/ci/reap-census.sh attribution-control; echo "control_rc=$?"
echo "leftover spt procs from rig: $(pgrep -f "$RIG/target/debug/spt" | wc -l)"
ls /tmp/hertz-185a-rt
echo "END $(date -u +%T)"
