diff --git a/README.md b/README.md index 10ceed0..fb95f32 100644 --- a/README.md +++ b/README.md @@ -3,8 +3,8 @@ > **Gitea Commit & Release Telemetry (`v2.17.1` • Namespace `urn:io:hyperstitionstud`)** > - **Repository Role & Public Route:** Shared PEP 420 Python core library (`hyperstitionstud_io.*`), MCP/REST server, `/quant/`, `/learn/`, `/engineering/`, `/math/`, & `/donate/` webroots → [`https://hyperstitionstud.io/`](https://hyperstitionstud.io/) -> - **Latest Commit Scope (`hyperstitionstudio-core`):** Synchronized v2.17.1 release state across 1 tracked module/artifact surface(s) -> - **Touched Files / Surfaces:** `tests/test_core_suite.py` +> - **Latest Commit Scope (`hyperstitionstudio-core`):** Synchronized v2.17.1 release state across 13 tracked module/artifact surface(s) +> - **Touched Files / Surfaces:** `deploy/push-all-to-git-libre-audio.sh`, `deploy/run-vps-data-production.sh`, `deploy/sync-vps-repos.sh`, `src/hyperstitionstud_io/ci/deploy_scripts_sync.py`, `src/hyperstitionstud_io/ci/public_regression.py`, `src/hyperstitionstud_io/config/__init__.py`, `src/hyperstitionstud_io/mcp/tools.py`, `src/hyperstitionstud_io/publishing/archive_rotator.py` (+5 more) > - **Live Verified Ecosystem Metrics (`v2.17.1`):** `6` Repositories • `17` CLI Entrypoints • `20` MCP/REST Tools • `14` URN Resources • `63` Verified Web Routes • `388` KG Nodes / `1,282` Edges • `282` Glossary Entries • `4,943` Offline CMUdict Phonetics • `0` Synthetic Data diff --git a/deploy/push-all-to-git-libre-audio.sh b/deploy/push-all-to-git-libre-audio.sh index 155c2c9..1ed2281 100755 --- a/deploy/push-all-to-git-libre-audio.sh +++ b/deploy/push-all-to-git-libre-audio.sh @@ -85,12 +85,16 @@ python3 "${WORKSPACE_DIR}/hyperstitionstudio-core/tests/test_core_suite.py" run_checked "build_encyclopedia_knowledge_graph.py --verify-only" python3 "${WORKSPACE_DIR}/encyclopedia-knowledge-graph/scripts/build_encyclopedia_knowledge_graph.py" --verify-only echo "[2/3] Verifying git.libre.audio remote URLs across all repositories..." +CI_REPO_DIR="hyperdope-ci-build" +if [[ ! -d "${WORKSPACE_DIR}/${CI_REPO_DIR}" ]] && [[ -d "${WORKSPACE_DIR}/ingglish-hyperdope-ci" ]]; then + CI_REPO_DIR="ingglish-hyperdope-ci" +fi for pair in \ "hyperstitionstudio-core:hyperstitionstudio-core.git" \ "ingglish-hyperdope-gematria:ingglish-hyperdope-gematria.git" \ "technocapital-singularity-zoology:technocapital-singularity-zoology.git" \ "encyclopedia-knowledge-graph:encyclopedia-knowledge-graph.git" \ - "hyperdope-ci-build:ingglish-hyperdope-ci.git"; do + "${CI_REPO_DIR}:ingglish-hyperdope-ci.git"; do rdir="${WORKSPACE_DIR}/${pair%%:*}" rslug="${pair##*:}" ensure_remote_url "${rdir}" origin "${FORGE_SSH}/${rslug}" @@ -127,10 +131,10 @@ git -C "${WORKSPACE_DIR}/encyclopedia-knowledge-graph" pull --rebase --autostash git -C "${WORKSPACE_DIR}/encyclopedia-knowledge-graph" push -u origin main push_head_tag "${WORKSPACE_DIR}/encyclopedia-knowledge-graph" origin -echo " -> (5/6) hyperdope-ci-build (feat/ingglish-aq-corpus + HEAD tag)" -git -C "${WORKSPACE_DIR}/hyperdope-ci-build" pull --rebase --autostash origin feat/ingglish-aq-corpus || true -git -C "${WORKSPACE_DIR}/hyperdope-ci-build" push -u origin feat/ingglish-aq-corpus -push_head_tag "${WORKSPACE_DIR}/hyperdope-ci-build" origin +echo " -> (5/6) hyperdope-ci-build (${CI_REPO_DIR}, feat/ingglish-aq-corpus + HEAD tag)" +git -C "${WORKSPACE_DIR}/${CI_REPO_DIR}" pull --rebase --autostash origin feat/ingglish-aq-corpus || true +git -C "${WORKSPACE_DIR}/${CI_REPO_DIR}" push -u origin feat/ingglish-aq-corpus +push_head_tag "${WORKSPACE_DIR}/${CI_REPO_DIR}" origin if [[ -d "${WORKSPACE_DIR}/haiperdohp-jemaytreeah/.git" ]]; then echo " -> (6/6) haiperdohp-jemaytreeah (downstream main, feat/ingglish-aq-corpus, feat/ingglish-priority-toggle + HEAD tag)" diff --git a/deploy/run-vps-data-production.sh b/deploy/run-vps-data-production.sh index a70a0ac..093db9e 100755 --- a/deploy/run-vps-data-production.sh +++ b/deploy/run-vps-data-production.sh @@ -90,9 +90,9 @@ if [[ "${PUSH_ONLY}" -eq 0 ]]; then run_checked "hs-macro-harvest (live FRED CSV)" "${PYTHON_BIN}" -m hyperstitionstud_io.quant.macro fi if [[ "${WINDOW_MODE}" == "utc-rollover" ]] && [[ -f "${REPOS_ROOT}/ingglish-hyperdope-gematria/ingglish-aq-archive/scripts/ci_provision_ingglish.py" ]]; then - CI_OUT_DIR="${REPOS_ROOT}/ingglish-hyperdope-ci" - if [[ ! -d "${CI_OUT_DIR}" ]] && [[ -d "${REPOS_ROOT}/hyperdope-ci-build" ]]; then - CI_OUT_DIR="${REPOS_ROOT}/hyperdope-ci-build" + CI_OUT_DIR="${REPOS_ROOT}/hyperdope-ci-build" + if [[ ! -d "${CI_OUT_DIR}" ]] && [[ -d "${REPOS_ROOT}/ingglish-hyperdope-ci" ]]; then + CI_OUT_DIR="${REPOS_ROOT}/ingglish-hyperdope-ci" fi if [[ -d "${CI_OUT_DIR}" ]]; then run_checked "ci_provision_ingglish.py (--tier 2)" "${PYTHON_BIN}" "${REPOS_ROOT}/ingglish-hyperdope-gematria/ingglish-aq-archive/scripts/ci_provision_ingglish.py" \ diff --git a/deploy/sync-vps-repos.sh b/deploy/sync-vps-repos.sh index 60caca6..af675c0 100755 --- a/deploy/sync-vps-repos.sh +++ b/deploy/sync-vps-repos.sh @@ -95,10 +95,10 @@ if [[ -f "${REPOS_ROOT}/workspace.toml" ]]; then export HYPERSTITIONSTUDIO_CONFIG="${REPOS_ROOT}/workspace.toml" fi -# Detect whether the CI artifact repository is cloned as ingglish-hyperdope-ci or hyperdope-ci-build -CI_REPO_DIR="ingglish-hyperdope-ci" -if [[ ! -d "${REPOS_ROOT}/${CI_REPO_DIR}" ]] && [[ -d "${REPOS_ROOT}/hyperdope-ci-build" ]]; then - CI_REPO_DIR="hyperdope-ci-build" +# Detect whether the CI artifact repository is cloned as hyperdope-ci-build (canonical) or ingglish-hyperdope-ci +CI_REPO_DIR="hyperdope-ci-build" +if [[ ! -d "${REPOS_ROOT}/${CI_REPO_DIR}" ]] && [[ -d "${REPOS_ROOT}/ingglish-hyperdope-ci" ]]; then + CI_REPO_DIR="ingglish-hyperdope-ci" fi REPOS=( @@ -248,8 +248,10 @@ for entry in "${REPOS[@]}"; do fi done -if [[ "${CI_REPO_DIR}" == "hyperdope-ci-build" ]] && [[ -d "${LIVE_REPOS}/hyperdope-ci-build" ]] && [[ ! -e "${LIVE_REPOS}/ingglish-hyperdope-ci" ]]; then +if [[ "${CI_REPO_DIR}" == "hyperdope-ci-build" ]] && [[ -d "${LIVE_REPOS}/hyperdope-ci-build" ]]; then ${LIVE_SUDO} ln -sfn "hyperdope-ci-build" "${LIVE_REPOS}/ingglish-hyperdope-ci" +elif [[ "${CI_REPO_DIR}" == "ingglish-hyperdope-ci" ]] && [[ -d "${LIVE_REPOS}/ingglish-hyperdope-ci" ]]; then + ${LIVE_SUDO} ln -sfn "ingglish-hyperdope-ci" "${LIVE_REPOS}/hyperdope-ci-build" fi # Create relative route symlinks inside LIVE_REPOS so both Caddy and standalone HTTP servers resolve all active routes @@ -287,7 +289,7 @@ ${LIVE_SUDO} ln -sfn "technocapital-singularity-zoology/encyclopedia" "${LIVE_RE ${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 "${CI_REPO_DIR}" "${LIVE_REPOS}/ci" ${LIVE_SUDO} ln -sfn "hyperstitionstudio-core/schemas" "${LIVE_REPOS}/schemas" echo "[4/5] Pre-compressing static HTML, JS, JSON, XML, Canvas, MD & CSS assets (< 5 MB) (.br / .gz) incrementally in parallel & enforcing single-layer (1x) compression..." diff --git a/src/hyperstitionstud_io/ci/deploy_scripts_sync.py b/src/hyperstitionstud_io/ci/deploy_scripts_sync.py index f361700..0fc979f 100644 --- a/src/hyperstitionstud_io/ci/deploy_scripts_sync.py +++ b/src/hyperstitionstud_io/ci/deploy_scripts_sync.py @@ -20,16 +20,11 @@ from pathlib import Path from typing import Any from hyperstitionstud_io import __version__ as CURRENT_VERSION -from hyperstitionstud_io.config import load_workspace_config +from hyperstitionstud_io.config import load_workspace_config, normalize_workspace_relpath def _norm_ws_path(p: Path | str, workspace_root: str | Path | None = None) -> str: - cfg = load_workspace_config(workspace_root=workspace_root) - ws_res = str(cfg.workspace_root.resolve()) - s = str(Path(p).resolve()) - if s.startswith(ws_res): - return "/workspace" + s[len(ws_res):] - return str(p) + return normalize_workspace_relpath(p, workspace_root=workspace_root) def prepare_and_verify_deploy_scripts( diff --git a/src/hyperstitionstud_io/ci/public_regression.py b/src/hyperstitionstud_io/ci/public_regression.py index 5632e94..501c3ca 100644 --- a/src/hyperstitionstud_io/ci/public_regression.py +++ b/src/hyperstitionstud_io/ci/public_regression.py @@ -60,9 +60,7 @@ def _resolve_web_route_to_disk(route: str, cfg: Any) -> Path: core = cfg.core_dir zoo = cfg.zoology_dir kg = cfg.knowledge_graph_dir - ci = cfg.paths.get("ci_build_dir") or (cfg.workspace_root / "hyperdope-ci-build") - if not ci.is_dir() and (cfg.workspace_root / "ingglish-hyperdope-ci").is_dir(): - ci = cfg.workspace_root / "ingglish-hyperdope-ci" + ci = cfg.ci_build_dir if route == "/": return core / "site" / "index.html" diff --git a/src/hyperstitionstud_io/config/__init__.py b/src/hyperstitionstud_io/config/__init__.py index 900396d..18c5b46 100644 --- a/src/hyperstitionstud_io/config/__init__.py +++ b/src/hyperstitionstud_io/config/__init__.py @@ -17,6 +17,8 @@ from dataclasses import dataclass, field from pathlib import Path from typing import Any +from hyperstitionstud_io import __version__ as _PKG_VERSION + CORE_REPO_ROOT = Path(__file__).resolve().parents[3] WORKSPACE_ROOT = CORE_REPO_ROOT.parent USER_WORKSPACE_TOML = Path.home() / ".config" / "hyperstitionstud.io" / "workspace.toml" @@ -173,7 +175,7 @@ def load_json_cached(path: str | Path, *, copy_result: bool = True) -> Any: @dataclass(frozen=True) class WorkspaceConfig: - schema_version: str = "1.2.0" + schema_version: str = _PKG_VERSION namespace_urn: str = "urn:io:hyperstitionstud" workspace_root: Path = WORKSPACE_ROOT paths: dict[str, Path] = field(default_factory=dict) @@ -288,7 +290,7 @@ def load_workspace_config( resolved_mounts = {str(_rebase_path(k, ws_root)): str(v) for k, v in raw_cit.items()} return WorkspaceConfig( - schema_version=str(raw.get("schema_version", "1.2.0")), + schema_version=str(raw.get("schema_version", _PKG_VERSION)), namespace_urn=str(raw.get("namespace_urn", "urn:io:hyperstitionstud")), workspace_root=ws_root, paths=resolved_paths, diff --git a/src/hyperstitionstud_io/mcp/tools.py b/src/hyperstitionstud_io/mcp/tools.py index 2aa1389..972ccdc 100644 --- a/src/hyperstitionstud_io/mcp/tools.py +++ b/src/hyperstitionstud_io/mcp/tools.py @@ -760,7 +760,7 @@ def call_mcp_tool(name: str, arguments: dict[str, Any]) -> dict[str, Any]: { "id": "ONBOARDING-INGGLISH-AQ", "category": "manuals", - "md_path": (cfg.paths.get("ci_repo_dir") or (cfg.workspace_root / "hyperdope-ci-build")) / "ONBOARDING-INGGLISH-AQ.md", + "md_path": cfg.ci_build_dir / "ONBOARDING-INGGLISH-AQ.md", "web_pdf_route": "/ci/ONBOARDING-INGGLISH-AQ.pdf", }, { diff --git a/src/hyperstitionstud_io/publishing/archive_rotator.py b/src/hyperstitionstud_io/publishing/archive_rotator.py index a09f364..c89be06 100644 --- a/src/hyperstitionstud_io/publishing/archive_rotator.py +++ b/src/hyperstitionstud_io/publishing/archive_rotator.py @@ -949,7 +949,7 @@ def audit_and_fix_multi_compressed_files( cfg.zoology_dir, cfg.knowledge_graph_dir, cfg.paths["gematria_js_dir"], - cfg.paths.get("ci_repo_dir", cfg.workspace_root / "hyperdope-ci-build"), + cfg.ci_build_dir, ] for ed in extra_dirs or []: ep = Path(ed) diff --git a/src/hyperstitionstud_io/publishing/closeups_sync.py b/src/hyperstitionstud_io/publishing/closeups_sync.py index 12ae555..d5124a0 100644 --- a/src/hyperstitionstud_io/publishing/closeups_sync.py +++ b/src/hyperstitionstud_io/publishing/closeups_sync.py @@ -348,7 +348,7 @@ def introspect_live_ui_elements(workspace_root: str | Path | None = None) -> dic core = cfg.core_dir kg = cfg.knowledge_graph_dir calc_dir = cfg.paths["gematria_js_dir"] - ci_dir = cfg.paths.get("ci_repo_dir") or (cfg.workspace_root / "hyperdope-ci-build") + ci_dir = cfg.ci_build_dir surfaces: dict[str, Path] = { "home": core / "site" / "index.html", diff --git a/src/hyperstitionstud_io/publishing/pdf_compiler.py b/src/hyperstitionstud_io/publishing/pdf_compiler.py index a067ad1..af71fdc 100644 --- a/src/hyperstitionstud_io/publishing/pdf_compiler.py +++ b/src/hyperstitionstud_io/publishing/pdf_compiler.py @@ -639,9 +639,7 @@ def discover_web_and_repo_pdf_pairs(workspace_root: str | Path | None = None) -> core = cfg.core_dir zoo = cfg.zoology_dir kg = cfg.knowledge_graph_dir - ci = cfg.paths.get("ci_build_dir") or (cfg.workspace_root / "hyperdope-ci-build") - if not ci.is_dir() and (cfg.workspace_root / "ingglish-hyperdope-ci").is_dir(): - ci = cfg.workspace_root / "ingglish-hyperdope-ci" + ci = cfg.ci_build_dir web_surfaces = [ core / "site" / "index.html", diff --git a/src/hyperstitionstud_io/publishing/readme_sync.py b/src/hyperstitionstud_io/publishing/readme_sync.py index 6cb601b..4462d96 100644 --- a/src/hyperstitionstud_io/publishing/readme_sync.py +++ b/src/hyperstitionstud_io/publishing/readme_sync.py @@ -34,7 +34,7 @@ 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 +from hyperstitionstud_io.config import load_workspace_config, resolve_workspace_repo_dir # noqa: E402 STATUS_START = "" STATUS_END = "" @@ -90,12 +90,7 @@ def _git_out(repo_dir: Path, args: list[str], strip_leading: bool = True) -> str def _resolve_repo_dir(ws_root: Path, repo_key: str) -> Path: - cand = ws_root / repo_key - if cand.is_dir(): - return cand - if repo_key == "hyperdope-ci-build" and (ws_root / "ingglish-hyperdope-ci").is_dir(): - return ws_root / "ingglish-hyperdope-ci" - return cand + return resolve_workspace_repo_dir(ws_root, repo_key) def _introspect_repo_commit_context(repo_dir: Path, version: str) -> dict[str, Any]: diff --git a/src/hyperstitionstud_io/version_sync.py b/src/hyperstitionstud_io/version_sync.py index 9dbfc6c..587427d 100755 --- a/src/hyperstitionstud_io/version_sync.py +++ b/src/hyperstitionstud_io/version_sync.py @@ -173,7 +173,7 @@ def collect_workspace_change_signals(ws_root: Path | None = None) -> dict[str, A cfg.zoology_dir, kg, cfg.paths["gematria_js_dir"], - cfg.paths.get("ci_repo_dir", cfg.workspace_root / "hyperdope-ci-build"), + cfg.ci_build_dir, ] repo_diff_summary: dict[str, dict[str, int]] = {} total_dirty = 0 @@ -491,12 +491,14 @@ def sync_workspace_version(target_version: str, check_only: bool = False, ws_roo 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 = 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: + if check_only: + mismatched_files.append(str(ws_toml)) + else: ws_toml.write_text(upd_ws, encoding="utf-8") modified_files.append(str(ws_toml)) diff --git a/tests/test_core_suite.py b/tests/test_core_suite.py index 1c82f4c..0e7b5db 100644 --- a/tests/test_core_suite.py +++ b/tests/test_core_suite.py @@ -106,7 +106,7 @@ def test_offline_urn_namespaces_and_no_external_https_fonts() -> None: cfg.zoology_dir, cfg.knowledge_graph_dir, cfg.paths["gematria_js_dir"], - cfg.paths.get("ci_repo_dir", cfg.workspace_root / "hyperdope-ci-build"), + cfg.ci_build_dir, ): if not rdir.is_dir(): continue @@ -212,8 +212,27 @@ def test_local_config_citation_resolution_and_proposals() -> None: def test_doctor_all_checks_pass() -> None: + from hyperstitionstud_io import __version__ as cur_ver + from hyperstitionstud_io.config import ( + normalize_workspace_relpath, + resolve_workspace_repo_dir, + ) + diag = run_diagnostics() assert diag["all_checks_passed"] is True + assert diag["schema_version"] == cur_ver + + cfg = load_workspace_config() + assert cfg.schema_version == cur_ver + assert cfg.ci_build_dir.is_dir() + assert ( + resolve_workspace_repo_dir(cfg.workspace_root, "hyperdope-ci-build") + == resolve_workspace_repo_dir(cfg.workspace_root, "ingglish-hyperdope-ci") + ) + assert ( + normalize_workspace_relpath(cfg.core_dir / "deploy" / "sync-vps-repos.sh", workspace_root=cfg.workspace_root) + == "/workspace/hyperstitionstudio-core/deploy/sync-vps-repos.sh" + ) def test_ipld_quant_and_mcp_server() -> None: @@ -1457,8 +1476,12 @@ def test_ipld_quant_and_mcp_server() -> None: plan_audit = verify_plan_specifications(workspace_root=cfg.workspace_root) assert plan_audit["ok"] is True, f"Plan specification audit failed: {plan_audit['errors']}" - assert plan_audit["total_plans_checked"] >= 6 + assert plan_audit["total_plans_checked"] == plan_audit["active_plans_checked"] + plan_audit["piecewise_plans_checked"] + assert plan_audit["total_plans_checked"] > 0 assert len(plan_audit["missing_pdfs"]) == 0 + assert len(plan_audit["missing_ledger_entries"]) == 0 + assert len(plan_audit["metadata_errors"]) == 0 + assert len(plan_audit["host_path_errors"]) == 0 # Write cached internal test baseline (.cache/internal-test-baseline-latest.json) for hs-public-smoke from hyperstitionstud_io.ci.public_regression import write_internal_test_baseline_cache