#!/bin/bash
# Create a fresh, git-initialized sandbox copy of the Eval C fixture.
# Usage: sandbox <P*-L*|N*-L*> <dest-dir>
#
# Eval C does not use graphify-out (ladder measures cue explicitness, not graph reach).
set -euo pipefail

SCENARIO="${1:?usage: sandbox <scenario> <dest-dir>}"
DEST="${2:?usage: sandbox <scenario> <dest-dir>}"
EVAL_ROOT="$(cd "$(dirname "$0")/.." && pwd)"
FIXTURE="$EVAL_ROOT/fixture/project"

# All scenarios use the same fixture without graphify-out
case "$SCENARIO" in
  P1-L1-execution|N1-L1-execution|P2-L2-execution|N2-L2-execution|P3-L3-execution|N3-L3-execution|\
  P4-L1-notifications|N4-L1-notifications|P5-L2-notifications|N5-L2-notifications|P6-L3-notifications|N6-L3-notifications)
    :
    ;;
  *) echo "unknown scenario: $SCENARIO" >&2; exit 2 ;;
esac

if [ -e "$DEST" ]; then echo "refusing to overwrite existing $DEST" >&2; exit 2; fi
mkdir -p "$DEST"
cp -r "$FIXTURE/." "$DEST/"
rm -rf "$DEST/.os-adr"

git -C "$DEST" init -q
git -C "$DEST" add -A
git -C "$DEST" -c user.email=eval@local -c user.name=eval commit -qm "fixture baseline"
echo "$DEST"
