Files
encyclopedia-knowledge-graph/docs/MILESTONE-V2-RELEASE-WINS-AND-LESSONS-LEARNED.md

47 lines
7.7 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# Milestone Release Report (`v2.0.0`): Wins Achieved, Architecture Codified & Lessons Learned Across the `hyperstitionstud.io` Ecosystem
- **Document ID:** `MILESTONE-V2-RELEASE-WINS-AND-LESSONS-LEARNED` (`v2.0.0`)
- **Milestone Release Tag Across Core Repositories:** `v2.0.0`
- `/workspace/hyperstitionstudio-core` (`v2.0.0`)
- `/workspace/encyclopedia-knowledge-graph` (`v2.0.0`)
- `/workspace/technocapital-singularity-zoology` (`v2.0.0`)
- `/workspace/ingglish-hyperdope-gematria` (`main`, synchronized `v2.0.0` dependency manifest)
- `/workspace/haiperdohp-jemaytreeah` (`main`, integrated `/calc/` application)
- `/workspace/hyperdope-ci-build` (`feat/ingglish-aq-corpus`, `/ci/` 4-Gate CI corpus)
- **Live Production Verification:** `10/10` end-to-end deployment success (`28/28` HTTP routes verified `200 OK`; `6/6` core test suites passed; `6/6` Knowledge Graph CI gates passed; `0` SHA-256 mutations on protected upstream registries).
---
## 1. Major Engineering & Domain Wins Achieved in the `v2.0.0` Milestone
1. **Six-Repository Modular Peer-Sibling Architecture (`git.libre.audio` <-> Local `/workspace` <-> Linode/Akamai VPS):**
- Established a 1-to-1 mapping between the 6 `git.libre.audio` repositories under `seasharp`, their persistent VPS clones in `/srv/hyperstitionstud.io/repos/<repo-slug>`, their RAM-backed `tmpfs` mirrors in `/var/www/hyperstitionstud.io/repos/<repo-slug>` (`512 MB`, `0` disk IOPS in the HTTP/3 request path), and their live web routes on `https://hyperstitionstud.io`:
- `/` & `/schemas/v1/*` -> `hyperstitionstudio-core` (`site/index.html` & `schemas/v1/*.schema.json`)
- `/graph/*` -> `encyclopedia-knowledge-graph` (`388` nodes, `1,282` deduplicated edges, 4 spatial layout modes + 1-hop ego isolator)
- `/encyclopedia/*`, `/technocapital-singularity-zoology/*` & `/zoology/*` -> `technocapital-singularity-zoology` (`9` divisions, `22` PDF volumes, `122` pages, `282`-term glossary, `ETI v2.0.0` tier list, Dossiers `65–69`, and 5 stakeholder proposals)
- `/archive/*` -> `ingglish-hyperdope-gematria/ingglish-aq-archive` (Dossiers `01–70` & `00:00 GMT` wire harvests)
- `/calc/*` -> `haiperdohp-jemaytreeah` (confluence of `hyperdope-ci-build` database output and upstream `hyperdope-gematria` UI with `ING` match-priority sort toggle)
- `/ci/*` -> `ingglish-hyperdope-ci` (`ONBOARDING-INGGLISH-AQ.pdf` & `ci-audit-report.json`).
2. **Shared Common Library (`hyperstitionstudio-core` / `hyperstitionstud_io.*` v2.0.0):**
- Extracted unified Base-36 `AQ` cipher math, prime-rank sieves, `G1–G6` vector evaluators, a `4,897`-entry offline `CMUdict` phonetics fallback (`cmudict_fallback.json`), a cross-OS TrueType font resolver (`publishing.fonts`), a ReportLab Markdown-to-PDF compiler (`hs-pdf-build`), a pure-Python `hashlib.sha256` isolation context manager (`ReadOnlyIsolationGuard`), a full 11-function / 7-subcommand local-config citation verifier (`hs-citations`), and a single-command environment diagnostic (`hs-doctor`).
3. **100% Offline (`file://`) & HTTP/3 Edge (`https://`) Dual Portability:**
- Replaced all networked `https://` schema and font links with RFC 8141 URN identifiers (`urn:io:hyperstitionstud:ns:kg:1.0`, `urn:io:hyperstitionstud:schema:v1:*`), local relative `$schema` paths, synchronous `<script src="graph-data.js">` data loading, and local monospace font stacks.
- Because Caddy maps `/technocapital-singularity-zoology/*` alongside `/graph/*`, the unmodified relative link `../technocapital-singularity-zoology/encyclopedia/<div_id>/<slug>.pdf` inside `encyclopedia-knowledge-graph/index.html` works identically over `file://`, local `python3 -m http.server`, and production `https://hyperstitionstud.io/graph/` without rewriting a single byte of `graph-data.js`.
4. **Cryptographic Read-Only Upstream Isolation (`Zero Glossary Leak`):**
- Across every graph rebuild, common-library refactor, and VPS deployment pass, `taxonomy/glossary-registry.json` (`282` entries, SHA-256 `7564ef40fb3e0e18d1d8547522db431b6a369c40139713b573df6e58b972d43d`) and `encyclopedia/encyclopedia-manifest.json` (`9` divisions, `22` PDFs, SHA-256 `0d7ce833bb0aa0eea069bf764b2e3b0b36ac2631821c42f3d6bcb897335f8a7d`) remained 100% byte-for-byte invariant.
---
## 2. Eight Technical Lessons Learned & Permanently Codified
| # | Symptom / Failure Mode Encountered | Root Cause | Permanent Engineering Fix Codified in `v2.0.0` |
| :- | :--- | :--- | :--- |
| **1** | `--query-node "125"` reported `degree: 8` but `incident_edge_count: 9` in the Knowledge Graph. | Shared flex hubs (`125`, `129`, `133`, `136`, `137`) bridged by multiple guilds emitted duplicate parallel `TROPHIC_GUILD_BRIDGE` edges (`("aq:125", "build:S6")`). | Added `seen_edges: set[tuple[str, str, str]]` in `add_edge()`, deduplicating `1,287 -> 1,282` edges (`40 -> 35` bridge edges) so `incident_edge_count == degree` holds globally. |
| **2** | `ModuleNotFoundError: No module named 'io.hyperstitionstud'; 'io' is not a package`. | `io` is a built-in C stdlib module in Python (`sys.builtin_module_names`), which cannot act as a PEP 420 namespace package root. | Named the top-level Python package `hyperstitionstud_io` (`from hyperstitionstud_io.ciphers import ...`) while retaining `urn:io:hyperstitionstud:*` for XML/JSON URNs. |
| **3** | Citation URL resolution risked coupling to `git remote` subprocesses or fabricating dead global namespace URLs. | Mixing code/schema identity (`hyperstitionstud.io`) with artifact hosting location. | Restricted `resolve_citation_target()` in `hyperstitionstud_io.ci.citation_sources` strictly to `[citations.path_mounts]` in local `workspace.toml`, falling back to the verified local filesystem path (`0%` VCS subprocesses). |
| **4** | Outside `/workspace`, `build_encyclopedia_knowledge_graph.py` dropped all `281` `IN_VOLUME` edges. | `encyclopedia-manifest.json` stores `/workspace/...` in `vol["md_path"]`; checking `Path(vol["md_path"]).exists()` failed in other directories. | Resolved volume Markdown files relative to `upstream_repo / "encyclopedia" / div_id / f"{slug}.md"` first, keeping `encyclopedia-manifest.json`'s locked SHA-256 untouched. |
| **5** | `push-all-to-git-libre-audio.sh` failed under host `zsh`/`sh` with `No module named 'hyperstitionstud_io'`. | `${BASH_SOURCE[0]}` is unset in `zsh`/`sh`, and `PYTHONPATH` had no exported default value. | Used `${BASH_SOURCE[0]:-$0}` with explicit `/workspace` fallback and `export PYTHONPATH="${WORKSPACE_DIR}/hyperstitionstudio-core/src..."`. |
| **6** | `hs-doctor` failed on the VPS in Step 5 (`Verify environment & all 6 Knowledge Graph CI gates`). | In `src/hyperstitionstud_io/config/__init__.py`, `Path(__file__).resolve().parents[2]` stopped at `hyperstitionstudio-core/src` instead of `parents[3]` (`hyperstitionstudio-core`), so `WORKSPACE_ROOT` missed `/srv/hyperstitionstud.io/repos/workspace.toml`. | Updated `CORE_REPO_ROOT` to `parents[3]` and added `Path.cwd() / "workspace.toml"` to the configuration search candidates. |
| **7** | `haiperdohp-jemaytreeah` fresh clones lacked `config.js`, `db.json`, and `db_lite.json` (`404` on `/calc/*`). | `haiperdohp-jemaytreeah/.gitignore` excludes those 3 files, and `generate_db_json.py` requires explicit `db.txt db.json` arguments. | Added explicit Step 2b / Step 5 instructions and automated `cp config.default.js config.js` + `python3 tools/generate_db_json.py db.txt db.json` inside `deploy/sync-vps-repos.sh`. |
| **8** | `sudo apt update` on Debian VPS reported `NO_PUBKEY ABA1F9B8875A6661` on Caddy's Cloudsmith repo. | Cloudsmith rotated the GPG signing key for `dl.cloudsmith.io/public/caddy/stable`. | Added the GPG keyring refresh (`curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/gpg.key' \| sudo gpg --dearmor --yes -o /usr/share/keyrings/caddy-stable-archive-keyring.gpg`) directly into Step 3 of the VPS deployment guide. |