scripts/drop-dataset.sh
#!/usr/bin/env bash
# drop-dataset.sh <model-slug> --yes — deletes a per-model dataset repo everywhere:
# the local mono-folder clone (Documents/fact.ngo/<slug>), the the self-hosted remote working clone
# (~/coherence/fact.ngo/<slug>), and the the self-hosted remote bare canonical (~/remotes/fact.ngo/<slug>.git).
# Irreversible. The xray mechanism repo is never touched.
set -euo pipefail
SLUG="${1:?usage: drop-dataset.sh <model-slug> --yes}"
CONFIRM="${2:-}"
REMOTE_HOST="${REMOTE_HOST:-remote}"
LOCAL_ROOT="${XRAY_DATASETS:-$HOME/Documents/fact.ngo}"
if [ "$CONFIRM" != "--yes" ]; then
echo "This permanently deletes the '$SLUG' dataset locally and on the self-hosted remote."
read -rp "Type the slug again to confirm: " input
[ "$input" = "$SLUG" ] || { echo "aborted"; exit 1; }
fi
rm -rf "$LOCAL_ROOT/$SLUG"
ssh "$REMOTE_HOST" "rm -rf ~/coherence/fact.ngo/$SLUG ~/remotes/fact.ngo/$SLUG.git"
echo "dataset '$SLUG' deleted everywhere."