website-builder-backend / 50_fix_runtime_validation.sh
David Prince
fix: add all missing local module stubs (remote_mcp_registry, mcp_auth, mcp_transport, etc)
cce8120
Raw
History Blame Contribute Delete
1.85 kB
#!/usr/bin/env bash
set -euo pipefail
ROOT=/root/projects/website-builder-backend-clean
cd "$ROOT"
echo "========================================"
echo "Dolor3V Runtime Validation Repair"
echo "========================================"
echo
echo "[1/8] Compile"
python3 -m compileall backend >/dev/null
echo
echo "[2/8] Start FastAPI"
uvicorn backend.main:app \
--host 127.0.0.1 \
--port 8000 \
>/tmp/dolor3v_runtime.log 2>&1 &
PID=$!
cleanup() {
kill $PID >/dev/null 2>&1 || true
}
trap cleanup EXIT
echo
echo "[3/8] Wait"
for i in $(seq 1 30); do
if curl -fs http://127.0.0.1:8000/health >/dev/null 2>&1; then
break
fi
sleep 1
done
curl -fs http://127.0.0.1:8000/health >/dev/null
echo "[OK] Runtime ready."
echo
echo "[4/8] Create workspace session"
SESSION_JSON=$(
curl -fs \
-X POST \
http://127.0.0.1:8000/api/workspace/session
)
echo "$SESSION_JSON"
SESSION_ID=$(
python3 - <<PY
import json
print(json.loads("""$SESSION_JSON""")["session_id"])
PY
)
echo
echo "[5/8] IDE search"
curl -fsG \
http://127.0.0.1:8000/api/ide/search \
--data-urlencode "query=backend"
echo
echo
echo "[6/8] Chat endpoint"
curl -fsG \
-X POST \
http://127.0.0.1:8000/api/workspace/chat/message \
--data-urlencode "session_id=${SESSION_ID}" \
--data-urlencode "role=user" \
--data-urlencode "content=Hello Dolor3V"
echo
echo
echo "[7/8] MCP"
curl -fs \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","id":"1","method":"ping"}' \
http://127.0.0.1:8000/mcp
echo
echo
echo "[8/8] Health"
curl -fs http://127.0.0.1:8000/health
echo
echo
echo "========================================"
echo "Runtime Validation Passed"
echo "========================================"
echo
echo "[CLEANUP]"
kill $PID >/dev/null 2>&1 || true
wait $PID 2>/dev/null || true