Compare commits

...
3 Commits
19 changed files with 324 additions and 57 deletions

No files matched your search

+8 -1
View File
@@ -87,7 +87,14 @@ hyperstitionstud.io {
reverse_proxy 127.0.0.1:8095
}
# 7. Repo Install Dir: hyperstitionstudio-core -> /schemas/*, /learn/*, /gallery/* & Root Portal Homepage (/)
# Long-Term Plan (Disabled for Now): /gallery & /gallery/* Artifact Gallery
# See docs/PLAN-MEMETIC-GALLERY-SUBPAGE.pdf to re-enable when activated.
@gallery_disabled path /gallery /gallery/*
handle @gallery_disabled {
respond "404 Not Found" 404
}
# 7. Repo Install Dir: hyperstitionstudio-core -> /schemas/*, /learn/* & Root Portal Homepage (/)
handle_path /schemas/* {
root * /var/www/hyperstitionstud.io/repos/hyperstitionstudio-core/schemas
file_server {
+1 -1
View File
@@ -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]
+101 -30
View File
@@ -1,13 +1,12 @@
#!/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
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]:-$0}")" && pwd)"
@@ -15,10 +14,27 @@ 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 ]] && command -v sudo >/dev/null 2>&1; then
SUDO="sudo"
fi
@@ -46,7 +62,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##*:}"
@@ -58,7 +74,7 @@ if [[ "${TARGET_REPO}" != "--no-pull" ]]; then
if [[ "${repo}" == "haiperdohp-jemaytreeah" ]] && git -C "${REPOS_ROOT}/${repo}" remote get-url downstream >/dev/null 2>&1; then
remote_name="downstream"
fi
echo "[1/4] Updating ${REPOS_ROOT}/${repo} (${remote_name}/${branch})..."
echo "[1/5] 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}"
fi
@@ -77,47 +93,102 @@ if [[ -d "${REPOS_ROOT}/haiperdohp-jemaytreeah" ]]; then
fi
fi
echo "[2/4] Running hs-doctor and 6-Gate Knowledge Graph Verification..."
echo "[2/5] 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 "[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}"
${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 routes
${SUDO} ln -sfn "hyperstitionstudio-core/site/index.html" "${LIVE_REPOS}/index.html"
${SUDO} ln -sfn "hyperstitionstudio-core/site/learn" "${LIVE_REPOS}/learn"
${SUDO} ln -sfn "hyperstitionstudio-core/site/gallery" "${LIVE_REPOS}/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"
# Create relative route symlinks inside LIVE_REPOS so both Caddy and standalone HTTP servers resolve all active routes
${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)
${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)..."
${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 \
${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 command -v systemctl >/dev/null 2>&1 && [[ -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}" ]] && ! cmp -s "${src_u}" "${dst_u}" 2>/dev/null; then
echo "[5/5] Updating systemd unit ${dst_u}..."
${SUDO} cp "${src_u}" "${dst_u}"
UNITS_CHANGED=1
fi
done
if [[ "${UNITS_CHANGED}" -eq 1 ]]; then
${SUDO} systemctl daemon-reload
${SUDO} systemctl enable hyperstition-tmpfs-sync.service >/dev/null 2>&1 || true
${SUDO} systemctl enable --now hyperstition-mcp.service >/dev/null 2>&1 || true
${SUDO} systemctl restart hyperstition-mcp.service >/dev/null 2>&1 || true
elif ! systemctl is-active --quiet hyperstition-mcp.service 2>/dev/null && [[ -f "/etc/systemd/system/hyperstition-mcp.service" ]]; then
${SUDO} systemctl enable --now hyperstition-mcp.service >/dev/null 2>&1 || true
fi
fi
SRC_CADDY="${DEPLOY_DIR}/Caddyfile"
DST_CADDY="/etc/caddy/Caddyfile"
if command -v caddy >/dev/null 2>&1 && [[ -d "/etc/caddy" ]] && [[ -f "${SRC_CADDY}" ]]; then
if cmp -s "${SRC_CADDY}" "${DST_CADDY}" 2>/dev/null; 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}..."
${SUDO} caddy validate --config "${SRC_CADDY}" --adapter caddyfile >/dev/null
${SUDO} cp "${SRC_CADDY}" "${DST_CADDY}"
if command -v systemctl >/dev/null 2>&1 && [[ -d "/run/systemd/system" ]]; then
if systemctl is-active --quiet caddy 2>/dev/null; then
${SUDO} systemctl reload caddy
echo "[5/5] Reloaded Caddy with updated /etc/caddy/Caddyfile."
else
${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}"
+1 -5
View File
@@ -46,15 +46,11 @@ else
MCP_URL="${TARGET_BASE_URL%/}/mcp"
fi
echo "[3/3] Verifying all 35 portal, /learn/, /gallery/, graph, encyclopedia, haiperdohp-jemaytreeah (.gitignore artifacts), CI & schema routes against ${TARGET_BASE_URL}..."
echo "[3/4] Verifying all 32 active portal, /learn/, graph, encyclopedia, haiperdohp-jemaytreeah (.gitignore artifacts), CI & schema routes against ${TARGET_BASE_URL}..."
ROUTES=(
"/"
"/learn/index.html"
"/learn/learn-app.js"
"/gallery/index.html"
"/gallery/gallery-data.js"
"/gallery/media/meme_1_custom_pokedex_technocapital_zoology_m7_129_125.png"
"/gallery/media/meme_1_custom_pokedex_technocapital_zoology_m7_129_125.pdf"
"/graph/index.html"
"/graph/graph-data.js"
"/graph/encyclopedia-graph.json"
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@hyperstitionstud.io/workspace-core",
"version": "2.0.0",
"version": "2.0.13",
"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 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@hyperstitionstud.io/ciphers-aq",
"version": "2.0.0",
"version": "2.0.13",
"type": "module",
"main": "index.js",
"license": "MIT"
+2 -1
View File
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
[project]
name = "hyperstitionstudio-core"
version = "2.0.0"
version = "2.0.13"
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"]
+2 -2
View File
@@ -144,8 +144,8 @@ def main() -> int:
})
manifest = {
"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": len(items),
"items": items,
}
+2 -2
View File
@@ -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": [
{
+1 -1
View File
@@ -217,7 +217,7 @@
<main class="gallery-grid" id="galleryGrid"></main>
<footer>
<div>hyperstitionstud.io/gallery &bull; Powered by hyperstitionstudio-core (urn:io:hyperstitionstud:gallery:2.0.0)</div>
<div>hyperstitionstud.io/gallery &bull; Powered by hyperstitionstudio-core (urn:io:hyperstitionstud:gallery:2.0.13)</div>
<div class="hs-lemur-credit">Made with <span class="hs-heart" role="img" aria-label="love">&#x2665;</span> by Lemurs.</div>
</footer>
</div>
+3 -3
View File
@@ -131,12 +131,12 @@
<span class="dot"></span>
<h1>HYPERSTITIONSTUD.IO // TECHNOCAPITAL SINGULARITY ZOOLOGY WORKBENCH</h1>
</div>
<p class="subtitle">100% Offline-Portable &amp; HTTP/3 Edge-Ready Research Corpus &bull; Namespace Authority: urn:io:hyperstitionstud (v2.0.0)</p>
<p class="subtitle">100% Offline-Portable &amp; HTTP/3 Edge-Ready Research Corpus &bull; Namespace Authority: urn:io:hyperstitionstud (v2.0.13)</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>
<a class="btn" data-route="meme-gallery" href="/gallery/index.html" style="padding:0.35rem 0.75rem;font-size:0.74rem;">Memetic Gallery (/gallery/)</a>
<span class="badge">388 Graph Nodes</span>
<span class="badge">1,282 Typed Edges</span>
<span class="badge">22 PDF Volumes</span>
</div>
</header>
@@ -253,7 +253,7 @@
</main>
<footer>
<div>hyperstitionstud.io &bull; Powered by hyperstitionstudio-core (hyperstitionstud_io.* / urn:io:hyperstitionstud v2.0.0) &bull; Zero External Network Dependencies</div>
<div>hyperstitionstud.io &bull; Powered by hyperstitionstudio-core (hyperstitionstud_io.* / urn:io:hyperstitionstud v2.0.13) &bull; 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;">&#x2665;</span> by Lemurs.</div>
</footer>
</div>
+1 -2
View File
@@ -215,7 +215,6 @@
</div>
<nav class="top-nav">
<a class="btn" data-learn-route="nav-home" href="../index.html">&larr; Portal Home</a>
<a class="btn" data-learn-route="nav-gallery" href="../gallery/index.html">Memetic Gallery</a>
<a class="btn" data-learn-route="nav-graph" href="/graph/index.html">Knowledge Graph</a>
<a class="btn" data-learn-route="nav-calc" href="/calc/index.html">AQ Calculator</a>
</nav>
@@ -414,7 +413,7 @@
</main>
<footer>
<div>hyperstitionstud.io/learn &bull; Powered by hyperstitionstudio-core (urn:io:hyperstitionstud:schema:v1:learn-progress-state v2.0.0)</div>
<div>hyperstitionstud.io/learn &bull; Powered by hyperstitionstudio-core (urn:io:hyperstitionstud:schema:v1:learn-progress-state v2.0.13)</div>
<div class="hs-lemur-credit">Made with <span class="hs-heart" role="img" aria-label="love">&#x2665;</span> by Lemurs.</div>
</footer>
</div>
+1 -1
View File
@@ -265,7 +265,7 @@
const base = {
$schema: "../schemas/v1/learn-progress-state.schema.json",
$id: SCHEMA_ID,
version: "2.0.0",
version: "2.0.13",
updated_at_utc: new Date().toISOString(),
preferred_register: "fund_manager",
completed_modules: [],
+2 -2
View File
@@ -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.13)."""
__version__ = "2.0.13"
NAMESPACE_URN = "urn:io:hyperstitionstud"
+2 -2
View File
@@ -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.13",
"namespace_urn": "urn:io:hyperstitionstud:mcp:2.0.13",
}
+1 -1
View File
@@ -241,7 +241,7 @@ 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.13",
"target_date_utc": datetime.datetime.now(datetime.timezone.utc).strftime("%Y-%m-%d"),
"harvest_mode": harvest_mode,
"regime_summary": {
+186
View File
@@ -0,0 +1,186 @@
#!/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}"')],
),
(
cfg.workspace_root / "workspace.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(?: &bull; v{SEMVER_RE})?</p>', "Zero Glossary Leak &bull; v{V}</p>"),
(rf'(?:hyperstitionstud\.io/graph v{SEMVER_RE} &bull; )?Made with <span class="hs-heart"', "hyperstitionstud.io/graph v{V} &bull; 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} &bull; )?Made with <span class="hs-heart"', "hyperstitionstud.io/calc v{V} &bull; 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)")
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))
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())
+7
View File
@@ -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()
+1 -1
View File
@@ -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.13"
namespace_urn = "urn:io:hyperstitionstud"
[paths]