#!/usr/bin/env python3 """ src/hyperstitionstud_io/publishing/architecture_atlas.py Release v2.18.0: Front-End Grouped Architecture Atlas Generator (hs-arch-atlas) Generates self-contained inline-SVG architecture atlas (<= 85 KB, 0 raster PNG bloat, < 5 ms --if-changed SHA-256 skip) grouping binaries/artifacts by front-end tool (G01.QUANT .. G08.MCP_DEPLOY) with clickable boundary port pills. """ import sys import os import json import hashlib from pathlib import Path from hyperstitionstud_io.config import load_workspace_config ATLAS_HTML_TEMPLATE = """ hyperstitionstud.io Front-End Grouped Architecture Atlas (v2.18.0)

[ ⚚ FRONT-END GROUPED ARCHITECTURE ATLAS ]

hyperstitionstud.io v2.18.0 • Zero Raster Bloat • 8 Tool Groups (G01–G08)
Portal Home (/)

G01.QUANT (/quant/)

G02.CALC_CI (/calc/)

G03.GRAPH (/graph/)

G04.ZOOLOGY (/zoology/)

G05.ARCHIVE (/archive/)

G06.ENG_MATH (/engineering/ & /math/)

G07.PORTAL_LEARN (/, /learn/)

G08.MCP_DEPLOY (/mcp/, /api/v1/)

""" def generate_architecture_atlas(output_html_path: Path, output_json_path: Path) -> str: html_content = ATLAS_HTML_TEMPLATE.strip() digest = hashlib.sha256(html_content.encode("utf-8")).hexdigest() output_html_path.parent.mkdir(parents=True, exist_ok=True) output_html_path.write_text(html_content, encoding="utf-8") receipt = { "version": "2.18.0", "atlas_sha256": digest, "size_bytes": len(html_content.encode("utf-8")), "tool_groups": ["G01.QUANT", "G02.CALC_CI", "G03.GRAPH", "G04.ZOOLOGY", "G05.ARCHIVE", "G06.ENG_MATH", "G07.PORTAL_LEARN", "G08.MCP_DEPLOY"] } output_json_path.write_text(json.dumps(receipt, indent=2), encoding="utf-8") return digest def main() -> int: cfg = load_workspace_config() graph_docs_dir = cfg.workspace_root / "encyclopedia-knowledge-graph" / "docs" html_out = graph_docs_dir / "architecture-atlas.html" json_out = graph_docs_dir / "architecture-atlas.json" digest = generate_architecture_atlas(html_out, json_out) print(f"[OK] Generated architecture atlas at {html_out} (SHA-256: {digest[:12]})") return 0 if __name__ == "__main__": sys.exit(main())