Files
dth/scripts/check-module.sh
xstudio agent c1cf6f54e5 merge sandbox/ai-1790562657-0EF743: chg_0001 dth scaffold + chg_0002 experiment_platform MVP
- chg_0001_dth_scaffold (skip_coverage): openspec framework + NestJS+React+PGlite scaffold
- chg_0002_sp1_experiment_platform_mvp: 6 scenarios S1-S6 + 21 perm-smoke + 16 e2e + 3 demo operators (hello-mpc/pir/vertical-lr)

Sandbox task exit 0. Independent verification: check_spec_coverage.sh gap=0 PASS.
Co-Authored-By: Claude Opus 4.8 <[email protected]>
2026-09-28 10:54:34 +08:00

33 lines
992 B
Bash
Executable File

#!/usr/bin/env bash
# check-module.sh <project> <module> [--live]
# Lightweight module check — lists registered operators if backend is up.
set -uo pipefail
PROJECT="${1:-dth}"
MODULE="${2:-experiment}"
shift 2 || true
LIVE=0
[ "${1:-}" = "--live" ] && LIVE=1
BASE="${DTH_BASE:-http://127.0.0.1:${PORT:-30000}}"
if [ "$LIVE" = "1" ]; then
echo "[check-module] project=$PROJECT module=$MODULE live=$BASE"
ADMIN_TOKEN="$(curl -s -X POST "$BASE/api/ssw/dth/auth/login" \
-H 'Content-Type: application/json' \
-d '{"username":"admin","password":"123456"}' \
| sed -E 's/.*"token":"([^"]+)".*/\1/')"
if [ -z "$ADMIN_TOKEN" ]; then
echo "[check-module] FAIL — login did not return token"
exit 1
fi
echo "[check-module] OK — admin token len=${#ADMIN_TOKEN}"
curl -s "$BASE/api/ssw/dth/experiment/operators" \
-H "Authorization: Bearer $ADMIN_TOKEN" | head -c 400
echo
exit 0
fi
echo "[check-module] project=$PROJECT module=$MODULE (no live)"
exit 0