feat(education): establish operational independence contracts

This commit is contained in:
2026-07-31 12:54:08 +08:00
parent 428d4e10fd
commit f42ef76527
24 changed files with 740 additions and 20 deletions

View File

@@ -0,0 +1,25 @@
#!/usr/bin/env bash
set -euo pipefail
BASE_URL="${BASE_URL:-http://127.0.0.1:48080}"
TOKEN="${EDUCATION_ADMIN_TOKEN:?EDUCATION_ADMIN_TOKEN is required}"
TENANT_ID="${EDUCATION_TENANT_ID:?EDUCATION_TENANT_ID is required}"
response="$(curl --fail --silent --show-error \
-H "Authorization: Bearer ${TOKEN}" \
-H "tenant-id: ${TENANT_ID}" \
"${BASE_URL}/admin-api/education/operations/health")"
python3 - "$response" <<'PY'
import json, sys
body = json.loads(sys.argv[1])
assert body.get("code") == 0, body
health = body["data"]
deps = {item["key"]: item for item in health["dependencies"]}
java = deps.get("java-read-postgresql")
scalar = deps.get("scalar-catalog")
assert java and java["required"] and java["status"] == "UP", deps
assert scalar and not scalar["required"] and scalar["status"] == "NOT_SELECTED", deps
assert health["status"] in ("UP", "DEGRADED"), health
print("target-only JAVA_READ readiness proof passed")
PY