Release v2.0.30: Cold-archive rotation (.tar.gz), 6-Gate public regression suite (hs-public-smoke), VPS-native periodic data production timers, /engineering/ (E0-E5) & /math/ (M0-M5) explication hubs, and LLM pipeline operator manual
This commit is contained in:
1 parent
64825ffd75
commit
54e7f8ff61
55 files changed
+4039
-62
No files matched your search
@@ -0,0 +1,12 @@
|
||||
[Unit]
|
||||
Description=Hyperstition Studio US Closing-Bell Financial & FRED Macro Harvest (21:30 UTC Mon-Fri)
|
||||
After=network-online.target
|
||||
Wants=network-online.target
|
||||
|
||||
[Service]
|
||||
Type=oneshot
|
||||
WorkingDirectory=/srv/hyperstitionstud.io/repos
|
||||
Environment="REPOS_ROOT=/srv/hyperstitionstud.io/repos"
|
||||
Environment="LIVE_REPOS=/var/www/hyperstitionstud.io/repos"
|
||||
Environment="PYTHONPATH=/srv/hyperstitionstud.io/repos/hyperstitionstudio-core/src"
|
||||
ExecStart=/srv/hyperstitionstud.io/repos/hyperstitionstudio-core/deploy/run-vps-data-production.sh --window=us-closing-bell
|
||||
@@ -0,0 +1,11 @@
|
||||
[Unit]
|
||||
Description=Weekday 21:30 UTC (16:30 EST) Timer for Hyperstition Studio US Closing-Bell Harvest
|
||||
|
||||
[Timer]
|
||||
OnCalendar=Mon..Fri *-*-* 21:30:00 UTC
|
||||
Persistent=true
|
||||
RandomizedDelaySec=15
|
||||
Unit=hyperstition-closing-bell-harvest.service
|
||||
|
||||
[Install]
|
||||
WantedBy=timers.target
|
||||
@@ -0,0 +1,12 @@
|
||||
[Unit]
|
||||
Description=Hyperstition Studio Midnight 00:00 UTC Rollover Telemetry & Daily Brief Harvest
|
||||
After=network-online.target
|
||||
Wants=network-online.target
|
||||
|
||||
[Service]
|
||||
Type=oneshot
|
||||
WorkingDirectory=/srv/hyperstitionstud.io/repos
|
||||
Environment="REPOS_ROOT=/srv/hyperstitionstud.io/repos"
|
||||
Environment="LIVE_REPOS=/var/www/hyperstitionstud.io/repos"
|
||||
Environment="PYTHONPATH=/srv/hyperstitionstud.io/repos/hyperstitionstudio-core/src"
|
||||
ExecStart=/srv/hyperstitionstud.io/repos/hyperstitionstudio-core/deploy/run-vps-data-production.sh --window=utc-rollover
|
||||
@@ -0,0 +1,11 @@
|
||||
[Unit]
|
||||
Description=Daily 00:00 UTC Timer for Hyperstition Studio Midnight Rollover Harvest
|
||||
|
||||
[Timer]
|
||||
OnCalendar=*-*-* 00:00:00 UTC
|
||||
Persistent=true
|
||||
RandomizedDelaySec=15
|
||||
Unit=hyperstition-utc-rollover-harvest.service
|
||||
|
||||
[Install]
|
||||
WantedBy=timers.target
|
||||
Executable
+133
@@ -0,0 +1,133 @@
|
||||
#!/usr/bin/env bash
|
||||
# /workspace/hyperstitionstudio-core/deploy/run-vps-data-production.sh
|
||||
# Autonomous VPS-Native Periodic Data Production Orchestrator for hyperstitionstud.io.
|
||||
# Executes Stage 1 (Harvest) -> Stage 2 (Compilers) -> Stage 3 (Transactional Test & Isolation Gate
|
||||
# with Automatic Rollback on Failure) -> Stage 4 (tmpfs RAM Hydration via sync-vps-repos.sh --no-pull)
|
||||
# -> Optional Automated Git Push to git.libre.audio.
|
||||
set -euo pipefail
|
||||
|
||||
on_error() {
|
||||
local exit_code=$?
|
||||
local line_no="${1:-unknown}"
|
||||
echo "[ERROR] run-vps-data-production.sh failed at line ${line_no} with exit code ${exit_code} while running: ${BASH_COMMAND}" >&2
|
||||
exit "${exit_code}"
|
||||
}
|
||||
trap 'on_error ${LINENO}' ERR
|
||||
|
||||
run_checked() {
|
||||
local label="$1"
|
||||
shift
|
||||
local out=""
|
||||
local rc=0
|
||||
out="$("$@" 2>&1)" || rc=$?
|
||||
if [[ "${rc}" -ne 0 ]]; then
|
||||
echo "[ERROR] ${label} failed (exit code ${rc}): $*" >&2
|
||||
if [[ -n "${out}" ]]; then
|
||||
echo "${out}" >&2
|
||||
fi
|
||||
return "${rc}"
|
||||
fi
|
||||
}
|
||||
|
||||
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]:-$0}")" && pwd)"
|
||||
DEFAULT_REPOS_ROOT="$(cd "${SCRIPT_DIR}/../.." && pwd)"
|
||||
export REPOS_ROOT="${REPOS_ROOT:-${DEFAULT_REPOS_ROOT}}"
|
||||
export LIVE_REPOS="${LIVE_REPOS:-/var/www/hyperstitionstud.io/repos}"
|
||||
export PYTHONPATH="${REPOS_ROOT}/hyperstitionstudio-core/src${PYTHONPATH:+:${PYTHONPATH}}"
|
||||
if [[ -f "${REPOS_ROOT}/workspace.toml" ]]; then
|
||||
export HYPERSTITIONSTUDIO_CONFIG="${REPOS_ROOT}/workspace.toml"
|
||||
fi
|
||||
|
||||
WINDOW_MODE="us-closing-bell"
|
||||
OFFLINE_MODE=0
|
||||
DO_PUSH=1
|
||||
SKIP_HYDRATE=0
|
||||
|
||||
for arg in "$@"; do
|
||||
case "${arg}" in
|
||||
--window=*)
|
||||
WINDOW_MODE="${arg#*=}"
|
||||
;;
|
||||
--offline|--no-network)
|
||||
OFFLINE_MODE=1
|
||||
;;
|
||||
--no-push)
|
||||
DO_PUSH=0
|
||||
;;
|
||||
--skip-hydrate)
|
||||
SKIP_HYDRATE=1
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
LOCK_FILE="${HYPERSTITION_HARVEST_LOCK:-/tmp/hyperstition-vps-harvest.lock}"
|
||||
if [[ -n "$(type -P flock || true)" ]]; then
|
||||
exec 9>"${LOCK_FILE}"
|
||||
if ! flock -n 9; then
|
||||
echo "[info] Another harvest/sync is currently holding ${LOCK_FILE}; exiting cleanly."
|
||||
exit 0
|
||||
fi
|
||||
fi
|
||||
|
||||
unset OPENROUTER_API_KEY OPENAI_API_KEY ANTHROPIC_API_KEY
|
||||
|
||||
echo "[1/5] Running Stage 1 & Stage 2 periodic data production (window=${WINDOW_MODE}, offline=${OFFLINE_MODE})..."
|
||||
if [[ "${OFFLINE_MODE}" -eq 1 ]]; then
|
||||
run_checked "hs-quant-harvest (offline)" python3 -m hyperstitionstud_io.quant.collector --mode "${WINDOW_MODE}"
|
||||
run_checked "hs-macro-harvest (offline)" python3 -m hyperstitionstud_io.quant.macro --offline
|
||||
else
|
||||
run_checked "hs-quant-harvest (--append-history --live)" python3 -m hyperstitionstud_io.quant.collector --mode "${WINDOW_MODE}" --append-history --live
|
||||
run_checked "hs-macro-harvest (live FRED CSV)" python3 -m hyperstitionstud_io.quant.macro
|
||||
fi
|
||||
if [[ "${WINDOW_MODE}" == "utc-rollover" ]] && [[ -f "${REPOS_ROOT}/ingglish-hyperdope-gematria/ingglish-aq-archive/scripts/ci_provision_ingglish.py" ]]; then
|
||||
CI_OUT_DIR="${REPOS_ROOT}/ingglish-hyperdope-ci"
|
||||
if [[ ! -d "${CI_OUT_DIR}" ]] && [[ -d "${REPOS_ROOT}/hyperdope-ci-build" ]]; then
|
||||
CI_OUT_DIR="${REPOS_ROOT}/hyperdope-ci-build"
|
||||
fi
|
||||
if [[ -d "${CI_OUT_DIR}" ]]; then
|
||||
run_checked "ci_provision_ingglish.py (--tier 2)" python3 "${REPOS_ROOT}/ingglish-hyperdope-gematria/ingglish-aq-archive/scripts/ci_provision_ingglish.py" \
|
||||
--archive-dir "${REPOS_ROOT}/ingglish-hyperdope-gematria/ingglish-aq-archive" \
|
||||
--out-dir "${CI_OUT_DIR}" \
|
||||
--tier 2
|
||||
fi
|
||||
fi
|
||||
run_checked "quant.timeseries" python3 -m hyperstitionstud_io.quant.timeseries
|
||||
run_checked "hs-daily-brief" python3 -m hyperstitionstud_io.quant.daily_brief
|
||||
run_checked "build_encyclopedia_knowledge_graph.py" python3 "${REPOS_ROOT}/encyclopedia-knowledge-graph/scripts/build_encyclopedia_knowledge_graph.py" --verify-only
|
||||
|
||||
echo "[2/5] Running Stage 3 transactional verification gates (hs-doctor, ReadOnlyIsolationGuard, test_core_suite)..."
|
||||
if ! python3 -m hyperstitionstud_io.ci.doctor || ! python3 "${REPOS_ROOT}/hyperstitionstudio-core/tests/test_core_suite.py"; then
|
||||
echo "[ROLLBACK] Verification gate failed! Rolling back uncommitted changes in ${REPOS_ROOT} without touching tmpfs..." >&2
|
||||
for r in hyperstitionstudio-core ingglish-hyperdope-gematria encyclopedia-knowledge-graph; do
|
||||
if [[ -d "${REPOS_ROOT}/${r}/.git" ]]; then
|
||||
git -C "${REPOS_ROOT}/${r}" checkout -- .
|
||||
fi
|
||||
done
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [[ "${SKIP_HYDRATE}" -eq 0 ]]; then
|
||||
echo "[3/5] Hydrating tmpfs RAM webroot (${LIVE_REPOS}) via sync-vps-repos.sh --no-pull --no-caddy..."
|
||||
run_checked "sync-vps-repos.sh --no-pull --no-caddy" "${SCRIPT_DIR}/sync-vps-repos.sh" --no-pull --no-caddy
|
||||
else
|
||||
echo "[3/5] Skipping tmpfs hydration (--skip-hydrate)."
|
||||
fi
|
||||
|
||||
if [[ "${DO_PUSH}" -eq 1 ]] && [[ -f "/etc/hyperstitionstud.io/id_ed25519_git_libre_audio" ]]; then
|
||||
echo "[4/5] Committing and pushing automated VPS telemetry updates to git.libre.audio..."
|
||||
export GIT_SSH_COMMAND="ssh -i /etc/hyperstitionstud.io/id_ed25519_git_libre_audio -o StrictHostKeyChecking=accept-new"
|
||||
STAMP_UTC="$(date -u +%Y-%m-%dT%H:%M:%SZ)"
|
||||
for r in hyperstitionstudio-core ingglish-hyperdope-gematria encyclopedia-knowledge-graph; do
|
||||
if [[ -d "${REPOS_ROOT}/${r}/.git" ]]; then
|
||||
git -C "${REPOS_ROOT}/${r}" add -A
|
||||
if ! git -C "${REPOS_ROOT}/${r}" diff --cached --quiet; then
|
||||
run_checked "git commit (${r})" git -C "${REPOS_ROOT}/${r}" commit -m "chore(telemetry): automated VPS ${WINDOW_MODE} harvest (${STAMP_UTC})"
|
||||
run_checked "git push (${r})" git -C "${REPOS_ROOT}/${r}" push origin main
|
||||
fi
|
||||
fi
|
||||
done
|
||||
else
|
||||
echo "[4/5] Skipping automated git.libre.audio push (no-push or deploy key absent)."
|
||||
fi
|
||||
|
||||
echo "[5/5] VPS periodic data production (${WINDOW_MODE}) completed and verified."
|
||||
@@ -164,6 +164,12 @@ ${LIVE_SUDO} ln -sfn "hyperstitionstudio-core/site/assets" "${LIVE_REPOS}/assets
|
||||
${LIVE_SUDO} ln -sfn "hyperstitionstudio-core/site/learn" "${LIVE_REPOS}/learn"
|
||||
${LIVE_SUDO} ln -sfn "hyperstitionstudio-core/site/quant" "${LIVE_REPOS}/quant"
|
||||
${LIVE_SUDO} ln -sfn "hyperstitionstudio-core/site/donate" "${LIVE_REPOS}/donate"
|
||||
if [[ -d "${LIVE_REPOS}/hyperstitionstudio-core/site/engineering" ]]; then
|
||||
${LIVE_SUDO} ln -sfn "hyperstitionstudio-core/site/engineering" "${LIVE_REPOS}/engineering"
|
||||
fi
|
||||
if [[ -d "${LIVE_REPOS}/hyperstitionstudio-core/site/math" ]]; then
|
||||
${LIVE_SUDO} ln -sfn "hyperstitionstudio-core/site/math" "${LIVE_REPOS}/math"
|
||||
fi
|
||||
# Note: /gallery is disabled for now (tracked as a long-term plan in docs/PLAN-MEMETIC-GALLERY-SUBPAGE.pdf)
|
||||
${LIVE_SUDO} rm -rf "${LIVE_REPOS}/gallery" "${LIVE_REPOS}/hyperstitionstudio-core/site/gallery"
|
||||
${LIVE_SUDO} ln -sfn "encyclopedia-knowledge-graph" "${LIVE_REPOS}/graph"
|
||||
@@ -204,7 +210,13 @@ if [[ "${DO_CADDY}" -eq 1 ]]; then
|
||||
|
||||
if [[ -n "$(type -P systemctl || true)" ]] && [[ -d "/run/systemd/system" ]]; then
|
||||
UNITS_CHANGED=0
|
||||
for unit_name in "hyperstition-tmpfs-sync.service" "hyperstition-mcp.service"; do
|
||||
for unit_name in \
|
||||
"hyperstition-tmpfs-sync.service" \
|
||||
"hyperstition-mcp.service" \
|
||||
"hyperstition-closing-bell-harvest.service" \
|
||||
"hyperstition-closing-bell-harvest.timer" \
|
||||
"hyperstition-utc-rollover-harvest.service" \
|
||||
"hyperstition-utc-rollover-harvest.timer"; do
|
||||
src_u="${DEPLOY_DIR}/${unit_name}"
|
||||
dst_u="/etc/systemd/system/${unit_name}"
|
||||
if [[ -f "${src_u}" ]]; then
|
||||
@@ -220,6 +232,8 @@ if [[ "${DO_CADDY}" -eq 1 ]]; then
|
||||
run_checked "systemctl enable hyperstition-tmpfs-sync.service" ${SUDO} systemctl enable hyperstition-tmpfs-sync.service
|
||||
run_checked "systemctl enable --now hyperstition-mcp.service" ${SUDO} systemctl enable --now hyperstition-mcp.service
|
||||
run_checked "systemctl restart hyperstition-mcp.service" ${SUDO} systemctl restart hyperstition-mcp.service
|
||||
run_checked "systemctl enable --now hyperstition-closing-bell-harvest.timer" ${SUDO} systemctl enable --now hyperstition-closing-bell-harvest.timer
|
||||
run_checked "systemctl enable --now hyperstition-utc-rollover-harvest.timer" ${SUDO} systemctl enable --now hyperstition-utc-rollover-harvest.timer
|
||||
elif [[ -f "/etc/systemd/system/hyperstition-mcp.service" ]]; then
|
||||
echo "[5/5] Restarting hyperstition-mcp.service to load latest MCP & REST API v1 (/api/v1/*) modules..."
|
||||
run_checked "systemctl enable --now hyperstition-mcp.service" ${SUDO} systemctl enable --now hyperstition-mcp.service
|
||||
|
||||
@@ -72,8 +72,10 @@ ROUTES=(
|
||||
"/graph/docs/specification-concentric-eti-tier-ring-radar-d-periphery.pdf"
|
||||
"/graph/docs/cross-repo-dependency-and-audit-flow-diagram.html"
|
||||
"/graph/docs/cross-repo-dependency-and-audit-flow-diagram.pdf"
|
||||
"/graph/docs/periodic-harvest-cicd-to-vps-flow-diagram.png"
|
||||
"/graph/docs/VPS-AND-GIT-OPERATOR-DEPLOYMENT-GUIDE.pdf"
|
||||
"/graph/docs/PLAN-ARCHIVE-ROTATION-AND-COMPRESSION-ECONOMIZER.pdf"
|
||||
"/graph/docs/OPERATORS-MANUAL-LLM-TOKEN-DEPENDENT-DATA-PIPELINES.pdf"
|
||||
"/graph/docs/PLAN-CRONJOB-ARCHIVE-ROTATION-ON-HYPERSTITIONSTUD-IO.pdf"
|
||||
"/graph/docs/PLAN-LEXICAL-AND-ETYMOLOGICAL-SIMPLIFICATION.pdf"
|
||||
"/graph/docs/PLAN-LLM-TOKEN-ECONOMIZER-AND-VARIANCE-ROUTING.pdf"
|
||||
"/graph/docs/PLAN-LLM-TOKEN-ECONOMIZER-DATA-FIDELITY-AND-DEGRADATION-RISK-EVALUATION.pdf"
|
||||
@@ -102,6 +104,19 @@ ROUTES=(
|
||||
"/schemas/v1/ticker-stats-card.schema.json"
|
||||
)
|
||||
|
||||
# Dynamically append enabled /engineering/* and /math/* routes from their manifests so piecewise/reverted subsets work seamlessly
|
||||
for man_p in \
|
||||
"${SCRIPT_DIR}/../site/engineering/engineering-manifest.json" \
|
||||
"${SCRIPT_DIR}/../site/math/math-manifest.json"; do
|
||||
if [[ -f "${man_p}" ]]; then
|
||||
while IFS= read -r dyn_r; do
|
||||
if [[ -n "${dyn_r}" ]]; then
|
||||
ROUTES+=("${dyn_r}")
|
||||
fi
|
||||
done < <(python3 -c 'import json,sys; d=json.load(open(sys.argv[1])); print("\n".join(d.get("enabled_routes",[])))' "${man_p}")
|
||||
fi
|
||||
done
|
||||
|
||||
PASS_COUNT=0
|
||||
for route in "${ROUTES[@]}"; do
|
||||
url="${TARGET_BASE_URL}${route}"
|
||||
@@ -158,4 +173,10 @@ print(f" [OK] SQLite metadata DB populated ({summary['total_requests']} calls),
|
||||
PY
|
||||
fi
|
||||
|
||||
echo "[OK] All ${PASS_COUNT}/${#ROUTES[@]} static routes + 2 MCP HTTP endpoints + 4 REST API v1 endpoints verified (HTTP 200 OK)."
|
||||
echo "[4d/4] Running 6-Gate Ad-Hoc Public API & Surface Regression Suite (hs-public-smoke Gates P1-P6) against ${TARGET_BASE_URL}..."
|
||||
PYTHONPATH="${SCRIPT_DIR}/../src" python3 -m hyperstitionstud_io.ci.public_regression \
|
||||
--base-url "${TARGET_BASE_URL}" \
|
||||
--mcp-url "${MCP_URL}" \
|
||||
--api-v1-url "${API_V1_URL}"
|
||||
|
||||
echo "[OK] All ${PASS_COUNT}/${#ROUTES[@]} static routes + 2 MCP HTTP endpoints + 4 REST API v1 endpoints + 6 Public Regression Gates verified (HTTP 200 OK)."
|
||||
Reference in new issue
Block a user