#!/usr/bin/env bash
# Lab step 10: 1,500 identical requests that each need human review.
source /lab/env.sh
echo '{"actor":"lab-agent","action":"send_customer_email","resource":{"customer":"42"},"args":{"to":"pat@example.com"},"confidence_signal":{"provider":"openai","token_logprobs":[-0.01,-0.01]}}' > /lab/review.json
ab -q -n 1500 -c 20 -p /lab/review.json -T application/json -H "Authorization: Bearer $KEY" \
  $BASE/v1/agent/authorize | grep -E 'Complete|Non-2xx|Time taken'
curl -sS -H "Authorization: Bearer $KEY" "$BASE/v1/queue/pending?limit=500" \
  | jq -c '{total, returned: (.items|length), distinct_fingerprints: ([.items[].payload_fingerprint]|unique|length)}'
