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

@@ -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`).