| 1 | #!/usr/bin/env bash |
| 2 | # Human-in-the-loop reproduction loop. |
| 3 | # Copy this file, edit the steps below, and run it. |
| 4 | # The agent runs the script; the user follows prompts in their terminal. |
| 5 | # |
| 6 | # Usage: |
| 7 | # bash hitl-loop.template.sh |
| 8 | # |
| 9 | # Two helpers: |
| 10 | # step "<instruction>" → show instruction, wait for Enter |
| 11 | # capture VAR "<question>" → show question, read response into VAR |
| 12 | # |
| 13 | # At the end, captured values are printed as KEY=VALUE for the agent to parse. |
| 14 | |
| 15 | set -euo pipefail |
| 16 | |
| 17 | step() { |
| 18 | printf '\n>>> %s\n' "$1" |
| 19 | read -r -p " [Enter when done] " _ |
| 20 | } |
| 21 | |
| 22 | capture() { |
| 23 | local var="$1" question="$2" answer |
| 24 | printf '\n>>> %s\n' "$question" |
| 25 | read -r -p " > " answer |
| 26 | printf -v "$var" '%s' "$answer" |
| 27 | } |
| 28 | |
| 29 | # --- edit below --------------------------------------------------------- |
| 30 | |
| 31 | step "Open the app at http://localhost:3000 and sign in." |
| 32 | |
| 33 | capture ERRORED "Click the 'Export' button. Did it throw an error? (y/n)" |
| 34 | |
| 35 | capture ERROR_MSG "Paste the error message (or 'none'):" |
| 36 | |
| 37 | # --- edit above --------------------------------------------------------- |
| 38 | |
| 39 | printf '\n--- Captured ---\n' |
| 40 | printf 'ERRORED=%s\n' "$ERRORED" |
| 41 | printf 'ERROR_MSG=%s\n' "$ERROR_MSG" |
| 42 |