#!/usr/bin/env bash
set -euo pipefail
cd /home/ubuntu/wt/pr-21092
scratch=/tmp/ev-21092-capture-final
expected=83ef5cf0b67c915b0db262e8089c84c6eb71a669
[[ $(git rev-parse HEAD) == "$expected" ]]
[[ -z $(git status --porcelain) ]]
# Run against fresh isolated files. This refuses to overwrite prior evidence.
[[ ! -e "$scratch/before-P-control-75.sqlite" ]]
proof=apps/server/src/orchestration-v2/EvidenceCapture.test.ts
before=apps/server/src/orchestration-v2/EvidenceBefore.ts
trap 'rm -f "$proof" "$before"' EXIT
cp "$scratch/EvidenceCapture.test.ts" "$proof"
git show 3cc31ed27c8956b36cee35a50509fb7c6869592b:apps/server/src/orchestration-v2/ProviderEventIngestor.ts > "$before"
vp test run apps/server/src/orchestration-v2/ProviderEventIngestor.test.ts > "$scratch/focused-tests.txt" 2>&1
vp test run "$proof" > "$scratch/runtime-tests.txt" 2>&1
python3 "$scratch/summarize.py"
python3 "$scratch/package-evidence.py"
