#!/bin/sh set -eu ROOT="$(CDPATH= cd -- "$(dirname "$0")/.." && pwd)" need_cmd() { if ! command -v "$1" >/dev/null 2>&1; then echo "missing required command: $1" >&2 exit 1 fi } need_cmd python3 need_cmd docker need_cmd node cd "$ROOT" echo "[1/6] compile collector-service" python3 -m compileall collector-service/app >/dev/null echo "[2/6] run backend contract tests" python3 -m unittest \ tests.test_main_agent_governance \ tests.test_platform_contracts \ tests.test_production_baseline >/dev/null echo "[3/6] validate docker compose" docker compose config >/dev/null echo "[4/6] validate n8n workflows" python3 - <<'PY' import json import pathlib for path in sorted(pathlib.Path("n8n/workflows").glob("*.json")): with path.open() as handle: json.load(handle) print(f"workflow ok: {path.name}") PY echo "[5/6] validate web scripts" for file in web/storyforge-web-v4/assets/app.js web/storyforge-web-v4/assets/storyforge-*.js; do node --check "$file" done node --check scripts/douyin-browser-capture/control_panel.mjs echo "[6/6] validate homepage and workbench tests" node --test \ web/storyforge-web-v4/tests/dashboard-home.test.mjs \ web/storyforge-web-v4/tests/workbench-pages.test.mjs echo "baseline checks passed"