#!/usr/bin/env bash # T5 — Next.js dev server probe. # # Verifies http://localhost:3002 is serving the Pascal editor cleanly without # touching the running process. # # Outputs structured "KEY=value" lines so the REPORT.md can be authored from # them, plus a longer human-readable summary at the end. set -uo pipefail URL_ROOT="http://localhost:3002/" URL_HEALTH="http://localhost:3002/api/health" TMPDIR="$(mktemp -d)" trap 'rm -rf "$TMPDIR"' EXIT ROOT_BODY="$TMPDIR/root.html" ROOT_HEAD="$TMPDIR/root.head" HEALTH_BODY="$TMPDIR/health.body" HEALTH_HEAD="$TMPDIR/health.head" echo "## Probe: $URL_ROOT" ROOT_STATUS=$(curl -sS --connect-timeout 5 --max-time 30 \ -o "$ROOT_BODY" -D "$ROOT_HEAD" -w '%{http_code}' "$URL_ROOT" || echo "000") ROOT_BYTES=$(wc -c < "$ROOT_BODY" | tr -d ' ') echo "ROOT_STATUS=$ROOT_STATUS" echo "ROOT_BYTES=$ROOT_BYTES" # Pascal mention: explicit "Pascal" string OR @pascal-app reference. if grep -q -i 'Pascal' "$ROOT_BODY"; then ROOT_HAS_PASCAL=1 else ROOT_HAS_PASCAL=0 fi if grep -q '@pascal-app' "$ROOT_BODY"; then ROOT_HAS_PASCAL_APP=1 else ROOT_HAS_PASCAL_APP=0 fi echo "ROOT_HAS_PASCAL=$ROOT_HAS_PASCAL" echo "ROOT_HAS_PASCAL_APP=$ROOT_HAS_PASCAL_APP" # Count