Release v2.17.0: Update documentation, workflow diagrams, and plan ledgers

This commit is contained in:
Hermes Agent committed 2026-12-02 07:11:07 +00:00
1 parent 37b9e0226f
commit 61a723c021
14 files changed
+286 -96

No files matched your search

@@ -0,0 +1,117 @@
# PLAN: Front-End-Grouped Architecture Atlas Tracing Producer/Consumer Binaries & Artifacts (`PLAN #67`)
**Document ID:** `PLAN-FRONT-END-GROUPED-ARCHITECTURE-ATLAS-AND-RELEASE-SYNC`
**Status:** `ACTIVE (docs/plans/active/)`
**Target Ecosystem Version:** `v2.18.0` (Baseline: `v2.17.0`)
**Target Repositories:** `hyperstitionstudio-core`, `encyclopedia-knowledge-graph`
**Web Route:** `https://hyperstitionstud.io/graph/docs/architecture-atlas.html` (`/graph/docs/architecture-atlas.html`)
**Author:** m00t & Hermes Agent
**Date:** 2026-12-01
---
## 1. Objective & Engineering Constraints
Build a lightweight, deterministic **Architecture Atlas** (`hyperstitionstud_io.publishing.architecture_atlas`, CLI `hs-arch-atlas`) that traces every **binary/script**, **intermediate/published artifact**, and **front-end tool** across the 6-repository `hyperstitionstud.io` ecosystem (`hyperstitionstudio-core`, `ingglish-hyperdope-gematria`, `technocapital-singularity-zoology`, `encyclopedia-knowledge-graph`, `haiperdohp-jemaytreeah`, `hyperdope-ci-build`), explicitly modeling producer -> artifact -> consumer lineage (for example: `hs-quant-harvest` & `hs-macro-harvest` -> `real-market-history.json` & `real-macro-indicators-latest.json` -> `quant/timeseries.py` -> `quant-timeseries.json` -> `hs-daily-brief` -> `daily-brief-latest.json` & `daily-brief-data.js` -> `/quant/` Panel 6 & `/api/v1/tools/hs_generate_daily_portfolio_brief`).
### Four Hard Design Invariants
1. **Front-End Tool Grouping Without Severing Interconnections:** Group diagrams by the **front-end tool / surface** they serve (`8` tool-centered groups `G01.QUANT` .. `G08.MCP_DEPLOY` + `1` shared backbone overview), while preserving **100%** of cross-group producer/consumer dependencies via typed **Boundary Port Pills** (`[IN <- G04.ZOOLOGY: <artifact>]` and `[OUT -> G08.MCP_DEPLOY: <consumer>]`) backed by clickable same-page lowercase hyphenated DOM anchors (`#g01-quant` .. `#g08-mcp-deploy`, avoiding CSS selector dot-collision on `.`) and matching canonical node/edge IDs (`binary:*`, `artifact:*`, `frontend:*`, `service:*`, `port:*`).
2. **Lightweight on Disk (`<= 85 KB` raw, `<= 16 KB` Brotli-11):** Render as a **single self-contained inline-SVG HTML document** (`/workspace/encyclopedia-knowledge-graph/docs/architecture-atlas.html`) plus an optional compact JSON graph index (`architecture-atlas.json`, `<= 25 KB`), avoiding multi-hundred-KB raster PNGs (`285 KB` each) and duplicate embedded-font PDFs in Git.
3. **Lightweight on Recompilation / Rerendering (`< 5 ms` no-op, `< 50 ms` dirty rebuild, `0` Pillow/ReportLab raster work):** Compute a deterministic `SHA-256` content digest over the introspected topology + `CURRENT_VERSION` (`vX.Y.Z`). With `--if-changed` (default in hooks/tests), rewrite disk artifacts **only when the topology or version actually changes**, eliminating spurious dirty Git diffs during `test_core_suite.py` runs.
4. **Automatic Release Synchronization (`0` extra manual steps):** Integrate into `hs-sync-version` (`version_sync.py`), `push-all-to-git-libre-audio.sh`, `deploy/sync-vps-repos.sh` (`.br`/`.gz` pre-compression), and `tests/test_core_suite.py` (coverage gate asserting 100% of `pyproject.toml` `[project.scripts]` binaries and `deploy/Caddyfile` routes appear in the atlas).
---
## 2. Format Selection & Disk / Render Footprint Budget
| Candidate Format | Disk Footprint (Uncompressed) | Brotli-11 VPS Size | Re-render Cost | Ctrl+F Searchable & Clickable Cross-Links | Decision |
| :--- | :---: | :---: | :---: | :---: | :--- |
| **Inline-SVG Self-Contained HTML (`architecture-atlas.html`) + `architecture-atlas.json`** | `~55–80 KB` total (`1` HTML + `1` JSON) | `~10–15 KB` | `< 5 ms` (`--if-changed` no-op) / `< 50 ms` rebuild (`0` Pillow/ReportLab) | Yes (`Ctrl+F` across all binary/artifact labels + clickable `#g01-quant..#g08-mcp-deploy` port links) | **SELECTED** |
| Per-group PNG suite (`8 × 285 KB`) | `~2.3 MB` binary assets in Git | `~2.3 MB` (incompressible) | `~2.5 s` Pillow rasterization + noisy binary diffs | No (`0` searchable text, `0` clickable links) | **REJECTED** |
| Compiled ReportLab PDF atlas | `~120–250 KB` per rebuild | `~120–250 KB` | `~600 ms` + non-deterministic stream diffs | Partial (`#page=`, poor interactive navigation) | **REJECTED** |
- **Visual Styling:** Reuses the offline Group 3 Stealth Basalt inline-SVG/CSS aesthetic (`#020617` void + `40px` grid, `#0f172a` double-rect masking behind arrows, DejaVu Sans Mono stack with zero external Google Fonts, semantic stroke colors: Cyan `#22d3ee` Front-End Tools, Emerald `#34d399` Binaries/CLIs, Violet `#a78bfa` Stored Artifacts/DBs, Amber `#fbbf24` Timers/Sync/Forge, Rose `#fb7185` Isolation/Security/CI Gates).
---
## 3. Front-End Tool Grouping Topology (`G01.QUANT` .. `G08.MCP_DEPLOY`, Zero Severed Edges)
The atlas (`architecture-atlas.html`) renders **Section 0 (Master Cross-Tool Backbone)** followed by **8 Front-End Tool Sub-Diagrams (`G01.QUANT` .. `G08.MCP_DEPLOY`)**. Cross-group edges never break: whenever an artifact produced in one group is consumed in another, the producing group emits a right-gutter **Output Port Pill** (`[OUT -> G03.GRAPH: taxonomy/*.json]` linking to `#g03-graph`) and the consuming group renders a matching left-gutter **Input Port Pill** (`[IN <- G04.ZOOLOGY: taxonomy/*.json]` linking back to `#g04-zoology`), both referencing the same canonical artifact ID (`artifact:*`). Using `id="g01-quant"` .. `id="g08-mcp-deploy"` for DOM/CSS anchors while displaying `G01.QUANT` .. `G08.MCP_DEPLOY` in diagram labels prevents CSS selector dot-parsing collisions.
### Section 0: Master Cross-Tool Backbone & Release/Deploy Spine
- Traces the top-level 6-repo flow at a glance:
- **Producers:** LAN Host `ingglish-exegesis.timer` (`ingglish-exegesis-push`) + VPS `systemd` timers (`run-vps-data-production.sh`, `run-vps-archive-rotation.sh`) + Developer `push-all-to-git-libre-audio.sh` (`hs-sync-version`, `hs-readme-sync`, `hs-deploy-scripts-sync`).
- **Hub & Hydrator:** `git.libre.audio` -> `deploy/sync-vps-repos.sh` -> `/var/www/hyperstitionstud.io/repos` (`tmpfs`, `.br`/`.gz`, `deploy/Caddyfile` + `hyperstition-mcp.service :8095`).
### `G01.QUANT` (`#g01-quant`): `/quant/` — Quantitative Time-Series, Macro & Bayesian Brief Workbench
- **Binaries & Modules:**
- `hs-quant-harvest` (`quant/collector.py`)
- `hs-macro-harvest` (`quant/macro.py`)
- `python3 -m hyperstitionstud_io.quant.timeseries` (`quant/timeseries.py`)
- `hs-daily-brief` (`quant/daily_brief.py`)
- `hs-ticker-card` (`quant/cards.py`)
- `hs-quant-voice-build` (`publishing/quant_voice.py`)
- `hs-pdf-build` (`publishing/pdf_compiler.py`)
- **Explicit Producer -> Artifact -> Consumer Trace (`hs-daily-brief` exemplar):**
1. `hs-quant-harvest` -> produces `ingglish-aq-archive/data/financial-aq-harvest-latest.json` & `site/quant/real-market-history.json`.
2. `hs-macro-harvest` -> produces `ingglish-aq-archive/data/real-macro-indicators-latest.json`.
3. `quant/timeseries.py` -> consumes `real-market-history.json` + `[IN <- G05.ARCHIVE: 25..NN-dossier-news-*.md]` + `[IN <- G04.ZOOLOGY: quantitative-economic-anchors.json]` -> produces `site/quant/quant-timeseries.json` & `quant-timeseries-data.js`.
4. **`hs-daily-brief`** -> consumes `real-macro-indicators-latest.json`, `quant-timeseries.json`, and prior `ingglish-aq-archive/data/daily-brief-state.json` (plus `ReadOnlyIsolationGuard` over `[IN <- G04.ZOOLOGY: glossary-registry.json, encyclopedia-manifest.json]`) -> produces `ingglish-aq-archive/data/daily-brief-state.json`, `site/quant/daily-brief-latest.json`, and `site/quant/daily-brief-data.js` -> consumed by `/quant/index.html` (Panel 6) and `[OUT -> G08.MCP_DEPLOY: hs_generate_daily_portfolio_brief]`.
5. `hs-ticker-card` -> consumes `quant-timeseries.json` + `[IN <- G04.ZOOLOGY: assemblage-builds-tier-list.json]` -> produces `*-stats-card.{png,json}` -> `[OUT -> G08.MCP_DEPLOY: /api/v1/tools/hs_generate_ticker_stats_card]`.
6. `hs-quant-voice-build` -> consumes `site/quant/quant-tutorials.js` -> produces deploy-time `site/quant/audio/ep0X-sY.wav` (gitignored, hydrated on VPS).
### `G02.CALC_CI` (`#g02-calc-ci`): `/calc/` & `/ci/` — Multi-Cipher Workbench (`haiperdohp-jemaytreeah`) & 4-Gate CI
- **Binaries & Scripts:** `ci_provision_ingglish.py`, `tools/normalize_caps.py`, `tools/classify_candidates.py`, `tools/generate_db_json.py`, `integrate-upstream-and-ui.sh` (`hyperdope-ci-build`), `run_exegesis_and_push_fedora41.sh`.
- **Artifacts:** `[IN <- G05.ARCHIVE: 01..NN-*.md & node_modules/ingglish]` -> `ci_provision_ingglish.py` produces `/ci/` (`db_ingglish_entries.txt`, `ci-audit-report.json`, `pr-payload.json`, `ONBOARDING-INGGLISH-AQ.{md,pdf}`) and patches `haiperdohp-jemaytreeah/db.txt` -> `generate_db_json.py` compiles `db_lite.json` (`16` ciphers) + `db.json` (`82` ciphers) + `config.js` -> consumed by `/calc/index.html` and `[OUT -> G07.PORTAL_LEARN: /calc/ Closeups]`.
### `G03.GRAPH` (`#g03-graph`): `/graph/` — Interactive Knowledge Graph Workbench & Plan Archives
- **Binaries & Scripts:** `hs-kg-build` (`graph/cli.py`), `build_encyclopedia_knowledge_graph.py`, `hs-archive-rotate` (`publishing/archive_rotator.py`), `hs-pdf-build`.
- **Artifacts:** `[IN <- G04.ZOOLOGY: taxonomy/*.json, encyclopedia-manifest.json]` -> `build_encyclopedia_knowledge_graph.py` produces `encyclopedia-graph.{json,graphml,gexf}`, `graph-data.js`, `encyclopedia.canvas`, `atlas-mode{1,2,3}.png` -> consumed by `/graph/index.html` and `[OUT -> G08.MCP_DEPLOY: hs_query_knowledge_graph & hs-db-build]`.
- **Plan/Manual Lineage:** `hs-archive-rotate` rotates `docs/archive/PLAN-*.md` & `docs/plans/inactive/` -> `completed-plans-archive.tar.gz` + `archive-manifest.json` & `inactive-plans-archive.tar.gz` + `inactive-archive-manifest.json` -> `[OUT -> G08.MCP_DEPLOY: hs_inspect_documentation_and_manuals]`.
### `G04.ZOOLOGY` (`#g04-zoology`): `/zoology/` & `/encyclopedia/` — Taxonomy, Glossary, ETI Tier List & 22-Volume PDFs
- **Binaries & Scripts:** `classify_technocapital_singularity.py`, `sources.py`, `hs-citations` (`ci/citation_sources.py`), `generate_aq_tier_list.py`, `build_wire_report_pdf.py`.
- **Artifacts:** `[IN <- G05.ARCHIVE: node_modules/ingglish & 65..69-dossier-*.md]` -> produces `taxonomy/*.json` (`glossary-registry.json`, `singularity-zoology-matrix.json`, `memetic-superclass-registry.json`, `quantitative-economic-anchors.json`, `assemblage-builds-tier-list.json`, `citations-ledger-*.json`), `encyclopedia/00..08/*.pdf` (`22` PDFs), `tier-list-*.{md,pdf,png}`, `comprehensive-glossary.{md,pdf}`, `proposal-*.{md,pdf}` -> `[OUT -> G01.QUANT, G03.GRAPH, G08.MCP_DEPLOY]`.
### `G05.ARCHIVE` (`#g05-archive`): `/archive/` — Current-Events & Thematic Ingglish AQ Corpus + Fedora 41 Worker
- **Binaries & Scripts:** `collect_news_aq.py`, `synthesize_news_dossier_openrouter.py`, `evaluate_aq.mjs`, `manage_lecture_artifacts.py`, `packaging/build-fedora41-rpm.sh`, `/usr/bin/ingglish-exegesis-push` (`run_exegesis_and_push_fedora41.sh`).
- **Artifacts:** `news-aq-harvest-*.json` -> `25..73+-dossier-news-YYYY-MM-DD.md` & `00-index-and-methodology.md` + `01-ingglish-aq-lexicon.md` + `65..69-dossier-*.md` + `ingglish-isopsephic-exegesis-*.fc41.noarch.rpm` -> `[OUT -> G01.QUANT, G02.CALC_CI, G04.ZOOLOGY]`.
### `G06.ENG_MATH` (`#g06-eng-math`): `/engineering/` & `/math/` — Live-Introspected Explication Hubs & Polyglot REPL
- **Binaries & Modules:** `hs-eng-docs` (`publishing/engineering_docs.py`), `hs-math-docs` (`publishing/math_docs.py`), `publishing/polyglot_sandbox.py`.
- **Artifacts:** Introspects `[IN <- G08.MCP_DEPLOY: pyproject.toml, mcp/tools.py, schemas/v1/]` + `[IN <- G01.QUANT / G03.GRAPH / G04.ZOOLOGY: ciphers, phonetics, quant, lenses, ipld]` -> produces `site/engineering/{index.html,*/index.html,engineering-manifest.json,engineering-manifest-data.js}`, `site/math/{index.html,*/index.html,math-manifest.json,math-manifest-data.js}`, wired with `site/assets/hs-guile-scheme-repl.js` -> `[OUT -> G08.MCP_DEPLOY: hs_inspect_engineering_and_math_docs & hs_evaluate_polyglot_sandbox]`.
### `G07.PORTAL_LEARN` (`#g07-portal-learn`): `/` (Portal Home), `/learn/` & `/donate/` — Showcase, Interactive Track & Repo READMEs
- **Binaries & Modules:** `hs-closeups-sync` (`publishing/closeups_sync.py`), `hs-readme-sync` (`publishing/readme_sync.py`), `hs-highlights` (`publishing/highlights.py`).
- **Artifacts:** Introspects UI states across `[IN <- G01.QUANT, G02.CALC_CI, G03.GRAPH, G06.ENG_MATH]` -> produces `site/assets/closeups/{quadrant-*.png,ui-elements-manifest.json}` consumed by `site/index.html`; `hs-readme-sync` maintains all `6` root `README.md` files + `.git/hooks/{pre-commit,commit-msg}`; `site/learn/{index.html,learn-app.js}` & `site/donate/index.html` bind `schemas/v1/learn-progress-state.schema.json`.
### `G08.MCP_DEPLOY` (`#g08-mcp-deploy`): `/mcp`, `/api/v1/*` & `/schemas/` — Stateless MCP/REST Server, SQLite Catalog & Release/Deploy Pipeline
- **Binaries & Modules:** `hs-mcp` (`mcp/{server,tools,resources,rest}.py`), `hs-db-build` (`db/sqlite_meta.py`), `hs-doctor` (`ci/doctor.py`), `hs-public-smoke` (`ci/public_regression.py`), `hs-sync-version` (`version_sync.py`), `hs-deploy-scripts-sync` (`ci/deploy_scripts_sync.py`), `deploy/{run-vps-data-production.sh,run-vps-archive-rotation.sh,sync-vps-repos.sh}`, `push-all-to-git-libre-audio.sh`.
- **Artifacts:** `hs-db-build` indexes `[IN <- G03.GRAPH, G04.ZOOLOGY, G05.ARCHIVE, G06.ENG_MATH, G07.PORTAL_LEARN]` into `.cache/hyperstition-catalog.db` & `.cache/api-telemetry.db` -> served alongside `[IN <- G01.QUANT: daily-brief-latest.json, quant-timeseries.json]` over `/mcp` (`20` tools, `14` resources) & `/api/v1/*` (with `ETag` `304`); `hs-doctor` + `hs-public-smoke` maintain `.cache/internal-test-baseline-latest.json`.
---
## 4. Architecture & Implementation Modules
1. **Create `src/hyperstitionstud_io/publishing/architecture_atlas.py` (`hs-arch-atlas`):**
- Defines typed node & edge dataclasses:
- `AtlasNode(id, group_id, kind, label, repo, path_or_route, module_or_entry)` where `kind in {"binary", "artifact", "frontend", "service", "port"}`, `group_id in {"G01.QUANT", "G02.CALC_CI", "G03.GRAPH", "G04.ZOOLOGY", "G05.ARCHIVE", "G06.ENG_MATH", "G07.PORTAL_LEARN", "G08.MCP_DEPLOY"}`, and `id` uses typed prefixes (`binary:*`, `artifact:*`, `frontend:*`, `service:*`, `port:in:*`, `port:out:*`).
- `AtlasEdge(src_id, dst_id, verb, label)` where `verb in {"produces", "consumes", "serves", "verifies", "syncs"}`.
- **Live Introspection + Coverage Verification:** Reads `pyproject.toml` (`[project.scripts]`), `mcp/tools.py` (`MCP_TOOLS_SCHEMA`), and `deploy/Caddyfile` (`handle_path` routes) at build time. Computes `topology_sha256` (`hashlib.sha256(canonical_json(atlas_payload) + CURRENT_VERSION)`).
- **Zero-Churn `--if-changed` Mode:** Before writing `architecture-atlas.html` or `architecture-atlas.json`, checks an embedded `<!-- HS-ATLAS-DIGEST: <sha256> v<version> -->` marker in the existing HTML (and `topology_sha256` in JSON). If identical, returns `{"ok": True, "changed": False, "skipped_write": True}` in `< 5 ms` with **0 disk writes**.
- **Pure-Python Inline SVG Layout Engine (`_render_group_svg`):** Automatically computes vertical lane columns inside each group (`Binaries/Scripts` | `Produced Artifacts` | `Consumers / Front-End Tool`), places `[IN <- GXX.TAG: ...]` pills on the left gutter and `[OUT -> GYY.TAG: ...]` pills on the right gutter (linking via lowercase `#gXX-tag` anchors), applies `#0f172a` double-rect masking behind orthogonal/cubic arrows so arrows never cross text, and verifies `0` bounding-box overlaps.
2. **Register CLI & Release Pipeline Hooks:**
- `pyproject.toml`: Add `hs-arch-atlas = "hyperstitionstud_io.publishing.architecture_atlas:main"`.
- `version_sync.py`: Call `build_architecture_atlas(if_changed=True)` at the end of `sync_versions()` so every `hs-sync-version --set` / `--auto-bump` release automatically refreshes the atlas with the new version and any added/changed binaries/routes.
- `push-all-to-git-libre-audio.sh` & `deploy/sync-vps-repos.sh`: Run `hs-arch-atlas --if-changed` pre-push (`push-all-to-git-libre-audio.sh`), and let `sync-vps-repos.sh`'s existing `*.html` pre-compression pass serve `/graph/docs/architecture-atlas.html` as Brotli-11 (`~12 KB` over the wire).
- `publishing/readme_sync.py` & `publishing/engineering_docs.py` (`Unit E0` / `E5`): Document the atlas link (`/graph/docs/architecture-atlas.html`) and update `17` -> `21` CLI entrypoints if needed (noting `pyproject.toml` already has `20` `hs-*` scripts today; adding `hs-arch-atlas` brings it to `21`).
- `tests/test_core_suite.py`: Assert `hs-arch-atlas --check` passes (`100%` of `pyproject.toml` `[project.scripts]` binaries, `hs-daily-brief`, and active `Caddyfile` front-end routes represented, `0` broken `#g01-quant..#g08-mcp-deploy` port targets, `0` container host paths, `architecture-atlas.html <= 100 KB`, and `--if-changed` second run performs `0` writes).
---
## 5. Verification Plan (Once Implemented)
1. Run `hs-arch-atlas` and confirm `architecture-atlas.html` (`<= 100 KB`) and `architecture-atlas.json` (`<= 30 KB`) are generated cleanly in `< 100 ms`.
2. Immediately re-run `hs-arch-atlas --if-changed` and verify `changed == False` and `skipped_write == True` (`< 10 ms`, `git status` clean).
3. Run `hs-arch-atlas --check` and confirm `missing_cli_binaries == []`, `missing_caddy_routes == []`, `broken_port_links == []`, and `hs-daily-brief` traces `real-market-history.json` + `real-macro-indicators-latest.json` + `quant-timeseries.json` + `daily-brief-state.json` -> `daily-brief-latest.json` + `daily-brief-data.js` -> `/quant/` & `/mcp`.
4. Run `PYTHONPATH=/workspace/hyperstitionstudio-core/src python3 /workspace/hyperstitionstudio-core/tests/test_core_suite.py` (`ALL 7 TEST SUITES PASSED`) and `deploy/test-first-deployment.sh` (`HTTP 200` on `/graph/docs/architecture-atlas.html` with `br` pre-compression).
@@ -0,0 +1,78 @@
# PLAN: Global `[A-Z][0-9]` Shorthand Disambiguation (`<PREFIX><NN>.<DOMAIN_TAG>`) Across Documentation & Comments (`PLAN #68`)
**Document ID:** `PLAN-HUMAN-TEXT-AND-COMMENT-SHORTHAND-DISAMBIGUATION`
**Status:** `ACTIVE (docs/plans/active/)`
**Target Ecosystem Version:** `v2.18.0` (Baseline: `v2.17.0`)
**Target Repositories:** All `6` repositories (`hyperstitionstudio-core`, `ingglish-hyperdope-gematria`, `technocapital-singularity-zoology`, `encyclopedia-knowledge-graph`, `haiperdohp-jemaytreeah`, `hyperdope-ci-build`)
**Scope:** **All human-read documentation, comments, and prose tracked anywhere in the repositories. Executable code is globally exempt so software functionality is 100% unimpacted.**
**Author:** m00t & Hermes Agent
**Date:** 2026-12-01
---
## 1. Objective & Strict Code-Exemption Invariant
Across the `6` `hyperstitionstud.io` repositories, bare `[A-Z][0-9]{1,2}` shorthands (`G0..G8`, `M0..M7`, `S1..S7`, `E0..E5`, `D0..D8`, `P1..P6`, `R1..R6`) overlap across independent subsystems (`RULE-G01.COLLAPSE` vs. `PLAN-GATE-G01.EXTANT_DATA` vs. `GEN-01.INGGLISH` vs. `ATLAS-G01.QUANT`; `CLASS-M01.ENTROPIC` vs. `UNIT-M01.BASE36_AQ` vs. `LEARN-M01.CABBALA` vs. `FRED M1/M2`; `CLASS-S01.SILICON` vs. `STYLE-GATE-S01.NO_SLATE_BG`; `DEPLOY-GATE-D01.MIRROR_PARITY` vs. `DOSE-D01.SINGLE_LOCK`; `REGIME-R01.BULL` vs. `RING-R01.AST_WHITELIST`).
### Hard Boundary: Human-Read Text & Comments vs. Executable Code
1. **In Scope (Human-Read Text & Comments Only):**
- Markdown documentation (`README.md`, `docs/*.md`, active/piecewise plans, operator's manuals, `00-index-and-methodology.md`, proposals) and compiled Dark-Mode PDFs (`.pdf`).
- Non-executable source comments (`# ...` in `.py`/`.sh`/`.toml`/`.yaml`, `// ...` and `/* ... */` in `.js`/`.mjs`/`.css`, `<!-- ... -->` in `.html`/`.svg`).
- Non-functional standalone module/file header docstrings (when **not** inspected at runtime or asserted by tests) and purely visual diagram labels (`.svg` `<text>`, atlas/mockup captions).
2. **Globally Exempt (Zero Software Functionality Impact):**
- **All executable code and machine-parsed identifiers:** variable/function/class/constant names, imports, expressions, control flow, CLI flags, HTTP routes, JSON/TOML keys, schema enums, CSS selectors/classes, HTML element IDs, and regexes.
- **All runtime-consumed string literals & test assertions:** strings compared by `tests/test_core_suite.py`, `public_regression.py`, `deploy_scripts_sync.py`, `MCP_TOOLS_SCHEMA` descriptions/arguments, `ReadOnlyIsolationGuard` SHA-256-locked source files (`glossary-registry.json`, `encyclopedia-manifest.json`), and historical cold `.tar.gz` archives.
- **Ast-Equivalence Guarantee:** Every `.py` file modified only in comments must pass an exact Python `ast.dump(ast.parse(before)) == ast.dump(ast.parse(after))` parity check (excluding purely cosmetic comment tokens) — guaranteeing **zero behavioral or functional change**.
---
## 2. Canonical Disambiguation Standard (`<PREFIX><NN>.<DOMAIN_TAG>`)
Whenever considering `[A-Z][0-9]` shorthand in documentation, comments, or the like across any of the `6` repositories, apply `<PREFIX><NN>.<DOMAIN_TAG>`:
| Subsystem / Category | Legacy Bare Form | Canonical Disambiguated Form (`<PREFIX><NN>.<DOMAIN_TAG>`) |
| :--- | :--- | :--- |
| **Architecture Atlas Tool Groups** | `G1..G8` | `G01.QUANT`, `G02.CALC_CI`, `G03.GRAPH`, `G04.ZOOLOGY`, `G05.ARCHIVE`, `G06.ENG_MATH`, `G07.PORTAL_LEARN`, `G08.MCP_DEPLOY` |
| **Orthographic Generations** | `G0`, `G1` | `GEN-00.ENGLISH`, `GEN-01.INGGLISH` *(or `Gen 0 (GEN-00.ENGLISH)`)* |
| **Cipher & Phonemic Rules** | `G1..G5` | `RULE-G01.COLLAPSE`, `RULE-G02.CROSS_GEN_TWIN`, `RULE-G03.STRUCTURAL`, `RULE-G04.ISOMETRIC`, `RULE-G05.TWIN_PRIME` |
| **Engineering Plan Binary Gates** | `G1..G4` | `PLAN-GATE-G01.EXTANT_DATA`, `PLAN-GATE-G02.ZERO_LLM`, `PLAN-GATE-G03.EROFS_SAFE`, `PLAN-GATE-G04.EXPORTABLE` |
| **Deploy Script Gates** | `D1..D8` | `DEPLOY-GATE-D01.MIRROR_PARITY` .. `DEPLOY-GATE-D08.PRE_COMMIT_STAGE` |
| **Public Smoke Gates** | `P1..P6` | `SMOKE-GATE-P01.STATIC_ROUTES` .. `SMOKE-GATE-P06.NAV_STYLE_PARITY` |
| **Style & Mobile Regression Gates** | `S1..S4` | `STYLE-GATE-S01.NO_SLATE_BG`, `STYLE-GATE-S02.DEJAVU_FONT`, `STYLE-GATE-S03.HEADER_PARITY`, `STYLE-GATE-S04.MOBILE_UI` |
| **Engineering Hub Units** | `E0..E5` | `UNIT-E00.HUB`, `UNIT-E01.CIPHERS`, `UNIT-E02.GRAPH_SQLITE`, `UNIT-E03.QUANT_BRIEF`, `UNIT-E04.MCP_REST_IPLD`, `UNIT-E05.CICD_VPS` |
| **Applied Math Hub Units** | `M0..M5` | `UNIT-M00.HUB`, `UNIT-M01.BASE36_AQ`, `UNIT-M02.PHONETICS_ENTROPY`, `UNIT-M03.GRAPH_SPECTRAL`, `UNIT-M04.Z_CALCULUS`, `UNIT-M05.MACRO_BAYESIAN` |
| **`/learn/` Track Folios** | `M01..M06` | `LEARN-M01.CABBALA`, `LEARN-M02.PARASITE`, `LEARN-M03.SERIES`, `LEARN-M04.STRATA`, `LEARN-M05.RHIZOME`, `LEARN-M06.GEOMANCY` |
| **Singularity & Memetic Classes** | `S1..S6`, `M1..M7+` | `CLASS-S01.SILICON` .. `CLASS-S06.AGI`; `CLASS-M01.ENTROPIC` .. `CLASS-M07.HYPERSTITIONAL` *(paired `S1 (CLASS-S01.SILICON)` near locked JSON keys)* |
| **Confluence Dose & Regimes** | `D0..D4`, `R1..R3` | `DOSE-D00.NONE` .. `DOSE-D04.FULL_LOCK`; `REGIME-R01.BULL`, `REGIME-R02.PINNED_ISOMETRIC`, `REGIME-R03.TAIL_DRAWDOWN` |
| **Polyglot Sandbox Security Rings** | `R1..R4` | `RING-R01.AST_WHITELIST`, `RING-R02.ZERO_EVAL`, `RING-R03.BOUNDED_FUEL`, `RING-R04.PURE_SUBSET` |
- **DOM/CSS Safety:** Keep HTML/CSS anchors lowercase hyphenated (`#g01-quant`, `#unit-e03-quant-brief`) so `.` never breaks CSS selectors.
- **Explicit Non-Shorthand Allowlist:** `H1/H2/H3` (HTTP), `V8` (Yahoo API), `FRED M1/M2` (monetary aggregates), `P20/P50/P90` (percentiles), `UTF-8`, `CIDv1`, `SHA-256`, `H01..H39` (harvest keys), `EUV`, `AI`.
---
## 3. Tokenizer-Based Scope Separation & 6-Repository Rollout
1. **Repository Policy Standard (`hyperstitionstudio-core/docs/SHORTHAND-DISAMBIGUATION-STANDARD.md`):**
- Documents the canonical `<PREFIX><NN>.<DOMAIN_TAG>` table, the **Global Executable Code Exemption**, and the `ast.dump` invariance guarantee under Git source control.
2. **Comment/Doc-Only Audit Helper (`src/hyperstitionstud_io/ci/shorthand_lint.py`, CLI `hs-shorthand-lint`):**
- **Strict Code Exemption via Real Lexers (`0` Regex False Positives on Code):**
- **Python (`.py`):** Uses `stdlib tokenize.generate_tokens` and checks **only `tokenize.COMMENT` tokens** (`# ...`). All code tokens (`NAME`, `STRING`, `OP`, `NUMBER`, runtime docstrings) are skipped completely.
- **JS / CSS / Shell / HTML:** Extracts **only** comment blocks (`//`, `/*...*/`, `# ...`, `<!--...-->`) and skips all executable code, strings, and `<script>`/`<style>` code bodies.
- **Markdown (`.md`):** Checks prose outside fenced code blocks (```` ```...``` ````) and inline backtick code spans (`` `...` ``).
- **Staged-Diff Gate & Ratchet:** `.git/hooks/pre-commit` (`--staged-diff`) prevents new bare `[A-Z][0-9]` tokens in newly authored docs/comments across all `6` repositories, while `--check-all` tracks migration progress against `.cache/shorthand-legacy-baseline.json` with zero runtime impact.
3. **Phased 6-Repository Documentation & Comment Migration:**
- **Phase 1 (`hyperstitionstudio-core`):** Migrate `.py`/`.sh`/`.js`/`.css`/`.html` **comments only** (`ast.dump` unchanged), `README.md`, and active operator manuals.
- **Phase 2 (`encyclopedia-knowledge-graph`):** Migrate `docs/plans/active/**`, `docs/*.md`, `OPERATORS-MANUAL-*.md`, `scripts/*.py` **comments only**, and `README.md`.
- **Phase 3 (`ingglish-hyperdope-gematria`):** Migrate `ingglish-aq-archive/scripts/**` & `packaging/**` **comments only**, `00-index-and-methodology.md`, `ONBOARDING-INGGLISH-AQ.md`, and `README.md`.
- **Phase 4 (`technocapital-singularity-zoology`):** Migrate `scripts/*.py` **comments only**, `proposal-*.md`, and `README.md` (`ReadOnlyIsolationGuard` JSON/encyclopedia files untouched).
- **Phase 5 (`hyperdope-ci-build` & `haiperdohp-jemaytreeah`):** Migrate `README.md`, `docs/ONBOARDING-INGGLISH-AQ.md`, and script/tool **comments only** without altering `db.txt`/`db.json`/UI logic.
- **Phase 6:** Recompile updated `.pdf` manuals via `hs-pdf-build --refresh-all-web-pdfs` and verify full regression pass.
---
## 4. Verification Plan (Once Implemented)
1. **Zero Functional Code Impact Verification:** Run an automated Python `ast.dump` parity check across every modified `.py` file (`ast.dump(old_ast) == ast.dump(new_ast)`), and confirm `bash -n` + `node --check` + `tests/test_core_suite.py` (`ALL 7 TEST SUITES PASSED`) pass with **0 code/test changes**.
2. **Tokenizer Exemption Verification:** Confirm `hs-shorthand-lint` ignores bare `G1`, `M2`, `S3` inside Python variables, string literals, JSON files, and fenced Markdown code blocks, while flagging bare `G1` / `M2` / `S3` inside `#` / `//` comments and Markdown prose.
3. **Deployment Parity:** Run `hs-deploy-scripts-sync --check` (Gates `DEPLOY-GATE-D01.MIRROR_PARITY` .. `D08`) and `deploy/test-first-deployment.sh`.
@@ -0,0 +1,30 @@
# PLAN: Deferred Candidate Strategies for Ecosystem-Wide Efficiency, Deduplication & Simplification (From Plan #62)
**Document ID:** `PLAN-PIECEWISE-CODEBASE-MODULARITY-DEFERRED-CANDIDATE-STRATEGIES`
**Status:** `INACTIVE / DEFERRED CANDIDATE STRATEGIES (docs/plans/inactive/ — Zero PDF Compilation)`
**Parent Active Plan:** `docs/plans/piecewise/PLAN-PIECEWISE-CODEBASE-MODULARITY-DEFERRED-STRATEGIES.md` (`Affirmed: 1A, 2A, 3A, 4A, 5A, 6A`)
**Author:** m00t & Hermes Agent
**Date:** 2026-12-01
---
## Deferred / Unaffirmed Candidate Strategies (`Rule C.4`)
- **Audit Point 1 (`1A` Affirmed):**
- `1B` (Partial): Extract only `render_explication_nav_html()` & `render_explication_subpage_html()`, keeping hub HTML renderers separate.
- `1C` (Status Quo): Retain `v2.17.0` split.
- **Audit Point 2 (`2A` Affirmed):**
- `2B` (Partial): Deduplicate only the 9 mirrored packaging scripts via `runpy` wrappers + `${STAGE_TOP}/SOURCES/` RPM staging + `compute_aq`/`safe_urlopen` delegation, keeping podcast MP3s and quant JSON files in their current locations.
- `2C` (Status Quo): Retain all current duplicates and split quant files.
- **Audit Point 3 (`3A` Affirmed):**
- `3B` (Partial): Add stat-memoized `count_file_lines_cached()` and `copy_result=False` fast-path only, without consolidating repo/git/path helpers.
- `3C` (Status Quo): Keep separate helper copies, uncached `db.txt` line scans, and default `deepcopy()` behavior.
- **Audit Point 4 (`4A` Affirmed):**
- `4B` (Partial): Wire `load_json_cached()` only into `publishing/quant_voice.py` and `publishing/highlights.py` plus the `fonts.py` font-index map.
- `4C` (Status Quo): Leave current JSON reads and `rglob` walks unchanged.
- **Audit Point 5 (`5A` Affirmed):**
- `5B` (Partial): Promote bounded Pillow typography helpers into `publishing/fonts.py` only, keeping `flow_diagram.py` PNG re-rendering unconditional.
- `5C` (Status Quo): Leave typography helpers duplicated and `flow_diagram.py` unconditional.
- **Audit Point 6 (`6A` Affirmed):**
- `6B` (Partial): Remove redundant pre-test subprocesses in `push-all-to-git-libre-audio.sh` only, keeping `.git/hooks/pre-commit` unconditional across all 6 repos.
- `6C` (Status Quo): Keep all double-executed checks and unconditional commit hooks.
@@ -0,0 +1,31 @@
# PLAN: Unaffirmed / Deferred Candidate Strategies from `PLAN-PIECEWISE-CODEBASE-MODULARITY-DEFERRED-STRATEGIES` (Plan #62)
**Document ID:** `PLAN-PIECEWISE-CODEBASE-MODULARITY-UNAFFIRMED-STRATEGIES`
**Status:** `INACTIVE / DEFERRED (docs/plans/inactive/ — zero PDF compilation)`
**Parent Plan:** `PLAN-PIECEWISE-CODEBASE-MODULARITY-DEFERRED-STRATEGIES` (Plan #62)
**Date:** 2026-12-01
---
## Deferred / Unaffirmed Candidate Strategies (`Rule C.4`)
All `6` Audit Points of Plan #62 were affirmed as **`1A, 2A, 3A, 4A, 5A, 6A`**. The partial and status-quo alternative candidate strategies below are preserved here for historical reference:
1. **Audit Point 1 (`1B`, `1C`):**
- `1B`: Extract only `render_explication_nav_html()` & `render_explication_subpage_html()`, keeping hub renderers separate.
- `1C`: Retain `v2.17.0` split (only `render_polyglot_cartridge_html()` and `_render_prereq_box_html()` shared).
2. **Audit Point 2 (`2B`, `2C`):**
- `2B`: Keep full mirrored copies across `ingglish-aq-archive/scripts/`, `packaging/bundle/scripts/`, and `packaging/bundle/skills/*/scripts/` in Git and auto-sync via `deploy_scripts_sync.py`.
- `2C`: Retain manual multi-copy script synchronization, duplicate podcast MP3/MD files, and split quant JSON state.
3. **Audit Point 3 (`3B`, `3C`):**
- `3B`: Add stat-memoized `count_file_lines_cached()` and `copy_result=False` fast-path only, without consolidating `CANONICAL_SIX_REPOS` / `resolve_workspace_repo_dir()` / `normalize_workspace_relpath()` / `run_git_stdout()`.
- `3C`: Keep separate helper copies and uncached line scans.
4. **Audit Point 4 (`4B`, `4C`):**
- `4B`: Wire `load_json_cached()` only into `quant_voice.py` & `highlights.py` + `fonts.py` font index, leaving `math_docs.py` / `quant/` / `sqlite_meta.py` / `ci/` on `json.loads(read_text())`.
- `4C`: Leave current uncached JSON reads and per-font `rglob` walks unchanged.
5. **Audit Point 5 (`5B`, `5C`):**
- `5B`: Promote bounded Pillow typography helpers into `publishing/fonts.py` only, keeping `flow_diagram.py` PNG re-rendering unconditional.
- `5C`: Keep bounded typography helpers duplicated across `closeups_sync.py` / `flow_diagram.py` / `cards.py`.
6. **Audit Point 6 (`6B`, `6C`):**
- `6B`: Remove redundant pre-test subprocesses in `push-all-to-git-libre-audio.sh` only, keeping `.git/hooks/pre-commit` unconditional across all 6 repos.
- `6C`: Keep double-executed checks and unconditional commit hooks.
@@ -1,7 +1,7 @@
# PLAN: Piecewise Grimoiric Transformation of `/learn/` — Integrated with Giordano Bruno's *Rota Umbrarum*, Nick Land's Numogram, Michel Serres's *Parasite*, Deleuze-Guattari Double Articulation & John Michael Greer's Geomantic Tetragrams (`Audit Points 1–5`, `Rule C` Piecewise Specification)
**Document ID:** `PLAN-PIECEWISE-GRIMOIRIC-LEARN-PAGE`
**Status:** `PENDING AUDIT PIECEWISE (docs/plans/piecewise/ — 0/5 AUDIT POINTS AFFIRMED, ENRICHED WITH SERRES / LAND / D&G / GREER / BRUNO CONTINGENT-MEANING OPERATORS)`
**Status:** `INACTIVE / DEFERRED (docs/plans/inactive/ — 0/5 AUDIT POINTS AFFIRMED, ENRICHED WITH SERRES / LAND / D&G / GREER / BRUNO CONTINGENT-MEANING OPERATORS)`
**Companion Cross-Workbench Plan:** `PLAN-PIECEWISE-CONTINGENT-MEANING-SERRES-LAND-DG-GREER-BRUNO` (Plan #64)
**Target Ecosystem Version:** `v2.17.0` (Baseline: `v2.16.0`)
**Target Repositories:** `hyperstitionstudio-core`, `encyclopedia-knowledge-graph`
@@ -1,109 +1,43 @@
# PLAN: Piecewise Codebase Modularity, Deduplication & Resource Economization — Revised for `v2.12.0..v2.15.0` Code Delta (`Audit Points 1–4`, `Rule C` Piecewise Specification)
# PLAN: Ecosystem-Wide Efficiency, Deduplication, Optimization & Simplification (`Audit Points 1–6` Affirmed, `Rule C` Piecewise Specification)
**Document ID:** `PLAN-PIECEWISE-CODEBASE-MODULARITY-DEFERRED-STRATEGIES`
**Status:** `PENDING AUDIT PIECEWISE (docs/plans/piecewise/ — 0/4 AUDIT POINTS AFFIRMED)`
**Status:** `ACTIVE / FULLY AFFIRMED PIECEWISE (docs/plans/piecewise/ — 6/6 AUDIT POINTS AFFIRMED: 1A, 2A, 3A, 4A, 5A, 6A)`
**Companion Deferred Strategies Plan:** `docs/plans/inactive/PLAN-PIECEWISE-CODEBASE-MODULARITY-DEFERRED-CANDIDATE-STRATEGIES.md`
**Parent Plan:** `PLAN-PIECEWISE-CODEBASE-MODULARITY-DEDUPLICATION-AND-RESOURCE-ECONOMIZATION` (`v2.12.0`)
**Target Ecosystem Version:** `v2.16.0` (Baseline: `v2.15.0`, evaluating full `v2.12.0..v2.15.0` delta)
**Target Repositories:** `hyperstitionstudio-core`, `ingglish-hyperdope-gematria`, `encyclopedia-knowledge-graph`
**Target Ecosystem Version:** `v2.18.0` (Baseline: `v2.17.0` + working tree)
**Target Repositories:** All `6` repositories (`hyperstitionstudio-core`, `ingglish-hyperdope-gematria`, `technocapital-singularity-zoology`, `encyclopedia-knowledge-graph`, `haiperdohp-jemaytreeah`, `hyperdope-ci-build`)
**Author:** m00t & Hermes Agent
**Date:** 2026-12-01
---
## 1. Ground-Truth Audit: Reactivated Deferred Strategy `2A` + `v2.12.0..v2.15.0` Code Delta (`+4,970` Lines Across 6 Repositories, `Rule C.1`)
## 1. Fixed Architectural Constraints & Four Binary Gates (`PLAN-GATE-G01..G04`)
Between `v2.12.0` (when the parent Plan #53 was executed) and `v2.15.0`, implementing Plans `#56`, `#57`, `#58`, `#59`, and `#60` added **`+4,970` insertions across 96 touched files** (`+1,500` in `hyperstitionstudio-core`, `+2,090` in `ingglish-hyperdope-gematria`, `+314` in `haiperdohp-jemaytreeah`, `+971` in `hyperdope-ci-build`, and `+220` in `encyclopedia-knowledge-graph`). Re-auditing the deferred strategy candidates alongside this exact `v2.12.0..v2.15.0` code delta reveals **4 high-leverage modularity, deduplication, security, and resource-economization Audit Points**:
| Audit Point & Subsystem | Empirically Verified `v2.12.0..v2.15.0` Codebase Delta Measurement | Duplication, Drift Risk, Security Gap or Resource Hotspot Identified |
| :--- | :--- | :--- |
| **Audit Point 1**<br/>*Unified Explication Hub, Subpage & Navigation Template Engine (`publishing/explication_template.py`, `engineering_docs.py` `801` lines & `math_docs.py` `628` lines — Reactivated Strategy `2A` from Plan #53)* | • In Plan #53 (`v2.12.0`), `Strategy 2B` unified `render_polyglot_cartridge_html()` and `_render_prereq_box_html()`, while deferring **`Strategy 2A`** (full `explication_template.py` extraction).<br/>• `publishing/engineering_docs.py` (`801` lines) and `publishing/math_docs.py` (`628` lines) still duplicate `~260` lines of identical `<head>` CSS, `<header>` layout, `> 6` subpage `More Units ▾` overflow `<select>`, `.grid-cards` unit card loops, `<footer>` colophon, `prev_link / next_link` subpage pagination, and `build_*_site()` bundle orchestration. | • **Eliminate `~260` Duplicate Lines & Enable Single-Point Cross-Page Nav Unification (Plan #63):** Extracting `src/hyperstitionstud_io/publishing/explication_template.py` (`render_explication_nav_html()`, `render_explication_hub_page_html()`, `render_explication_subpage_html()`, `write_explication_site_bundle()`) removes `~260` duplicate lines and lets `/engineering/*` and `/math/*` share one header/subnav renderer. |
| **Audit Point 2 (NEW from `v2.13.0–v2.15.0` Delta)**<br/>*Exegesis & CI Script Deduplication + `safe_urlopen` / `compute_aq` Reuse in `ingglish-hyperdope-gematria` (`+2,090` lines added in `v2.13.0–v2.15.0`)* | • Plan #56 (`v2.13.0`) added `synthesize_news_dossier_openrouter.py` (`736` lines) in **two identical copies** (`ingglish-aq-archive/scripts/` and `packaging/bundle/scripts/` = `1,472` lines).<br/>• Plan #60 (`v2.15.0`) had to patch `ci_provision_ingglish.py` across **three identical copies** (`ingglish-aq-archive/scripts/`, `packaging/bundle/scripts/`, and `packaging/bundle/skills/hyperdope-ingglish-ci/scripts/` = `~1,950` lines), plus duplicate copies of `collect_news_aq.py`, `generate_aq_tier_list.py`, and `build_wire_report_pdf.py` (`~3,600+` duplicated lines in `ingglish-hyperdope-gematria`!).<br/>• `synthesize_news_dossier_openrouter.py` redefines `compute_aq()` locally (`lines 39–46`) and calls raw `urllib.request.urlopen()` instead of delegating to `hyperstitionstud_io.ciphers.compute_aq` and `hyperstitionstud_io.security.safe_urlopen` when available. | • **Eliminate `~2,100+` Lines of Multi-Copy Script Drift in `ingglish-hyperdope-gematria`:** Keep `ingglish-aq-archive/scripts/*.py` as the Single Source of Truth, replace duplicate copies in `packaging/bundle/scripts/` and `packaging/bundle/skills/.../scripts/` with thin `runpy` delegators (while `packaging/build-fedora41-rpm.sh` materializes standalone copies into the RPM buildroot at package build time), and wire `compute_aq` + `safe_urlopen` delegation into `synthesize_news_dossier_openrouter.py`. |
| **Audit Point 3 (NEW from `v2.14.0–v2.15.0` Delta)**<br/>*Pre-Commit & Release Pipeline Consolidation: Shared 6-Repo Discovery, Path Normalizer, Git Helper & Stat-Cached Line Counter (`config/__init__.py`, `deploy_scripts_sync.py` `266` lines, `version_sync.py` `550` lines, `readme_sync.py` `616` lines, `closeups_sync.py` `765` lines)* | • Plan #58 (`v2.14.0`) added `src/hyperstitionstud_io/ci/deploy_scripts_sync.py` (`266` lines) and wired it into `.git/hooks/pre-commit` (`readme_sync.py`) and `version_sync.py`.<br/>• Across `version_sync.py`, `readme_sync.py`, `highlights.py`, and `deploy_scripts_sync.py`, `_norm_ws_path()`, `_resolve_repo_dir()` (`hyperdope-ci-build` vs `ingglish-hyperdope-ci`), `_git_out()`, and the canonical 6-repo list are now duplicated in **`4` modules**.<br/>• Every `git commit` triggers `.git/hooks/pre-commit` (`deploy_scripts_sync` + `closeups_sync` + `readme_sync`), which scans all `231,615` lines (`4.17 MB`) of `haiperdohp-jemaytreeah/db.txt` from disk multiple times even when `(st_mtime_ns, st_size)` are unchanged. | • **Consolidate 4x Duplicated Repo/Git Helpers & Stat-Cache `db.txt` Line Counts:** Centralizing `CANONICAL_SIX_REPOS`, `resolve_workspace_repo_dir()`, `normalize_workspace_relpath()`, `run_git_stdout()`, and `(resolved_path, st_mtime_ns, st_size)`-memoized `count_file_lines_cached()` in `src/hyperstitionstud_io/config/__init__.py` removes `4` duplicate helper implementations and cuts repeated `4.17 MB` `db.txt` line scans during `pre-commit` to `0`. |
| **Audit Point 4 (NEW from `v2.13.0–v2.15.0` Delta)**<br/>*Shared Bounded Pillow Text-Fitting Primitives (`publishing/fonts.py`) & `load_json_cached` Reuse in `publishing/quant_voice.py` (`511` lines)* | • Plan #57 & Plan #59 (`v2.13.0–v2.15.0`) added `src/hyperstitionstud_io/publishing/quant_voice.py` (`511` lines), which reads `voice-manifest.json` via raw `json.loads(manifest_p.read_text())` (`line 336`) instead of `load_json_cached()`.<br/>• `publishing/closeups_sync.py` (`765` lines), `publishing/flow_diagram.py` (`401` lines), and `quant/cards.py` (`550` lines) place text via manual `d.text()` coordinates and `[:N]` slicing without shared bounded text-fitting primitives in `publishing/fonts.py` (`90` lines). | • **Unified Bounded Pillow Typography & Manifest Caching:** Adding `fit_pillow_text_to_width()`, `draw_bounded_box_text()`, and `draw_bounded_kv_row()` to `src/hyperstitionstud_io/publishing/fonts.py` (directly supporting Plan #61's closeup bounding-box fixes) and wiring `load_json_cached()` into `quant_voice.py` unifies image text fitting and JSON caching across `publishing/`. |
- **Fixed Constraint 1 (6-Repo Separation):** Keep all `6` peer Git repositories distinct.
- **Fixed Constraint 2 (`task-router` Disciplinary Separation):** Keep Tier 1 deterministic zero-token code cleanly partitioned by domain (`phonetics/`, `ciphers/` + `ipld/` + `lenses/`, `quant/`, `graph/`, `publishing/`, `ci/`, `mcp/`, `db/`) and preserve `haiperdohp-jemaytreeah` upstream patch compatibility.
- **Fixed Constraint 3 (Zero Broken Functionality):** Preserve all `20` `hs-*` CLI entrypoints, `20` MCP/OpenAPI 3.1 tools, `63` Caddy routes, Fedora 41 RPM (`ingglish-isopsephic-exegesis`), `ReadOnlyIsolationGuard` SHA-256 locks, and `tests/test_core_suite.py` (`7/7` suites).
- **Binary Gates:** `PLAN-GATE-G01.EXTANT_DATA`, `PLAN-GATE-G02.ZERO_LLM`, `PLAN-GATE-G03.EROFS_SAFE`, `PLAN-GATE-G04.EXPORTABLE`.
---
## 2. Four Factual Binary Engineering Gates (`G1–G4`, Zero Synthetic Data & Two-Script Deployment Invariant)
## 2. Affirmed Deliverables Across Audit Points `1–6` (`Rule C.4`)
- **`Gate G1` (100% Backward-Compatible Public API, CLI Entrypoints, RPM Builder & Two-Script Deployment Invariant):** Zero breaking changes to any `pyproject.toml` CLI entrypoint (`hs-*`), MCP tool, OpenAPI 3.1 REST endpoint, `packaging/build-fedora41-rpm.sh`, or the Two-Script Manual Operator Deployment Invariant.
- **`Gate G2` (`0` LLM Tokens & `0` New External Dependencies):** Uses Python `3.12+` standard library (`runpy`, `functools`, `subprocess`) and existing workspace libraries (`Pillow`).
- **`Gate G3` (`ProtectSystem=strict` `EROFS` & `ReadOnlyIsolationGuard` Safe):** All caches are in-memory and invalidated automatically on `(st_mtime_ns, st_size)` updates.
- **`Gate G4` (Measurable Code Deduplication Across Both `hyperstitionstudio-core` & `ingglish-hyperdope-gematria`):** Eliminates `~260` duplicate HTML template lines in `publishing/`, `~2,100+` duplicate Python script lines in `ingglish-hyperdope-gematria/packaging/bundle/`, and `4` duplicate Git/repo helper blocks.
### Audit Point 1 — `[AFFIRMED: Strategy 1A]` Explication HTML/Nav/Subpage Template Engine (`publishing/explication_template.py`)
- Create `src/hyperstitionstud_io/publishing/explication_template.py` (`render_explication_nav_html()`, `render_explication_hub_page_html()`, `render_explication_subpage_html()`, `write_explication_site_bundle()`) and refactor `engineering_docs.py` (`841` lines) and `math_docs.py` (`650` lines) to delegate their shared Group 3 (`UI-G03.BASALT_CHAMFER`) HTML/nav/subpage/bundle rendering while keeping all domain specs, cartridges, manifests, and public signatures 100% intact (`~-290` duplicate lines).
---
### Audit Point 2 — `[AFFIRMED: Strategy 2A]` Cross-Repo Script, Wrapper, Media & Quant Split Deduplication
1. **Script Single Source of Truth + Clean RPM Staging:** Keep `ingglish-aq-archive/scripts/*` canonical; replace the `9` mirrored copies (`~4,128` lines) in `packaging/bundle/scripts/` and `packaging/bundle/skills/*/scripts/` with ~25-line self-locating `runpy`/JS wrappers; update `build-fedora41-rpm.sh` to copy canonical scripts directly into `${STAGE_TOP}/SOURCES/` (so tracked wrappers never get overwritten dirty on RPM builds); update `test_core_suite.py` (`L1331–1335`) to assert wrapper delegation + canonical script integrity; delegate `compute_aq()` & `safe_urlopen()` in `synthesize_news_dossier_openrouter.py` when `hyperstitionstud_io` is importable.
2. **Cross-Repo Media & Disabled Demo Cleanup (`-83.9 MB`):** Remove the `5` byte-identical `lecture-podcast-ep01..05-*-ingglish-aq.{mp3,md}` duplicates (`83.14 MB`) from `ingglish-hyperdope-gematria` (canonical home: `technocapital-singularity-zoology/podcast-ep01..05-*`) and prune duplicate `meme_2_memegen_awkward_moment_seal_id_ams.png` (`747 KB`) from disabled `site/gallery/media/demos/`.
3. **Disciplinary Quant Consolidation (`site/quant/`):** Move `financial-aq-harvest-latest.json` and `daily-brief-state.json` from `ingglish-hyperdope-gematria/` into `hyperstitionstudio-core/site/quant/` (updating `collector.py`, `daily_brief.py`, `readme_sync.py`, `tests/test_core_suite.py`) and retire the redundant 20-line `collect_financial_quant_aq.py` shim (`hs-quant-harvest` is canonical), keeping `/archive/` Caddy routes (`25..73-dossier-news-*.md` & `10..19-ledger-*.md`) intact.
## 3. Piecewise Audit Points & Candidate Strategies (`Strategies 1A–1C` through `4A–4C`, `Rule C.2`)
### Audit Point 3 — `[AFFIRMED: Strategy 3A]` Shared Workspace Helpers, Stat Line Cache & Read-Only JSON Fast-Path (`config/__init__.py`)
- Add `CANONICAL_SIX_REPOS`, `resolve_workspace_repo_dir()`, `normalize_workspace_relpath()`, `run_git_stdout()`, and `(resolved_path, st_mtime_ns, st_size)`-memoized `count_file_lines_cached()` to `config/__init__.py`; remove duplicate `_norm_ws_path` (`deploy_scripts_sync.py`, `archive_rotator.py`), `_git_out`/`_git_run` (`readme_sync.py`, `version_sync.py`), and uncached `db.txt` scans (`archive_rotator.py`, `closeups_sync.py`); audit read-only `load_json_cached()` callers to pass `copy_result=False` (eliminating `1.5 MB` `deepcopy` overhead).
Each Audit Point below is 100% independent and commutative so they can be reviewed, affirmed, or deferred one at a time under the strict Turn-Ending Invariant (`Rule C.3`).
### Audit Point 4 — `[AFFIRMED: Strategy 4A]` Eliminate `25+` Uncached JSON Reads & Per-Font `rglob` Walks (`core/src`)
- Replace repeated `json.loads(p.read_text())` reads across `math_docs.py` (x5), `quant/timeseries.py` (x2), `quant/daily_brief.py`, `quant/macro.py`, `quant/collector.py`, `db/sqlite_meta.py`, `publishing/quant_voice.py` (`L396`), `publishing/highlights.py` (`L47`), `publishing/closeups_sync.py`, `ci/doctor.py`, `ci/citation_sources.py`, `ci/public_regression.py`, and `mcp/tools.py` with `load_json_cached(..., copy_result=False)`, and replace per-font `/usr/share/fonts` `rglob` calls in `publishing/fonts.py` with a single `@lru_cache` font-filename index map.
---
### Audit Point 5 — `[AFFIRMED: Strategy 5A]` Bounded Pillow Typography (`publishing/fonts.py`) & Zero-Churn `flow_diagram.py` Digest Skip
- Promote `fit_pillow_text_to_width()`, `draw_bounded_box_text()`, and `draw_bounded_kv_row()` out of `closeups_sync.py` (`1,021` lines) into `publishing/fonts.py`, reuse them across `closeups_sync.py`, `flow_diagram.py`, and `quant/cards.py` (`verify_closeup_geometry()` invariants 100% preserved), and embed a deterministic `hs_diagram_sha256` PNG `tEXt` chunk in `flow_diagram.py` so `render_periodic_harvest_cicd_flow_diagram_png(if_changed=True)` skips rewriting the `285 KB` PNG when inputs and version are unchanged.
### Audit Point 1: Unified Explication Hub, Subpage & Navigation Template Engine (`src/hyperstitionstud_io/publishing/explication_template.py` — Reactivated Strategy `2A`)
- **Strategy `1A` (Extract Shared Group 3 Explication Page Renderer into `src/hyperstitionstud_io/publishing/explication_template.py` — Recommended Candidate):**
- **What Changes:**
1. Creates `src/hyperstitionstud_io/publishing/explication_template.py` containing the parameterized Group 3 HTML builders and site-bundle writer shared by `/engineering/` and `/math/`:
- `render_explication_nav_html()`,
- `render_explication_hub_page_html()`,
- `render_explication_subpage_html()`, and
- `write_explication_site_bundle()`.
2. Refactors `publishing/engineering_docs.py` (`hs-eng-docs`) and `publishing/math_docs.py` (`hs-math-docs`) to delegate their HTML/nav/bundle rendering to `explication_template.py` while keeping all domain specifications, cartridges, manifests, and public function signatures 100% intact.
- **Modularity Gain:** Eliminates `~260` lines of duplicated HTML/CSS/JS templates and provides a single shared header/navigation builder for `/engineering/*` and `/math/*`.
- **Strategy `1B` (Extract Only `render_explication_nav_html()` & `render_explication_subpage_html()`, Keeping Hub Renderers Separate — Partial Candidate):**
- Unifies navigation and subpage HTML templates while leaving `_render_hub_html()` and `_render_math_hub_html()` separate.
- **Strategy `1C` (Retain Current `v2.12.0` Strategy `2B` Split — Status Quo / Deferred):**
- Keeps only `render_polyglot_cartridge_html()` and `_render_prereq_box_html()` shared.
---
### Audit Point 2 (NEW from `v2.13.0–v2.15.0` Delta): Exegesis & CI Script Deduplication + `safe_urlopen` / `compute_aq` Delegation in `ingglish-hyperdope-gematria`
- **Strategy `2A` (Single-Source-of-Truth Scripts in `ingglish-aq-archive/scripts/` + Thin `runpy` Bundle Wrappers + Automatic Standalone Copy Materialization in `build-fedora41-rpm.sh` + `compute_aq`/`safe_urlopen` Delegation — Recommended Candidate):**
- **What Changes:**
1. Designates `ingglish-aq-archive/scripts/{synthesize_news_dossier_openrouter.py,ci_provision_ingglish.py,collect_news_aq.py,generate_aq_tier_list.py,build_wire_report_pdf.py}` as the Single Source of Truth in `ingglish-hyperdope-gematria`.
2. Replaces the duplicate multi-hundred-line copies in `packaging/bundle/scripts/*.py` and `packaging/bundle/skills/hyperdope-ingglish-ci/scripts/ci_provision_ingglish.py` with compact (`~25`-line) self-locating `runpy.run_path` / `importlib` delegators that resolve the canonical script in `ingglish-aq-archive/scripts/` when run from the repo, while updating `packaging/build-fedora41-rpm.sh` to copy the canonical `ingglish-aq-archive/scripts/*.py` files directly into the RPM `SOURCES` bundle at package build time so the installed Fedora 41 RPM (`/usr/libexec/ingglish-exegesis/scripts/*.py`) remains 100% standalone.
3. Updates `synthesize_news_dossier_openrouter.py` to delegate `compute_aq()` to `hyperstitionstud_io.ciphers.compute_aq` and HTTP requests in `call_openrouter_exegesis()` to `hyperstitionstud_io.security.safe_urlopen` whenever `hyperstitionstud_io` is importable (retaining the stdlib fallback for standalone Fedora 41 RPM hosts).
- **Modularity & Security Gain:** Eliminates `~2,100+` lines of duplicate Python code across `ingglish-hyperdope-gematria`, prevents multi-copy drift across future edits, and extends `safe_urlopen` SSRF/size-cap protection to `synthesize_news_dossier_openrouter.py`.
- **Strategy `2B` (Keep Full Copies on Disk, Add Auto-Sync Step to `deploy_scripts_sync.py` + `compute_aq`/`safe_urlopen` Delegation Only — Partial Candidate):**
- Keeps duplicate files in Git but synchronizes them automatically in `deploy_scripts_sync.py` before commits.
- **Strategy `2C` (Leave Multi-Copy Scripts in `ingglish-hyperdope-gematria` Unchanged — Status Quo / Deferred):**
- Retains the current manual multi-copy layout.
---
### Audit Point 3 (NEW from `v2.14.0–v2.15.0` Delta): Pre-Commit & Release Pipeline Consolidation — Shared 6-Repo Discovery, Path Normalizer, Git Helper & Stat-Cached Line Counter (`src/hyperstitionstud_io/config/__init__.py`)
- **Strategy `3A` (Centralize `CANONICAL_SIX_REPOS`, `resolve_workspace_repo_dir()`, `normalize_workspace_relpath()`, `run_git_stdout()`, and Stat-Memoized `count_file_lines_cached()` in `src/hyperstitionstud_io/config/__init__.py` — Recommended Candidate):**
- **What Changes:**
1. Adds `CANONICAL_SIX_REPOS`, `resolve_workspace_repo_dir(ws_root, repo_key)`, `normalize_workspace_relpath(p, workspace_root=None)`, `run_git_stdout(repo_dir, args, *, strip_leading=True, timeout=5.0)`, and `(resolved_path, st_mtime_ns, st_size)`-memoized `count_file_lines_cached(path)` to `src/hyperstitionstud_io/config/__init__.py`.
2. Refactors `version_sync.py`, `publishing/readme_sync.py`, `publishing/highlights.py`, `ci/deploy_scripts_sync.py`, and `publishing/closeups_sync.py` to import and use these shared helpers instead of maintaining `4` separate copies of `_git_out` / `_resolve_repo_dir` / `_norm_ws_path` and re-scanning `231,615` lines of `db.txt` on every commit hook.
- **Modularity & Resource Gain:** Eliminates `4` duplicate Git/repo/path helper blocks and cuts repeated `4.17 MB` `db.txt` line-count scans during `pre-commit` hooks to `0`.
- **Strategy `3B` (Add Stat-Memoized `count_file_lines_cached()` Only — Minimal Candidate):**
- Caches line counts by `(resolved_path, st_mtime_ns, st_size)` in `config/__init__.py` without consolidating `_git_out`, `_resolve_repo_dir`, and `_norm_ws_path`.
- **Strategy `3C` (Keep Separate Helpers & Uncached Line Scans — Status Quo / Deferred):**
- Leaves `config/__init__.py`, `version_sync.py`, `readme_sync.py`, `highlights.py`, `deploy_scripts_sync.py`, and `closeups_sync.py` unchanged.
---
### Audit Point 4 (NEW from `v2.13.0–v2.15.0` Delta): Shared Bounded Pillow Text-Fitting Primitives (`publishing/fonts.py`) & `load_json_cached` Reuse in `publishing/quant_voice.py`
- **Strategy `4A` (Add `fit_pillow_text_to_width()`, `draw_bounded_box_text()`, and `draw_bounded_kv_row()` to `src/hyperstitionstud_io/publishing/fonts.py` + Wire `load_json_cached()` into `publishing/quant_voice.py` — Recommended Candidate):**
- **What Changes:**
1. Extends `src/hyperstitionstud_io/publishing/fonts.py` with reusable, zero-truncation Pillow text-layout helpers (`fit_pillow_text_to_width()`, `draw_bounded_box_text()`, and `draw_bounded_kv_row()`) that step down the cached DejaVu font ladder (`14px -> 9px`) so text always fits inside its bounding box with `>= 6px` horizontal padding and `0` mid-word `[:N]` slicing.
2. Reuses these shared primitives in `publishing/closeups_sync.py` (directly powering Plan #61's bounding-box remediation) and wires `load_json_cached()` into `publishing/quant_voice.py` when reading `voice-manifest.json`.
- **Modularity Gain:** Centralizes bounded Pillow typography in `publishing/fonts.py` and brings `quant_voice.py` into full compliance with the `load_json_cached()` pattern established in `v2.12.0`.
- **Strategy `4B` (Keep Bounded Text Helpers Local Inside `publishing/closeups_sync.py` Only — Partial Candidate):**
- Implements text-fitting helpers privately inside `closeups_sync.py` without promoting them to `publishing/fonts.py`.
- **Strategy `4C` (Manual Per-Call Coordinate Adjustments Only — Status Quo / Deferred):**
- Adjusts individual `(x, y)` coordinates manually without shared bounded-text primitives.
---
## 4. Summary Matrix of Audit Points `1–4` for Stepwise Review (`Rule C.3`)
| Audit Point | Target Subsystem (`v2.12.0..v2.15.0` Delta) | Strategy `A` (Full Modularity, Deduplication & Resource Economization — Recommended) | Strategy `B` (Partial / Scoped Change) | Strategy `C` (Status Quo / Deferred) |
| :--- | :--- | :--- | :--- | :--- |
| **Point 1** | **Explication HTML Template Engine** (`publishing/explication_template.py`, `engineering_docs.py`, `math_docs.py`) | **`1A`:** Extract shared Group 3 nav, hub, subpage & bundle builders into `explication_template.py` (`-260` duplicate lines) | **`1B`:** Extract shared nav & subpage HTML builders only, keeping hub HTML builders separate | **`1C`:** Retain `v2.12.0` `2B` split |
| **Point 2** | **Exegesis & CI Script Deduplication + Security** (`ingglish-hyperdope-gematria/packaging/bundle/` & `synthesize_news_dossier_openrouter.py`) | **`2A`:** Single Source of Truth in `ingglish-aq-archive/scripts/` + thin `runpy` bundle wrappers (`-2,100+` duplicate lines) + standalone copy materialization in `build-fedora41-rpm.sh` + `compute_aq`/`safe_urlopen` delegation | **`2B`:** Keep duplicate files in Git, auto-sync in `deploy_scripts_sync.py` + `compute_aq`/`safe_urlopen` delegation | **`2C`:** Keep manual multi-copy scripts |
| **Point 3** | **Pre-Commit & Release Pipeline Consolidation** (`config/__init__.py`, `deploy_scripts_sync.py`, `version_sync.py`, `readme_sync.py`, `closeups_sync.py`) | **`3A`:** Centralize `CANONICAL_SIX_REPOS`, `resolve_workspace_repo_dir()`, `normalize_workspace_relpath()`, `run_git_stdout()`, & stat-cached `count_file_lines_cached()` in `config/__init__.py` | **`3B`:** Add stat-cached `count_file_lines_cached()` only | **`3C`:** Keep 4 separate copies & uncached scans |
| **Point 4** | **Bounded Pillow Text-Fitting Primitives & Voice Manifest Cache** (`publishing/fonts.py`, `closeups_sync.py`, `quant_voice.py`) | **`4A`:** Add `fit_pillow_text_to_width()`, `draw_bounded_box_text()`, & `draw_bounded_kv_row()` to `publishing/fonts.py` + wire `load_json_cached()` into `quant_voice.py` | **`4B`:** Keep bounded text helpers private inside `closeups_sync.py` | **`4C`:** Manual coordinate tweaks only |
### Audit Point 6 — `[AFFIRMED: Strategy 6A]` Path-Aware `.git/hooks/pre-commit` & Push Deduplication (`push-all-to-git-libre-audio.sh`, `readme_sync.py`)
- Update `PRE_COMMIT_HOOK_SCRIPT` in `readme_sync.py` so `closeups_sync` and `deploy_scripts_sync` only run when staged files affect their respective surfaces (falling back cleanly to `--check` or skipping irrelevant repos), and remove duplicate pre-test subprocess calls in `push-all-to-git-libre-audio.sh` that `tests/test_core_suite.py` already enforces in-process (keeping `version_sync --corpus-delta`, `build-fedora41-rpm.sh`, `run_exegesis_and_push_fedora41.sh --dry-run`, `test_core_suite.py`, and `build_encyclopedia_knowledge_graph.py --verify-only`).