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:
Hermes Agent committed 2026-11-29 21:19:15 +00:00
1 parent b4ca2ceb1e
commit d4b9eda541
10 files changed
+975 -56

No files matched your search

@@ -0,0 +1,186 @@
# Git Operator Release & Public HTTP Repository Update Plan: Guaranteeing Zero-Error New-User Onboarding (`v1.0.0`)
- **Document ID:** `PLAN-GIT-OPERATOR-PUBLIC-HTTP-RELEASE-AND-ONBOARDING` (`v1.0.0`)
- **Target Audience:** Git Operator maintaining the public HTTP repositories (`https://git.libre.audio/seasharp/*` and/or GitHub mirrors)
- **End-User Guarantee:** A completely new user cloning the public HTTP repositories into **any** arbitrary local parent directory (e.g., `~/hyperstition-workspace/` on Linux or macOS, **not** `/workspace/`) can follow `README.md` and `OPERATORS-MANUAL-ENCYCLOPEDIA-KNOWLEDGE-GRAPH.md` from top to bottom with **zero errors**.
- **Glossary & Encyclopedia Isolation Invariant:** Verified (`0` changes to `taxonomy/glossary-registry.json` or `encyclopedia/encyclopedia-manifest.json`).
---
## 1. Executive Audit: Current Repository & Remote State vs. Public HTTP Readiness
An audit of the 5 sibling repositories in `/workspace` reveals two categories of blockers that a Git Operator must resolve before updating the public HTTP remotes:
### 1.1 Current Git Working-Tree & Remote Status Across `/workspace`
| Repository | Current Branch & Tag | Configured Remote (`git remote -v`) | Working-Tree State & Blocker to Resolve |
| :--- | :--- | :--- | :--- |
| **`hyperstitionstudio-core`** | `main` (`v1.2.0`, `f8235a2`) | *None configured yet* | Clean working tree; needs remote `origin` added and pushed first. |
| **`ingglish-hyperdope-gematria`** | `main` | `origin`: `ssh://git@git.libre.audio:2222/seasharp/ingglish-hyperdope-gematria.git` | **Has uncommitted modified & untracked files** (`48..70-dossier-*.md`, `news-aq-harvest-latest.json`, `build_wire_report_pdf.py`). If not committed & pushed, a new user cloning from HTTP will miss Dossiers `48–70`! |
| **`technocapital-singularity-zoology`** | `main` (`v1.7.0`, `1f2c4f4`) | *None configured yet* | Clean working tree (`8` JSON registries tracked); needs remote `origin` added and pushed. |
| **`encyclopedia-knowledge-graph`** | `main` (`v1.0.0`, `b4ca2ce`) | *None configured yet* | Clean working tree (`388` nodes, `1,282` edges); needs remote `origin` added and pushed. |
| **`hyperdope-ci-build`** | `feat/ingglish-aq-corpus` (`ahead 43`) | `origin`: `ssh://git@git.libre.audio:2222/seasharp/ingglish-hyperdope-ci.git` | Clean working tree (`43` local commits ahead of `origin`); needs `git push origin feat/ingglish-aq-corpus`. |
### 1.2 Four Hidden "/workspace" Traps That Would Break a Brand-New User Outside `/workspace`
Even if all 5 repositories are pushed as-is today, a new user who clones them into `~/projects/hyperstition/` (instead of `/workspace/`) and follows the docs will hit **four deterministic errors** unless the Git Operator applies the Phase 1 portability hardening below before pushing:
1. **Trap 1 — Hardcoded `/workspace/...` Default Paths in Python CLI Scripts:**
- `build_encyclopedia_knowledge_graph.py` currently sets `KG_REPO_ROOT = Path("/workspace/encyclopedia-knowledge-graph")` and `UPSTREAM_REPO_DEFAULT = Path("/workspace/technocapital-singularity-zoology")`.
- `hyperstitionstud_io/config/__init__.py` defaults to `Path("/workspace/...")` when `/workspace/workspace.toml` does not exist.
- **Effect on New User:** Running `python3 scripts/build_encyclopedia_knowledge_graph.py` or `hs-doctor` inside `~/projects/hyperstition/encyclopedia-knowledge-graph` raises `FileNotFoundError: '/workspace/technocapital-singularity-zoology/...'`.
- **Fix:** Derive `REPO_ROOT = Path(__file__).resolve().parent.parent` and `WORKSPACE_ROOT = REPO_ROOT.parent` dynamically in every script and in `hyperstitionstud_io.config`.
2. **Trap 2 — Absolute `/workspace/...` Paths Stored Inside `encyclopedia-manifest.json` (`vol["md_path"]`):**
- `encyclopedia/encyclopedia-manifest.json` stores `"md_path": "/workspace/technocapital-singularity-zoology/encyclopedia/00-.../00-....md"`.
- In `build_encyclopedia_knowledge_graph.py` (line 197), `md_p = Path(vol["md_path"])` checks that literal `/workspace/...` path instead of resolving `upstream_repo / "encyclopedia" / vol["division_id"] / f"{vol['slug']}.md"`.
- **Effect on New User:** Outside `/workspace`, `md_p.exists()` returns `False`, causing all `281` `IN_VOLUME` edges to drop to `0` and failing Gate 3 (`edges >= 1282`)!
- **Fix:** Resolve volume Markdown paths relative to `upstream_repo / "encyclopedia" / vol["division_id"] / f"{vol['slug']}.md"` first, falling back to `Path(vol["md_path"])`.
3. **Trap 3 — Relative Local Paths in `verify_draft()` When Running Outside `/workspace`:**
- In `taxonomy/citations-ledger-common.json`, entries `[3]..[7]` store `/workspace/technocapital-singularity-zoology/dossiers/65-dossier-...md`.
- When a new user runs `hs-citations verify` or `test_core_suite.py` inside `~/projects/hyperstition/`, `load_ledger()` should resolve `/workspace/technocapital-singularity-zoology/...` prefix against the active `cfg.zoology_dir` when `/workspace` does not exist on the host machine.
4. **Trap 4 — OS-Specific DejaVu TrueType Font Paths (`/usr/share/fonts/truetype/dejavu/`):**
- Debian/Ubuntu stores DejaVu fonts in `/usr/share/fonts/truetype/dejavu/`, whereas Fedora/RHEL uses `/usr/share/fonts/dejavu-sans-fonts/`, Arch uses `/usr/share/fonts/TTF/`, and macOS uses `/Library/Fonts/` or Homebrew paths.
- **Fix:** Implement a multi-path TrueType font resolver in `hyperstitionstud_io.publishing.fonts` (with graceful fallback to `ImageFont.load_default()` in Pillow and built-in `Helvetica`/`Courier` in ReportLab) so new users on Fedora, Arch, Ubuntu, or macOS never hit `TTFError` or `OSError`.
---
## 2. Step-by-Step Git Operator Execution Plan (`Phases 1–5`)
### Phase 1: Eliminate All Hardcoded `/workspace` & OS-Font Assumptions (Location-Independent Sibling Discovery)
Before pushing to any public HTTP remote, update the path-resolution logic in `hyperstitionstudio-core`, `encyclopedia-knowledge-graph`, and `technocapital-singularity-zoology`:
1. **Dynamic Sibling Discovery in `hyperstitionstud_io.config`:**
Instead of defaulting to `/workspace`, `load_workspace_config()` computes:
```python
PACKAGE_REPO_ROOT = Path(__file__).resolve().parents[3] # .../hyperstitionstudio-core
WORKSPACE_ROOT = PACKAGE_REPO_ROOT.parent # Parent folder containing all sibling repos
```
and searches for `WORKSPACE_ROOT / "workspace.toml"` before `/workspace/workspace.toml`. All default sibling paths (`core_dir`, `archive_dir`, `zoology_dir`, `knowledge_graph_dir`, `ci_build_dir`) resolve relative to `WORKSPACE_ROOT`.
2. **Dynamic `REPO_ROOT` & Relative `encyclopedia/` Lookup in `build_encyclopedia_knowledge_graph.py`:**
- Set `KG_REPO_ROOT = Path(__file__).resolve().parent.parent` and `UPSTREAM_REPO_DEFAULT = KG_REPO_ROOT.parent / "technocapital-singularity-zoology"`.
- Resolve each volume Markdown file as `md_p = upstream_repo / "encyclopedia" / div_id / f"{slug}.md"` (falling back to `Path(vol["md_path"])` only if the relative path is absent).
3. **Cross-Distro / Cross-OS Font Resolver (`hyperstitionstud_io.publishing.fonts`):**
Search candidate font directories (`/usr/share/fonts/truetype/dejavu`, `/usr/share/fonts/dejavu-sans-fonts`, `/usr/share/fonts/dejavu-sans-mono-fonts`, `/usr/share/fonts/TTF`, `/Library/Fonts`) and fall back cleanly to built-in fonts if DejaVu is not installed.
---
### Phase 2: Synchronize & Commit Pending Upstream Archive Files in `/workspace/ingglish-hyperdope-gematria`
Ensure the upstream archive repository has zero uncommitted or untracked files before pushing:
```bash
cd /workspace/ingglish-hyperdope-gematria
# 1. Verify .mp3 files are ignored in .gitignore so audio binaries do not bloat HTTP clones
grep -q '\*.mp3' .gitignore || printf "\n*.mp3\n__pycache__/\n*.pyc\n" >> .gitignore
# 2. Stage all dossiers (48..70-dossier-*.md), news-aq-harvest-latest.json, and updated scripts
git add -A
git commit -m "feat(archive): sync dossiers 48-70, 2026-11-28 wire harvest, zoology dossiers 65-69, and lecture transcripts"
git status -s -b
```
---
### Phase 3: Provision & Push Repositories in Strict Dependency Order
The Git Operator must create the remote repositories on the Git host (e.g., `https://git.libre.audio/seasharp/<repo>.git` or `https://github.com/<org>/<repo>.git`) with **public HTTP read access enabled** so anonymous users can `git clone https://...` without SSH keys, and push them in topological order:
```bash
# Set your remote base URL (SSH for operator push; public HTTP for new-user clone)
OPERATOR_PUSH_BASE="ssh://git@git.libre.audio:2222/seasharp"
PUBLIC_HTTP_BASE="https://git.libre.audio/seasharp"
# 1. Push Tier 0 Common Library: hyperstitionstudio-core (v1.2.0)
/workspace/hyperstitionstudio-core/push-to-origin.sh "${OPERATOR_PUSH_BASE}/hyperstitionstudio-core.git"
# 2. Push Tier 1 Upstream Archive: ingglish-hyperdope-gematria
cd /workspace/ingglish-hyperdope-gematria
git push -u origin main
# 3. Push Tier 2 Domain Taxonomy & Encyclopedia: technocapital-singularity-zoology (v1.7.0)
cd /workspace/technocapital-singularity-zoology
git remote add origin "${OPERATOR_PUSH_BASE}/technocapital-singularity-zoology.git" 2>/dev/null || \
git remote set-url origin "${OPERATOR_PUSH_BASE}/technocapital-singularity-zoology.git"
git push -u origin main
git push origin --tags
# 4. Push Tier 3 Interactive Knowledge Graph: encyclopedia-knowledge-graph (v1.0.0)
/workspace/encyclopedia-knowledge-graph/push-to-origin.sh "${OPERATOR_PUSH_BASE}/encyclopedia-knowledge-graph.git"
# 5. Push Tier 4 Downstream CI PR Fork: hyperdope-ci-build
cd /workspace/hyperdope-ci-build
git push -u origin feat/ingglish-aq-corpus
```
---
### Phase 4: Standardize the Public HTTP "New User Quickstart" Across All `README.md` Files
Every repository's top-level `README.md` must present the exact same, copy-pasteable **5-Minute New-User Onboarding Block** using **public `https://` clone URLs** and **relative paths** (never requiring `/workspace` or root privileges):
```bash
# 1. Create a parent workspace folder anywhere on your machine
mkdir -p ~/hyperstition-workspace && cd ~/hyperstition-workspace
# 2. Clone the peer repositories over public HTTPS (no SSH key required)
git clone https://git.libre.audio/seasharp/hyperstitionstudio-core.git
git clone https://git.libre.audio/seasharp/ingglish-hyperdope-gematria.git
git clone https://git.libre.audio/seasharp/technocapital-singularity-zoology.git
git clone https://git.libre.audio/seasharp/encyclopedia-knowledge-graph.git
# 3. Create & activate a local Python virtual environment and install dependencies
python3 -m venv .venv
source .venv/bin/activate
pip install --upgrade pip
pip install -r hyperstitionstudio-core/requirements.txt
pip install --no-deps -e ./hyperstitionstudio-core
# 4. Copy the default workspace configuration and run the pre-flight health check
cp hyperstitionstudio-core/workspace.example.toml ./workspace.toml
hs-doctor
# 5. Verify the Knowledge Graph (all 6 CI gates) & launch in your browser
python3 encyclopedia-knowledge-graph/scripts/build_encyclopedia_knowledge_graph.py --verify-only
# Deployment Option A (100% Offline Direct Browser Open — Zero Server):
xdg-open encyclopedia-knowledge-graph/index.html # Linux (or `open` on macOS)
# Deployment Option B (Local HTTP Server — Serves Both Graph Workbench & 22 Encyclopedia PDFs):
python3 -m http.server 8090 --bind 127.0.0.1 --directory .
# Then open: http://127.0.0.1:8090/encyclopedia-knowledge-graph/index.html
```
---
### Phase 5: Mandatory Clean-Room New-User Simulation Gate (Pre-Release Verification)
Before announcing or closing the release, the Git Operator must execute a **Clean-Room New-User Simulation** in an isolated directory outside `/workspace` (e.g., `/tmp/new-user-cleanroom-test`) while temporarily hiding or ignoring `/workspace` defaults:
```bash
rm -rf /tmp/new-user-cleanroom-test
mkdir -p /tmp/new-user-cleanroom-test && cd /tmp/new-user-cleanroom-test
# Clone strictly via git clone (from public HTTP URLs or local bare/repo paths during staging)
git clone /workspace/hyperstitionstudio-core
git clone /workspace/ingglish-hyperdope-gematria
git clone /workspace/technocapital-singularity-zoology
git clone /workspace/encyclopedia-knowledge-graph
# Run every documented new-user command inside /tmp/new-user-cleanroom-test
PYTHONPATH="/tmp/new-user-cleanroom-test/hyperstitionstudio-core/src" \
python3 /tmp/new-user-cleanroom-test/hyperstitionstudio-core/tests/test_core_suite.py
PYTHONPATH="/tmp/new-user-cleanroom-test/hyperstitionstudio-core/src" \
python3 /tmp/new-user-cleanroom-test/encyclopedia-knowledge-graph/scripts/build_encyclopedia_knowledge_graph.py
PYTHONPATH="/tmp/new-user-cleanroom-test/hyperstitionstudio-core/src" \
python3 /tmp/new-user-cleanroom-test/encyclopedia-knowledge-graph/scripts/build_encyclopedia_knowledge_graph.py --verify-only
```
**Release Acceptance Criteria (All 5 Must Pass):**
1. `test_core_suite.py` exits `0` (`ALL 6 TEST SUITES PASSED`) inside `/tmp/new-user-cleanroom-test`.
2. `build_encyclopedia_knowledge_graph.py` exits `0` inside `/tmp/new-user-cleanroom-test` without passing `--upstream-repo` or `--out-dir` flags, producing all `388` nodes and `1,282` deduplicated edges (`281` `IN_VOLUME` edges preserved).
3. `build_encyclopedia_knowledge_graph.py --verify-only` reports `"all_gates_passed": true`.
4. `sources.py verify --evidence` exits `0` (`citations OK`) on all 5 stakeholder proposals inside `/tmp/new-user-cleanroom-test`.
5. `git status -s` is completely empty across every repository in `/workspace`.
@@ -0,0 +1,260 @@
# Production Deployment Plan: Lightning-Fast `hyperstitionstud.io` Homepage & Knowledge Workbench on a Linode / Akamai Connected Cloud VPS (`v1.0.0`)
- **Document ID:** `PLAN-LINODE-AKAMAI-VPS-HOMEPAGE-DEPLOYMENT` (`v1.0.0`)
- **Target Domain:** `https://hyperstitionstud.io` (and `https://www.hyperstitionstud.io` -> `308` redirect)
- **Target Infrastructure:** Linode / Akamai Connected Cloud VPS (Debian 12 Bookworm or Ubuntu 24.04 LTS on AMD EPYC, IPv4 + IPv6 dual-stack, Cloud Firewall + Akamai Edge/DNS)
- **Performance Targets:**
- **Time to First Byte (`TTFB`):** `< 15 ms` (regional) / `< 40 ms` (global)
- **Largest Contentful Paint (`LCP`):** `< 200 ms`
- **Knowledge Graph Payload (`graph-data.js.br`):** `~32 KB` over the wire via Pre-Compressed Brotli-11 (`-q 11`) + HTTP/3 (`QUIC`)
- **Disk I/O on Request Path:** `0 IOPS` (100% served from RAM via `tmpfs` + Linux kernel `sendfile` + `ktls`)
- **Offline Portability Preservation:** The deployed site uses the exact same static bundle (`index.html`, `graph-data.js`, `encyclopedia/*.pdf`) that runs offline over `file://`, with zero external CDN, font, or analytics dependencies.
---
## 1. Architectural Philosophy: Why Static RAM-Backed HTTP/3 Beats Dynamic Application Servers
Every user-facing artifact across the workspace—the **388-node Interactive Encyclopedia Knowledge Graph**, the **22-Volume Alphabetized PDF Encyclopedia (`122` pages)**, the **282-Term Comprehensive Glossary**, the **Assemblage Builds `ETI` Tier List**, the **Gen IV Pokedex Field-Scanner Cards**, the **5-Episode Audio Podcast Series**, and the **Hyperdope-Gematria `AQ` Calculator**—is already deterministically pre-compiled before deployment.
Therefore, the production VPS requires **zero runtime Python, Node.js, or database processes in the HTTP request path**:
1. **Zero Dynamic Compute in the Request Path:**
All Python compilation (`classify_technocapital_singularity.py`, `build_encyclopedia_knowledge_graph.py`, `hs-pdf-build`, `hs-doctor`) runs at **build/release time**, never on incoming HTTP requests.
2. **Pre-Compressed Static Assets (`Brotli -q 11` & `Gzip -9`):**
Every `.html`, `.js`, `.css`, `.json`, `.svg`, `.graphml`, `.gexf`, and `.canvas` artifact is compressed once during release staging (`graph-data.js` shrinks from `~245 KB` raw to `~32 KB` `.br`). The web server sends the pre-built `.br` file directly without spending CPU cycles compressing responses on the fly.
3. **`tmpfs` In-Memory Web Root (`/var/www/hyperstitionstud.io/live`):**
Excluding optional `.mp3` audio streams, the entire compiled static site (HTML, JS, JSON, SVG, PNGs, and all 22 Encyclopedia PDFs) totals **`~34 MB`**. Mounting `/var/www/hyperstitionstud.io/live` on a `256 MB` RAM-backed `tmpfs` (and keeping `.mp3` podcasts in `/srv/hyperstitionstud.io/media/podcast` with HTTP `206` byte-range streaming) guarantees that every page load, graph query, and PDF open is served directly from system RAM.
---
## 2. Linode / Akamai VPS Provisioning, DNS & Kernel Network Tuning
### 2.1 Recommended Linode Instance & Storage Layout
| Resource | Specification | Rationale |
| :--- | :--- | :--- |
| **Instance Plan** | **Linode Dedicated 4 GB** or **Shared 2 GB / 4 GB** (`2 vCPU`, `4 GB RAM`, `80 GB NVMe`, `4 TB Transfer`) | `256 MB` `tmpfs` holds the entire HTML/JS/JSON/PDF corpus in RAM with `> 3 GB` headroom for OS page cache and build staging. |
| **Region** | `us-iad` (Washington, DC) or `us-east` (Newark) | Lowest transatlantic + North American fiber latency on Akamai's backbone. |
| **Base OS** | **Debian 12 (Bookworm)** or **Ubuntu 24.04 LTS** (`Linux 6.8+` kernel) | Native kernel TLS (`ktls`), TCP BBR congestion control, and official Caddy 2 / Nginx Brotli packages. |
| **Linode Cloud Firewall** | Inbound allow **only**:<br/>• `TCP 443` (HTTPS / HTTP/2)<br/>• `UDP 443` (**HTTP/3 QUIC** — critical!)<br/>• `TCP 80` (ACME HTTP-01 & `308` redirect to HTTPS)<br/>• `TCP 22` (SSH, restricted to operator IP/WireGuard) | Blocks all unsolicited port scans at Akamai's hypervisor edge before packets reach the VPS NIC. |
### 2.2 Linode DNS Manager Records (`hyperstitionstud.io`)
Configure in Linode DNS Manager (or Akamai Edge DNS) with `TTL = 300` during cutover, then `TTL = 3600`:
| Type | Name | Value / Target | Purpose |
| :--- | :--- | :--- | :--- |
| `A` | `@` | `<LINODE_IPV4>` | Apex IPv4 (`hyperstitionstud.io`) |
| `AAAA` | `@` | `<LINODE_IPV6>` | Apex IPv6 (`hyperstitionstud.io`) |
| `A` | `www` | `<LINODE_IPV4>` | `www` IPv4 (redirects `308` to apex) |
| `AAAA` | `www` | `<LINODE_IPV6>` | `www` IPv6 (redirects `308` to apex) |
| `CAA` | `@` | `0 issue "letsencrypt.org"` | Authorizes automatic Let's Encrypt TLS 1.3 certificates |
| `HTTPS` | `@` | `1 . alpn="h3,h2"` | **SVCB/HTTPS DNS record (RFC 9460):** Instructs browsers to connect via **HTTP/3 (`h3`)** on the very first packet without waiting for an HTTP/1.1 or HTTP/2 `Alt-Svc` header! |
### 2.3 Linux Kernel TCP BBR & QUIC UDP Buffer Tuning (`/etc/sysctl.d/99-hyperstition-fastnet.conf`)
Apply on the Linode VPS (`sudo sysctl --system`) to eliminate TCP slow-start bottlenecks and UDP buffer drops under HTTP/3 QUIC bursts:
```ini
# /etc/sysctl.d/99-hyperstition-fastnet.conf
net.core.default_qdisc = fq
net.ipv4.tcp_congestion_control = bbr
net.ipv4.tcp_fastopen = 3
net.ipv4.tcp_slow_start_after_idle = 0
net.core.rmem_max = 16777216
net.core.wmem_max = 16777216
net.core.rmem_default = 2097152
net.core.wmem_default = 2097152
```
---
## 3. Unified Site URL Map & Landing Homepage Design (`https://hyperstitionstud.io`)
```text
/var/www/hyperstitionstud.io/live/ (256 MB tmpfs RAM mount — 0 disk I/O)
├── index.html # Lightning-fast (< 8 KB inline CSS/SVG) Portal Homepage
├── graph/ # Interactive Encyclopedia Knowledge Graph Workbench
│ ├── index.html # 388 Nodes, 1,282 Edges (encyclopedia_base_path = "/encyclopedia")
│ ├── graph-data.js (+ .br / .gz) # ~32 KB over the wire via Brotli-11
│ ├── encyclopedia-graph.json (+ .br) # Raw property graph JSON
│ ├── encyclopedia-graph.graphml (+ .br) # Gephi / Cytoscape / yEd export
│ ├── encyclopedia-graph.gexf (+ .br) # GEXF 1.3 export
│ ├── encyclopedia.canvas (+ .br) # Obsidian JSON Canvas 1.0 (282 cards, 1,120 edges)
│ ├── atlas-mode1-trophic-food-web.png # 1600x1060 Static Atlas Board 1
│ ├── atlas-mode2-concentric-eti-radar.png# 1600x1060 Static Atlas Board 2 (S+ -> D Periphery)
│ └── atlas-mode3-bipartite-g1-funnel.png # 1600x1060 Static Atlas Board 3
├── encyclopedia/ # 9 Ontological Divisions (00..08) & 22 PDF Volumes (122 Pages)
│ ├── encyclopedia-manifest.json (+ .br)
│ ├── 00-index-and-ontological-atlas/*.pdf
│ └── ... (01 through 08 division PDFs)
├── zoology/ # Core Dossiers, Tier Lists, Glossary & Architecture Diagrams
│ ├── tier-list-technocapital-assemblage-builds.{pdf,png}
│ ├── technocapital-singularity-zoology-comprehensive-glossary.pdf
│ ├── cross-repo-dependency-and-audit-flow-diagram.{html,png,pdf}
│ ├── OPERATORS-MANUAL-ENCYCLOPEDIA-KNOWLEDGE-GRAPH.pdf
│ └── dossiers/65..69-dossier-*.md
├── pokedex/ # Gen IV INFO Pokedex Field-Scanner Cards & Manifest
│ └── meme_1_custom_pokedex_technocapital_zoology_m7_129_125.{png,pdf}
├── calc/ # Static Hyperdope-Gematria Browser Workbench
│ ├── index.html
│ └── db.json (+ .br / .gz)
└── podcast/ # Symlinked to /srv/hyperstitionstud.io/media/podcast (NVMe)
└── podcast-ep01..05-*.{mp3,pdf} # Served with HTTP 206 Byte-Range streaming
```
### 3.1 Homepage (`/` -> `index.html`) Speed & UX Specification
- **Single-Packet HTML Delivery (`< 10 KB` raw, `< 3.2 KB` Brotli):**
- Inline critical CSS using the exact dark-mode palette (`--bg-canvas: #020617`, `--bg-panel: #0f172a`, `--accent-cyan: #22d3ee`, `--accent-red: #ff4d4d`, `--accent-gold: #f5c630`).
- Zero external `<link>` stylesheets, zero external web fonts (`'DejaVu Sans Mono', 'JetBrains Mono', ui-monospace, monospace`), and zero third-party tracking scripts.
- **Six Instant-Launch Bento Cards Above the Fold:**
1. **Interactive Encyclopedia Knowledge Graph (`/graph/`):** Live node/edge badge (`388 Nodes • 1,282 Edges • 4 Spatial Modes`), direct launch into `Mode 2: Concentric ETI Tier-Ring Radar (S+ -> D Periphery)`, and download links for `.json`, `.graphml`, `.gexf`, and `.canvas`.
2. **22-Volume PDF Encyclopedia & 282-Term Glossary (`/encyclopedia/`):** Direct division matrix (`Divisions 00–08`, `122 Pages`) + 1-click PDF drawer.
3. **Assemblage Builds `ETI` Tier List (`/zoology/tier-list-technocapital-assemblage-builds.png` & `.pdf`):** `S+` (`#1 S1` `93 ETI`, `#2 S2` `90 ETI`) through `D Periphery` (`49 ETI`) visual scorecard.
4. **Gen IV INFO Pokedex Field-Scanner (`/pokedex/`):** `M7_candidate_2026_11_28` (`AWFLAIN == RUHSHA == BLAKWEL == 129`, `DOUNZ == KAPATAL == KAPCHER == 125`).
5. **The Singularity Field Guide Audio Podcast (`/podcast/`):** Native HTML5 `<audio preload="metadata">` player with companion PDF transcripts for Episodes `01–05`.
6. **Base-36 `AQ` & Phonemic `Ingglish` Calculator (`/calc/`):** Client-side cipher evaluation workbench.
- **Smart Prefetching (`<link rel="prefetch">`):**
The homepage includes `<link rel="prefetch" href="/graph/graph-data.js" as="script">` so while the visitor reads the homepage header for 1 second, the `32 KB` Brotli-compressed Knowledge Graph dataset is already warmed in the browser cache—making clicking `/graph/` render all 388 nodes in **0 ms network wait time**.
---
## 4. Web Server Configuration: Caddy 2 (`HTTP/3` + Pre-Compressed `br`/`gzip` + Immutable Caching)
Caddy 2 (`sudo apt install caddy`) provides automatic TLS 1.3 certificate management, native HTTP/3 (`QUIC`), kernel `sendfile`, and first-class `precompressed br gzip` support in a 35-line `/etc/caddy/Caddyfile`:
```caddyfile
# /etc/caddy/Caddyfile
{
servers {
protocols h1 h2 h3
}
}
www.hyperstitionstud.io {
redir https://hyperstitionstud.io{uri} permanent
}
hyperstitionstud.io {
root * /var/www/hyperstitionstud.io/live
encode zstd gzip
# Serve pre-built .br (Brotli-11) and .gz files from RAM with 0 CPU overhead
file_server {
precompressed br gzip
}
# Advertise HTTP/3 QUIC and enforce strict security headers
header {
Alt-Svc "h3=\":443\"; ma=2592000"
Strict-Transport-Security "max-age=63072000; includeSubDomains; preload"
X-Content-Type-Options "nosniff"
Referrer-Policy "strict-origin-when-cross-origin"
-Server
}
# Long-lived caching for heavy static PDFs, PNGs, and MP3s (with ETag + HTTP 206 Byte-Range)
@immutable_media path *.pdf *.png *.mp3 *.graphml *.gexf *.canvas
header @immutable_media Cache-Control "public, max-age=86400, stale-while-revalidate=604800"
# Instant revalidation for HTML & graph-data.js
@html_js path *.html *.js *.json
header @html_js Cache-Control "public, max-age=300, stale-while-revalidate=86400"
}
```
---
## 5. Atomic Build, Pre-Compression & RAM-Sync Release Script (`deploy-hyperstitionstud-io.sh`)
The operator deploys updates using a deterministic, zero-downtime release script that:
1. Runs `hs-doctor` and `build_encyclopedia_knowledge_graph.py --verify-only` (aborting immediately if any of the 6 CI gates or SHA-256 glossary isolation locks fail).
2. Assembles the release directory `/srv/hyperstitionstud.io/releases/<UTC_TIMESTAMP>`, setting `encyclopedia_base_path = "/encyclopedia"` in the deployed `/graph/graph-data.js` so PDF links resolve cleanly from `/graph/`.
3. Pre-compresses all text/JSON/JS/XML/HTML artifacts at maximum compression (`brotli -q 11 -k` and `gzip -9 -k`).
4. Atomically flips `/srv/hyperstitionstud.io/current` and `rsync --delete` syncs the release into the `/var/www/hyperstitionstud.io/live` `tmpfs` RAM mount in `< 50 ms`.
```bash
#!/usr/bin/env bash
# deploy-hyperstitionstud-io.sh — Atomic Pre-Compressed RAM-Backed Release Builder
set -euo pipefail
WORKSPACE_DIR="${WORKSPACE_DIR:-/workspace}"
RELEASE_ROOT="/srv/hyperstitionstud.io"
LIVE_TMPFS="/var/www/hyperstitionstud.io/live"
STAMP="$(date -u +%Y%m%dT%H%M%SZ)"
REL_DIR="${RELEASE_ROOT}/releases/${STAMP}"
echo "[1/5] Running hs-doctor & 6-Gate Knowledge Graph Verification..."
hs-doctor >/dev/null
python3 "${WORKSPACE_DIR}/encyclopedia-knowledge-graph/scripts/build_encyclopedia_knowledge_graph.py" --verify-only >/dev/null
echo "[2/5] Staging static release bundle at ${REL_DIR}..."
mkdir -p "${REL_DIR}"/{graph,encyclopedia,zoology/dossiers,pokedex,podcast,schemas/v1}
# Copy Knowledge Graph Workbench & rewrite encyclopedia_base_path for /encyclopedia web route
cp -a "${WORKSPACE_DIR}/encyclopedia-knowledge-graph"/{index.html,encyclopedia-graph.*,encyclopedia.canvas,atlas-mode*.png} "${REL_DIR}/graph/"
python3 - <<PY
import json
from pathlib import Path
src = Path("${WORKSPACE_DIR}/encyclopedia-knowledge-graph/encyclopedia-graph.json")
data = json.loads(src.read_text(encoding="utf-8"))
data["encyclopedia_base_path"] = "/encyclopedia"
j_str = json.dumps(data, separators=(",", ":"), ensure_ascii=False)
(Path("${REL_DIR}/graph/encyclopedia-graph.json")).write_text(j_str, encoding="utf-8")
(Path("${REL_DIR}/graph/graph-data.js")).write_text(
"window.HyperstitionStudio=window.HyperstitionStudio||{};"
f"window.HyperstitionStudio.EncyclopediaGraphData={j_str};"
"window.ENCYCLOPEDIA_GRAPH_DATA=window.HyperstitionStudio.EncyclopediaGraphData;",
encoding="utf-8",
)
PY
# Copy 22-Volume PDF Encyclopedia, Zoology Reports, Schemas & Pokedex
cp -a "${WORKSPACE_DIR}/technocapital-singularity-zoology/encyclopedia"/* "${REL_DIR}/encyclopedia/"
cp -a "${WORKSPACE_DIR}/technocapital-singularity-zoology/dossiers"/*.md "${REL_DIR}/zoology/dossiers/"
cp -a "${WORKSPACE_DIR}/technocapital-singularity-zoology"/tier-list-technocapital-assemblage-builds.{pdf,png} "${REL_DIR}/zoology/"
cp -a "${WORKSPACE_DIR}/technocapital-singularity-zoology"/technocapital-singularity-zoology-comprehensive-glossary.pdf "${REL_DIR}/zoology/"
cp -a "${WORKSPACE_DIR}/encyclopedia-knowledge-graph/OPERATORS-MANUAL-ENCYCLOPEDIA-KNOWLEDGE-GRAPH.pdf" "${REL_DIR}/zoology/"
cp -a "${WORKSPACE_DIR}/encyclopedia-knowledge-graph/docs/cross-repo-dependency-and-audit-flow-diagram".{html,png,pdf} "${REL_DIR}/zoology/"
cp -a "${WORKSPACE_DIR}/hyperstitionstudio-core/schemas/v1"/*.json "${REL_DIR}/schemas/v1/"
cp -a "${WORKSPACE_DIR}/memes"/meme_1_custom_pokedex_technocapital_zoology_m7_129_125.{png,pdf} "${REL_DIR}/pokedex/"
echo "[3/5] Pre-compressing HTML, JS, JSON, XML & Canvas assets with Brotli (-q 11) and Gzip (-9)..."
find "${REL_DIR}" -type f \( -name "*.html" -o -name "*.js" -o -name "*.json" -o -name "*.graphml" -o -name "*.gexf" -o -name "*.canvas" -o -name "*.md" \) | while read -r f; do
gzip -9 -k -f "$f"
if command -v brotli >/dev/null 2>&1; then
brotli -q 11 -k -f "$f"
fi
done
echo "[4/5] Flipping atomic symlink ${RELEASE_ROOT}/current -> ${REL_DIR}..."
ln -sfn "${REL_DIR}" "${RELEASE_ROOT}/current"
echo "[5/5] Syncing into RAM-backed ${LIVE_TMPFS}..."
mkdir -p "${LIVE_TMPFS}"
rsync -a --delete "${RELEASE_ROOT}/current/" "${LIVE_TMPFS}/"
echo "[OK] Deployed release ${STAMP} to ${LIVE_TMPFS}"
```
---
## 6. Post-Deploy Verification & Benchmark Checklist
After running `deploy-hyperstitionstud-io.sh` on the Linode VPS, verify all 5 speed and integrity gates:
1. **HTTP/3 QUIC & Brotli Verification:**
```bash
curl -I --http3 -H "Accept-Encoding: br" https://hyperstitionstud.io/graph/graph-data.js
```
Confirm `HTTP/3 200`, `content-encoding: br`, and `content-length` around `32000` bytes (`~87%` compression ratio).
2. **Sub-15ms TTFB Latency Benchmark:**
```bash
curl -o /dev/null -s -w "DNS: %{time_namelookup}s | TLS: %{time_appconnect}s | TTFB: %{time_starttransfer}s | Total: %{time_total}s\n" https://hyperstitionstud.io/
```
3. **PDF Byte-Range Streaming Verification (Encyclopedia Volumes):**
```bash
curl -I -H "Range: bytes=0-1023" https://hyperstitionstud.io/encyclopedia/00-index-and-ontological-atlas/00-master-encyclopedia-index-a-to-z.pdf
```
Confirm `HTTP/2 206` (or `HTTP/3 206`) and `accept-ranges: bytes`.
4. **Offline Portability Parity:**
Downloading `/graph/index.html` and `/graph/graph-data.js` still works 100% offline with zero external CDN or font requests.
Binary file not shown.
+61 -44
View File
@@ -1,8 +1,58 @@
# Encyclopedia Knowledge Graph (`v1.0.0`)
# `encyclopedia-knowledge-graph` (`v1.0.0`)
Standalone open-source interactive knowledge graph workbench, multi-format graph compiler (`JSON`, `GraphML`, `GEXF`, `Obsidian JSON Canvas`), visual atlas renderer, and operator's manual for the **Encyclopedia of Technocapital Singularity Zoology**.
Operates as a peer sibling Git repository in `/workspace/encyclopedia-knowledge-graph`, ingesting `/workspace/technocapital-singularity-zoology` strictly in **read-only mode** with cryptographic pre/post `SHA-256` isolation verification so zero knowledge-graph or visualization concepts ever enter the upstream glossary or encyclopedia.
Powered by `hyperstitionstud_io.*` (`urn:io:hyperstitionstud:ns:kg:1.0`). Ingests `technocapital-singularity-zoology` strictly in **read-only mode** with cryptographic pre/post `SHA-256` isolation verification so zero knowledge-graph or visualization concepts ever enter the upstream glossary or encyclopedia.
---
## 5-Minute New-User Onboarding (Public HTTP Clone into Any Directory)
```bash
# 1. Create a parent workspace folder anywhere on your machine
mkdir -p ~/hyperstition-workspace && cd ~/hyperstition-workspace
# 2. Clone the peer repositories over public HTTPS (no SSH key required)
git clone https://git.libre.audio/seasharp/hyperstitionstudio-core.git
git clone https://git.libre.audio/seasharp/ingglish-hyperdope-gematria.git
git clone https://git.libre.audio/seasharp/technocapital-singularity-zoology.git
git clone https://git.libre.audio/seasharp/encyclopedia-knowledge-graph.git
# 3. Create & activate a local Python virtual environment and install dependencies
python3 -m venv .venv
source .venv/bin/activate
pip install --upgrade pip
pip install -r hyperstitionstudio-core/requirements.txt
pip install --no-deps -e ./hyperstitionstudio-core
# 4. Copy the location-independent workspace configuration and run the health check
cp hyperstitionstudio-core/workspace.example.toml ./workspace.toml
hs-doctor
# 5. Rebuild or verify all 6 Knowledge Graph CI gates (location-independent, zero flags needed)
python3 encyclopedia-knowledge-graph/scripts/build_encyclopedia_knowledge_graph.py
python3 encyclopedia-knowledge-graph/scripts/build_encyclopedia_knowledge_graph.py --verify-only
```
---
## Dual Deployment Modes (`Scenario A: file://` Offline Browser vs. `Scenario B: http://` Server)
### Scenario A — 100% Offline In-Browser Application (Zero Server, `file://`)
Open `encyclopedia-knowledge-graph/index.html` directly from your file manager or browser (`xdg-open encyclopedia-knowledge-graph/index.html` on Linux, `open encyclopedia-knowledge-graph/index.html` on macOS). All `388` nodes, `1,282` edges, `4` spatial layout modes, ego-network isolator, PNG canvas export, and `../technocapital-singularity-zoology/encyclopedia/*.pdf` links work offline via `graph-data.js`.
### Scenario B — Static HTTP Server Hosting (`http://`)
- **Option B1 (Serve Parent Workspace Directory so `../technocapital-singularity-zoology/encyclopedia/*.pdf` Resolves):**
```bash
python3 -m http.server 8090 --bind 127.0.0.1 --directory .
# Open: http://127.0.0.1:8090/encyclopedia-knowledge-graph/index.html
```
- **Option B2 (Serve `encyclopedia-knowledge-graph` as a Single Standalone Web Root):**
```bash
python3 encyclopedia-knowledge-graph/scripts/build_encyclopedia_knowledge_graph.py --bundle-encyclopedia
python3 -m http.server 8090 --bind 127.0.0.1 --directory ./encyclopedia-knowledge-graph
# Open: http://127.0.0.1:8090/index.html
```
---
@@ -10,45 +60,12 @@ Operates as a peer sibling Git repository in `/workspace/encyclopedia-knowledge-
| Path | Description |
| :--- | :--- |
| `OPERATORS-MANUAL-ENCYCLOPEDIA-KNOWLEDGE-GRAPH.{md,pdf}` | Step-by-step Operator's Manual (Write -> Test -> Edit -> Publish verified) |
| `scripts/build_encyclopedia_knowledge_graph.py` | Deterministic 100%-FOSS graph compiler, 6-gate verifier, and CLI ego-network query engine |
| `index.html` & `graph-data.js` | Offline-capable interactive dark-mode HTML5/Canvas workbench (5 layout modes, live filters, PDF drawer) |
| `encyclopedia-graph.json` | Full 388-node, 1,282-edge property graph & centrality analytics JSON |
| `encyclopedia-graph.graphml` & `encyclopedia-graph.gexf` | Standard XML exports for Gephi, Cytoscape Desktop, yEd, and NetworkX |
| `encyclopedia.canvas` | Obsidian JSON Canvas 1.0 (`282` cards, `1,120` edges) |
| `atlas-mode{1,2,3}.png` | High-resolution (`1600x1060`) visual atlas boards (Trophic Food-Web, Concentric ETI Radar `S+ -> D Periphery`, and Bipartite `Gen 0 -> Gen 1` Funnel) |
| `docs/` | Architecture plan (`plan-interactive-knowledge-graph-encyclopedia.{md,pdf}`), `D Periphery` radar specification (`specification-concentric-eti-tier-ring-radar-d-periphery.{md,pdf}`), and dependency/push guide (`DEPENDENCIES-AND-FIRST-PUSH-GUIDE.{md,pdf}`) |
| `requirements.txt` | Python package manifest (`Pillow`, `reportlab`, `pypdf`, `pdfplumber`) |
| `push-to-origin.sh` | Executable helper script for configuring remote `origin` and executing the first push |
---
## Quickstart Commands
```bash
# 1. Check upstream Glossary & Encyclopedia SHA-256 isolation
python3 /workspace/encyclopedia-knowledge-graph/scripts/build_encyclopedia_knowledge_graph.py --check-isolation
# 2. Rebuild all graph exports, atlas PNGs & run 6-gate verification
python3 /workspace/encyclopedia-knowledge-graph/scripts/build_encyclopedia_knowledge_graph.py
# 3. Run standalone 6-gate verification without rebuilding
python3 /workspace/encyclopedia-knowledge-graph/scripts/build_encyclopedia_knowledge_graph.py --verify-only
# 4. Query any node & inspect its 1-hop ego-network
python3 /workspace/encyclopedia-knowledge-graph/scripts/build_encyclopedia_knowledge_graph.py --query-node "125"
```
---
## First Push to Remote `origin`
```bash
cd /workspace/encyclopedia-knowledge-graph
git remote add origin <REMOTE_GIT_URL>
git push -u origin main
git push origin v1.0.0
# Or via the bundled verification + push script:
/workspace/encyclopedia-knowledge-graph/push-to-origin.sh <REMOTE_GIT_URL>
```
| `OPERATORS-MANUAL-ENCYCLOPEDIA-KNOWLEDGE-GRAPH.{md,pdf}` | Step-by-step Operator's Manual (`7` pages PDF) |
| `PLAN-COMMON-LIBRARY-HYPERSTITIONSTUDIO.{md,pdf}` | Shared Common Library (`hyperstitionstud_io.*` / `urn:io:hyperstitionstud:*`) Architecture & Implementation Plan (`6` pages PDF) |
| `PLAN-GIT-OPERATOR-PUBLIC-HTTP-RELEASE-AND-ONBOARDING.{md,pdf}` | Git Operator Release & Public HTTP Onboarding Plan (`5` pages PDF) |
| `PLAN-LINODE-AKAMAI-VPS-HOMEPAGE-DEPLOYMENT.{md,pdf}` | Production Deployment Plan for `https://hyperstitionstud.io` on Linode / Akamai VPS (`6` pages PDF) |
| `scripts/build_encyclopedia_knowledge_graph.py` | Location-independent graph compiler, 6-gate verifier, and CLI ego-network query engine |
| `index.html` & `graph-data.js` | Offline-capable interactive dark-mode HTML5/Canvas workbench (`388` nodes, `1,282` deduplicated edges) |
| `encyclopedia-graph.{json,graphml,gexf}` & `encyclopedia.canvas` | Open-source graph interchange exports (`xmlns:hs="urn:io:hyperstitionstud:ns:kg:1.0"`) |
| `atlas-mode{1,2,3}.png` | High-resolution (`1600x1060`) visual atlas boards |
| `docs/cross-repo-dependency-and-audit-flow-diagram.{html,png,pdf,md}` | Visual Dependency Flow Diagram & 3-Stage `BUILD -> TEST -> STAGE_COMMIT` Audit Pipeline |
@@ -0,0 +1,186 @@
# Git Operator Release & Public HTTP Repository Update Plan: Guaranteeing Zero-Error New-User Onboarding (`v1.0.0`)
- **Document ID:** `PLAN-GIT-OPERATOR-PUBLIC-HTTP-RELEASE-AND-ONBOARDING` (`v1.0.0`)
- **Target Audience:** Git Operator maintaining the public HTTP repositories (`https://git.libre.audio/seasharp/*` and/or GitHub mirrors)
- **End-User Guarantee:** A completely new user cloning the public HTTP repositories into **any** arbitrary local parent directory (e.g., `~/hyperstition-workspace/` on Linux or macOS, **not** `/workspace/`) can follow `README.md` and `OPERATORS-MANUAL-ENCYCLOPEDIA-KNOWLEDGE-GRAPH.md` from top to bottom with **zero errors**.
- **Glossary & Encyclopedia Isolation Invariant:** Verified (`0` changes to `taxonomy/glossary-registry.json` or `encyclopedia/encyclopedia-manifest.json`).
---
## 1. Executive Audit: Current Repository & Remote State vs. Public HTTP Readiness
An audit of the 5 sibling repositories in `/workspace` reveals two categories of blockers that a Git Operator must resolve before updating the public HTTP remotes:
### 1.1 Current Git Working-Tree & Remote Status Across `/workspace`
| Repository | Current Branch & Tag | Configured Remote (`git remote -v`) | Working-Tree State & Blocker to Resolve |
| :--- | :--- | :--- | :--- |
| **`hyperstitionstudio-core`** | `main` (`v1.2.0`, `f8235a2`) | *None configured yet* | Clean working tree; needs remote `origin` added and pushed first. |
| **`ingglish-hyperdope-gematria`** | `main` | `origin`: `ssh://git@git.libre.audio:2222/seasharp/ingglish-hyperdope-gematria.git` | **Has uncommitted modified & untracked files** (`48..70-dossier-*.md`, `news-aq-harvest-latest.json`, `build_wire_report_pdf.py`). If not committed & pushed, a new user cloning from HTTP will miss Dossiers `48–70`! |
| **`technocapital-singularity-zoology`** | `main` (`v1.7.0`, `1f2c4f4`) | *None configured yet* | Clean working tree (`8` JSON registries tracked); needs remote `origin` added and pushed. |
| **`encyclopedia-knowledge-graph`** | `main` (`v1.0.0`, `b4ca2ce`) | *None configured yet* | Clean working tree (`388` nodes, `1,282` edges); needs remote `origin` added and pushed. |
| **`hyperdope-ci-build`** | `feat/ingglish-aq-corpus` (`ahead 43`) | `origin`: `ssh://git@git.libre.audio:2222/seasharp/ingglish-hyperdope-ci.git` | Clean working tree (`43` local commits ahead of `origin`); needs `git push origin feat/ingglish-aq-corpus`. |
### 1.2 Four Hidden "/workspace" Traps That Would Break a Brand-New User Outside `/workspace`
Even if all 5 repositories are pushed as-is today, a new user who clones them into `~/projects/hyperstition/` (instead of `/workspace/`) and follows the docs will hit **four deterministic errors** unless the Git Operator applies the Phase 1 portability hardening below before pushing:
1. **Trap 1 — Hardcoded `/workspace/...` Default Paths in Python CLI Scripts:**
- `build_encyclopedia_knowledge_graph.py` currently sets `KG_REPO_ROOT = Path("/workspace/encyclopedia-knowledge-graph")` and `UPSTREAM_REPO_DEFAULT = Path("/workspace/technocapital-singularity-zoology")`.
- `hyperstitionstud_io/config/__init__.py` defaults to `Path("/workspace/...")` when `/workspace/workspace.toml` does not exist.
- **Effect on New User:** Running `python3 scripts/build_encyclopedia_knowledge_graph.py` or `hs-doctor` inside `~/projects/hyperstition/encyclopedia-knowledge-graph` raises `FileNotFoundError: '/workspace/technocapital-singularity-zoology/...'`.
- **Fix:** Derive `REPO_ROOT = Path(__file__).resolve().parent.parent` and `WORKSPACE_ROOT = REPO_ROOT.parent` dynamically in every script and in `hyperstitionstud_io.config`.
2. **Trap 2 — Absolute `/workspace/...` Paths Stored Inside `encyclopedia-manifest.json` (`vol["md_path"]`):**
- `encyclopedia/encyclopedia-manifest.json` stores `"md_path": "/workspace/technocapital-singularity-zoology/encyclopedia/00-.../00-....md"`.
- In `build_encyclopedia_knowledge_graph.py` (line 197), `md_p = Path(vol["md_path"])` checks that literal `/workspace/...` path instead of resolving `upstream_repo / "encyclopedia" / vol["division_id"] / f"{vol['slug']}.md"`.
- **Effect on New User:** Outside `/workspace`, `md_p.exists()` returns `False`, causing all `281` `IN_VOLUME` edges to drop to `0` and failing Gate 3 (`edges >= 1282`)!
- **Fix:** Resolve volume Markdown paths relative to `upstream_repo / "encyclopedia" / vol["division_id"] / f"{vol['slug']}.md"` first, falling back to `Path(vol["md_path"])`.
3. **Trap 3 — Relative Local Paths in `verify_draft()` When Running Outside `/workspace`:**
- In `taxonomy/citations-ledger-common.json`, entries `[3]..[7]` store `/workspace/technocapital-singularity-zoology/dossiers/65-dossier-...md`.
- When a new user runs `hs-citations verify` or `test_core_suite.py` inside `~/projects/hyperstition/`, `load_ledger()` should resolve `/workspace/technocapital-singularity-zoology/...` prefix against the active `cfg.zoology_dir` when `/workspace` does not exist on the host machine.
4. **Trap 4 — OS-Specific DejaVu TrueType Font Paths (`/usr/share/fonts/truetype/dejavu/`):**
- Debian/Ubuntu stores DejaVu fonts in `/usr/share/fonts/truetype/dejavu/`, whereas Fedora/RHEL uses `/usr/share/fonts/dejavu-sans-fonts/`, Arch uses `/usr/share/fonts/TTF/`, and macOS uses `/Library/Fonts/` or Homebrew paths.
- **Fix:** Implement a multi-path TrueType font resolver in `hyperstitionstud_io.publishing.fonts` (with graceful fallback to `ImageFont.load_default()` in Pillow and built-in `Helvetica`/`Courier` in ReportLab) so new users on Fedora, Arch, Ubuntu, or macOS never hit `TTFError` or `OSError`.
---
## 2. Step-by-Step Git Operator Execution Plan (`Phases 1–5`)
### Phase 1: Eliminate All Hardcoded `/workspace` & OS-Font Assumptions (Location-Independent Sibling Discovery)
Before pushing to any public HTTP remote, update the path-resolution logic in `hyperstitionstudio-core`, `encyclopedia-knowledge-graph`, and `technocapital-singularity-zoology`:
1. **Dynamic Sibling Discovery in `hyperstitionstud_io.config`:**
Instead of defaulting to `/workspace`, `load_workspace_config()` computes:
```python
PACKAGE_REPO_ROOT = Path(__file__).resolve().parents[3] # .../hyperstitionstudio-core
WORKSPACE_ROOT = PACKAGE_REPO_ROOT.parent # Parent folder containing all sibling repos
```
and searches for `WORKSPACE_ROOT / "workspace.toml"` before `/workspace/workspace.toml`. All default sibling paths (`core_dir`, `archive_dir`, `zoology_dir`, `knowledge_graph_dir`, `ci_build_dir`) resolve relative to `WORKSPACE_ROOT`.
2. **Dynamic `REPO_ROOT` & Relative `encyclopedia/` Lookup in `build_encyclopedia_knowledge_graph.py`:**
- Set `KG_REPO_ROOT = Path(__file__).resolve().parent.parent` and `UPSTREAM_REPO_DEFAULT = KG_REPO_ROOT.parent / "technocapital-singularity-zoology"`.
- Resolve each volume Markdown file as `md_p = upstream_repo / "encyclopedia" / div_id / f"{slug}.md"` (falling back to `Path(vol["md_path"])` only if the relative path is absent).
3. **Cross-Distro / Cross-OS Font Resolver (`hyperstitionstud_io.publishing.fonts`):**
Search candidate font directories (`/usr/share/fonts/truetype/dejavu`, `/usr/share/fonts/dejavu-sans-fonts`, `/usr/share/fonts/dejavu-sans-mono-fonts`, `/usr/share/fonts/TTF`, `/Library/Fonts`) and fall back cleanly to built-in fonts if DejaVu is not installed.
---
### Phase 2: Synchronize & Commit Pending Upstream Archive Files in `/workspace/ingglish-hyperdope-gematria`
Ensure the upstream archive repository has zero uncommitted or untracked files before pushing:
```bash
cd /workspace/ingglish-hyperdope-gematria
# 1. Verify .mp3 files are ignored in .gitignore so audio binaries do not bloat HTTP clones
grep -q '\*.mp3' .gitignore || printf "\n*.mp3\n__pycache__/\n*.pyc\n" >> .gitignore
# 2. Stage all dossiers (48..70-dossier-*.md), news-aq-harvest-latest.json, and updated scripts
git add -A
git commit -m "feat(archive): sync dossiers 48-70, 2026-11-28 wire harvest, zoology dossiers 65-69, and lecture transcripts"
git status -s -b
```
---
### Phase 3: Provision & Push Repositories in Strict Dependency Order
The Git Operator must create the remote repositories on the Git host (e.g., `https://git.libre.audio/seasharp/<repo>.git` or `https://github.com/<org>/<repo>.git`) with **public HTTP read access enabled** so anonymous users can `git clone https://...` without SSH keys, and push them in topological order:
```bash
# Set your remote base URL (SSH for operator push; public HTTP for new-user clone)
OPERATOR_PUSH_BASE="ssh://git@git.libre.audio:2222/seasharp"
PUBLIC_HTTP_BASE="https://git.libre.audio/seasharp"
# 1. Push Tier 0 Common Library: hyperstitionstudio-core (v1.2.0)
/workspace/hyperstitionstudio-core/push-to-origin.sh "${OPERATOR_PUSH_BASE}/hyperstitionstudio-core.git"
# 2. Push Tier 1 Upstream Archive: ingglish-hyperdope-gematria
cd /workspace/ingglish-hyperdope-gematria
git push -u origin main
# 3. Push Tier 2 Domain Taxonomy & Encyclopedia: technocapital-singularity-zoology (v1.7.0)
cd /workspace/technocapital-singularity-zoology
git remote add origin "${OPERATOR_PUSH_BASE}/technocapital-singularity-zoology.git" 2>/dev/null || \
git remote set-url origin "${OPERATOR_PUSH_BASE}/technocapital-singularity-zoology.git"
git push -u origin main
git push origin --tags
# 4. Push Tier 3 Interactive Knowledge Graph: encyclopedia-knowledge-graph (v1.0.0)
/workspace/encyclopedia-knowledge-graph/push-to-origin.sh "${OPERATOR_PUSH_BASE}/encyclopedia-knowledge-graph.git"
# 5. Push Tier 4 Downstream CI PR Fork: hyperdope-ci-build
cd /workspace/hyperdope-ci-build
git push -u origin feat/ingglish-aq-corpus
```
---
### Phase 4: Standardize the Public HTTP "New User Quickstart" Across All `README.md` Files
Every repository's top-level `README.md` must present the exact same, copy-pasteable **5-Minute New-User Onboarding Block** using **public `https://` clone URLs** and **relative paths** (never requiring `/workspace` or root privileges):
```bash
# 1. Create a parent workspace folder anywhere on your machine
mkdir -p ~/hyperstition-workspace && cd ~/hyperstition-workspace
# 2. Clone the peer repositories over public HTTPS (no SSH key required)
git clone https://git.libre.audio/seasharp/hyperstitionstudio-core.git
git clone https://git.libre.audio/seasharp/ingglish-hyperdope-gematria.git
git clone https://git.libre.audio/seasharp/technocapital-singularity-zoology.git
git clone https://git.libre.audio/seasharp/encyclopedia-knowledge-graph.git
# 3. Create & activate a local Python virtual environment and install dependencies
python3 -m venv .venv
source .venv/bin/activate
pip install --upgrade pip
pip install -r hyperstitionstudio-core/requirements.txt
pip install --no-deps -e ./hyperstitionstudio-core
# 4. Copy the default workspace configuration and run the pre-flight health check
cp hyperstitionstudio-core/workspace.example.toml ./workspace.toml
hs-doctor
# 5. Verify the Knowledge Graph (all 6 CI gates) & launch in your browser
python3 encyclopedia-knowledge-graph/scripts/build_encyclopedia_knowledge_graph.py --verify-only
# Deployment Option A (100% Offline Direct Browser Open — Zero Server):
xdg-open encyclopedia-knowledge-graph/index.html # Linux (or `open` on macOS)
# Deployment Option B (Local HTTP Server — Serves Both Graph Workbench & 22 Encyclopedia PDFs):
python3 -m http.server 8090 --bind 127.0.0.1 --directory .
# Then open: http://127.0.0.1:8090/encyclopedia-knowledge-graph/index.html
```
---
### Phase 5: Mandatory Clean-Room New-User Simulation Gate (Pre-Release Verification)
Before announcing or closing the release, the Git Operator must execute a **Clean-Room New-User Simulation** in an isolated directory outside `/workspace` (e.g., `/tmp/new-user-cleanroom-test`) while temporarily hiding or ignoring `/workspace` defaults:
```bash
rm -rf /tmp/new-user-cleanroom-test
mkdir -p /tmp/new-user-cleanroom-test && cd /tmp/new-user-cleanroom-test
# Clone strictly via git clone (from public HTTP URLs or local bare/repo paths during staging)
git clone /workspace/hyperstitionstudio-core
git clone /workspace/ingglish-hyperdope-gematria
git clone /workspace/technocapital-singularity-zoology
git clone /workspace/encyclopedia-knowledge-graph
# Run every documented new-user command inside /tmp/new-user-cleanroom-test
PYTHONPATH="/tmp/new-user-cleanroom-test/hyperstitionstudio-core/src" \
python3 /tmp/new-user-cleanroom-test/hyperstitionstudio-core/tests/test_core_suite.py
PYTHONPATH="/tmp/new-user-cleanroom-test/hyperstitionstudio-core/src" \
python3 /tmp/new-user-cleanroom-test/encyclopedia-knowledge-graph/scripts/build_encyclopedia_knowledge_graph.py
PYTHONPATH="/tmp/new-user-cleanroom-test/hyperstitionstudio-core/src" \
python3 /tmp/new-user-cleanroom-test/encyclopedia-knowledge-graph/scripts/build_encyclopedia_knowledge_graph.py --verify-only
```
**Release Acceptance Criteria (All 5 Must Pass):**
1. `test_core_suite.py` exits `0` (`ALL 6 TEST SUITES PASSED`) inside `/tmp/new-user-cleanroom-test`.
2. `build_encyclopedia_knowledge_graph.py` exits `0` inside `/tmp/new-user-cleanroom-test` without passing `--upstream-repo` or `--out-dir` flags, producing all `388` nodes and `1,282` deduplicated edges (`281` `IN_VOLUME` edges preserved).
3. `build_encyclopedia_knowledge_graph.py --verify-only` reports `"all_gates_passed": true`.
4. `sources.py verify --evidence` exits `0` (`citations OK`) on all 5 stakeholder proposals inside `/tmp/new-user-cleanroom-test`.
5. `git status -s` is completely empty across every repository in `/workspace`.
@@ -0,0 +1,260 @@
# Production Deployment Plan: Lightning-Fast `hyperstitionstud.io` Homepage & Knowledge Workbench on a Linode / Akamai Connected Cloud VPS (`v1.0.0`)
- **Document ID:** `PLAN-LINODE-AKAMAI-VPS-HOMEPAGE-DEPLOYMENT` (`v1.0.0`)
- **Target Domain:** `https://hyperstitionstud.io` (and `https://www.hyperstitionstud.io` -> `308` redirect)
- **Target Infrastructure:** Linode / Akamai Connected Cloud VPS (Debian 12 Bookworm or Ubuntu 24.04 LTS on AMD EPYC, IPv4 + IPv6 dual-stack, Cloud Firewall + Akamai Edge/DNS)
- **Performance Targets:**
- **Time to First Byte (`TTFB`):** `< 15 ms` (regional) / `< 40 ms` (global)
- **Largest Contentful Paint (`LCP`):** `< 200 ms`
- **Knowledge Graph Payload (`graph-data.js.br`):** `~32 KB` over the wire via Pre-Compressed Brotli-11 (`-q 11`) + HTTP/3 (`QUIC`)
- **Disk I/O on Request Path:** `0 IOPS` (100% served from RAM via `tmpfs` + Linux kernel `sendfile` + `ktls`)
- **Offline Portability Preservation:** The deployed site uses the exact same static bundle (`index.html`, `graph-data.js`, `encyclopedia/*.pdf`) that runs offline over `file://`, with zero external CDN, font, or analytics dependencies.
---
## 1. Architectural Philosophy: Why Static RAM-Backed HTTP/3 Beats Dynamic Application Servers
Every user-facing artifact across the workspace—the **388-node Interactive Encyclopedia Knowledge Graph**, the **22-Volume Alphabetized PDF Encyclopedia (`122` pages)**, the **282-Term Comprehensive Glossary**, the **Assemblage Builds `ETI` Tier List**, the **Gen IV Pokedex Field-Scanner Cards**, the **5-Episode Audio Podcast Series**, and the **Hyperdope-Gematria `AQ` Calculator**—is already deterministically pre-compiled before deployment.
Therefore, the production VPS requires **zero runtime Python, Node.js, or database processes in the HTTP request path**:
1. **Zero Dynamic Compute in the Request Path:**
All Python compilation (`classify_technocapital_singularity.py`, `build_encyclopedia_knowledge_graph.py`, `hs-pdf-build`, `hs-doctor`) runs at **build/release time**, never on incoming HTTP requests.
2. **Pre-Compressed Static Assets (`Brotli -q 11` & `Gzip -9`):**
Every `.html`, `.js`, `.css`, `.json`, `.svg`, `.graphml`, `.gexf`, and `.canvas` artifact is compressed once during release staging (`graph-data.js` shrinks from `~245 KB` raw to `~32 KB` `.br`). The web server sends the pre-built `.br` file directly without spending CPU cycles compressing responses on the fly.
3. **`tmpfs` In-Memory Web Root (`/var/www/hyperstitionstud.io/live`):**
Excluding optional `.mp3` audio streams, the entire compiled static site (HTML, JS, JSON, SVG, PNGs, and all 22 Encyclopedia PDFs) totals **`~34 MB`**. Mounting `/var/www/hyperstitionstud.io/live` on a `256 MB` RAM-backed `tmpfs` (and keeping `.mp3` podcasts in `/srv/hyperstitionstud.io/media/podcast` with HTTP `206` byte-range streaming) guarantees that every page load, graph query, and PDF open is served directly from system RAM.
---
## 2. Linode / Akamai VPS Provisioning, DNS & Kernel Network Tuning
### 2.1 Recommended Linode Instance & Storage Layout
| Resource | Specification | Rationale |
| :--- | :--- | :--- |
| **Instance Plan** | **Linode Dedicated 4 GB** or **Shared 2 GB / 4 GB** (`2 vCPU`, `4 GB RAM`, `80 GB NVMe`, `4 TB Transfer`) | `256 MB` `tmpfs` holds the entire HTML/JS/JSON/PDF corpus in RAM with `> 3 GB` headroom for OS page cache and build staging. |
| **Region** | `us-iad` (Washington, DC) or `us-east` (Newark) | Lowest transatlantic + North American fiber latency on Akamai's backbone. |
| **Base OS** | **Debian 12 (Bookworm)** or **Ubuntu 24.04 LTS** (`Linux 6.8+` kernel) | Native kernel TLS (`ktls`), TCP BBR congestion control, and official Caddy 2 / Nginx Brotli packages. |
| **Linode Cloud Firewall** | Inbound allow **only**:<br/>• `TCP 443` (HTTPS / HTTP/2)<br/>• `UDP 443` (**HTTP/3 QUIC** — critical!)<br/>• `TCP 80` (ACME HTTP-01 & `308` redirect to HTTPS)<br/>• `TCP 22` (SSH, restricted to operator IP/WireGuard) | Blocks all unsolicited port scans at Akamai's hypervisor edge before packets reach the VPS NIC. |
### 2.2 Linode DNS Manager Records (`hyperstitionstud.io`)
Configure in Linode DNS Manager (or Akamai Edge DNS) with `TTL = 300` during cutover, then `TTL = 3600`:
| Type | Name | Value / Target | Purpose |
| :--- | :--- | :--- | :--- |
| `A` | `@` | `<LINODE_IPV4>` | Apex IPv4 (`hyperstitionstud.io`) |
| `AAAA` | `@` | `<LINODE_IPV6>` | Apex IPv6 (`hyperstitionstud.io`) |
| `A` | `www` | `<LINODE_IPV4>` | `www` IPv4 (redirects `308` to apex) |
| `AAAA` | `www` | `<LINODE_IPV6>` | `www` IPv6 (redirects `308` to apex) |
| `CAA` | `@` | `0 issue "letsencrypt.org"` | Authorizes automatic Let's Encrypt TLS 1.3 certificates |
| `HTTPS` | `@` | `1 . alpn="h3,h2"` | **SVCB/HTTPS DNS record (RFC 9460):** Instructs browsers to connect via **HTTP/3 (`h3`)** on the very first packet without waiting for an HTTP/1.1 or HTTP/2 `Alt-Svc` header! |
### 2.3 Linux Kernel TCP BBR & QUIC UDP Buffer Tuning (`/etc/sysctl.d/99-hyperstition-fastnet.conf`)
Apply on the Linode VPS (`sudo sysctl --system`) to eliminate TCP slow-start bottlenecks and UDP buffer drops under HTTP/3 QUIC bursts:
```ini
# /etc/sysctl.d/99-hyperstition-fastnet.conf
net.core.default_qdisc = fq
net.ipv4.tcp_congestion_control = bbr
net.ipv4.tcp_fastopen = 3
net.ipv4.tcp_slow_start_after_idle = 0
net.core.rmem_max = 16777216
net.core.wmem_max = 16777216
net.core.rmem_default = 2097152
net.core.wmem_default = 2097152
```
---
## 3. Unified Site URL Map & Landing Homepage Design (`https://hyperstitionstud.io`)
```text
/var/www/hyperstitionstud.io/live/ (256 MB tmpfs RAM mount — 0 disk I/O)
├── index.html # Lightning-fast (< 8 KB inline CSS/SVG) Portal Homepage
├── graph/ # Interactive Encyclopedia Knowledge Graph Workbench
│ ├── index.html # 388 Nodes, 1,282 Edges (encyclopedia_base_path = "/encyclopedia")
│ ├── graph-data.js (+ .br / .gz) # ~32 KB over the wire via Brotli-11
│ ├── encyclopedia-graph.json (+ .br) # Raw property graph JSON
│ ├── encyclopedia-graph.graphml (+ .br) # Gephi / Cytoscape / yEd export
│ ├── encyclopedia-graph.gexf (+ .br) # GEXF 1.3 export
│ ├── encyclopedia.canvas (+ .br) # Obsidian JSON Canvas 1.0 (282 cards, 1,120 edges)
│ ├── atlas-mode1-trophic-food-web.png # 1600x1060 Static Atlas Board 1
│ ├── atlas-mode2-concentric-eti-radar.png# 1600x1060 Static Atlas Board 2 (S+ -> D Periphery)
│ └── atlas-mode3-bipartite-g1-funnel.png # 1600x1060 Static Atlas Board 3
├── encyclopedia/ # 9 Ontological Divisions (00..08) & 22 PDF Volumes (122 Pages)
│ ├── encyclopedia-manifest.json (+ .br)
│ ├── 00-index-and-ontological-atlas/*.pdf
│ └── ... (01 through 08 division PDFs)
├── zoology/ # Core Dossiers, Tier Lists, Glossary & Architecture Diagrams
│ ├── tier-list-technocapital-assemblage-builds.{pdf,png}
│ ├── technocapital-singularity-zoology-comprehensive-glossary.pdf
│ ├── cross-repo-dependency-and-audit-flow-diagram.{html,png,pdf}
│ ├── OPERATORS-MANUAL-ENCYCLOPEDIA-KNOWLEDGE-GRAPH.pdf
│ └── dossiers/65..69-dossier-*.md
├── pokedex/ # Gen IV INFO Pokedex Field-Scanner Cards & Manifest
│ └── meme_1_custom_pokedex_technocapital_zoology_m7_129_125.{png,pdf}
├── calc/ # Static Hyperdope-Gematria Browser Workbench
│ ├── index.html
│ └── db.json (+ .br / .gz)
└── podcast/ # Symlinked to /srv/hyperstitionstud.io/media/podcast (NVMe)
└── podcast-ep01..05-*.{mp3,pdf} # Served with HTTP 206 Byte-Range streaming
```
### 3.1 Homepage (`/` -> `index.html`) Speed & UX Specification
- **Single-Packet HTML Delivery (`< 10 KB` raw, `< 3.2 KB` Brotli):**
- Inline critical CSS using the exact dark-mode palette (`--bg-canvas: #020617`, `--bg-panel: #0f172a`, `--accent-cyan: #22d3ee`, `--accent-red: #ff4d4d`, `--accent-gold: #f5c630`).
- Zero external `<link>` stylesheets, zero external web fonts (`'DejaVu Sans Mono', 'JetBrains Mono', ui-monospace, monospace`), and zero third-party tracking scripts.
- **Six Instant-Launch Bento Cards Above the Fold:**
1. **Interactive Encyclopedia Knowledge Graph (`/graph/`):** Live node/edge badge (`388 Nodes • 1,282 Edges • 4 Spatial Modes`), direct launch into `Mode 2: Concentric ETI Tier-Ring Radar (S+ -> D Periphery)`, and download links for `.json`, `.graphml`, `.gexf`, and `.canvas`.
2. **22-Volume PDF Encyclopedia & 282-Term Glossary (`/encyclopedia/`):** Direct division matrix (`Divisions 00–08`, `122 Pages`) + 1-click PDF drawer.
3. **Assemblage Builds `ETI` Tier List (`/zoology/tier-list-technocapital-assemblage-builds.png` & `.pdf`):** `S+` (`#1 S1` `93 ETI`, `#2 S2` `90 ETI`) through `D Periphery` (`49 ETI`) visual scorecard.
4. **Gen IV INFO Pokedex Field-Scanner (`/pokedex/`):** `M7_candidate_2026_11_28` (`AWFLAIN == RUHSHA == BLAKWEL == 129`, `DOUNZ == KAPATAL == KAPCHER == 125`).
5. **The Singularity Field Guide Audio Podcast (`/podcast/`):** Native HTML5 `<audio preload="metadata">` player with companion PDF transcripts for Episodes `01–05`.
6. **Base-36 `AQ` & Phonemic `Ingglish` Calculator (`/calc/`):** Client-side cipher evaluation workbench.
- **Smart Prefetching (`<link rel="prefetch">`):**
The homepage includes `<link rel="prefetch" href="/graph/graph-data.js" as="script">` so while the visitor reads the homepage header for 1 second, the `32 KB` Brotli-compressed Knowledge Graph dataset is already warmed in the browser cache—making clicking `/graph/` render all 388 nodes in **0 ms network wait time**.
---
## 4. Web Server Configuration: Caddy 2 (`HTTP/3` + Pre-Compressed `br`/`gzip` + Immutable Caching)
Caddy 2 (`sudo apt install caddy`) provides automatic TLS 1.3 certificate management, native HTTP/3 (`QUIC`), kernel `sendfile`, and first-class `precompressed br gzip` support in a 35-line `/etc/caddy/Caddyfile`:
```caddyfile
# /etc/caddy/Caddyfile
{
servers {
protocols h1 h2 h3
}
}
www.hyperstitionstud.io {
redir https://hyperstitionstud.io{uri} permanent
}
hyperstitionstud.io {
root * /var/www/hyperstitionstud.io/live
encode zstd gzip
# Serve pre-built .br (Brotli-11) and .gz files from RAM with 0 CPU overhead
file_server {
precompressed br gzip
}
# Advertise HTTP/3 QUIC and enforce strict security headers
header {
Alt-Svc "h3=\":443\"; ma=2592000"
Strict-Transport-Security "max-age=63072000; includeSubDomains; preload"
X-Content-Type-Options "nosniff"
Referrer-Policy "strict-origin-when-cross-origin"
-Server
}
# Long-lived caching for heavy static PDFs, PNGs, and MP3s (with ETag + HTTP 206 Byte-Range)
@immutable_media path *.pdf *.png *.mp3 *.graphml *.gexf *.canvas
header @immutable_media Cache-Control "public, max-age=86400, stale-while-revalidate=604800"
# Instant revalidation for HTML & graph-data.js
@html_js path *.html *.js *.json
header @html_js Cache-Control "public, max-age=300, stale-while-revalidate=86400"
}
```
---
## 5. Atomic Build, Pre-Compression & RAM-Sync Release Script (`deploy-hyperstitionstud-io.sh`)
The operator deploys updates using a deterministic, zero-downtime release script that:
1. Runs `hs-doctor` and `build_encyclopedia_knowledge_graph.py --verify-only` (aborting immediately if any of the 6 CI gates or SHA-256 glossary isolation locks fail).
2. Assembles the release directory `/srv/hyperstitionstud.io/releases/<UTC_TIMESTAMP>`, setting `encyclopedia_base_path = "/encyclopedia"` in the deployed `/graph/graph-data.js` so PDF links resolve cleanly from `/graph/`.
3. Pre-compresses all text/JSON/JS/XML/HTML artifacts at maximum compression (`brotli -q 11 -k` and `gzip -9 -k`).
4. Atomically flips `/srv/hyperstitionstud.io/current` and `rsync --delete` syncs the release into the `/var/www/hyperstitionstud.io/live` `tmpfs` RAM mount in `< 50 ms`.
```bash
#!/usr/bin/env bash
# deploy-hyperstitionstud-io.sh — Atomic Pre-Compressed RAM-Backed Release Builder
set -euo pipefail
WORKSPACE_DIR="${WORKSPACE_DIR:-/workspace}"
RELEASE_ROOT="/srv/hyperstitionstud.io"
LIVE_TMPFS="/var/www/hyperstitionstud.io/live"
STAMP="$(date -u +%Y%m%dT%H%M%SZ)"
REL_DIR="${RELEASE_ROOT}/releases/${STAMP}"
echo "[1/5] Running hs-doctor & 6-Gate Knowledge Graph Verification..."
hs-doctor >/dev/null
python3 "${WORKSPACE_DIR}/encyclopedia-knowledge-graph/scripts/build_encyclopedia_knowledge_graph.py" --verify-only >/dev/null
echo "[2/5] Staging static release bundle at ${REL_DIR}..."
mkdir -p "${REL_DIR}"/{graph,encyclopedia,zoology/dossiers,pokedex,podcast,schemas/v1}
# Copy Knowledge Graph Workbench & rewrite encyclopedia_base_path for /encyclopedia web route
cp -a "${WORKSPACE_DIR}/encyclopedia-knowledge-graph"/{index.html,encyclopedia-graph.*,encyclopedia.canvas,atlas-mode*.png} "${REL_DIR}/graph/"
python3 - <<PY
import json
from pathlib import Path
src = Path("${WORKSPACE_DIR}/encyclopedia-knowledge-graph/encyclopedia-graph.json")
data = json.loads(src.read_text(encoding="utf-8"))
data["encyclopedia_base_path"] = "/encyclopedia"
j_str = json.dumps(data, separators=(",", ":"), ensure_ascii=False)
(Path("${REL_DIR}/graph/encyclopedia-graph.json")).write_text(j_str, encoding="utf-8")
(Path("${REL_DIR}/graph/graph-data.js")).write_text(
"window.HyperstitionStudio=window.HyperstitionStudio||{};"
f"window.HyperstitionStudio.EncyclopediaGraphData={j_str};"
"window.ENCYCLOPEDIA_GRAPH_DATA=window.HyperstitionStudio.EncyclopediaGraphData;",
encoding="utf-8",
)
PY
# Copy 22-Volume PDF Encyclopedia, Zoology Reports, Schemas & Pokedex
cp -a "${WORKSPACE_DIR}/technocapital-singularity-zoology/encyclopedia"/* "${REL_DIR}/encyclopedia/"
cp -a "${WORKSPACE_DIR}/technocapital-singularity-zoology/dossiers"/*.md "${REL_DIR}/zoology/dossiers/"
cp -a "${WORKSPACE_DIR}/technocapital-singularity-zoology"/tier-list-technocapital-assemblage-builds.{pdf,png} "${REL_DIR}/zoology/"
cp -a "${WORKSPACE_DIR}/technocapital-singularity-zoology"/technocapital-singularity-zoology-comprehensive-glossary.pdf "${REL_DIR}/zoology/"
cp -a "${WORKSPACE_DIR}/encyclopedia-knowledge-graph/OPERATORS-MANUAL-ENCYCLOPEDIA-KNOWLEDGE-GRAPH.pdf" "${REL_DIR}/zoology/"
cp -a "${WORKSPACE_DIR}/encyclopedia-knowledge-graph/docs/cross-repo-dependency-and-audit-flow-diagram".{html,png,pdf} "${REL_DIR}/zoology/"
cp -a "${WORKSPACE_DIR}/hyperstitionstudio-core/schemas/v1"/*.json "${REL_DIR}/schemas/v1/"
cp -a "${WORKSPACE_DIR}/memes"/meme_1_custom_pokedex_technocapital_zoology_m7_129_125.{png,pdf} "${REL_DIR}/pokedex/"
echo "[3/5] Pre-compressing HTML, JS, JSON, XML & Canvas assets with Brotli (-q 11) and Gzip (-9)..."
find "${REL_DIR}" -type f \( -name "*.html" -o -name "*.js" -o -name "*.json" -o -name "*.graphml" -o -name "*.gexf" -o -name "*.canvas" -o -name "*.md" \) | while read -r f; do
gzip -9 -k -f "$f"
if command -v brotli >/dev/null 2>&1; then
brotli -q 11 -k -f "$f"
fi
done
echo "[4/5] Flipping atomic symlink ${RELEASE_ROOT}/current -> ${REL_DIR}..."
ln -sfn "${REL_DIR}" "${RELEASE_ROOT}/current"
echo "[5/5] Syncing into RAM-backed ${LIVE_TMPFS}..."
mkdir -p "${LIVE_TMPFS}"
rsync -a --delete "${RELEASE_ROOT}/current/" "${LIVE_TMPFS}/"
echo "[OK] Deployed release ${STAMP} to ${LIVE_TMPFS}"
```
---
## 6. Post-Deploy Verification & Benchmark Checklist
After running `deploy-hyperstitionstud-io.sh` on the Linode VPS, verify all 5 speed and integrity gates:
1. **HTTP/3 QUIC & Brotli Verification:**
```bash
curl -I --http3 -H "Accept-Encoding: br" https://hyperstitionstud.io/graph/graph-data.js
```
Confirm `HTTP/3 200`, `content-encoding: br`, and `content-length` around `32000` bytes (`~87%` compression ratio).
2. **Sub-15ms TTFB Latency Benchmark:**
```bash
curl -o /dev/null -s -w "DNS: %{time_namelookup}s | TLS: %{time_appconnect}s | TTFB: %{time_starttransfer}s | Total: %{time_total}s\n" https://hyperstitionstud.io/
```
3. **PDF Byte-Range Streaming Verification (Encyclopedia Volumes):**
```bash
curl -I -H "Range: bytes=0-1023" https://hyperstitionstud.io/encyclopedia/00-index-and-ontological-atlas/00-master-encyclopedia-index-a-to-z.pdf
```
Confirm `HTTP/2 206` (or `HTTP/3 206`) and `accept-ranges: bytes`.
4. **Offline Portability Parity:**
Downloading `/graph/index.html` and `/graph/graph-data.js` still works 100% offline with zero external CDN or font requests.
Binary file not shown.
+22 -12
View File
@@ -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"))