= 1
assert "STEALTH BASALT" in dm_body["data"]["archived_plans"][0]["markdown"] or "ReportLab" in dm_body["data"]["archived_plans"][0]["markdown"]
gs_code, _, gs_body = dispatch_rest_v1("GET", "/api/v1/tools/hs_evaluate_guile_scheme_z_calculus?lang=rust&expression=aq_base36(%22LEMUR%22)")
assert gs_code == 200 and gs_body["data"]["formatted"] == "114"
cat_st_code, _, cat_st_body = dispatch_rest_v1("GET", "/api/v1/tools/hs_query_workspace_catalog_and_release_state?fts_query=lemur®istry=all&aq_int=137&symbol=NVDA")
assert cat_st_code == 200 and "version_bump_heuristics" in cat_st_body["data"]
assert "registry_manifests" in cat_st_body["data"] and len(cat_st_body["data"]["registry_manifests"]) >= 1
assert "coordinate_join" in cat_st_body["data"] and cat_st_body["data"]["coordinate_join"]["coordinate_aq"] == 137
assert "timeseries_bars" in cat_st_body["data"]
# Verify HTTP ETag & If-None-Match (304 Not Modified) from PLAN-SQLITE-META-REST-ENDPOINTS-ETAG-AND-VPS-SYNC
from hyperstitionstud_io.mcp.rest import compute_response_etag, matches_if_none_match
st_etag = compute_response_etag(st_body)
assert st_etag.startswith('"') and st_etag.endswith('"')
assert matches_if_none_match(st_etag, st_etag) is True
assert matches_if_none_match(f"W/{st_etag}", st_etag) is True
nm_code, _, nm_body = dispatch_rest_v1("GET", "/api/v1/status", if_none_match=st_etag)
assert nm_code == 304 and nm_body == ""
res_eng_code, _, res_eng_body = dispatch_rest_v1("GET", "/api/v1/resources/engineering-manifest")
assert res_eng_code == 200 and res_eng_body["data"]["$id"] == "urn:io:hyperstitionstud:engineering-manifest"
# Verify PLAN-SUBTLE-CYBERNETIC-MATRIX-CODE-RAIN-BACKGROUND & PLAN-CYBERNETIC-AND-OCCULT-MICRO-SIGIL-UI-ACCENTS
matrix_woff2_p = cfg.core_dir / "site" / "assets" / "matrix-font.woff2"
coderain_js_p = cfg.core_dir / "site" / "assets" / "hs-matrix-coderain.js"
assert matrix_woff2_p.is_file() and matrix_woff2_p.stat().st_size > 4000
assert coderain_js_p.is_file()
assert "@font-face" in g3_css and "matrix-font.woff2" in g3_css
assert ".hs-sigil-seal" in g3_css and ".hs-plate-g3.plate-lock-gold::after" in g3_css
for surf_p in (
cfg.core_dir / "site" / "index.html",
cfg.core_dir / "site" / "learn" / "index.html",
cfg.core_dir / "site" / "quant" / "index.html",
cfg.core_dir / "site" / "donate" / "index.html",
cfg.core_dir / "site" / "engineering" / "index.html",
cfg.core_dir / "site" / "math" / "index.html",
):
surf_txt = surf_p.read_text(encoding="utf-8")
assert "hs-matrix-coderain.js?v=" in surf_txt, f"Missing hs-matrix-coderain.js in {surf_p}"
assert "hs-sigil-seal" in surf_txt, f"Missing hs-sigil-seal in {surf_p}"
assert "hs-sigil-colophon" in surf_txt, f"Missing hs-sigil-colophon in {surf_p}"
node_rain_test = subprocess.run(
[
"node",
"-e",
f"const CR = require({json.dumps(str(coderain_js_p))});"
"if (CR.MATRIX_CHARS.length !== 66) process.exit(1);"
"if (CR.SIGIL_GLINTS.length < 8) process.exit(2);"
"const sub = CR.PROFILES.subtle;"
"if (sub.frameIntervalMs !== 80 || sub.colPitchPx !== 24 || sub.canvasOpacity !== 0.45) process.exit(3);"
"const aCenter = CR.computeColumnAlpha(500, 1000, sub, false);"
"const aOuter = CR.computeColumnAlpha(50, 1000, sub, false);"
"if (!(aCenter < aOuter && aCenter <= 0.09 && aOuter >= 0.20)) process.exit(4);",
],
capture_output=True,
text=True,
check=False,
)
assert node_rain_test.returncode == 0, f"Node CodeRain check failed ({node_rain_test.returncode}): {node_rain_test.stderr}"
# Verify PLAN-AUTOMATED-PER-COMMIT-REPO-ROOT-README-SYNCHRONIZATION-FOR-GITEA
# and PLAN-README-AND-GIT-COMMIT-MESSAGE-VERSION-PARITY-FIX
from hyperstitionstud_io import __version__ as cur_v_str
from hyperstitionstud_io.publishing.readme_sync import (
install_git_pre_commit_hooks,
sync_all_repo_readmes,
)
rm_chk = sync_all_repo_readmes(ws_root=cfg.workspace_root, check_only=True)
assert rm_chk["all_in_sync"] is True and len(rm_chk["checked_readmes"]) == 6, f"README drift: {rm_chk}"
for rm_rel in rm_chk["checked_readmes"]:
rm_p = cfg.workspace_root / Path(rm_rel).relative_to("/workspace")
rm_txt = rm_p.read_text(encoding="utf-8")
assert re.search(r"(?.*?", home_txt, flags=re.S)
assert hdr_match is not None and len(re.findall(r"
]+href="([^"]+)"', home_txt)
assert len(home_hrefs) == len(set(home_hrefs)), f"Duplicate href links on homepage: {home_hrefs}"
quant_html_txt = (cfg.core_dir / "site" / "quant" / "index.html").read_text(encoding="utf-8")
assert "24 Watchlist Instruments" in quant_html_txt
for q_ctrl in ('id="timeWindowPills"', 'id="tickerQuickFilter"', 'id="heatmapPaginationBar"', 'id="wireTapeFilterInput"'):
assert q_ctrl in quant_html_txt, f"Missing Strategy 1A/2A control {q_ctrl} in site/quant/index.html"
kg_html_txt = (cfg.knowledge_graph_dir / "index.html").read_text(encoding="utf-8")
assert 'value="syzygy"' in kg_html_txt and 'id="minDegreeFilter"' in kg_html_txt
assert 'id="filterBookmarkInput"' in (cfg.core_dir / "site" / "learn" / "index.html").read_text(encoding="utf-8")
assert 'id="engCliFilterInput"' in (cfg.core_dir / "site" / "engineering" / "index.html").read_text(encoding="utf-8")
assert 'screen") === "dose-d3"' in (cfg.core_dir / "site" / "quant" / "quant-app.js").read_text(encoding="utf-8")
assert 'uParams.get("repl") === "trace"' in (cfg.core_dir / "site" / "assets" / "hs-guile-scheme-repl.js").read_text(encoding="utf-8")
assert 'id="live-smoke-probe"' in (cfg.core_dir / "site" / "engineering" / "mcp-chatbot-rest-and-ipld" / "index.html").read_text(encoding="utf-8")
# Verify Plan #53 (Strategies 1A, 2B, 3A, 4A, 5A, 6A, 7A): security.py, load_json_cached(), font lru_cache
from hyperstitionstud_io.config import load_json_cached
from hyperstitionstud_io.publishing.closeups_sync import _extract_js_ui_signature
from hyperstitionstud_io.publishing.fonts import load_pillow_font
from hyperstitionstud_io.security import SecurityBoundaryError, validate_safe_url
assert load_pillow_font("DejaVuSansMono.ttf", 12) is load_pillow_font("DejaVuSansMono.ttf", 12)
assert validate_safe_url("https://fred.stlouisfed.org/graph/fredgraph.csv") == "https://fred.stlouisfed.org/graph/fredgraph.csv"
assert validate_safe_url("http://127.0.0.1:18090/status", allow_http_localhost=True) == "http://127.0.0.1:18090/status"
for bad_url in ("file:///etc/passwd", "http://169.254.169.254/latest/meta-data/", "http://example.com/test"):
blocked_u = False
try:
validate_safe_url(bad_url, allow_http_localhost=False)
except SecurityBoundaryError:
blocked_u = True
assert blocked_u, f"Expected SecurityBoundaryError for {bad_url}"
tmp_json_f = tmp_path / "cached-test.json"
tmp_json_f.write_text('{"k": 1}', encoding="utf-8")
assert load_json_cached(tmp_json_f)["k"] == 1
tmp_json_f.write_text('{"k": 22}', encoding="utf-8")
assert load_json_cached(tmp_json_f)["k"] == 22
# Verify Plan #51 (Strategies 1B, 2A, 3A, 4A): /quant/ guided tour voice narration, #lensSelect UI indicator & JS closeup introspection
assert 'id="tutUiElementIndicator"' in quant_html_txt
quant_tut_js_p = cfg.core_dir / "site" / "quant" / "quant-tutorials.js"
quant_tut_txt = quant_tut_js_p.read_text(encoding="utf-8")
js_sig_1 = _extract_js_ui_signature(quant_tut_txt)
js_sig_2 = _extract_js_ui_signature(quant_tut_txt + '\n// document.getElementById("syntheticTestMutatedId")')
assert js_sig_1["js_ui_sha256"] != js_sig_2["js_ui_sha256"], "Mutating JS DOM control must change js_ui_sha256 fingerprint"
assert js_sig_1["has_lens_select_highlight"] is True and js_sig_1["speech_text_count"] == 25
node_quant_tut_test = subprocess.run(
[
"node",
"-e",
f"const QT = require({json.dumps(str(quant_tut_js_p))});"
"if (QT.episodes.length !== 5) process.exit(1);"
"let totalScenes = 0;"
"QT.episodes.forEach((ep) => {"
" ep.keyframes.forEach((kf) => {"
" totalScenes++;"
" if (!Array.isArray(kf.uiTargets) || kf.uiTargets.length === 0) process.exit(2);"
" if (!kf.uiElementLabel || !kf.speechText) process.exit(3);"
" });"
"});"
"if (totalScenes !== 25) process.exit(4);"
"const ep04 = QT.episodes[3];"
"if (!ep04.keyframes.every((kf) => kf.uiTargets.includes('lensSelect') && kf.uiTargets.includes('lensProjectionCard'))) process.exit(5);",
],
capture_output=True,
text=True,
check=False,
)
assert node_quant_tut_test.returncode == 0, f"Node QuantTutorials check failed ({node_quant_tut_test.returncode}): {node_quant_tut_test.stderr}"
# Verify Plan #57 (Strategies 1A, 2A, 3A): Zero-Git-Audio deploy-time WAV voice compiler (quant_voice.py) & 0 audio files in Git
from hyperstitionstud_io.publishing.quant_voice import build_quant_tour_voice_assets
tmp_voice_dir = tmp_path / "quant_audio"
v_res = build_quant_tour_voice_assets(out_dir=tmp_voice_dir, workspace_root=cfg.workspace_root)
assert v_res["ok"] is True and v_res["clip_count"] == 25
assert (tmp_voice_dir / "ep01-s1.wav").is_file() and (tmp_voice_dir / "ep01-s1.wav").read_bytes()[:4] == b"RIFF"
assert (tmp_voice_dir / "ep04-s1.wav").is_file() and (tmp_voice_dir / "voice-manifest.json").is_file()
git_gitignore = (cfg.core_dir / ".gitignore").read_text(encoding="utf-8")
assert "site/quant/audio/" in git_gitignore, "site/quant/audio/ must be in .gitignore so 0 audio files enter Git"
assert "__hsActiveUtterance" in quant_tut_txt and "playDeployTimeWavOrFormant" in quant_tut_txt
# Verify Plan #56: Fedora 41 OpenRouter Exegesis Synthesizer, Pre-Solved 333/666/777 Equation Engine & Push Worker
import importlib.util
synth_script_p = cfg.archive_dir / "ingglish-aq-archive" / "scripts" / "synthesize_news_dossier_openrouter.py"
assert synth_script_p.is_file()
spec_s = importlib.util.spec_from_file_location("synthesize_news_dossier_openrouter", synth_script_p)
assert spec_s is not None and spec_s.loader is not None
mod_s = importlib.util.module_from_spec(spec_s)
spec_s.loader.exec_module(mod_s)
sample_harvest = {
"temporal_metadata": {"target_date_utc": "2026-12-01"},
"counts": {"total_headlines": 2, "cross_story_collision_classes": 1, "isometric_locks": 1},
"headlines": [
{"headline": "Nvidia unveils next-generation Blackwell wafer cluster", "eng_aq": 812, "ing_aq": 834},
{"headline": "Spanish election coalition talks continue in Madrid", "eng_aq": 745, "ing_aq": 761},
],
"entities": [
{"eng": "Nvidia", "ing": "envideea", "eng_aq": 115, "ing_aq": 137, "story": "Silicon Wire"},
{"eng": "Spanish", "ing": "spanish", "eng_aq": 149, "ing_aq": 149, "story": "Europe Wire"},
],
"isometric_locks": [{"eng": "Spanish", "ing": "spanish", "eng_aq": 149, "ing_aq": 149}],
"cross_story_collisions": {},
}
solved_30 = mod_s.solve_cluster_equations_333_666_777(sample_harvest)
assert len(solved_30["eq_333"]) == 10 and len(solved_30["eq_666"]) == 10 and len(solved_30["eq_777"]) == 10
tmp_arc_d = tmp_path / "test_exegesis_arc"
tmp_arc_d.mkdir(parents=True, exist_ok=True)
(tmp_arc_d / "00-index-and-methodology.md").write_text("# Index\n\n### Category D:\n", encoding="utf-8")
tmp_harv_f = tmp_path / "sample-harvest.json"
tmp_harv_f.write_text(json.dumps(sample_harvest), encoding="utf-8")
syn_out = mod_s.synthesize_news_dossier(
harvest_path=tmp_harv_f,
archive_dir=tmp_arc_d,
api_key="",
allow_deterministic_fallback=True,
)
assert syn_out["ok"] is True and syn_out["equations_verified_count"] == 30 and syn_out["aq_mismatches"] == 0
assert Path(syn_out["dossier_path"]).is_file()
for pkg_f in (
cfg.archive_dir / "packaging" / "build-fedora41-rpm.sh",
cfg.archive_dir / "packaging" / "bundle" / "scripts" / "run_exegesis_and_push_fedora41.sh",
cfg.archive_dir / "packaging" / "rpm" / "ingglish-isopsephic-exegesis.spec",
cfg.archive_dir / "packaging" / "rpm" / "ingglish-exegesis.sysconfig",
):
assert pkg_f.is_file(), f"Missing Fedora 41 packaging file {pkg_f}"
assert "/dev/null" not in pkg_f.read_text(encoding="utf-8")
# Verify Plan #58: Pre-Commit Preparation & Gates D1-D8 for push-all-to-git-libre-audio.sh & deploy/sync-vps-repos.sh
from hyperstitionstud_io.ci.deploy_scripts_sync import prepare_and_verify_deploy_scripts
dep_sync = prepare_and_verify_deploy_scripts(workspace_root=cfg.workspace_root, check_only=False)
assert dep_sync["ok"] is True, f"Deploy scripts sync failed: {dep_sync}"
assert all(dep_sync["gates"].values()), f"Deploy scripts gates failed: {dep_sync['gates']}"
dep_chk = prepare_and_verify_deploy_scripts(workspace_root=cfg.workspace_root, check_only=True)
assert dep_chk["ok"] is True, f"Deploy scripts check_only failed: {dep_chk}"
assert (cfg.core_dir / "deploy" / "push-all-to-git-libre-audio.sh").read_text(encoding="utf-8") == (
cfg.workspace_root / "push-all-to-git-libre-audio.sh"
).read_text(encoding="utf-8")
# Verify Plan #60: /calc/ (haiperdohpjematreeah) Homepage Group 3 UI Parity, Zero "Cypher Calculator" & hyperdope-ci-build Patch Integration
calc_dir = cfg.paths["gematria_js_dir"]
calc_html = (calc_dir / "index.html").read_text(encoding="utf-8")
assert "haiperdohpjematreeah" in calc_html
assert 'id="hsCalcHeader"' in calc_html and 'class="btn-donate-pill"' in calc_html
assert "hs-group3-basalt-chamfer.css" in calc_html
for chk_p in (
calc_dir / "index.html",
calc_dir / "config.default.js",
calc_dir / "manifest.json",
calc_dir / "docs" / "ONBOARDING-INGGLISH-AQ.md",
(cfg.paths.get("ci_repo_dir") or (cfg.workspace_root / "hyperdope-ci-build")) / "config.default.js",
):
if chk_p.is_file():
assert re.search(r"(?i)cypher\s*calculator", chk_p.read_text(encoding="utf-8")) is None, f"Forbidden Cypher Calculator branding in {chk_p}"
ci_dir = cfg.paths.get("ci_repo_dir") or (cfg.workspace_root / "hyperdope-ci-build")
assert (ci_dir / "integrate-upstream-and-ui.sh").is_file()
assert (ci_dir / "patches" / "0001-feat-calc-ingglish-priority-toggle.patch").is_file()
assert (ci_dir / "patches" / "0002-feat-ui-group3-homepage-parity-and-haiperdohpjematreeah-branding.patch").is_file()
# Verify Plan #59 (Strategies 1A, 2A, 3A): normalize_speech_prosody(), master_wav_broadcast_warmth(), and WebAudio BiquadFilterNode EQ
from hyperstitionstud_io.publishing.quant_voice import normalize_speech_prosody
norm_p = normalize_speech_prosody("Inspecting NVDA and ASML with CIDv1 and 81 bps.")
assert "Nvidia" in norm_p and "A S M L" in norm_p and "C I D version 1" in norm_p and "basis points" in norm_p
assert "createBiquadFilter" in (cfg.core_dir / "site" / "quant" / "quant-tutorials.js").read_text(encoding="utf-8")
# Verify Plan #61: Homepage UI Quadrant Closeup Bounding-Box Containment & Geometry Audit (Invariants B1-B3)
closeups_man_p = cfg.core_dir / "site" / "assets" / "closeups" / "ui-elements-manifest.json"
assert closeups_man_p.is_file()
closeups_man_obj = json.loads(closeups_man_p.read_text(encoding="utf-8"))
geom_audit = closeups_man_obj.get("geometry_audit") or {}
assert geom_audit.get("all_clean") is True, f"Closeup geometry audit not clean: {geom_audit}"
assert geom_audit.get("breach_count") == 0
assert geom_audit.get("border_crossing_count") == 0
assert geom_audit.get("text_overlap_count") == 0
# Verify Plan #63 & Plan #65: Homepage Navigation Immutability + Intra-Page & Cross-Page UI Style/Font/Background Parity (Gates S1-S3)
from hyperstitionstud_io.ci.public_regression import verify_ui_style_and_navigation_consistency
style_audit = verify_ui_style_and_navigation_consistency(workspace_root=cfg.workspace_root)
assert style_audit["ok"] is True, f"UI style and navigation consistency audit failed: {style_audit}"
assert all(style_audit["gates"].values()), f"Style gates failed: {style_audit['gates']}"
# Verify PLAN-INTROSPECTIVE-PROTECT-SYSTEM-STRICT-EROFS-TEST-HARNESS
from hyperstitionstud_io.ci.erofs_harness import run_introspective_erofs_suite
erofs_res = run_introspective_erofs_suite()
assert erofs_res["verified"] is True
assert erofs_res["mcp_tools_swept"] >= 15
# 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
base_cache_p = write_internal_test_baseline_cache(erofs_audit_receipt=erofs_res)
assert base_cache_p.is_file()
finally:
if prev_tel_env is None:
os.environ.pop("HYPERSTITION_TELEMETRY_DB_PATH", None)
else:
os.environ["HYPERSTITION_TELEMETRY_DB_PATH"] = prev_tel_env
if __name__ == "__main__":
test_offline_urn_namespaces_and_no_external_https_fonts()
print("[PASS] test_offline_urn_namespaces_and_no_external_https_fonts")
test_ciphers_and_bilingual_ledger_parity()
print("[PASS] test_ciphers_and_bilingual_ledger_parity")
test_offline_phonetics_fallback_zero_workdir()
print("[PASS] test_offline_phonetics_fallback_zero_workdir")
test_read_only_isolation_guard()
print("[PASS] test_read_only_isolation_guard")
test_local_config_citation_resolution_and_proposals()
print("[PASS] test_local_config_citation_resolution_and_proposals")
test_doctor_all_checks_pass()
print("[PASS] test_doctor_all_checks_pass")
test_ipld_quant_and_mcp_server()
print("[PASS] test_ipld_quant_and_mcp_server")
print("ALL 7 TEST SUITES PASSED.")