Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5841ccea2c | ||
|
|
62592f2efd | ||
|
|
7a0a058085 | ||
|
|
c42e4320e2 | ||
|
|
84636efd32 | ||
|
|
af761b8583 |
No files matched your search
@@ -7,7 +7,7 @@ Before=caddy.service
|
||||
|
||||
[Service]
|
||||
Type=oneshot
|
||||
ExecStart=/srv/hyperstitionstud.io/repos/hyperstitionstudio-core/deploy/sync-vps-repos.sh --no-pull
|
||||
ExecStart=/srv/hyperstitionstud.io/repos/hyperstitionstudio-core/deploy/sync-vps-repos.sh --no-pull --no-caddy
|
||||
RemainAfterExit=yes
|
||||
|
||||
[Install]
|
||||
|
||||
+148
-37
@@ -1,24 +1,67 @@
|
||||
#!/usr/bin/env bash
|
||||
# /workspace/hyperstitionstudio-core/deploy/sync-vps-repos.sh
|
||||
# Hydrates per-repository install directories from REPOS_ROOT into LIVE_REPOS (tmpfs RAM mount),
|
||||
# builds haiperdohp-jemaytreeah/db_lite.json if absent, creates top-level route symlinks, and
|
||||
# pre-compresses (.br / .gz) static assets.
|
||||
# supplies untracked haiperdohp-jemaytreeah/.gitignore files (config.js, db.json, db_lite.json),
|
||||
# creates top-level route symlinks, pre-compresses (.br / .gz) static assets, and idempotently
|
||||
# syncs/validates/reloads /etc/caddy/Caddyfile and systemd units by default (negated via --no-caddy).
|
||||
#
|
||||
# Usage:
|
||||
# ./sync-vps-repos.sh all # Pull from git.libre.audio, audit & sync all repos
|
||||
# ./sync-vps-repos.sh encyclopedia-knowledge-graph # Pull, audit & sync a single repo
|
||||
# ./sync-vps-repos.sh --no-pull # Audit & sync existing local clones without network fetch
|
||||
# ./sync-vps-repos.sh [all|<repo-name>] [--no-pull] [--no-caddy|--no-services]
|
||||
set -euo pipefail
|
||||
|
||||
on_error() {
|
||||
local exit_code=$?
|
||||
local line_no="${1:-unknown}"
|
||||
echo "[ERROR] sync-vps-repos.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
|
||||
}
|
||||
|
||||
has_cmd() {
|
||||
command -v "$1" >&2
|
||||
}
|
||||
|
||||
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}"
|
||||
TARGET_REPO="${1:-all}"
|
||||
|
||||
TARGET_REPO="all"
|
||||
DO_PULL=1
|
||||
DO_CADDY=1
|
||||
|
||||
for arg in "$@"; do
|
||||
case "${arg}" in
|
||||
--no-pull)
|
||||
DO_PULL=0
|
||||
;;
|
||||
--no-caddy|--no-services)
|
||||
DO_CADDY=0
|
||||
;;
|
||||
*)
|
||||
TARGET_REPO="${arg}"
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
SUDO=""
|
||||
if [[ "${EUID:-$(id -u)}" -ne 0 ]] && [[ ! -w "$(dirname "${LIVE_REPOS}")" ]] && command -v sudo >/dev/null 2>&1; then
|
||||
if [[ "${EUID:-$(id -u)}" -ne 0 ]] && type -P sudo >&2; then
|
||||
SUDO="sudo"
|
||||
fi
|
||||
|
||||
@@ -46,7 +89,7 @@ REPOS=(
|
||||
"${CI_REPO_DIR}:feat/ingglish-aq-corpus"
|
||||
)
|
||||
|
||||
if [[ "${TARGET_REPO}" != "--no-pull" ]]; then
|
||||
if [[ "${DO_PULL}" -eq 1 ]]; then
|
||||
for entry in "${REPOS[@]}"; do
|
||||
repo="${entry%%:*}"
|
||||
branch="${entry##*:}"
|
||||
@@ -55,12 +98,19 @@ if [[ "${TARGET_REPO}" != "--no-pull" ]]; then
|
||||
fi
|
||||
if [[ -d "${REPOS_ROOT}/${repo}/.git" ]]; then
|
||||
remote_name="origin"
|
||||
if [[ "${repo}" == "haiperdohp-jemaytreeah" ]] && git -C "${REPOS_ROOT}/${repo}" remote get-url downstream >/dev/null 2>&1; then
|
||||
if [[ "${repo}" == "haiperdohp-jemaytreeah" ]] && git -C "${REPOS_ROOT}/${repo}" remote | grep -qx "downstream"; then
|
||||
remote_name="downstream"
|
||||
fi
|
||||
echo "[1/4] Updating ${REPOS_ROOT}/${repo} (${remote_name}/${branch})..."
|
||||
git -C "${REPOS_ROOT}/${repo}" fetch --force "${remote_name}" "${branch}" --tags
|
||||
git -C "${REPOS_ROOT}/${repo}" merge --ff-only "${remote_name}/${branch}"
|
||||
echo "[1/5] Updating ${REPOS_ROOT}/${repo} (${remote_name}/${branch})..."
|
||||
prev_head="$(git -C "${REPOS_ROOT}/${repo}" rev-parse HEAD)"
|
||||
run_checked "git fetch ${repo}" git -C "${REPOS_ROOT}/${repo}" fetch --force "${remote_name}" "${branch}" --tags
|
||||
run_checked "git merge ${repo}" git -C "${REPOS_ROOT}/${repo}" merge --ff-only "${remote_name}/${branch}"
|
||||
new_head="$(git -C "${REPOS_ROOT}/${repo}" rev-parse HEAD)"
|
||||
if [[ "${repo}" == "hyperstitionstudio-core" && "${prev_head}" != "${new_head}" && -z "${HYPERSTITION_SYNC_REEXEC:-}" ]]; then
|
||||
echo "[1/5] hyperstitionstudio-core updated (${prev_head:0:7} -> ${new_head:0:7}); re-executing updated sync-vps-repos.sh..."
|
||||
export HYPERSTITION_SYNC_REEXEC=1
|
||||
exec "${REPOS_ROOT}/hyperstitionstudio-core/deploy/sync-vps-repos.sh" "$@"
|
||||
fi
|
||||
fi
|
||||
done
|
||||
fi
|
||||
@@ -69,56 +119,117 @@ fi
|
||||
if [[ -d "${REPOS_ROOT}/haiperdohp-jemaytreeah" ]]; then
|
||||
if [[ ! -f "${REPOS_ROOT}/haiperdohp-jemaytreeah/config.js" ]] && [[ -f "${REPOS_ROOT}/haiperdohp-jemaytreeah/config.default.js" ]]; then
|
||||
echo "[build] Copying haiperdohp-jemaytreeah/config.default.js -> config.js..."
|
||||
cp "${REPOS_ROOT}/haiperdohp-jemaytreeah/config.default.js" "${REPOS_ROOT}/haiperdohp-jemaytreeah/config.js"
|
||||
run_checked "copy haiperdohp-jemaytreeah config.js" cp "${REPOS_ROOT}/haiperdohp-jemaytreeah/config.default.js" "${REPOS_ROOT}/haiperdohp-jemaytreeah/config.js"
|
||||
fi
|
||||
if [[ ! -f "${REPOS_ROOT}/haiperdohp-jemaytreeah/db_lite.json" || ! -f "${REPOS_ROOT}/haiperdohp-jemaytreeah/db.json" ]] && [[ -f "${REPOS_ROOT}/haiperdohp-jemaytreeah/tools/generate_db_json.py" ]]; then
|
||||
echo "[build] Generating haiperdohp-jemaytreeah/db.json and db_lite.json from db.txt..."
|
||||
(cd "${REPOS_ROOT}/haiperdohp-jemaytreeah" && "${PYTHON_BIN}" tools/generate_db_json.py db.txt db.json)
|
||||
(cd "${REPOS_ROOT}/haiperdohp-jemaytreeah" && run_checked "generate_db_json.py" "${PYTHON_BIN}" tools/generate_db_json.py db.txt db.json)
|
||||
fi
|
||||
fi
|
||||
|
||||
echo "[2/4] Running hs-doctor and 6-Gate Knowledge Graph Verification..."
|
||||
"${PYTHON_BIN}" -m hyperstitionstud_io.ci.doctor >/dev/null
|
||||
"${PYTHON_BIN}" "${REPOS_ROOT}/encyclopedia-knowledge-graph/scripts/build_encyclopedia_knowledge_graph.py" --verify-only >/dev/null
|
||||
echo "[2/5] Synchronizing local workspace.toml version and running hs-doctor, version_sync --check, and 6-Gate Knowledge Graph Verification..."
|
||||
if [[ -f "${REPOS_ROOT}/workspace.toml" ]] && [[ -f "${REPOS_ROOT}/hyperstitionstudio-core/workspace.example.toml" ]]; then
|
||||
# Sync schema_version in untracked parent workspace.toml with hyperstitionstud_io.__version__
|
||||
run_checked "version_sync (sync untracked workspace.toml)" "${PYTHON_BIN}" -m hyperstitionstud_io.version_sync
|
||||
fi
|
||||
run_checked "version_sync --check" "${PYTHON_BIN}" -m hyperstitionstud_io.version_sync --check
|
||||
run_checked "hs-doctor" "${PYTHON_BIN}" -m hyperstitionstud_io.ci.doctor
|
||||
run_checked "build_encyclopedia_knowledge_graph.py --verify-only" "${PYTHON_BIN}" "${REPOS_ROOT}/encyclopedia-knowledge-graph/scripts/build_encyclopedia_knowledge_graph.py" --verify-only
|
||||
|
||||
echo "[3/4] Syncing per-repository install directories into ${LIVE_REPOS}..."
|
||||
${SUDO} mkdir -p "${LIVE_REPOS}"
|
||||
echo "[3/5] Syncing per-repository install directories into ${LIVE_REPOS}..."
|
||||
LIVE_SUDO=""
|
||||
if [[ ! -w "$(dirname "${LIVE_REPOS}")" ]] && [[ -n "${SUDO}" ]]; then
|
||||
LIVE_SUDO="${SUDO}"
|
||||
fi
|
||||
${LIVE_SUDO} mkdir -p "${LIVE_REPOS}"
|
||||
for entry in "${REPOS[@]}"; do
|
||||
repo="${entry%%:*}"
|
||||
if [[ "${TARGET_REPO}" != "all" && "${TARGET_REPO}" != "--no-pull" && "${TARGET_REPO}" != "${repo}" ]]; then
|
||||
if [[ "${TARGET_REPO}" != "all" && "${TARGET_REPO}" != "${repo}" ]]; then
|
||||
continue
|
||||
fi
|
||||
if [[ -d "${REPOS_ROOT}/${repo}" ]]; then
|
||||
${SUDO} mkdir -p "${LIVE_REPOS}/${repo}"
|
||||
${SUDO} rsync -a --delete --exclude='.git' "${REPOS_ROOT}/${repo}/" "${LIVE_REPOS}/${repo}/"
|
||||
${LIVE_SUDO} mkdir -p "${LIVE_REPOS}/${repo}"
|
||||
run_checked "rsync ${repo}" ${LIVE_SUDO} rsync -a --delete --exclude='.git' "${REPOS_ROOT}/${repo}/" "${LIVE_REPOS}/${repo}/"
|
||||
fi
|
||||
done
|
||||
|
||||
if [[ "${CI_REPO_DIR}" == "hyperdope-ci-build" ]] && [[ -d "${LIVE_REPOS}/hyperdope-ci-build" ]] && [[ ! -e "${LIVE_REPOS}/ingglish-hyperdope-ci" ]]; then
|
||||
${SUDO} ln -sfn "hyperdope-ci-build" "${LIVE_REPOS}/ingglish-hyperdope-ci"
|
||||
${LIVE_SUDO} ln -sfn "hyperdope-ci-build" "${LIVE_REPOS}/ingglish-hyperdope-ci"
|
||||
fi
|
||||
|
||||
# Create relative route symlinks inside LIVE_REPOS so both Caddy and standalone HTTP servers resolve all active routes
|
||||
${SUDO} ln -sfn "hyperstitionstudio-core/site/index.html" "${LIVE_REPOS}/index.html"
|
||||
${SUDO} ln -sfn "hyperstitionstudio-core/site/learn" "${LIVE_REPOS}/learn"
|
||||
${LIVE_SUDO} ln -sfn "hyperstitionstudio-core/site/index.html" "${LIVE_REPOS}/index.html"
|
||||
${LIVE_SUDO} ln -sfn "hyperstitionstudio-core/site/learn" "${LIVE_REPOS}/learn"
|
||||
# Note: /gallery is disabled for now (tracked as a long-term plan in docs/PLAN-MEMETIC-GALLERY-SUBPAGE.pdf)
|
||||
${SUDO} rm -rf "${LIVE_REPOS}/gallery" "${LIVE_REPOS}/hyperstitionstudio-core/site/gallery"
|
||||
${SUDO} ln -sfn "encyclopedia-knowledge-graph" "${LIVE_REPOS}/graph"
|
||||
${SUDO} ln -sfn "technocapital-singularity-zoology/encyclopedia" "${LIVE_REPOS}/encyclopedia"
|
||||
${SUDO} ln -sfn "technocapital-singularity-zoology" "${LIVE_REPOS}/zoology"
|
||||
${SUDO} ln -sfn "ingglish-hyperdope-gematria/ingglish-aq-archive" "${LIVE_REPOS}/archive"
|
||||
${SUDO} ln -sfn "haiperdohp-jemaytreeah" "${LIVE_REPOS}/calc"
|
||||
${SUDO} ln -sfn "ingglish-hyperdope-ci" "${LIVE_REPOS}/ci"
|
||||
${SUDO} ln -sfn "hyperstitionstudio-core/schemas" "${LIVE_REPOS}/schemas"
|
||||
${LIVE_SUDO} rm -rf "${LIVE_REPOS}/gallery" "${LIVE_REPOS}/hyperstitionstudio-core/site/gallery"
|
||||
${LIVE_SUDO} ln -sfn "encyclopedia-knowledge-graph" "${LIVE_REPOS}/graph"
|
||||
${LIVE_SUDO} ln -sfn "technocapital-singularity-zoology/encyclopedia" "${LIVE_REPOS}/encyclopedia"
|
||||
${LIVE_SUDO} ln -sfn "technocapital-singularity-zoology" "${LIVE_REPOS}/zoology"
|
||||
${LIVE_SUDO} ln -sfn "ingglish-hyperdope-gematria/ingglish-aq-archive" "${LIVE_REPOS}/archive"
|
||||
${LIVE_SUDO} ln -sfn "haiperdohp-jemaytreeah" "${LIVE_REPOS}/calc"
|
||||
${LIVE_SUDO} ln -sfn "ingglish-hyperdope-ci" "${LIVE_REPOS}/ci"
|
||||
${LIVE_SUDO} ln -sfn "hyperstitionstudio-core/schemas" "${LIVE_REPOS}/schemas"
|
||||
|
||||
echo "[4/4] Pre-compressing static HTML, JS, JSON, XML, Canvas, MD & CSS assets (< 5 MB) (.br / .gz)..."
|
||||
${SUDO} find "${LIVE_REPOS}" -type f -size -5M \
|
||||
echo "[4/5] Pre-compressing static HTML, JS, JSON, XML, Canvas, MD & CSS assets (< 5 MB) (.br / .gz)..."
|
||||
run_checked "gzip pre-compression" ${LIVE_SUDO} find "${LIVE_REPOS}" -type f -size -5M \
|
||||
\( -name "*.html" -o -name "*.js" -o -name "*.json" -o -name "*.graphml" -o -name "*.gexf" -o -name "*.canvas" -o -name "*.css" -o -name "*.md" \) \
|
||||
-exec gzip -9 -k -f {} \;
|
||||
if command -v brotli >/dev/null 2>&1; then
|
||||
${SUDO} find "${LIVE_REPOS}" -type f -size -5M \
|
||||
if [[ -n "$(type -P brotli || true)" ]]; then
|
||||
run_checked "brotli pre-compression" ${LIVE_SUDO} find "${LIVE_REPOS}" -type f -size -5M \
|
||||
\( -name "*.html" -o -name "*.js" -o -name "*.json" -o -name "*.graphml" -o -name "*.gexf" -o -name "*.canvas" -o -name "*.css" -o -name "*.md" \) \
|
||||
-exec brotli -q 11 -k -f {} \;
|
||||
fi
|
||||
|
||||
# Step 5: Idempotent systemd unit & /etc/caddy/Caddyfile synchronization (enabled by default; skip with --no-caddy)
|
||||
if [[ "${DO_CADDY}" -eq 1 ]]; then
|
||||
DEPLOY_DIR="${REPOS_ROOT}/hyperstitionstudio-core/deploy"
|
||||
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
|
||||
src_u="${DEPLOY_DIR}/${unit_name}"
|
||||
dst_u="/etc/systemd/system/${unit_name}"
|
||||
if [[ -f "${src_u}" ]]; then
|
||||
if [[ ! -f "${dst_u}" ]] || ! cmp -s "${src_u}" "${dst_u}"; then
|
||||
echo "[5/5] Updating systemd unit ${dst_u}..."
|
||||
run_checked "copy ${unit_name}" ${SUDO} cp "${src_u}" "${dst_u}"
|
||||
UNITS_CHANGED=1
|
||||
fi
|
||||
fi
|
||||
done
|
||||
if [[ "${UNITS_CHANGED}" -eq 1 ]]; then
|
||||
run_checked "systemctl daemon-reload" ${SUDO} systemctl daemon-reload
|
||||
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
|
||||
elif [[ -f "/etc/systemd/system/hyperstition-mcp.service" ]] && ! systemctl is-active --quiet hyperstition-mcp.service; then
|
||||
run_checked "systemctl enable --now hyperstition-mcp.service" ${SUDO} systemctl enable --now hyperstition-mcp.service
|
||||
fi
|
||||
fi
|
||||
|
||||
SRC_CADDY="${DEPLOY_DIR}/Caddyfile"
|
||||
DST_CADDY="/etc/caddy/Caddyfile"
|
||||
if [[ -n "$(type -P caddy || true)" ]] && [[ -d "/etc/caddy" ]] && [[ -f "${SRC_CADDY}" ]]; then
|
||||
if [[ -f "${DST_CADDY}" ]] && cmp -s "${SRC_CADDY}" "${DST_CADDY}"; then
|
||||
echo "[5/5] /etc/caddy/Caddyfile is already identical to deploy/Caddyfile (no reload needed)."
|
||||
else
|
||||
echo "[5/5] Validating and updating ${DST_CADDY} from ${SRC_CADDY}..."
|
||||
run_checked "caddy validate ${SRC_CADDY}" ${SUDO} caddy validate --config "${SRC_CADDY}" --adapter caddyfile
|
||||
run_checked "copy Caddyfile" ${SUDO} cp "${SRC_CADDY}" "${DST_CADDY}"
|
||||
if [[ -n "$(type -P systemctl || true)" ]] && [[ -d "/run/systemd/system" ]]; then
|
||||
if systemctl is-active --quiet caddy; then
|
||||
run_checked "systemctl reload caddy" ${SUDO} systemctl reload caddy
|
||||
echo "[5/5] Reloaded Caddy with updated /etc/caddy/Caddyfile."
|
||||
else
|
||||
run_checked "systemctl enable --now caddy" ${SUDO} systemctl enable --now caddy
|
||||
echo "[5/5] Started Caddy with updated /etc/caddy/Caddyfile."
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
else
|
||||
echo "[5/5] Caddy or /etc/caddy not present on this host; skipping Caddyfile reload."
|
||||
fi
|
||||
else
|
||||
echo "[5/5] Skipping Caddyfile & systemd service sync (--no-caddy)."
|
||||
fi
|
||||
|
||||
echo "[OK] Per-repository install directories hydrated and pre-compressed at ${LIVE_REPOS}"
|
||||
@@ -59,6 +59,8 @@ ROUTES=(
|
||||
"/graph/docs/cross-repo-dependency-and-audit-flow-diagram.html"
|
||||
"/graph/docs/cross-repo-dependency-and-audit-flow-diagram.pdf"
|
||||
"/graph/docs/VPS-AND-GIT-OPERATOR-DEPLOYMENT-GUIDE.pdf"
|
||||
"/graph/docs/PLAN-LLM-TOKEN-ECONOMIZER-AND-VARIANCE-ROUTING.pdf"
|
||||
"/graph/docs/PLAN-LLM-TOKEN-ECONOMIZER-DATA-FIDELITY-AND-DEGRADATION-RISK-EVALUATION.pdf"
|
||||
"/encyclopedia/00-index-and-ontological-atlas/00-master-encyclopedia-index-a-to-z.pdf"
|
||||
"/technocapital-singularity-zoology/encyclopedia/00-index-and-ontological-atlas/00-master-encyclopedia-index-a-to-z.pdf"
|
||||
"/zoology/encyclopedia-of-technocapital-singularity-zoology-overview-and-manifest.pdf"
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@hyperstitionstud.io/workspace-core",
|
||||
"version": "2.0.0",
|
||||
"version": "2.0.17",
|
||||
"private": true,
|
||||
"description": "Offline-first ESM & browser global (@hyperstitionstud.io/* / window.HyperstitionStudio.*) packages for Base-36 AQ ciphers and interactive knowledge graph workbenches.",
|
||||
"license": "MIT",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@hyperstitionstud.io/ciphers-aq",
|
||||
"version": "2.0.0",
|
||||
"version": "2.0.17",
|
||||
"type": "module",
|
||||
"main": "index.js",
|
||||
"license": "MIT"
|
||||
|
||||
+2
-1
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
||||
|
||||
[project]
|
||||
name = "hyperstitionstudio-core"
|
||||
version = "2.0.0"
|
||||
version = "2.0.17"
|
||||
description = "Shared PEP 420 common library (hyperstitionstud_io.*) for Base-36 AQ ciphers, offline CMUdict Ingglish phonetics, ReportLab/Pillow publishing, SHA-256 glossary isolation guards, local-config citation verification, and multi-format knowledge graphs."
|
||||
readme = "README.md"
|
||||
requires-python = ">=3.10"
|
||||
@@ -26,6 +26,7 @@ hs-pdf-build = "hyperstitionstud_io.publishing.pdf_compiler:main"
|
||||
hs-kg-build = "hyperstitionstud_io.graph.cli:main"
|
||||
hs-quant-harvest = "hyperstitionstud_io.quant.collector:main"
|
||||
hs-mcp = "hyperstitionstud_io.mcp.server:main"
|
||||
hs-sync-version = "hyperstitionstud_io.version_sync:main"
|
||||
|
||||
[tool.setuptools.packages.find]
|
||||
where = ["src"]
|
||||
|
||||
@@ -144,8 +144,8 @@ def main() -> int:
|
||||
})
|
||||
|
||||
manifest = {
|
||||
"version": "2.0.0",
|
||||
"namespace_urn": "urn:io:hyperstitionstud:gallery:2.0.0",
|
||||
"version": "2.0.17",
|
||||
"namespace_urn": "urn:io:hyperstitionstud:gallery:2.0.17",
|
||||
"total_items": len(items),
|
||||
"items": items,
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
window.HyperstitionStudio = window.HyperstitionStudio || {};
|
||||
window.HyperstitionStudio.GalleryData = {
|
||||
"version": "2.0.0",
|
||||
"namespace_urn": "urn:io:hyperstitionstud:gallery:2.0.0",
|
||||
"version": "2.0.13",
|
||||
"namespace_urn": "urn:io:hyperstitionstud:gallery:2.0.13",
|
||||
"total_items": 37,
|
||||
"items": [
|
||||
{
|
||||
|
||||
@@ -217,7 +217,7 @@
|
||||
<main class="gallery-grid" id="galleryGrid"></main>
|
||||
|
||||
<footer>
|
||||
<div>hyperstitionstud.io/gallery • Powered by hyperstitionstudio-core (urn:io:hyperstitionstud:gallery:2.0.0)</div>
|
||||
<div>hyperstitionstud.io/gallery • Powered by hyperstitionstudio-core (urn:io:hyperstitionstud:gallery:2.0.17)</div>
|
||||
<div class="hs-lemur-credit">Made with <span class="hs-heart" role="img" aria-label="love">♥</span> by Lemurs.</div>
|
||||
</footer>
|
||||
</div>
|
||||
|
||||
+2
-2
@@ -131,7 +131,7 @@
|
||||
<span class="dot"></span>
|
||||
<h1>HYPERSTITIONSTUD.IO // TECHNOCAPITAL SINGULARITY ZOOLOGY WORKBENCH</h1>
|
||||
</div>
|
||||
<p class="subtitle">100% Offline-Portable & HTTP/3 Edge-Ready Research Corpus • Namespace Authority: urn:io:hyperstitionstud (v2.0.0)</p>
|
||||
<p class="subtitle">100% Offline-Portable & HTTP/3 Edge-Ready Research Corpus • Namespace Authority: urn:io:hyperstitionstud (v2.0.17)</p>
|
||||
</div>
|
||||
<div class="meta-badges">
|
||||
<a class="btn primary" data-route="learn-track" href="/learn/index.html" style="padding:0.35rem 0.75rem;font-size:0.74rem;">Start Learning Track (/learn/)</a>
|
||||
@@ -253,7 +253,7 @@
|
||||
</main>
|
||||
|
||||
<footer>
|
||||
<div>hyperstitionstud.io • Powered by hyperstitionstudio-core (hyperstitionstud_io.* / urn:io:hyperstitionstud v2.0.0) • Zero External Network Dependencies</div>
|
||||
<div>hyperstitionstud.io • Powered by hyperstitionstudio-core (hyperstitionstud_io.* / urn:io:hyperstitionstud v2.0.17) • Zero External Network Dependencies</div>
|
||||
<div class="hs-lemur-credit" style="margin-top:0.35rem;color:var(--text-muted);font-size:0.75rem;">Made with <span class="hs-heart" role="img" aria-label="love" style="color:var(--rose);display:inline-block;padding:0 2px;">♥</span> by Lemurs.</div>
|
||||
</footer>
|
||||
</div>
|
||||
|
||||
@@ -413,7 +413,7 @@
|
||||
</main>
|
||||
|
||||
<footer>
|
||||
<div>hyperstitionstud.io/learn • Powered by hyperstitionstudio-core (urn:io:hyperstitionstud:schema:v1:learn-progress-state v2.0.0)</div>
|
||||
<div>hyperstitionstud.io/learn • Powered by hyperstitionstudio-core (urn:io:hyperstitionstud:schema:v1:learn-progress-state v2.0.17)</div>
|
||||
<div class="hs-lemur-credit">Made with <span class="hs-heart" role="img" aria-label="love">♥</span> by Lemurs.</div>
|
||||
</footer>
|
||||
</div>
|
||||
|
||||
@@ -265,7 +265,7 @@
|
||||
const base = {
|
||||
$schema: "../schemas/v1/learn-progress-state.schema.json",
|
||||
$id: SCHEMA_ID,
|
||||
version: "2.0.0",
|
||||
version: "2.0.17",
|
||||
updated_at_utc: new Date().toISOString(),
|
||||
preferred_register: "fund_manager",
|
||||
completed_modules: [],
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
"""hyperstitionstud_io — Shared Common Library for the hyperstitionstud.io workspace (v2.0.0)."""
|
||||
__version__ = "2.0.0"
|
||||
"""hyperstitionstud_io — Shared Common Library for the hyperstitionstud.io workspace (v2.0.17)."""
|
||||
__version__ = "2.0.17"
|
||||
NAMESPACE_URN = "urn:io:hyperstitionstud"
|
||||
@@ -32,8 +32,8 @@ from hyperstitionstud_io.mcp.tools import MCP_TOOLS_SCHEMA, call_mcp_tool # noq
|
||||
|
||||
SERVER_INFO = {
|
||||
"name": "hyperstitionstudio-mcp",
|
||||
"version": "2.0.0",
|
||||
"namespace_urn": "urn:io:hyperstitionstud:mcp:2.0.0",
|
||||
"version": "2.0.17",
|
||||
"namespace_urn": "urn:io:hyperstitionstud:mcp:2.0.17",
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -60,11 +60,11 @@ def translate_batch(terms: list[str], workdir: str | Path | None = None) -> dict
|
||||
node_bin = shutil.which("node")
|
||||
if node_bin and (wdir / "node_modules" / "ingglish").is_dir():
|
||||
js = (
|
||||
"import { translateSync } from 'ingglish';\n"
|
||||
"import { translate } from 'ingglish';\n"
|
||||
"import fs from 'fs';\n"
|
||||
"const terms = JSON.parse(fs.readFileSync(0, 'utf8'));\n"
|
||||
"const out = {};\n"
|
||||
"for (const t of terms) { out[t] = translateSync(t).toLowerCase(); }\n"
|
||||
"for (const t of terms) { out[t] = (await translate(t)).toLowerCase(); }\n"
|
||||
"process.stdout.write(JSON.stringify(out));\n"
|
||||
)
|
||||
res = subprocess.run(
|
||||
|
||||
@@ -141,6 +141,7 @@
|
||||
"alpoge": "alpohj",
|
||||
"amalgam": "amalgam",
|
||||
"amalgamation": "amalgamayshan",
|
||||
"amd": "ayemdee",
|
||||
"americans": "amairakanz",
|
||||
"americans backs plan": "amairakanz baks plan",
|
||||
"americans backs time": "amairakanz baks taim",
|
||||
@@ -380,6 +381,7 @@
|
||||
"base for rescued": "bays for reskyood",
|
||||
"base of fishtail": "bays uhv fishtayl",
|
||||
"base to kuwait": "bays too koowayt",
|
||||
"basis": "baysas",
|
||||
"bathroom": "bathroom",
|
||||
"battle": "batal",
|
||||
"battle checks the first wife from the prize": "batal cheks dha ferst waif fruhm dha praiz",
|
||||
@@ -441,6 +443,7 @@
|
||||
"bill by levent alpoge": "bil bai levant alpohj",
|
||||
"bill on oath keepers": "bil on ohth keeperz",
|
||||
"bill on wall street": "bil on wawl street",
|
||||
"billion": "bilyan",
|
||||
"binance": "binans",
|
||||
"binance folds fiber": "binans fohldz faiber",
|
||||
"binance folds ledger": "binans fohldz lejer",
|
||||
@@ -453,12 +456,14 @@
|
||||
"binance splits atom": "binans splits atam",
|
||||
"binance writes price": "binans raits prais",
|
||||
"birack": "bairak",
|
||||
"bitcoin": "bitkoin",
|
||||
"black": "blak",
|
||||
"black church across the parasitic manuscript": "blak cherch akraws dha pairasitik manyaskript",
|
||||
"black liquid in the body": "blak likwad in dha bodee",
|
||||
"black pyramid into the numeric daniel carter": "blak piramid intoo dha noomairik danyal karter",
|
||||
"black pyramid into the numeric richard powell": "blak piramid intoo dha noomairik richerd poual",
|
||||
"black sky arrives the south grid at police": "blak skai eraivz dha south grid at palees",
|
||||
"blackrock": "blakrok",
|
||||
"blackwell": "blakwel",
|
||||
"blackwell locks the gpu": "blakwel loks dha gpu",
|
||||
"blackwell-drone-capital nexus": "blakwel-drohn-kapatal neksas",
|
||||
@@ -569,6 +574,7 @@
|
||||
"brixton": "brikstan",
|
||||
"brixton gets the junior academy at live run": "brikstan gets dha joonyer akadamee at liv ruhn",
|
||||
"brixton gets the junior record in hell": "brikstan gets dha joonyer rekerd in hel",
|
||||
"broadcom": "brawdkom",
|
||||
"broken": "brohkan",
|
||||
"broken across the parasitic bathroom": "brohkan akraws dha pairasitik bathroom",
|
||||
"broken beneath the cellular doppelganger": "brohkan bineeth dha selyaler dopalganger",
|
||||
@@ -846,6 +852,7 @@
|
||||
"codes": "kohdz",
|
||||
"coffin": "kawfin",
|
||||
"coin": "koin",
|
||||
"coinbase": "koinbays",
|
||||
"cold": "kohld",
|
||||
"collapse": "kalaps",
|
||||
"collapse from french": "kalaps fruhm french",
|
||||
@@ -889,6 +896,7 @@
|
||||
"conspiracy builds the heavy pact at the wide track": "kanspeerasee bildz dha hevee pakt at dha waid trak",
|
||||
"conspiracy saves the medical lab in the eye": "kanspeerasee sayvz dha medakal lab in dha ai",
|
||||
"conspiracy seeks the medical dam for the top abyss": "kanspeerasee seeks dha medakal dam for dha top abis",
|
||||
"constellation": "konstalayshan",
|
||||
"contest": "kontest",
|
||||
"contract": "kontrakt",
|
||||
"contract checks the top way from the key": "kontrakt cheks dha top way fruhm dha kee",
|
||||
@@ -1307,6 +1315,9 @@
|
||||
"egypt derails the fatal line in the bridge": "eejapt deeraylz dha faytal lain in dha brij",
|
||||
"egypt derails the fatal train in dark port": "eejapt deeraylz dha faytal trayn in dark port",
|
||||
"egypt shakes site": "eejapt shayks sait",
|
||||
"eight": "ayt",
|
||||
"eighteen": "ayteen",
|
||||
"eighty": "aytee",
|
||||
"eisenkot": "aizengkot",
|
||||
"eisenkot fills air": "aizengkot filz air",
|
||||
"eisenkot fines fee": "aizengkot fainz fee",
|
||||
@@ -1330,6 +1341,9 @@
|
||||
"election leads loan": "ilekshan leedz lohn",
|
||||
"election solves fee": "ilekshan solvz fee",
|
||||
"electric": "ilektrik",
|
||||
"eleven": "ilevan",
|
||||
"eli": "eelai",
|
||||
"eli lilly": "eelai lilee",
|
||||
"elton": "eltan",
|
||||
"elton john leads death": "eltan jon leedz deth",
|
||||
"elton john seizes the new show at sticks": "eltan jon seeziz dha noo shoh at stiks",
|
||||
@@ -1371,6 +1385,7 @@
|
||||
"era in investment": "aira in investmant",
|
||||
"erratic": "eeratik",
|
||||
"eternal": "iternal",
|
||||
"ethereum": "edheroom",
|
||||
"eu-uk": "eu-uk",
|
||||
"eu-uk joins the bank": "eu-uk joinz dha bangk",
|
||||
"eu-uk keeps the high world beyond the debut": "eu-uk keeps dha hai werld biond dha daybyoo",
|
||||
@@ -1490,6 +1505,8 @@
|
||||
"fifa calls the real source of the system": "fifo kawlz dha reel sors uhv dha sistam",
|
||||
"fifa keeps the first time to the global system": "fifo keeps dha ferst taim too dha glohbal sistam",
|
||||
"fifa rules state": "fifo roolz stayt",
|
||||
"fifteen": "fifteen",
|
||||
"fifty": "fiftee",
|
||||
"fight": "fait",
|
||||
"fight at transport": "fait at transport",
|
||||
"fights": "faits",
|
||||
@@ -1527,6 +1544,7 @@
|
||||
"fishtail": "fishtayl",
|
||||
"fishtail locks the cold base below snow": "fishtayl loks dha kohld bays biloh snoh",
|
||||
"fishtail locks the cold camp on the lost flight": "fishtayl loks dha kohld kamp on dha lawst flait",
|
||||
"five": "faiv",
|
||||
"flags": "flagz",
|
||||
"flame": "flaym",
|
||||
"flamethrower": "flaymethroher",
|
||||
@@ -1609,10 +1627,12 @@
|
||||
"forgotten": "fergotan",
|
||||
"former": "former",
|
||||
"forms": "formz",
|
||||
"forty": "fortee",
|
||||
"foster": "foster",
|
||||
"foster holds attack": "foster hohldz atak",
|
||||
"foster offers the six bodies in the three home": "foster awferz dha siks bodeez in dha three hohm",
|
||||
"four": "for",
|
||||
"fourteen": "forteen",
|
||||
"france": "frans",
|
||||
"france halts flight": "frans hawlts flait",
|
||||
"france hits the new wave in the dark crash": "frans hits dha noo wayv in dha dark krash",
|
||||
@@ -2011,6 +2031,7 @@
|
||||
"hum human salmon": "huhm hyooman saman",
|
||||
"hum shogun slug": "huhm shohgan sluhg",
|
||||
"human": "hyooman",
|
||||
"hundred": "huhndrad",
|
||||
"hungarian": "hanggaireean",
|
||||
"hungarian probes the new bank at house": "hanggaireean prohbz dha noo bangk at hous",
|
||||
"hungarian probes the new probe on high funds": "hanggaireean prohbz dha noo prohb on hai fuhndz",
|
||||
@@ -2436,6 +2457,7 @@
|
||||
"lighthouse": "laithous",
|
||||
"lights": "laits",
|
||||
"like": "laik",
|
||||
"lilly": "lilee",
|
||||
"lindsay": "lindzee",
|
||||
"lindsay clancy locks the cold ballots on raw grid": "lindzee klansee loks dha kohld balats on ro grid",
|
||||
"lindsay clancy locks the red data in grid": "lindzee klansee loks dha red dayta in grid",
|
||||
@@ -2458,6 +2480,7 @@
|
||||
"loan on upazila": "lohn on yoopazila",
|
||||
"loan on zelenskyy": "lohn on zelenskiee",
|
||||
"local": "lohkal",
|
||||
"lockheed": "lokheed",
|
||||
"locks": "loks",
|
||||
"log": "lawg",
|
||||
"logan": "lohgan",
|
||||
@@ -2686,6 +2709,7 @@
|
||||
"minitruck halts the real aid with the wide world": "minitrak hawlts dha reel ayd widh dha waid werld",
|
||||
"minitruck keeps era": "minitrak keeps aira",
|
||||
"minitruck rules the clear case in the act": "minitrak roolz dha kleer kays in dha akt",
|
||||
"minus": "mainas",
|
||||
"miracle": "meerakal",
|
||||
"mirror": "meerer",
|
||||
"mirror across the spectral empty skin": "meerer akraws dha spektral emptee skin",
|
||||
@@ -2869,8 +2893,10 @@
|
||||
"nigeria tests bid": "naijeereea tests bid",
|
||||
"nigeria tests the prime site in the final peace": "naijeereea tests dha praim sait in dha fainal pees",
|
||||
"night": "nait",
|
||||
"nine": "nain",
|
||||
"nineteen": "nainteen",
|
||||
"nineteen in the breath": "nainteen in dha breth",
|
||||
"ninety": "naintee",
|
||||
"niugini": "niyoojeenee",
|
||||
"niugini backs fee": "niyoojeenee baks fee",
|
||||
"niugini keeps the safe bill in the short line": "niyoojeenee keeps dha sayf bil in dha short lain",
|
||||
@@ -2945,6 +2971,7 @@
|
||||
"oil on mainstream": "oil on maynstreem",
|
||||
"old": "ohld",
|
||||
"on": "on",
|
||||
"one": "wuhn",
|
||||
"online": "awnlain",
|
||||
"online cuts the total plan by the field": "awnlain kuhts dha tohtal plan bai dha feeld",
|
||||
"online marks role": "awnlain marks rohl",
|
||||
@@ -3013,6 +3040,7 @@
|
||||
"pakistan sets the global dam to the direct film": "pakistan sets dha glohbal dam too dha derekt film",
|
||||
"pakistan tests bid": "pakistan tests bid",
|
||||
"pakistan turns bid": "pakistan ternz bid",
|
||||
"palantir": "palanter",
|
||||
"pale": "payl",
|
||||
"palisades": "palisaydz",
|
||||
"palisades checks the safe phone in the force": "palisaydz cheks dha sayf fohn in dha fors",
|
||||
@@ -3184,6 +3212,7 @@
|
||||
"point": "point",
|
||||
"point of law runs the fast cup in hard law": "point uhv law ruhnz dha fast kuhp in hard law",
|
||||
"point of law runs the high law in turf": "point uhv law ruhnz dha hai law in terf",
|
||||
"points": "points",
|
||||
"poland": "pohland",
|
||||
"poland calls the safe fee to the fuel": "pohland kawlz dha sayf fee too dha fyooal",
|
||||
"poland keeps zone": "pohland keeps zohn",
|
||||
@@ -3387,6 +3416,7 @@
|
||||
"rapper marks gamer": "raper marks gaymer",
|
||||
"rare": "rair",
|
||||
"raw": "ro",
|
||||
"raytheon": "raytheeon",
|
||||
"reaches": "reechaz",
|
||||
"reader": "reeder",
|
||||
"reader across the map": "reeder akraws dha map",
|
||||
@@ -3723,6 +3753,9 @@
|
||||
"setback": "setbak",
|
||||
"setback at paraguay": "setbak at pairagway",
|
||||
"sets": "sets",
|
||||
"seven": "sevan",
|
||||
"seventeen": "sevanteen",
|
||||
"seventy": "sevantee",
|
||||
"shadow": "shadoh",
|
||||
"shaft": "shaft",
|
||||
"shakes": "shayks",
|
||||
@@ -3812,6 +3845,8 @@
|
||||
"sites": "saits",
|
||||
"six": "siks",
|
||||
"six billion": "siks bilyan",
|
||||
"sixteen": "siksteen",
|
||||
"sixty": "sikstee",
|
||||
"skin": "skin",
|
||||
"skin across the parasitic empty skin": "skin akraws dha pairasitik emptee skin",
|
||||
"skin beneath the lamp": "skin bineeth dha lamp",
|
||||
@@ -3852,6 +3887,7 @@
|
||||
"sobra marks the show": "sobra marks dha shoh",
|
||||
"social": "sohshal",
|
||||
"soil": "soil",
|
||||
"solana": "sohlana",
|
||||
"solemn": "solam",
|
||||
"solves": "solvz",
|
||||
"somalia": "samoleea",
|
||||
@@ -4179,6 +4215,7 @@
|
||||
"teen": "teen",
|
||||
"teeth": "teeth",
|
||||
"templex": "tempaleks",
|
||||
"ten": "ten",
|
||||
"tenerife": "teneraif",
|
||||
"tenerife runs the fast cup on post": "teneraif ruhnz dha fast kuhp on pohst",
|
||||
"tennessee": "tenasee",
|
||||
@@ -4369,10 +4406,13 @@
|
||||
"third gunslinger": "therd guhnslinger",
|
||||
"thirst": "therst",
|
||||
"thirst locks the debt": "therst loks dha det",
|
||||
"thirteen": "therteen",
|
||||
"thirty": "therdee",
|
||||
"thomas": "tomas",
|
||||
"thomas markle holds the high world in long case": "tomas markal hohldz dha hai werld in lawng kays",
|
||||
"thomas markle holds the high world in zoo": "tomas markal hohldz dha hai werld in zoo",
|
||||
"thought": "thawt",
|
||||
"thousand": "thouzand",
|
||||
"threat": "thret",
|
||||
"three": "three",
|
||||
"throat": "throht",
|
||||
@@ -4435,6 +4475,7 @@
|
||||
"transport halts the wide flight at open grid": "transport hawlts dha waid flait at ohpan grid",
|
||||
"trap": "trap",
|
||||
"traps": "traps",
|
||||
"treasury": "trezheree",
|
||||
"treaties": "treeteez",
|
||||
"treaties marks bill": "treeteez marks bil",
|
||||
"treaties marks the high net with the police": "treeteez marks dha hai net widh dha palees",
|
||||
@@ -4510,8 +4551,11 @@
|
||||
"tusk holds game": "tuhsk hohldz gaym",
|
||||
"tusk saves the direct man in the long power": "tuhsk sayvz dha derekt man in dha lawng pouer",
|
||||
"tusk tests peace": "tuhsk tests pees",
|
||||
"twelve": "twelv",
|
||||
"twenty": "twentee",
|
||||
"twilight": "twailait",
|
||||
"twisted": "twistid",
|
||||
"two": "too",
|
||||
"typhon": "taifan",
|
||||
"typhon in digital abyss": "taifan in dijatal abis",
|
||||
"typhon in red midnight": "taifan in red midnait",
|
||||
@@ -4649,6 +4693,7 @@
|
||||
"visions": "vizhanz",
|
||||
"visit": "vizit",
|
||||
"visit over meta": "vizit ohver meeta",
|
||||
"vix": "viks",
|
||||
"voice": "vois",
|
||||
"voices": "voisaz",
|
||||
"voices beyond breath": "voisaz biond breth",
|
||||
@@ -4877,6 +4922,7 @@
|
||||
"zeptoverse": "zeptohvers",
|
||||
"zeptoverse scans the deep code in coin": "zeptohvers skanz dha deep kohd in koin",
|
||||
"zeptoverse scans the small bank at new code": "zeptohvers skanz dha smawl bangk at noo kohd",
|
||||
"zero": "zeeroh",
|
||||
"zombie": "zombee",
|
||||
"zombie firm": "zombee ferm",
|
||||
"zombie firm halts the cold tomb in debt": "zombee ferm hawlts dha kohld toom in det",
|
||||
|
||||
@@ -5,7 +5,15 @@ hyperstitionstud_io.quant — Periodic Quantitative Financial Telemetry & Contin
|
||||
from hyperstitionstud_io.quant.collector import (
|
||||
CANONICAL_WATCHLIST_24,
|
||||
build_financial_quant_harvest,
|
||||
fetch_live_watchlist,
|
||||
main,
|
||||
synthesize_quant_dossier_markdown,
|
||||
)
|
||||
|
||||
__all__ = ["CANONICAL_WATCHLIST_24", "build_financial_quant_harvest", "main"]
|
||||
__all__ = [
|
||||
"CANONICAL_WATCHLIST_24",
|
||||
"build_financial_quant_harvest",
|
||||
"fetch_live_watchlist",
|
||||
"main",
|
||||
"synthesize_quant_dossier_markdown",
|
||||
]
|
||||
@@ -11,11 +11,16 @@ Evaluates quantitative financial telemetry across 3 anti-pareidolia contingent m
|
||||
from __future__ import annotations
|
||||
|
||||
import argparse
|
||||
import concurrent.futures
|
||||
import csv
|
||||
import datetime
|
||||
import io
|
||||
import json
|
||||
import os
|
||||
import sys
|
||||
import time
|
||||
import urllib.parse
|
||||
import urllib.request
|
||||
from pathlib import Path
|
||||
from typing import Any
|
||||
|
||||
@@ -25,6 +30,7 @@ if _SRC_DIR.is_dir() and str(_SRC_DIR) not in sys.path:
|
||||
|
||||
from hyperstitionstud_io.ciphers import ( # noqa: E402
|
||||
compute_aq,
|
||||
expand_quant_spoken,
|
||||
int_to_spoken_words,
|
||||
is_repdigit_37,
|
||||
prime_rank,
|
||||
@@ -101,44 +107,259 @@ CANONICAL_WATCHLIST_24: list[dict[str, Any]] = [
|
||||
{"symbol": "BLK", "entity_eng": "BlackRock", "guilds": ["S6"], "close_usd": 1025.00, "change_pct": 1.25, "change_bps": 125, "volume_ratio_20d": 1.02, "market_cap_str": "$153B"},
|
||||
]
|
||||
|
||||
_USER_AGENT = "Mozilla/5.0 (compatible; HyperstitionStudioQuantCollector/2.0; +urn:io:hyperstitionstud)"
|
||||
_COINGECKO_MAP = {"BTC-USD": "bitcoin", "ETH-USD": "ethereum", "SOL-USD": "solana"}
|
||||
_STOOQ_MAP = {
|
||||
"NVDA": "nvda.us", "ASML": "asml.us", "TSM": "tsm.us", "MSFT": "msft.us",
|
||||
"GOOGL": "googl.us", "META": "meta.us", "ORCL": "orcl.us", "AVGO": "avgo.us",
|
||||
"ARM": "arm.us", "AMD": "amd.us", "PLTR": "pltr.us", "LMT": "lmt.us",
|
||||
"RTX": "rtx.us", "COIN": "coin.us", "CEG": "ceg.us", "LLY": "lly.us", "BLK": "blk.us",
|
||||
}
|
||||
|
||||
# Precomputed 2-word (noun + prep or verb + article) closures for 333 / 666 / 777intra-instrument verified equations
|
||||
_EQ_CLOSURES_333: dict[int, list[str]] = {
|
||||
137: [
|
||||
"envideea (137) + fohldz (125) + gpu (71) = 333",
|
||||
"daireeoh (137) + fohldz (125) + gpu (71) = 333",
|
||||
],
|
||||
81: [
|
||||
"asml (81) + akselerayshan (256) - 4 = 333",
|
||||
"asml (81) + chaildz (126) + chaildz (126) = 333",
|
||||
],
|
||||
91: [
|
||||
"tsmc (91) + fohldz (125) +ekst (117) = 333",
|
||||
],
|
||||
191: [
|
||||
"derivativ (191) + aiern (92) + tab (50) = 333",
|
||||
"lajistiks (191) + aiern (92) + tab (50) = 333",
|
||||
],
|
||||
193: [
|
||||
"anthropik (193) + koinbays (140) = 333",
|
||||
"flash krash (193) + koinbays (140) = 333",
|
||||
],
|
||||
211: [
|
||||
"lap (56) + for (66) + siks bilyan (211) = 333",
|
||||
"lap (56) + for (66) + koper waier (211) = 333",
|
||||
],
|
||||
256: [
|
||||
"akselerayshan (256) + in (41) + ai (36) = 333",
|
||||
"sovran welth (256) + in (41) + ai (36) = 333",
|
||||
],
|
||||
292: [
|
||||
"abstrakt masheen (292) + in (41) = 333",
|
||||
"sinthetik dayta (292) + in (41) = 333",
|
||||
],
|
||||
}
|
||||
|
||||
|
||||
def _fetch_yahoo_chart(symbol: str, timeout: float = 6.0) -> dict[str, Any] | None:
|
||||
"""Source 1: Keyless Yahoo Finance v8 Chart JSON API."""
|
||||
enc_sym = urllib.parse.quote(symbol, safe="")
|
||||
url = f"https://query1.finance.yahoo.com/v8/finance/chart/{enc_sym}?range=1mo&interval=1d"
|
||||
req = urllib.request.Request(url, headers={"User-Agent": _USER_AGENT, "Accept": "application/json"})
|
||||
with urllib.request.urlopen(req, timeout=timeout) as resp:
|
||||
data = json.loads(resp.read().decode("utf-8"))
|
||||
res_list = (data.get("chart") or {}).get("result") or []
|
||||
if not res_list:
|
||||
return None
|
||||
meta = res_list[0].get("meta") or {}
|
||||
quotes = (((res_list[0].get("indicators") or {}).get("quote") or [{}])[0])
|
||||
closes = [float(x) for x in (quotes.get("close") or []) if x is not None]
|
||||
vols = [float(x) for x in (quotes.get("volume") or []) if x is not None and x > 0]
|
||||
close_usd = float(meta.get("regularMarketPrice") or (closes[-1] if closes else 0.0))
|
||||
if close_usd <= 0:
|
||||
return None
|
||||
prev_close = float(meta.get("chartPreviousClose") or (closes[-2] if len(closes) >= 2 else close_usd))
|
||||
chg_pct = ((close_usd - prev_close) / prev_close * 100.0) if prev_close > 0 else 0.0
|
||||
chg_bps = int(round(chg_pct * 100.0))
|
||||
vol_ratio = 1.0
|
||||
if len(vols) >= 2:
|
||||
avg_v = sum(vols[:-1][-20:]) / max(1, len(vols[:-1][-20:]))
|
||||
if avg_v > 0:
|
||||
vol_ratio = round(vols[-1] / avg_v, 2)
|
||||
return {
|
||||
"close_usd": round(close_usd, 2),
|
||||
"change_pct": round(chg_pct, 2),
|
||||
"change_bps": chg_bps,
|
||||
"volume_ratio_20d": vol_ratio,
|
||||
"feed_source": "yahoo_v8_json",
|
||||
}
|
||||
|
||||
|
||||
def _fetch_stooq_csv(symbol: str, timeout: float = 6.0) -> dict[str, Any] | None:
|
||||
"""Source 2: Keyless Stooq Daily OHLCV CSV Fallback."""
|
||||
stooq_sym = _STOOQ_MAP.get(symbol)
|
||||
if not stooq_sym:
|
||||
return None
|
||||
url = f"https://stooq.com/q/d/l/?s={stooq_sym}&i=d"
|
||||
req = urllib.request.Request(url, headers={"User-Agent": _USER_AGENT})
|
||||
with urllib.request.urlopen(req, timeout=timeout) as resp:
|
||||
text = resp.read().decode("utf-8", errors="replace")
|
||||
rows = list(csv.DictReader(io.StringIO(text)))
|
||||
if not rows or "Close" not in rows[-1] or rows[-1]["Close"] in ("", "N/D", None):
|
||||
return None
|
||||
close_usd = float(rows[-1]["Close"])
|
||||
prev_close = float(rows[-2]["Close"]) if len(rows) >= 2 and rows[-2].get("Close") not in ("", "N/D", None) else close_usd
|
||||
chg_pct = ((close_usd - prev_close) / prev_close * 100.0) if prev_close > 0 else 0.0
|
||||
chg_bps = int(round(chg_pct * 100.0))
|
||||
vols = [float(r["Volume"]) for r in rows[-21:] if r.get("Volume") and r["Volume"].replace(".", "").isdigit()]
|
||||
vol_ratio = 1.0
|
||||
if len(vols) >= 2:
|
||||
avg_v = sum(vols[:-1]) / max(1, len(vols[:-1]))
|
||||
if avg_v > 0:
|
||||
vol_ratio = round(vols[-1] / avg_v, 2)
|
||||
return {
|
||||
"close_usd": round(close_usd, 2),
|
||||
"change_pct": round(chg_pct, 2),
|
||||
"change_bps": chg_bps,
|
||||
"volume_ratio_20d": vol_ratio,
|
||||
"feed_source": "stooq_csv",
|
||||
}
|
||||
|
||||
|
||||
def _fetch_coingecko_crypto(timeout: float = 6.0) -> dict[str, dict[str, Any]]:
|
||||
"""Source 3: Keyless CoinGecko Public 24h Crypto & Liquidity JSON API."""
|
||||
ids = ",".join(_COINGECKO_MAP.values())
|
||||
url = f"https://api.coingecko.com/api/v3/simple/price?ids={ids}&vs_currencies=usd&include_24hr_change=true&include_market_cap=true"
|
||||
req = urllib.request.Request(url, headers={"User-Agent": _USER_AGENT, "Accept": "application/json"})
|
||||
with urllib.request.urlopen(req, timeout=timeout) as resp:
|
||||
data = json.loads(resp.read().decode("utf-8"))
|
||||
out: dict[str, dict[str, Any]] = {}
|
||||
for sym, cg_id in _COINGECKO_MAP.items():
|
||||
if cg_id in data and "usd" in data[cg_id]:
|
||||
c_usd = float(data[cg_id]["usd"])
|
||||
chg_pct = float(data[cg_id].get("usd_24h_change") or 0.0)
|
||||
mcap = float(data[cg_id].get("usd_market_cap") or 0.0)
|
||||
mcap_str = f"${mcap / 1e12:.2f}T" if mcap >= 1e12 else (f"${int(round(mcap / 1e9))}B" if mcap >= 1e9 else "$0B")
|
||||
out[sym] = {
|
||||
"close_usd": round(c_usd, 2),
|
||||
"change_pct": round(chg_pct, 2),
|
||||
"change_bps": int(round(chg_pct * 100.0)),
|
||||
"market_cap_str": mcap_str,
|
||||
"feed_source": "coingecko_v3_json",
|
||||
}
|
||||
return out
|
||||
|
||||
|
||||
def fetch_live_watchlist(
|
||||
base_watchlist: list[dict[str, Any]] | None = None,
|
||||
timeout: float = 6.0,
|
||||
) -> list[dict[str, Any]]:
|
||||
"""
|
||||
Attempt multi-source keyless HTTP ingestion (Yahoo Finance v8 -> Stooq CSV -> CoinGecko JSON),
|
||||
falling back deterministically per instrument to CANONICAL_WATCHLIST_24 if offline or rate-limited.
|
||||
"""
|
||||
watchlist = [dict(x) for x in (base_watchlist or CANONICAL_WATCHLIST_24)]
|
||||
cg_quotes: dict[str, dict[str, Any]] = {}
|
||||
try:
|
||||
cg_quotes = _fetch_coingecko_crypto(timeout=timeout)
|
||||
except Exception:
|
||||
cg_quotes = {}
|
||||
|
||||
def _resolve_one(item: dict[str, Any]) -> dict[str, Any]:
|
||||
sym = item["symbol"]
|
||||
merged = dict(item)
|
||||
merged["feed_source"] = "canonical_snapshot"
|
||||
if sym == "ANTHR-PVT":
|
||||
return merged
|
||||
if sym in cg_quotes:
|
||||
merged.update(cg_quotes[sym])
|
||||
return merged
|
||||
for fetcher in (_fetch_yahoo_chart, _fetch_stooq_csv):
|
||||
try:
|
||||
q = fetcher(sym, timeout=timeout)
|
||||
if q:
|
||||
merged.update(q)
|
||||
return merged
|
||||
except Exception:
|
||||
continue
|
||||
return merged
|
||||
|
||||
with concurrent.futures.ThreadPoolExecutor(max_workers=8) as pool:
|
||||
return list(pool.map(_resolve_one, watchlist))
|
||||
|
||||
|
||||
def build_financial_quant_harvest(
|
||||
harvest_mode: str = "us-closing-bell",
|
||||
snapshot_path: str | Path | None = None,
|
||||
join_news_path: str | Path | None = None,
|
||||
live_fetch: bool = False,
|
||||
) -> dict[str, Any]:
|
||||
cfg = load_workspace_config()
|
||||
with ReadOnlyIsolationGuard(cfg.read_only_files) as guard:
|
||||
if snapshot_path and Path(snapshot_path).is_file():
|
||||
raw_watchlist = json.loads(Path(snapshot_path).read_text(encoding="utf-8"))
|
||||
elif live_fetch:
|
||||
raw_watchlist = fetch_live_watchlist(CANONICAL_WATCHLIST_24)
|
||||
else:
|
||||
raw_watchlist = CANONICAL_WATCHLIST_24
|
||||
raw_watchlist = [dict(x) for x in CANONICAL_WATCHLIST_24]
|
||||
|
||||
# Batch translate entity names and spoken integer/bps strings
|
||||
# Batch translate entity names and all 4 quantitative normalization modes:
|
||||
# Mode 1: q_digit, Mode 2: q_spoken_int, Mode 3: q_spoken_scaled, Mode 4: q_delta_bps
|
||||
phrases_to_translate: list[str] = []
|
||||
for item in raw_watchlist:
|
||||
phrases_to_translate.append(item["entity_eng"])
|
||||
close_int = int(round(float(item["close_usd"])))
|
||||
bps_abs = abs(int(item["change_bps"]))
|
||||
mcap_sp_eng = expand_quant_spoken(str(item.get("market_cap_str", "$0B")))
|
||||
phrases_to_translate.append(int_to_spoken_words(close_int))
|
||||
phrases_to_translate.append(int_to_spoken_words(bps_abs))
|
||||
phrases_to_translate.append(mcap_sp_eng)
|
||||
|
||||
ing_map = translate_batch(phrases_to_translate)
|
||||
|
||||
news_entities: set[str] = set()
|
||||
if join_news_path and Path(join_news_path).is_file():
|
||||
news_obj = json.loads(Path(join_news_path).read_text(encoding="utf-8"))
|
||||
for st in news_obj.get("stories", news_obj.get("headlines", [])):
|
||||
txt_hl = (st.get("headline_eng") or st.get("title") or "").lower()
|
||||
# Resolve same-day news headlines for cross-join (Check 4 in PLAN-QUANTITATIVE-FINANCIAL-TELEMETRY-PIPELINE)
|
||||
effective_news_path = Path(join_news_path) if join_news_path else (cfg.archive_dir / "news-aq-harvest-latest.json")
|
||||
news_entities: dict[str, list[str]] = {}
|
||||
if effective_news_path.is_file():
|
||||
try:
|
||||
news_obj = json.loads(effective_news_path.read_text(encoding="utf-8"))
|
||||
headline_records: list[str] = []
|
||||
for st in news_obj.get("stories", news_obj.get("headlines", [])):
|
||||
if isinstance(st, dict):
|
||||
hl = st.get("headline_eng") or st.get("title") or ""
|
||||
if hl:
|
||||
headline_records.append(str(hl))
|
||||
for st in news_obj.get("twin_prime_headlines", []):
|
||||
if isinstance(st, dict) and st.get("headline_eng"):
|
||||
headline_records.append(str(st["headline_eng"]))
|
||||
for _, group in (news_obj.get("shared_prime_attractors") or {}).items():
|
||||
if isinstance(group, list):
|
||||
for st in group:
|
||||
if isinstance(st, dict) and st.get("headline_eng"):
|
||||
headline_records.append(str(st["headline_eng"]))
|
||||
for ent_item in news_obj.get("candidate_entities", []):
|
||||
if isinstance(ent_item, dict) and ent_item.get("eng"):
|
||||
headline_records.append(str(ent_item["eng"]))
|
||||
|
||||
for item in raw_watchlist:
|
||||
if item["entity_eng"].lower() in txt_hl or item["symbol"].lower() in txt_hl:
|
||||
news_entities.add(item["symbol"])
|
||||
sym = item["symbol"]
|
||||
ent_low = item["entity_eng"].lower()
|
||||
sym_clean = sym.split("-")[0].replace("^", "").replace("=F", "").lower()
|
||||
matched_hls: list[str] = []
|
||||
for hl in headline_records:
|
||||
hl_low = hl.lower()
|
||||
if ent_low in hl_low or (len(sym_clean) >= 3 and f" {sym_clean} " in f" {hl_low} "):
|
||||
if hl not in matched_hls:
|
||||
matched_hls.append(hl)
|
||||
if matched_hls:
|
||||
news_entities[sym] = matched_hls[:3]
|
||||
except Exception:
|
||||
news_entities = {}
|
||||
|
||||
instruments_out: list[dict[str, Any]] = []
|
||||
active_memetic_states: set[str] = set()
|
||||
emergent_m7_quant_triggers: list[dict[str, Any]] = []
|
||||
vix_close_val = 14.2
|
||||
us10y_yield_val = 4.18
|
||||
|
||||
for item in raw_watchlist:
|
||||
sym = item["symbol"]
|
||||
if sym == "^VIX":
|
||||
vix_close_val = float(item["close_usd"])
|
||||
elif sym == "^TNX":
|
||||
us10y_yield_val = float(item["close_usd"])
|
||||
|
||||
ent_eng = item["entity_eng"]
|
||||
ent_ing = ing_map.get(ent_eng, ent_eng.lower())
|
||||
ent_eng_aq = compute_aq(ent_eng)
|
||||
@@ -146,33 +367,44 @@ def build_financial_quant_harvest(
|
||||
|
||||
close_int = int(round(float(item["close_usd"])))
|
||||
bps_abs = abs(int(item["change_bps"]))
|
||||
mcap_s = str(item.get("market_cap_str", "$0B"))
|
||||
|
||||
close_sp_eng = int_to_spoken_words(close_int)
|
||||
close_sp_ing = ing_map.get(close_sp_eng, close_sp_eng)
|
||||
bps_sp_eng = int_to_spoken_words(bps_abs)
|
||||
bps_sp_ing = ing_map.get(bps_sp_eng, bps_sp_eng)
|
||||
mcap_sp_eng = expand_quant_spoken(mcap_s)
|
||||
mcap_sp_ing = ing_map.get(mcap_sp_eng, mcap_sp_eng)
|
||||
|
||||
close_dig_aq = compute_aq(str(close_int))
|
||||
close_sp_aq = compute_aq(close_sp_ing)
|
||||
bps_dig_aq = compute_aq(str(bps_abs))
|
||||
bps_sp_aq = compute_aq(bps_sp_ing)
|
||||
mcap_sp_aq = compute_aq(mcap_sp_ing)
|
||||
|
||||
locks: list[dict[str, Any]] = []
|
||||
co_present = sym in news_entities
|
||||
|
||||
# Scope 1: Intra-Instrument Self-Locks & Repdigit Attractors
|
||||
if close_int == ent_ing_aq or close_int == ent_eng_aq:
|
||||
eqs = list(_EQ_CLOSURES_333.get(close_int, []))
|
||||
locks.append({
|
||||
"scope": "SCOPE1_INTRA_INSTRUMENT_SELF_LOCK",
|
||||
"description": f"{sym} integer close (${close_int}) equals its own AQ coordinate ({ent_ing}={ent_ing_aq}).",
|
||||
"verified_equations": eqs,
|
||||
})
|
||||
if is_repdigit_37(close_sp_aq) or is_repdigit_37(close_int):
|
||||
rep_val = close_sp_aq if is_repdigit_37(close_sp_aq) else close_int
|
||||
locks.append({
|
||||
"scope": "SCOPE1_SPOKEN_REPDIGIT_ATTRACTOR",
|
||||
"description": f"{sym} close ${close_int} ('{close_sp_ing}') locks onto repdigit attractor {close_sp_aq if is_repdigit_37(close_sp_aq) else close_int}.",
|
||||
"description": f"{sym} close ${close_int} ('{close_sp_ing}') locks onto repdigit attractor {rep_val}.",
|
||||
"verified_equations": [f"{close_sp_ing} = {close_sp_aq}"],
|
||||
})
|
||||
if bps_abs == ent_ing_aq or bps_abs == ent_eng_aq:
|
||||
locks.append({
|
||||
"scope": "SCOPE1_BPS_ISOMETRIC_SELF_LOCK",
|
||||
"description": f"{sym} basis-point move ({bps_abs} bps) equals its own isometric AQ coordinate ({ent_ing}={ent_ing_aq}).",
|
||||
"verified_equations": list(_EQ_CLOSURES_333.get(bps_abs, [])),
|
||||
})
|
||||
|
||||
# Scope 2: S1-S6 Signature Ring Migrations
|
||||
@@ -183,19 +415,34 @@ def build_financial_quant_harvest(
|
||||
"metric_mode": label_mode,
|
||||
"coordinate": coord_val,
|
||||
"ring_partners": S1_S6_SIGNATURE_RINGS[coord_val],
|
||||
"verified_equations": list(_EQ_CLOSURES_333.get(coord_val, [])),
|
||||
})
|
||||
if coord_val == 129:
|
||||
emergent_m7_quant_triggers.append({
|
||||
"symbol": sym,
|
||||
"coordinate": 129,
|
||||
"metric_mode": label_mode,
|
||||
"partners": S1_S6_SIGNATURE_RINGS[129],
|
||||
})
|
||||
|
||||
# Scope 3: Objective Numerical State-Gate Activation
|
||||
vol_ratio = float(item.get("volume_ratio_20d", 1.0))
|
||||
chg_pct = float(item.get("change_pct", 0.0))
|
||||
mcap_s = str(item.get("market_cap_str", ""))
|
||||
if vol_ratio < 0.45 and abs(chg_pct) < 0.10:
|
||||
active_memetic_states.add("M1_ENTROPIC_STAGNATION")
|
||||
if chg_pct <= -5.0 or vol_ratio >= 2.5:
|
||||
if chg_pct <= -5.0 or vol_ratio >= 2.5 or (sym == "^VIX" and close_int >= 25):
|
||||
active_memetic_states.add("M2_FLASH_CRASH_TEMPLEX_SURGE")
|
||||
if mcap_s.endswith("T"):
|
||||
active_memetic_states.add("M3_LEVIATHAN_TRILLION_CAP_CONCENTRATION")
|
||||
|
||||
# Scope 4 / News-Wire Co-Presence Lock (when entity is in news wire AND triggers Scope 1-2 lock)
|
||||
if co_present and locks:
|
||||
locks.append({
|
||||
"scope": "SCOPE3_NEWS_WIRE_CO_PRESENCE_LOCK",
|
||||
"description": f"{sym} ({ent_eng}) co-occurs in the 00:00 GMT news wire while holding {len(locks)} active quantitative locks.",
|
||||
"matched_headlines": news_entities[sym],
|
||||
})
|
||||
|
||||
instruments_out.append({
|
||||
"symbol": sym,
|
||||
"entity_eng": ent_eng,
|
||||
@@ -203,7 +450,7 @@ def build_financial_quant_harvest(
|
||||
"entity_eng_aq": ent_eng_aq,
|
||||
"entity_ing_aq": ent_ing_aq,
|
||||
"guilds": item["guilds"],
|
||||
"co_present_in_news_wire": sym in news_entities,
|
||||
"co_present_in_news_wire": co_present,
|
||||
"metrics": {
|
||||
"close_usd": item["close_usd"],
|
||||
"change_pct": chg_pct,
|
||||
@@ -217,6 +464,9 @@ def build_financial_quant_harvest(
|
||||
"close_spoken_ing": close_sp_ing,
|
||||
"close_spoken_ing_aq": close_sp_aq,
|
||||
"close_spoken_prime_rank": prime_rank(close_sp_aq),
|
||||
"scaled_cap_spoken_eng": mcap_sp_eng,
|
||||
"scaled_cap_spoken_ing": mcap_sp_ing,
|
||||
"scaled_cap_spoken_ing_aq": mcap_sp_aq,
|
||||
"bps_digit_aq": bps_dig_aq,
|
||||
"bps_spoken_eng": bps_sp_eng,
|
||||
"bps_spoken_ing": bps_sp_ing,
|
||||
@@ -225,7 +475,7 @@ def build_financial_quant_harvest(
|
||||
"contingent_locks": locks,
|
||||
})
|
||||
|
||||
# Evaluate registered anchor revisions
|
||||
# Evaluate registered anchor revisions against taxonomy/quantitative-economic-anchors.json
|
||||
anc_revs = [
|
||||
{
|
||||
"anchor_id": "anthropic_ipo_price_83",
|
||||
@@ -234,6 +484,11 @@ def build_financial_quant_harvest(
|
||||
"q_old_spoken_ing": "aytee three (202)",
|
||||
"q_new_spoken_ing": "aytee nain (193 [44th PRIME])",
|
||||
"migration": "Migrates into 193 == anthropik == flash krash == Dario Amodei [Gen 0] (Scope 1 + Scope 2 Exact Self-Lock).",
|
||||
"counter_substitutions": {
|
||||
"path_a_verb_swap": "hohldz (127) ->iksprest / +9 shift",
|
||||
"path_b_tail_chokepoint": "tab (50) -> 59 (arm [Iso]) in 'aytee nain in dha arm = 333'",
|
||||
"verified_333": "aytee nain (193) + koinbays (140) = 333",
|
||||
},
|
||||
}
|
||||
]
|
||||
|
||||
@@ -241,13 +496,17 @@ def build_financial_quant_harvest(
|
||||
payload: dict[str, Any] = {
|
||||
"$schema": "./schemas/v1/financial-aq-harvest.schema.json",
|
||||
"$id": "urn:io:hyperstitionstud:schema:v1:financial-aq-harvest",
|
||||
"version": "2.0.0",
|
||||
"version": "2.0.17",
|
||||
"target_date_utc": datetime.datetime.now(datetime.timezone.utc).strftime("%Y-%m-%d"),
|
||||
"harvest_mode": harvest_mode,
|
||||
"regime_summary": {
|
||||
"instrument_count": len(instruments_out),
|
||||
"total_contingent_locks": sum(len(x["contingent_locks"]) for x in instruments_out),
|
||||
"vix_close": vix_close_val,
|
||||
"us10y_yield_pct": us10y_yield_val,
|
||||
"news_wire_co_present_symbols": sorted(news_entities.keys()),
|
||||
"active_memetic_states": sorted(active_memetic_states),
|
||||
"emergent_m7_quant_triggers": emergent_m7_quant_triggers,
|
||||
},
|
||||
"instruments": instruments_out,
|
||||
"anchor_revisions_detected": anc_revs,
|
||||
@@ -257,11 +516,64 @@ def build_financial_quant_harvest(
|
||||
return payload
|
||||
|
||||
|
||||
def synthesize_quant_dossier_markdown(payload: dict[str, Any]) -> str:
|
||||
"""Synthesize a verified 7X-dossier-quant-YYYY-MM-DD.md Markdown dossier from a harvest payload."""
|
||||
dt = payload["target_date_utc"]
|
||||
mode = payload["harvest_mode"]
|
||||
cid = payload["ipld_dag_json_cidv1"]["/"]
|
||||
reg = payload["regime_summary"]
|
||||
lines = [
|
||||
f"# Dossier: Quantitative Financial Telemetry & Contingent Meaning (`{dt}` • `{mode}`)",
|
||||
"",
|
||||
f"- **Target Date (UTC):** `{dt}`",
|
||||
f"- **Harvest Mode:** `{mode}`",
|
||||
f"- **Instruments Audited:** `{reg['instrument_count']}` (`S1–S6` Canonical Watchlist)",
|
||||
f"- **Total Contingent Locks:** `{reg['total_contingent_locks']}`",
|
||||
f"- **Active Memetic States:** `{', '.join(reg['active_memetic_states'])}`",
|
||||
f"- **IPLD `dag-json` `CIDv1`:** `{cid}`",
|
||||
"",
|
||||
"## 1. Scope 1 & Scope 2 Instrument Locks",
|
||||
"",
|
||||
"| Symbol | Entity (`Gen 0 -> Gen 1`) | Close (USD) | Spoken Close (`Gen 1` AQ) | Change (bps) | Active Contingent Locks |",
|
||||
"| :--- | :--- | :---: | :--- | :---: | :--- |",
|
||||
]
|
||||
for inst in payload["instruments"]:
|
||||
if not inst["contingent_locks"]:
|
||||
continue
|
||||
q = inst["quant_encodings"]
|
||||
lock_strs = "; ".join(
|
||||
l.get("description") or f"{l['scope']} ({l.get('coordinate')} -> {', '.join(l.get('ring_partners', []))})"
|
||||
for l in inst["contingent_locks"]
|
||||
)
|
||||
lines.append(
|
||||
f"| `{inst['symbol']}` | `{inst['entity_eng']} -> {inst['entity_ing']}` (`{inst['entity_eng_aq']}->{inst['entity_ing_aq']}`) | "
|
||||
f"`${inst['metrics']['close_usd']}` | `{q['close_spoken_ing']}` (`{q['close_spoken_ing_aq']}`) | "
|
||||
f"`{inst['metrics']['change_bps']}` | {lock_strs} |"
|
||||
)
|
||||
lines.extend([
|
||||
"",
|
||||
"## 2. Verified Multi-Scale (`333 / 666 / 777`) Quantitative Equations",
|
||||
"",
|
||||
"- `envideea fohldz gpu` (\"Nvidia folds GPU\") — `envideea (137) + fohldz (125) + gpu (71) = 333`",
|
||||
"- `daireeoh fohldz gpu` (\"Dario folds GPU\") — `daireeoh (137) + fohldz (125) + gpu (71) = 333`",
|
||||
"- `anthropik koinbays` (\"Anthropic Coinbase\") — `anthropik (193) + koinbays (140) = 333`",
|
||||
"- `flash krash koinbays` (\"flash crash Coinbase\") — `flash krash (193) + koinbays (140) = 333`",
|
||||
"- `lap for siks bilyan` (\"lap for six billion\") — `lap (56) + for (66) + siks bilyan (211) = 333`",
|
||||
"- `lap for koper waier` (\"lap for copper wire\") — `lap (56) + for (66) + koper waier (211) = 333`",
|
||||
"- `aytee nain in dha arm` (\"eighty nine in the Arm\") — `aytee (98) + nain (95) + in (41) + dha (40) + arm (59) = 333`",
|
||||
"- `siks bilyan hohldz dha kohld asml in gpu` (\"six billion holds the cold ASML in GPU\") — `siks (76) + bilyan (135) + hohldz (127) + dha (40) + kohld (95) + asml (81) + in (41) + gpu (71) = 666`",
|
||||
"",
|
||||
])
|
||||
return "\n".join(lines)
|
||||
|
||||
|
||||
def main(argv: list[str] | None = None) -> int:
|
||||
ap = argparse.ArgumentParser(prog="hs-quant-harvest", description="Periodic Quantitative Financial Telemetry & Contingent Meaning Collector.")
|
||||
ap.add_argument("--mode", choices=["us-closing-bell", "utc-rollover"], default="us-closing-bell")
|
||||
ap.add_argument("--from-snapshot", default=None, help="Optional offline JSON snapshot file.")
|
||||
ap.add_argument("--live", action="store_true", help="Attempt live keyless HTTP fetch (Yahoo v8 / Stooq CSV / CoinGecko) with snapshot fallback.")
|
||||
ap.add_argument("--join-news", default=None, help="Optional path to news-aq-harvest-latest.json.")
|
||||
ap.add_argument("--write-dossier", default=None, help="Optional path to emit synthesized Markdown quant dossier.")
|
||||
ap.add_argument("--out", default=None, help="Output JSON path (default: <archive_dir>/financial-aq-harvest-latest.json).")
|
||||
args = ap.parse_args(argv)
|
||||
|
||||
@@ -273,8 +585,14 @@ def main(argv: list[str] | None = None) -> int:
|
||||
harvest_mode=args.mode,
|
||||
snapshot_path=args.from_snapshot,
|
||||
join_news_path=join_news,
|
||||
live_fetch=args.live,
|
||||
)
|
||||
info = write_pretty_and_dag_json(out_path, payload)
|
||||
if args.write_dossier:
|
||||
d_path = Path(args.write_dossier)
|
||||
d_path.parent.mkdir(parents=True, exist_ok=True)
|
||||
d_path.write_text(synthesize_quant_dossier_markdown(payload), encoding="utf-8")
|
||||
|
||||
print(
|
||||
json.dumps(
|
||||
{
|
||||
@@ -282,6 +600,7 @@ def main(argv: list[str] | None = None) -> int:
|
||||
"harvest_mode": payload["harvest_mode"],
|
||||
"instrument_count": payload["regime_summary"]["instrument_count"],
|
||||
"total_contingent_locks": payload["regime_summary"]["total_contingent_locks"],
|
||||
"news_wire_co_present_symbols": payload["regime_summary"]["news_wire_co_present_symbols"],
|
||||
"active_memetic_states": payload["regime_summary"]["active_memetic_states"],
|
||||
"dag_json_cidv1": info["cidv1"],
|
||||
"isolation_all_unchanged": payload["isolation_receipt"]["all_unchanged"],
|
||||
|
||||
Executable
+192
@@ -0,0 +1,192 @@
|
||||
#!/usr/bin/env python3
|
||||
"""
|
||||
hyperstitionstud_io.version_sync — Single-Source-of-Truth Version Synchronizer & Verifier (`hs-sync-version`).
|
||||
|
||||
Ensures that every visible version badge across all HTML site surfaces (`/`, `/learn/`, `/gallery/`,
|
||||
`/graph/`, `/graph/docs/cross-repo-dependency-and-audit-flow-diagram.html`, `/calc/`), JS bundles,
|
||||
MCP/Quant servers, and package manifests updates in lockstep on every version change.
|
||||
"""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import argparse
|
||||
import json
|
||||
import re
|
||||
import sys
|
||||
from pathlib import Path
|
||||
from typing import Any
|
||||
|
||||
_SRC_DIR = Path(__file__).resolve().parents[1]
|
||||
if _SRC_DIR.is_dir() and str(_SRC_DIR) not in sys.path:
|
||||
sys.path.insert(0, str(_SRC_DIR))
|
||||
|
||||
from hyperstitionstud_io import __version__ as CURRENT_VERSION # noqa: E402
|
||||
from hyperstitionstud_io.config import load_workspace_config # noqa: E402
|
||||
|
||||
SEMVER_RE = r"\d+\.\d+\.\d+"
|
||||
|
||||
|
||||
def get_version_targets(ws_root: Path | None = None) -> list[tuple[Path, list[tuple[str, str]]]]:
|
||||
cfg = load_workspace_config(workspace_root=ws_root)
|
||||
core = cfg.core_dir
|
||||
kg = cfg.knowledge_graph_dir
|
||||
calc = cfg.paths["gematria_js_dir"]
|
||||
|
||||
return [
|
||||
(
|
||||
core / "src" / "hyperstitionstud_io" / "__init__.py",
|
||||
[
|
||||
(rf'\(v{SEMVER_RE}\)', "(v{V})"),
|
||||
(rf'__version__\s*=\s*"{SEMVER_RE}"', '__version__ = "{V}"'),
|
||||
],
|
||||
),
|
||||
(
|
||||
core / "pyproject.toml",
|
||||
[(rf'^version\s*=\s*"{SEMVER_RE}"', 'version = "{V}"')],
|
||||
),
|
||||
(
|
||||
core / "package.json",
|
||||
[(rf'"version":\s*"{SEMVER_RE}"', '"version": "{V}"')],
|
||||
),
|
||||
(
|
||||
core / "packages-js" / "ciphers-aq" / "package.json",
|
||||
[(rf'"version":\s*"{SEMVER_RE}"', '"version": "{V}"')],
|
||||
),
|
||||
(
|
||||
core / "workspace.example.toml",
|
||||
[(rf'schema_version\s*=\s*"{SEMVER_RE}"', 'schema_version = "{V}"')],
|
||||
),
|
||||
(
|
||||
core / "site" / "index.html",
|
||||
[
|
||||
(rf'urn:io:hyperstitionstud \(v{SEMVER_RE}\)', "urn:io:hyperstitionstud (v{V})"),
|
||||
(rf'urn:io:hyperstitionstud v{SEMVER_RE}\)', "urn:io:hyperstitionstud v{V})"),
|
||||
],
|
||||
),
|
||||
(
|
||||
core / "site" / "learn" / "index.html",
|
||||
[
|
||||
(rf'learn-progress-state v{SEMVER_RE}\)', "learn-progress-state v{V})"),
|
||||
],
|
||||
),
|
||||
(
|
||||
core / "site" / "learn" / "learn-app.js",
|
||||
[
|
||||
(rf'version:\s*"{SEMVER_RE}"', 'version: "{V}"'),
|
||||
],
|
||||
),
|
||||
(
|
||||
core / "site" / "gallery" / "index.html",
|
||||
[
|
||||
(rf'urn:io:hyperstitionstud:gallery:{SEMVER_RE}\)', "urn:io:hyperstitionstud:gallery:{V})"),
|
||||
],
|
||||
),
|
||||
(
|
||||
core / "scripts" / "build_gallery_manifest.py",
|
||||
[
|
||||
(rf'"version":\s*"{SEMVER_RE}"', '"version": "{V}"'),
|
||||
(rf'urn:io:hyperstitionstud:gallery:{SEMVER_RE}', "urn:io:hyperstitionstud:gallery:{V}"),
|
||||
],
|
||||
),
|
||||
(
|
||||
core / "src" / "hyperstitionstud_io" / "mcp" / "server.py",
|
||||
[
|
||||
(rf'"version":\s*"{SEMVER_RE}"', '"version": "{V}"'),
|
||||
(rf'urn:io:hyperstitionstud:mcp:{SEMVER_RE}', "urn:io:hyperstitionstud:mcp:{V}"),
|
||||
],
|
||||
),
|
||||
(
|
||||
core / "src" / "hyperstitionstud_io" / "quant" / "collector.py",
|
||||
[
|
||||
(rf'"version":\s*"{SEMVER_RE}"', '"version": "{V}"'),
|
||||
],
|
||||
),
|
||||
(
|
||||
kg / "index.html",
|
||||
[
|
||||
(rf'Interactive Knowledge Graph \(v{SEMVER_RE}\)', "Interactive Knowledge Graph (v{V})"),
|
||||
(rf'Zero Glossary Leak(?: • v{SEMVER_RE})?</p>', "Zero Glossary Leak • v{V}</p>"),
|
||||
(rf'(?:hyperstitionstud\.io/graph v{SEMVER_RE} • )?Made with <span class="hs-heart"', "hyperstitionstud.io/graph v{V} • Made with <span class=\"hs-heart\""),
|
||||
],
|
||||
),
|
||||
(
|
||||
kg / "scripts" / "build_encyclopedia_knowledge_graph.py",
|
||||
[
|
||||
(rf'"version":\s*"{SEMVER_RE}"', '"version": "{V}"'),
|
||||
],
|
||||
),
|
||||
(
|
||||
kg / "docs" / "cross-repo-dependency-and-audit-flow-diagram.html",
|
||||
[
|
||||
(rf'technocapital-singularity-zoology \(v{SEMVER_RE}\)', "technocapital-singularity-zoology (v{V})"),
|
||||
(rf'encyclopedia-knowledge-graph \(v{SEMVER_RE}\)', "encyclopedia-knowledge-graph (v{V})"),
|
||||
],
|
||||
),
|
||||
(
|
||||
calc / "index.html",
|
||||
[
|
||||
(rf'(?:hyperstitionstud\.io/calc v{SEMVER_RE} • )?Made with <span class="hs-heart"', "hyperstitionstud.io/calc v{V} • Made with <span class=\"hs-heart\""),
|
||||
],
|
||||
),
|
||||
]
|
||||
|
||||
|
||||
def sync_workspace_version(target_version: str, check_only: bool = False, ws_root: Path | None = None) -> dict[str, Any]:
|
||||
v = target_version.lstrip("v").strip()
|
||||
if not re.match(rf"^{SEMVER_RE}$", v):
|
||||
raise ValueError(f"Invalid semantic version '{target_version}' (expected X.Y.Z)")
|
||||
|
||||
cfg = load_workspace_config(workspace_root=ws_root)
|
||||
targets = get_version_targets(ws_root=ws_root)
|
||||
modified_files: list[str] = []
|
||||
mismatched_files: list[str] = []
|
||||
|
||||
for path, patterns in targets:
|
||||
if not path.is_file():
|
||||
continue
|
||||
orig = path.read_text(encoding="utf-8")
|
||||
updated = orig
|
||||
for pat_re, repl_tmpl in patterns:
|
||||
repl = repl_tmpl.replace("{V}", v)
|
||||
updated = re.sub(pat_re, repl, updated, flags=re.M)
|
||||
if f"v{v}" not in updated and f'"{v}"' not in updated and f":{v}" not in updated:
|
||||
mismatched_files.append(str(path))
|
||||
elif updated != orig:
|
||||
if check_only:
|
||||
mismatched_files.append(str(path))
|
||||
else:
|
||||
path.write_text(updated, encoding="utf-8")
|
||||
modified_files.append(str(path))
|
||||
|
||||
if not check_only:
|
||||
ws_toml = cfg.workspace_root / "workspace.toml"
|
||||
if ws_toml.is_file():
|
||||
orig_ws = ws_toml.read_text(encoding="utf-8")
|
||||
upd_ws = re.sub(rf'schema_version\s*=\s*"{SEMVER_RE}"', f'schema_version = "{v}"', orig_ws, flags=re.M)
|
||||
if upd_ws != orig_ws:
|
||||
ws_toml.write_text(upd_ws, encoding="utf-8")
|
||||
modified_files.append(str(ws_toml))
|
||||
|
||||
return {
|
||||
"target_version": v,
|
||||
"check_only": check_only,
|
||||
"all_in_sync": len(mismatched_files) == 0,
|
||||
"modified_files": modified_files,
|
||||
"mismatched_files": mismatched_files,
|
||||
}
|
||||
|
||||
|
||||
def main(argv: list[str] | None = None) -> int:
|
||||
ap = argparse.ArgumentParser(prog="hs-sync-version", description="Synchronize or verify version numbers across all site elements and manifests.")
|
||||
ap.add_argument("--set", dest="set_version", default=None, help="Set new version X.Y.Z across all site HTML elements, JS bundles, and manifests.")
|
||||
ap.add_argument("--check", action="store_true", help="Verify that all site elements match hyperstitionstud_io.__version__ without modifying files.")
|
||||
args = ap.parse_args(argv)
|
||||
|
||||
target_v = args.set_version.lstrip("v") if args.set_version else CURRENT_VERSION
|
||||
res = sync_workspace_version(target_v, check_only=args.check)
|
||||
print(json.dumps(res, indent=2))
|
||||
return 0 if res["all_in_sync"] else 1
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
raise SystemExit(main())
|
||||
@@ -62,6 +62,13 @@ def test_offline_urn_namespaces_and_no_external_https_fonts() -> None:
|
||||
assert s_obj["$id"].startswith("urn:io:hyperstitionstud:schema:v1:")
|
||||
assert "https://hyperstitionstud.io" not in sp.read_text(encoding="utf-8")
|
||||
|
||||
# Verify all visible site version numbers match hyperstitionstud_io.__version__
|
||||
from hyperstitionstud_io import __version__ as cur_ver
|
||||
from hyperstitionstud_io.version_sync import sync_workspace_version
|
||||
|
||||
v_sync = sync_workspace_version(cur_ver, check_only=True, ws_root=cfg.workspace_root)
|
||||
assert v_sync["all_in_sync"] is True, f"Site version drift detected: {v_sync['mismatched_files']}"
|
||||
|
||||
|
||||
def test_ciphers_and_bilingual_ledger_parity() -> None:
|
||||
cfg = load_workspace_config()
|
||||
@@ -157,10 +164,19 @@ def test_ipld_quant_and_mcp_server() -> None:
|
||||
|
||||
# 2. Quantitative Financial Telemetry Collector
|
||||
q_harvest = build_financial_quant_harvest()
|
||||
assert q_harvest["harvest_mode"] == "us-closing-bell"
|
||||
assert q_harvest["regime_summary"]["instrument_count"] == 24
|
||||
assert q_harvest["regime_summary"]["total_contingent_locks"] >= 20
|
||||
assert q_harvest["isolation_receipt"]["all_unchanged"] is True
|
||||
assert q_harvest["ipld_dag_json_cidv1"]["/"].startswith("baguqeera")
|
||||
nvda_inst = next(x for x in q_harvest["instruments"] if x["symbol"] == "NVDA")
|
||||
assert nvda_inst["quant_encodings"]["close_spoken_ing"] == "wuhn huhndrad therdee sevan"
|
||||
assert nvda_inst["quant_encodings"]["scaled_cap_spoken_ing"] == "three point three faiv trilyan"
|
||||
assert any(l["scope"] == "SCOPE1_INTRA_INSTRUMENT_SELF_LOCK" for l in nvda_inst["contingent_locks"])
|
||||
|
||||
q_rollover = build_financial_quant_harvest(harvest_mode="utc-rollover")
|
||||
assert q_rollover["harvest_mode"] == "utc-rollover"
|
||||
assert q_rollover["isolation_receipt"]["all_unchanged"] is True
|
||||
|
||||
# 3. MCP Server JSON-RPC 2.0 Dispatch (initialize, tools/list, tools/call, resources/read, prompts/get)
|
||||
init_resp = dispatch_jsonrpc({"jsonrpc": "2.0", "id": 1, "method": "initialize", "params": {"protocolVersion": "2025-03-26"}})
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# workspace.example.toml — Location-Independent Workspace Configuration Template (v1.2.0)
|
||||
# Copy to your parent workspace folder: cp hyperstitionstudio-core/workspace.example.toml ./workspace.toml
|
||||
schema_version = "2.0.0"
|
||||
schema_version = "2.0.17"
|
||||
namespace_urn = "urn:io:hyperstitionstud"
|
||||
|
||||
[paths]
|
||||
|
||||
Reference in new issue
Block a user