#!/usr/bin/env bash
# Cold first-run acceptance ladder for public 1.0 release.
# Run on a clean machine or VM with network access.
set -euo pipefail
cd "$(dirname "$0")/.."

echo "==> Layer 1: clean-room boot"
make clean-room-boot

echo "==> Layer 2: install smoke (network)"
make install-smoke

echo "==> Layer 2b: standalone Python smoke (macOS)"
if [[ "$(uname -s)" == "Darwin" ]]; then
  make standalone-smoke
else
  echo "    skip standalone-smoke (not macOS)"
fi

echo "==> Layer 3: first-run MLX smoke (Apple Silicon + MLX)"
if [[ "$(uname -m)" == "arm64" ]]; then
  make first-run-smoke
else
  echo "    skip first-run-smoke (not arm64)"
fi

echo "==> Layer 4: fresh install smoke (backs up ~/.mugi)"
./scripts/fresh_install_smoke.sh

echo ""
echo "COLD START ACCEPTANCE: PASS"
echo "Optional: ./scripts/fresh_install_smoke.sh --launch for GUI onboarding"
echo "Restore: make fresh-install-restore"
