feat(portability): eliminate hardcoded /workspace paths, resolve relative volume Markdown paths, add VPS and Git Operator plans, and update README (v1.0.0)
This commit is contained in:
1 parent
b4ca2ceb1e
commit
d4b9eda541
10 files changed
+975
-56
No files matched your search
@@ -30,7 +30,9 @@ import sys
|
||||
from pathlib import Path
|
||||
from typing import Any
|
||||
|
||||
_CORE_SRC = Path("/workspace/hyperstitionstudio-core/src")
|
||||
KG_REPO_ROOT = Path(__file__).resolve().parent.parent
|
||||
WORKSPACE_ROOT = KG_REPO_ROOT.parent
|
||||
_CORE_SRC = WORKSPACE_ROOT / "hyperstitionstudio-core" / "src"
|
||||
if _CORE_SRC.is_dir() and str(_CORE_SRC) not in sys.path:
|
||||
sys.path.insert(0, str(_CORE_SRC))
|
||||
|
||||
@@ -38,16 +40,17 @@ try:
|
||||
from hyperstitionstud_io.ciphers import compute_aq as _hs_compute_aq
|
||||
from hyperstitionstud_io.glossary import ReadOnlyIsolationGuard
|
||||
from hyperstitionstud_io.graph import URN_GRAPH_NS, URN_SCHEMA_GRAPH, make_entity_urn
|
||||
from hyperstitionstud_io.publishing.fonts import load_pillow_font
|
||||
except ImportError:
|
||||
_hs_compute_aq = None
|
||||
ReadOnlyIsolationGuard = None
|
||||
load_pillow_font = None
|
||||
URN_GRAPH_NS = "urn:io:hyperstitionstud:ns:kg:1.0"
|
||||
URN_SCHEMA_GRAPH = "urn:io:hyperstitionstud:schema:v1:encyclopedia-graph"
|
||||
def make_entity_urn(domain: str, entity_type: str, entity_id: str | int) -> str:
|
||||
return f"urn:io:hyperstitionstud:{domain}:{entity_type}:{entity_id}"
|
||||
|
||||
KG_REPO_ROOT = Path("/workspace/encyclopedia-knowledge-graph")
|
||||
UPSTREAM_REPO_DEFAULT = Path("/workspace/technocapital-singularity-zoology")
|
||||
UPSTREAM_REPO_DEFAULT = WORKSPACE_ROOT / "technocapital-singularity-zoology"
|
||||
HOST_UPSTREAM_ROOT = "/home/m00t/hermes/workspace/technocapital-singularity-zoology"
|
||||
|
||||
FLEX_13_COORDS = {292, 256, 211, 193, 183, 153, 137, 136, 133, 125, 96, 95, 91, 81}
|
||||
@@ -228,7 +231,8 @@ def build_graph(upstream_repo: Path = UPSTREAM_REPO_DEFAULT) -> dict[str, Any]:
|
||||
)
|
||||
add_edge(nid, f"div:{div_id}", "IN_DIVISION", label="in division", weight=2.0, color="#4B5563")
|
||||
|
||||
md_p = Path(vol["md_path"])
|
||||
rel_md = upstream_repo / "encyclopedia" / div_id / f"{slug}.md"
|
||||
md_p = rel_md if rel_md.is_file() else Path(vol["md_path"])
|
||||
if md_p.exists():
|
||||
for line in md_p.read_text(encoding="utf-8").splitlines():
|
||||
if line.startswith("### "):
|
||||
@@ -864,13 +868,19 @@ def export_obsidian_canvas(graph_data: dict[str, Any], out_path: Path) -> None:
|
||||
def render_atlas_pngs(graph_data: dict[str, Any], out_dir: Path) -> list[str]:
|
||||
from PIL import Image, ImageDraw, ImageFont
|
||||
|
||||
font_b_path = "/usr/share/fonts/truetype/dejavu/DejaVuSans-Bold.ttf"
|
||||
font_r_path = "/usr/share/fonts/truetype/dejavu/DejaVuSans.ttf"
|
||||
font_m_path = "/usr/share/fonts/truetype/dejavu/DejaVuSansMono-Bold.ttf"
|
||||
f_title = ImageFont.truetype(font_b_path, 22)
|
||||
f_sub = ImageFont.truetype(font_r_path, 13)
|
||||
f_lbl_b = ImageFont.truetype(font_b_path, 11)
|
||||
f_lbl_s = ImageFont.truetype(font_m_path, 9)
|
||||
if load_pillow_font is not None:
|
||||
f_title = load_pillow_font("DejaVuSans-Bold.ttf", 22)
|
||||
f_sub = load_pillow_font("DejaVuSans.ttf", 13)
|
||||
f_lbl_b = load_pillow_font("DejaVuSans-Bold.ttf", 11)
|
||||
f_lbl_s = load_pillow_font("DejaVuSansMono-Bold.ttf", 9)
|
||||
else:
|
||||
font_b_path = "/usr/share/fonts/truetype/dejavu/DejaVuSans-Bold.ttf"
|
||||
font_r_path = "/usr/share/fonts/truetype/dejavu/DejaVuSans.ttf"
|
||||
font_m_path = "/usr/share/fonts/truetype/dejavu/DejaVuSansMono-Bold.ttf"
|
||||
f_title = ImageFont.truetype(font_b_path, 22)
|
||||
f_sub = ImageFont.truetype(font_r_path, 13)
|
||||
f_lbl_b = ImageFont.truetype(font_b_path, 11)
|
||||
f_lbl_s = ImageFont.truetype(font_m_path, 9)
|
||||
|
||||
modes = [
|
||||
(
|
||||
@@ -1012,7 +1022,7 @@ def verify_published_artifacts(kg_dir: Path, upstream_repo: Path, pre_gl_sha: st
|
||||
gml_p = kg_dir / "encyclopedia-graph.graphml"
|
||||
gexf_p = kg_dir / "encyclopedia-graph.gexf"
|
||||
canv_p = kg_dir / "encyclopedia.canvas"
|
||||
html_p = KG_REPO_ROOT / "index.html"
|
||||
html_p = (kg_dir / "index.html") if (kg_dir / "index.html").exists() else (KG_REPO_ROOT / "index.html")
|
||||
|
||||
j_obj = json.loads(json_p.read_text(encoding="utf-8"))
|
||||
c_obj = json.loads(canv_p.read_text(encoding="utf-8"))
|
||||
|
||||
Reference in new issue
Block a user