128 lines
5.0 KiB
Bash
Executable File
128 lines
5.0 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
set -euo pipefail
|
|
|
|
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
ROOT="$(cd "$SCRIPT_DIR/.." && pwd)"
|
|
CHORUS="$ROOT"
|
|
LIVE=0
|
|
PRIMARY_MODEL="${PRIMARY_MODEL:-openai/gpt-oss-120b}"
|
|
FALLBACK_MODEL="${FALLBACK_MODEL:-zai-org/glm-4.7-fp8}"
|
|
|
|
if [[ "${1:-}" == "--live" ]]; then
|
|
LIVE=1
|
|
fi
|
|
|
|
PASS=0
|
|
FAIL=0
|
|
|
|
pass() {
|
|
PASS=$((PASS + 1))
|
|
printf "PASS: %s\n" "$1"
|
|
}
|
|
|
|
fail() {
|
|
FAIL=$((FAIL + 1))
|
|
printf "FAIL: %s\n" "$1"
|
|
}
|
|
|
|
check_file() {
|
|
local f="$1"
|
|
local label="$2"
|
|
if [[ -f "$f" ]]; then
|
|
pass "$label"
|
|
else
|
|
fail "$label (missing: $f)"
|
|
fi
|
|
}
|
|
|
|
check_contains() {
|
|
local f="$1"
|
|
local pattern="$2"
|
|
local label="$3"
|
|
if rg -n --fixed-strings "$pattern" "$f" >/dev/null 2>&1; then
|
|
pass "$label"
|
|
else
|
|
fail "$label (pattern not found: $pattern)"
|
|
fi
|
|
}
|
|
|
|
check_not_contains() {
|
|
local f="$1"
|
|
local pattern="$2"
|
|
local label="$3"
|
|
if rg -n --fixed-strings "$pattern" "$f" >/dev/null 2>&1; then
|
|
fail "$label (still present: $pattern)"
|
|
else
|
|
pass "$label"
|
|
fi
|
|
}
|
|
|
|
printf "March 8 Bootstrap Gate\n"
|
|
date -u +"UTC now: %Y-%m-%dT%H:%M:%SZ"
|
|
printf "Mode: %s\n\n" "$([[ $LIVE -eq 1 ]] && echo "live" || echo "static")"
|
|
|
|
# Core files
|
|
check_file "$ROOT/docs/progress/MARCH8-BOOTSTRAP-RELEASE-BOARD.md" "Release board exists"
|
|
check_file "$CHORUS/docker/docker-compose.yml" "CHORUS compose exists"
|
|
check_file "$CHORUS/pkg/config/config.go" "CHORUS config defaults exists"
|
|
check_file "$CHORUS/reasoning/reasoning.go" "Reasoning provider code exists"
|
|
check_file "$ROOT/resetdata-models.txt" "ResetData model list exists"
|
|
check_file "$ROOT/resetdata-examples.md" "ResetData examples exists"
|
|
|
|
# Configuration consistency
|
|
check_contains "$CHORUS/docker/docker-compose.yml" "CHORUS_AI_PROVIDER=\${CHORUS_AI_PROVIDER:-resetdata}" "Compose defaults to resetdata provider"
|
|
check_contains "$CHORUS/docker/docker-compose.yml" "RESETDATA_BASE_URL=\${RESETDATA_BASE_URL:-https://app.resetdata.ai/api/v1}" "Compose base URL points at app.resetdata.ai"
|
|
check_contains "$CHORUS/docker/docker-compose.yml" "RESETDATA_MODEL=\${RESETDATA_MODEL:-openai/gpt-oss-120b}" "Compose default model is frozen primary model"
|
|
check_contains "$CHORUS/pkg/config/config.go" "BaseURL: getEnvOrDefault(\"RESETDATA_BASE_URL\", \"https://app.resetdata.ai/api/v1\")" "Go default base URL points at app.resetdata.ai"
|
|
check_contains "$CHORUS/pkg/config/config.go" "Provider: getEnvOrDefault(\"CHORUS_AI_PROVIDER\", \"resetdata\")" "Go default provider is resetdata"
|
|
check_contains "$CHORUS/pkg/config/config.go" "Model: getEnvOrDefault(\"RESETDATA_MODEL\", \"openai/gpt-oss-120b\")" "Go default model is frozen primary model"
|
|
|
|
# SWOOSH integration check
|
|
check_contains "$CHORUS/docker/docker-compose.yml" "WHOOSH_API_BASE_URL=\${SWOOSH_API_BASE_URL:-http://swoosh:8080}" "Compose points CHORUS to SWOOSH API"
|
|
check_contains "$CHORUS/docker/docker-compose.yml" "WHOOSH_API_ENABLED=true" "SWOOSH/WHOOSH API integration enabled"
|
|
|
|
# Critical gate: mock execution must be removed from critical path
|
|
check_not_contains "$CHORUS/coordinator/task_coordinator.go" "Task execution will fall back to mock implementation" "No mock fallback banner in task coordinator"
|
|
check_not_contains "$CHORUS/coordinator/task_coordinator.go" "Task completed successfully (mock execution)" "No mock completion path in task coordinator"
|
|
|
|
# Optional live API probe (does not print secret)
|
|
if [[ $LIVE -eq 1 ]]; then
|
|
KEY_FILE="${RESETDATA_API_KEY_FILE:-/home/tony/chorus/business/secrets/resetdata-beta.txt}"
|
|
if [[ -f "$KEY_FILE" ]]; then
|
|
API_KEY="$(tr -d '\n' < "$KEY_FILE")"
|
|
if [[ -n "$API_KEY" ]]; then
|
|
HTTP_CODE="$(curl -sS -o /tmp/resetdata_probe_primary.json -w "%{http_code}" \
|
|
-X POST "https://app.resetdata.ai/api/v1/chat/completions" \
|
|
-H "Authorization: Bearer $API_KEY" \
|
|
-H "Content-Type: application/json" \
|
|
-d "{\"model\":\"$PRIMARY_MODEL\",\"messages\":[{\"role\":\"user\",\"content\":\"Respond with OK\"}],\"max_tokens\":16,\"temperature\":0.0}")"
|
|
if [[ "$HTTP_CODE" == "200" ]]; then
|
|
pass "Live ResetData primary probe returned 200 ($PRIMARY_MODEL)"
|
|
else
|
|
fail "Live ResetData primary probe failed (HTTP $HTTP_CODE, model $PRIMARY_MODEL)"
|
|
fi
|
|
|
|
HTTP_CODE="$(curl -sS -o /tmp/resetdata_probe_fallback.json -w "%{http_code}" \
|
|
-X POST "https://app.resetdata.ai/api/v1/chat/completions" \
|
|
-H "Authorization: Bearer $API_KEY" \
|
|
-H "Content-Type: application/json" \
|
|
-d "{\"model\":\"$FALLBACK_MODEL\",\"messages\":[{\"role\":\"user\",\"content\":\"Respond with OK\"}],\"max_tokens\":16,\"temperature\":0.0}")"
|
|
if [[ "$HTTP_CODE" == "200" ]]; then
|
|
pass "Live ResetData fallback probe returned 200 ($FALLBACK_MODEL)"
|
|
else
|
|
fail "Live ResetData fallback probe failed (HTTP $HTTP_CODE, model $FALLBACK_MODEL)"
|
|
fi
|
|
else
|
|
fail "Live ResetData probe skipped (empty key file)"
|
|
fi
|
|
else
|
|
fail "Live ResetData probe skipped (missing key file)"
|
|
fi
|
|
fi
|
|
|
|
printf "\nSummary: %d passed, %d failed\n" "$PASS" "$FAIL"
|
|
|
|
if [[ "$FAIL" -gt 0 ]]; then
|
|
exit 1
|
|
fi
|