unoverse 0.1.142 → 0.1.144
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/operator/.env.example +6 -0
- package/operator/lib/deploy.sh +62 -0
- package/package.json +1 -1
package/operator/.env.example
CHANGED
|
@@ -67,3 +67,9 @@ AUTH_AUDIENCE=gravity-api
|
|
|
67
67
|
|
|
68
68
|
# Quick no-login mode (local only — production refuses to start with it):
|
|
69
69
|
# AUTH_ENABLED=false
|
|
70
|
+
|
|
71
|
+
# Node memoization (docs/unoverseCopilot/EXECUTION_EFFICIENCY.md §3). OFF by default.
|
|
72
|
+
# Cacheable nodes (capabilities.cacheable in the node YAML) reuse a prior run's output when
|
|
73
|
+
# the fingerprint matches — saves re-running expensive parses/scrapes across test cycles.
|
|
74
|
+
# WORKFLOW_NODE_MEMOIZATION=true
|
|
75
|
+
# WORKFLOW_NODE_MEMOIZATION_TTL_MS=21600000
|
package/operator/lib/deploy.sh
CHANGED
|
@@ -918,6 +918,68 @@ EOF
|
|
|
918
918
|
|
|
919
919
|
rm -f "$tmp_inventory"
|
|
920
920
|
|
|
921
|
+
# ── POST-DEPLOY SMOKE ───────────────────────────────────────────────────────
|
|
922
|
+
# The deployed stack, probed from the outside. SELF-CONTAINED (curl only): this script
|
|
923
|
+
# is vendored into the operator CLI and runs in a universe folder, so it can lean on no
|
|
924
|
+
# repo test suite. Every check is an outage that shipped and was found by hand: the
|
|
925
|
+
# blank canvas (uncompressed/uncached bundle, 2026-08-15), the no-login boot (empty
|
|
926
|
+
# auth config, 2026-08-14), and the engine→Postgres 500 behind a healthy-looking stack
|
|
927
|
+
# (Trusted Sources, 2026-08-13). The repo twin with more detail lives at
|
|
928
|
+
# apps/canvas/tests/smoke/deployed.test.ts.
|
|
929
|
+
# Runs on the plain deploy only — init/db/harden are not "the site is live" moments.
|
|
930
|
+
if [ -z "$subcommand" ] || [ "$subcommand" = "deploy" ]; then
|
|
931
|
+
local smoke_canvas smoke_api smoke_fail=0
|
|
932
|
+
smoke_canvas=$(terraform -chdir="$ROOT/infra/$cloud" output -raw canvas_url 2>/dev/null)
|
|
933
|
+
smoke_api=$(terraform -chdir="$ROOT/infra/$cloud" output -raw api_url 2>/dev/null)
|
|
934
|
+
if [ -n "$smoke_api" ]; then
|
|
935
|
+
echo ""
|
|
936
|
+
info "Smoke-testing the deployed stack ${DIM}($smoke_api)${NC}"
|
|
937
|
+
# WAIT FOR STEADY STATE FIRST. A restart is ~36s of boot plus however many
|
|
938
|
+
# health-check intervals the load balancer needs to re-admit the droplet, and
|
|
939
|
+
# during that window EVERY api-side probe answers 503. The smoke test measures
|
|
940
|
+
# the stack's steady state, not the race — so it starts at the first 200 from
|
|
941
|
+
# /health THROUGH the balancer (which proves both the app and re-admission), and
|
|
942
|
+
# only a stack that never gets there fails. Observed live 2026-08-16: a healthy
|
|
943
|
+
# v1.13.79 deploy reported four FAILs and "fix forward or roll back", all of it
|
|
944
|
+
# re-admission lag. A false stop after the irreversible half is the worst kind.
|
|
945
|
+
local smoke_wait=0
|
|
946
|
+
until [ "$(curl -s -m 5 -o /dev/null -w '%{http_code}' "$smoke_api/health")" = 200 ]; do
|
|
947
|
+
if [ "$smoke_wait" -ge 180 ]; then
|
|
948
|
+
echo -e " ${RED}FAIL${NC} stack never became healthy (/health ≠ 200 after ${smoke_wait}s)"
|
|
949
|
+
smoke_fail=1
|
|
950
|
+
break
|
|
951
|
+
fi
|
|
952
|
+
[ "$smoke_wait" = 0 ] && echo -e " ${DIM}waiting for /health through the balancer (boot + LB re-admission)...${NC}"
|
|
953
|
+
sleep 5; smoke_wait=$((smoke_wait + 5))
|
|
954
|
+
done
|
|
955
|
+
[ "$smoke_fail" = 0 ] && [ "$smoke_wait" -gt 0 ] && echo -e " ${DIM}healthy after ${smoke_wait}s${NC}"
|
|
956
|
+
_smoke() { # name, then the test itself as "$@"
|
|
957
|
+
local name="$1"; shift
|
|
958
|
+
if "$@" >/dev/null 2>&1; then echo -e " ${GREEN}ok${NC} $name"
|
|
959
|
+
else echo -e " ${RED}FAIL${NC} $name"; smoke_fail=1; fi
|
|
960
|
+
}
|
|
961
|
+
# Universe discovery answers (the connector's first question).
|
|
962
|
+
_smoke "universe discovery" curl -sf -m 10 "$smoke_api/.well-known/unoverse-universe" -o /dev/null
|
|
963
|
+
# Embed doorway is served AND compressed (identity-encoded JS was a live outage).
|
|
964
|
+
_smoke "embed.js gzipped" sh -c "curl -sf -m 10 -H 'accept-encoding: gzip' -D - '$smoke_api/embed.js' -o /dev/null | grep -qi '^content-encoding: gzip'"
|
|
965
|
+
# MCP lane accepts an initialize (every external connector dies here first).
|
|
966
|
+
_smoke "MCP initialize" sh -c "curl -sf -m 10 -X POST '$smoke_api/mcp' -H 'content-type: application/json' -H 'accept: application/json, text/event-stream' -d '{\"jsonrpc\":\"2.0\",\"id\":1,\"method\":\"initialize\",\"params\":{\"protocolVersion\":\"2025-06-18\",\"capabilities\":{},\"clientInfo\":{\"name\":\"smoke\",\"version\":\"0\"}}}' -o /dev/null"
|
|
967
|
+
# Engine → Postgres canary: 200 (auth off) or 401 (auth on) prove the chain; a 500
|
|
968
|
+
# is the DB-unreachable incident that hides behind an otherwise healthy stack.
|
|
969
|
+
_smoke "engine reaches database" sh -c "code=\$(curl -s -m 10 -o /dev/null -w '%{http_code}' '$smoke_api/marketplace'); [ \"\$code\" = 200 ] || [ \"\$code\" = 401 ]"
|
|
970
|
+
if [ -n "$smoke_canvas" ]; then
|
|
971
|
+
# The canvas page and the hashed bundle it names: present, compressed, cacheable.
|
|
972
|
+
_smoke "canvas page + compressed bundle" sh -c "asset=\$(curl -sf -m 10 '$smoke_canvas/' | grep -o '/assets/index-[^\"]*\.js' | head -1); [ -n \"\$asset\" ] && curl -sf -m 20 -H 'accept-encoding: gzip' -D - \"$smoke_canvas\$asset\" -o /dev/null | grep -qi '^content-encoding: gzip'"
|
|
973
|
+
# Empty auth values in config.js = the no-login boot where every call 401s.
|
|
974
|
+
_smoke "canvas auth config present" sh -c "! curl -sf -m 10 '$smoke_canvas/config.js' | grep -qE '(issuer|clientId): *\"\"'"
|
|
975
|
+
fi
|
|
976
|
+
if [ "$smoke_fail" = 1 ]; then
|
|
977
|
+
fail "Deploy finished but the smoke test FAILED — the stack above is live and misbehaving. Fix forward or roll back."
|
|
978
|
+
exit 1
|
|
979
|
+
fi
|
|
980
|
+
fi
|
|
981
|
+
fi
|
|
982
|
+
|
|
921
983
|
echo ""
|
|
922
984
|
echo -e " ${GREEN}${BOLD}Done${NC} ${DIM}in $(timer_elapsed)${NC}"
|
|
923
985
|
echo ""
|
package/package.json
CHANGED