17 KiB
17 KiB
PLAN: Piecewise Complete Software Engineering Explication Across /engineering/ (Unit E0 Hub & Subpages E1–E5, Strict Anti-Self-Reference Closure Boundary, Audit Points 1–6, Rule C Piecewise Specification)
Document ID: PLAN-PIECEWISE-COMPLETE-SOFTWARE-ENGINEERING-EXPLICATION
Status: ACTIVE / READY FOR STEPWISE PIECEWISE REVIEW & IMPLEMENTATION
Target Ecosystem Version: v2.9.0
Target Repositories: hyperstitionstudio-core, encyclopedia-knowledge-graph
Author: m00t & Hermes Agent
Date: 2026-11-30
1. Strict Anti-Self-Reference / Non-Circular Closure Invariant (Zero Self-Explication of /engineering/*)
To prevent self-referential fixed-point and IPLD dag-json CIDv1 closure issues (where modifying /engineering/ to describe /engineering/ alters engineering_docs.py / engineering-manifest.json / hs-eng-docs counts and routes in a circular feedback loop):
- Strict Explication Boundary (What
/engineering/*Must NEVER Explicate):/engineering/(Unit E0Hub and SubpagesE1–E5) is the observer/explication lens, never the observed subject.- Therefore,
/engineering/and its subpages (E1–E5) must omit/engineering/(site/engineering/*),publishing/engineering_docs.py,hs-eng-docs,engineering-manifest.json, and the/engineering/subpages themselves (E0–E5) from the subject matter being explicated (and likewise omitpublishing/math_docs.py/hs-math-docsself-reference). - In
ENGINEERING_GUILE_CARTRIDGES["E0"]and the HubE0tables, replace self-referentialintrospect_engineering_manifest()examples with non-self-referential workspace target introspection (load_workspace_config(),MCP_TOOLS_SCHEMA,REST_DOMAIN_ALIASES, and core domain CLI entrypoints excludinghs-eng-docs/hs-math-docsfrom self-referential prose).
- What
/engineering/*Explicates Instead (100% of the Target Domain Software Engineering):- Explicates exclusively the underlying operational software systems of
hyperstitionstud.io:- Domain
E1:ciphers,phonetics,packages-js/ciphers-aq,/calc/(haiperdohp-jemaytreeah), and the 4-Gate CI provisioner (ci_provision_ingglish.py). - Domain
E2:glossary(ReadOnlyIsolationGuard),graph(build_encyclopedia_knowledge_graph.py), anddb/sqlite_meta.py(hyperstition-catalog.db&api-telemetry.db). - Domain
E3:quant/{collector,timeseries,macro,daily_brief}.py,lenses/__init__.py, and/quant/(quant-app.js,quant-tutorials.js). - Domain
E4:mcp/{server,rest,tools,resources,prompts}.py,quant/cards.py,ipld/__init__.py, andpublishing/polyglot_sandbox.py(hs-guile-scheme-repl.js). - Domain
E5:deploy/{sync-vps-repos.sh,run-vps-data-production.sh,run-vps-archive-rotation.sh,Caddyfile},push-all-to-git-libre-audio.sh,version_sync.py,publishing/{pdf_compiler,archive_rotator,readme_sync,highlights,flow_diagram}.py,ci/{doctor,citation_sources,erofs_harness,public_regression}.py, andsite/assets/{hs-group3-basalt-chamfer.css,hs-matrix-coderain.js}.
- Domain
- Explicates exclusively the underlying operational software systems of
2. Ground-Truth Audit: Live Target Codebase Modules (v2.8.1) vs. Current /engineering/ Explication Gaps (Rule C.1)
Audit Point & /engineering/ Surface |
What Is Currently Rendered on /engineering/ (v2.8.1) |
Self-Reference Bugs, Stale Counts & Undocumented Target Modules Found in Audit (Gaps to Fix) |
|---|---|---|
| Audit Point 1 Hub E0 (/engineering/index.html) |
• E0 Polyglot Cartridge currently calls manifest = introspect_engineering_manifest() (self-referential!) and hardcodes stale tools=15 and lenses=4• Includes an Enabled Subpages: 5 / 5 stat tile and hs-eng-docs / hs-math-docs in the CLI table |
1. Eliminate Self-Reference on E0: Replace introspect_engineering_manifest() in ENGINEERING_GUILE_CARTRIDGES["E0"] with non-self-referential load_workspace_config() / MCP_TOOLS_SCHEMA (20 tools, 6 lenses), remove the self-referential Enabled Subpages stat tile, and filter hs-eng-docs & hs-math-docs out of the target domain CLI table.2. Add Non-Self-Referential 6-Repository & Core Subpackage Architecture Table: Map the 6 repositories and core domain subpackages ( config, ciphers, phonetics, glossary, graph, quant, lenses, db, ipld, mcp, ci) without referencing /engineering/ itself. |
| Audit Point 2 Subpage E1 (ciphers-and-phonetics) |
• Section 1: Base-36 mapping & quantization modes (digit, off, spoken)• Section 2: 3-Tier translate_batch() phonetics transducer (4,943 cmudict_fallback.json keys) |
1. Undocumented packages-js/ciphers-aq Dual-Runtime Parity & /calc/ Progressive DB Hydration: Omits how the browser/ESM package (packages-js/ciphers-aq) and /calc/ (haiperdohp-jemaytreeah/tools/generate_db_json.py, progressive db_lite.json + db.json hydration over 231,615 db.txt entries) stay in lockstep with Python hyperstitionstud_io.ciphers.2. Undocumented 4-Gate CI Provisioner (ci_provision_ingglish.py): Omits the 4 gates (Gate A Format, Gate B Phonemic Determinism, Gate C Isopsephic Parity, Gate D Deduplication) that filter candidates into db.txt. |
| Audit Point 3 Subpage E2 (knowledge-graph-and-sqlite) |
• Section 1: ReadOnlyIsolationGuard (glossary/__init__.py)• Section 2: 6-Gate KG compiler & api-telemetry.db 100M quiescent logrotate |
1. Undocumented v2.8.0 Zero-PII Market-Research Telemetry Schema (sqlite_meta.py): Omits the external_requests vs internal_requests split (N>=500 "No data available" gate), the closed-set allowlist api_parameter_rollups table (symbol, lens, lang, surface, donate_from, donate_copy, export_action), static_route_rollups (--ingest-caddy-route-counts), and get_longitudinal_telemetry_summary() (--telemetry-history across .1.gz..12.gz).2. Undocumented 6 Knowledge Graph Verification Gates: Mentions "6-Gate" without listing what Gates 1–6 in build_encyclopedia_knowledge_graph.py verify. |
| Audit Point 4 Subpage E3 (quant-macro-and-bayesian-brief) |
• Section 1: collector.py & macro.py• Section 2: 14-Point Census, Confluence Dose (D \in \{0..4\}), & daily_brief.py |
1. Stale Bar Count (440 vs 472): Line 282 hardcodes "23 public tickers load 440 verified daily exchange bars" instead of dynamically reading the live 472 real exchange bars (19 trading days across 24 instruments)!2. Undocumented LENS_REGISTRY (lenses/__init__.py) & Frontend Quant Engine (quant-app.js / quant-tutorials.js): Omits how LENS_REGISTRY projects struct_* and ts_* keys across the 6 lenses and how the Zero-MP4 25-scene canvas choreographer (quant-tutorials.js) and 27 ⓘ glossary popovers work. |
| Audit Point 5 Subpage E4 (mcp-chatbot-rest-and-ipld) |
• Section 1: Stateless MCP (/mcp) & OpenAPI 3.1 REST (/api/v1/*)• Section 2: quant/cards.py (900×1260 TCG stats cards) & ipld/__init__.py (CIDv1) |
1. Stale Tool Count (15 vs 20) & Self-Referential Tool Exclusion: Line 311 hardcodes "expose all 15 tools in MCP_TOOLS_SCHEMA" instead of the live domain tools, static URN resources (mcp/resources.py), URI templates, and prompts (mcp/prompts.py).2. Undocumented HTTP ETag (304 Not Modified) Middleware & 34x Stats-Card Fast-Path: Omits compute_response_etag() / matches_if_none_match() in mcp/rest.py and the pre-compiled quant-timeseries.json fast-path (1,186 ms -> ~35 ms) in quant/cards.py.3. Undocumented 4-Ring Polyglot Sandbox ( publishing/polyglot_sandbox.py & hs-guile-scheme-repl.js): Never explains how the 4-Ring Zero-eval() AST sandbox (Ring 1 Lexer Gate, Ring 2 Step/Depth Quota, Ring 3 Pure AST Evaluator for Guile/TS/Rust, Ring 4 Read-Only Isolation) works. |
| Audit Point 6 Subpage E5 (cicd-vps-tmpfs-and-regression) |
• Section 1: Zero-/dev/null scripts & HYPERSTITION_SYNC_REEXEC• Section 2: pdf_compiler.py, archive_rotator.py, & public_regression.py (Gates P1–P6) |
1. Eliminate Self-Referential Subtitle Text (Non-Sequentially Revertible via hs-eng-docs --disable ...): Subtitles across E0–E5 currently describe hs-eng-docs --disable (self-reference!). Replace with non-self-referential domain authority subtitles.2. Undocumented ProtectSystem=strict (EROFS) Syscall Test Harness (ci/erofs_harness.py), readme_sync.py (hs-readme-sync), Git Hooks (pre-commit & commit-msg), citation_sources.py (hs-citations), & hs-matrix-coderain.js: Add sections covering these core CI/CD and frontend modules without mentioning engineering_docs.py. |
3. Four Factual Binary Engineering Gates (G1–G4, Zero Self-Reference & Zero Synthetic Data)
Gate G1(Strict Anti-Self-Reference Closure): Zero prose, code examples, subtitles, or tables on/engineering/*may referenceengineering_docs.py,hs-eng-docs,engineering-manifest.json, or/engineering/itself as a subject of explication.Gate G2(100% Live Introspected Domain Counts — Zero Stale Numbers): Every domain count (472real exchange bars,4,943CMUdict entries,24watchlist tickers,14FRED series,388KG nodes,1,282edges) is interpolated dynamically from the target domain registries.Gate G3(0LLM Tokens &ProtectSystem=strictEROFS/ReadOnlyIsolationGuardSafe): Zero mutations to locked upstream registries (all_unchanged: True).Gate G4(100% Target Domain Module Coverage): Every target operational module inhyperstitionstud_io.*(excluding the observer modulesengineering_docs.pyandmath_docs.py) is explicated.
4. Piecewise Audit Points & Candidate Strategies (Strategies 1A–1C through 6A–6C)
Audit Point 1: Hub E0 (/engineering/index.html) — Remove Self-Reference (introspect_engineering_manifest, Enabled Subpages, hs-eng-docs) & Add 6-Repo Target Domain Architecture Map
- Strategy
1A(Purge Self-Reference fromE0Cartridge/Tiles/Tables + Add Non-Self-Referential 6-Repository & Core Subpackage Architecture Table — Recommended Candidate):- Replaces
introspect_engineering_manifest()inENGINEERING_GUILE_CARTRIDGES["E0"]withload_workspace_config()(hyperstitionstud_io.config) and live domain counts (repositories=6,watchlist=24,fred=14,lenses=6), removes the self-referentialEnabled Subpagesstat tile andhs-eng-docs/hs-math-docsrows from the CLI table, removes self-referentialhs-eng-docs --disabletext fromE0–E5subtitles, and adds a 6-Repository & Core PEP 420 Subpackage Architecture Table describing the target operational codebase (config,ciphers,phonetics,glossary,graph,quant,lenses,db,ipld,mcp,ci).
- Replaces
- Strategy
1B(Purge Self-Reference & Fix Counts Only — Minimal Candidate):- Removes self-references and fixes stale counts in
E0without adding the 6-repository & subpackage architecture table.
- Removes self-references and fixes stale counts in
- Strategy
1C(LeaveE0Unchanged — Status Quo):- Retains self-referential
introspect_engineering_manifest()and stale15/4counts.
- Retains self-referential
Audit Point 2: Unit E1 (ciphers-and-phonetics) — Dual-Runtime JS/Python Cipher Parity, /calc/ Progressive DB Hydration & 4-Gate CI Provisioner
- Strategy
2A(Add Section 3 toE1: Browser/ESMpackages-js/ciphers-aqParity, Progressivedb_lite.json+db.jsonHydration (231,615Entries) & 4-Gateci_provision_ingglish.py— Recommended Candidate):- Explains how
packages-js/ciphers-aqandhaiperdohp-jemaytreeah/tools/generate_db_json.pymaintain 100% parity with Pythoncompute_aq(), how/calc/progressively hydratesdb_lite.json\todb.json, and howci_provision_ingglish.pyenforces GatesA–D.
- Explains how
- Strategy
2B(Documentci_provision_ingglish.pyOnly — Partial Candidate):- Covers the 4-Gate CI script without
/calc/'s progressive DB hydration.
- Covers the 4-Gate CI script without
- Strategy
2C(LeaveE1at 2 Sections — Status Quo):- Leaves
/calc/andhyperdope-ci-buildundocumented.
- Leaves
Audit Point 3: Unit E2 (knowledge-graph-and-sqlite) — 6-Gate KG Verifier Specification & v2.8.0 Zero-PII SQLite Telemetry Schema
- Strategy
3A(ExpandE2with Explicit 6-Gate KG Verifier Breakdown +v2.8.04-Table Zero-PII SQLite Telemetry Architecture — Recommended Candidate):- Explicitly enumerates Gates
1–6ofbuild_encyclopedia_knowledge_graph.py --verify-onlyand documents bothhyperstition-catalog.db(8tables including FTS5 BM25fts_catalog, omitting any self-referential manifest rows) and/var/lib/hyperstitionstud.io/api-telemetry.db(api_endpoint_rollupsexternal_requestsvsinternal_requests, closed-set allowlistapi_parameter_rollups, zero-IP Caddystatic_route_rollups,get_longitudinal_telemetry_summary()across.1.gz..12.gz, andN_{\text{ext}} \ge 500"No data available"confidence gating).
- Explicitly enumerates Gates
- Strategy
3B(Updatesqlite_meta.pyProse Only — Partial Candidate):- Mentions
api_parameter_rollupswithout enumerating the 6 KG gates.
- Mentions
- Strategy
3C(LeaveE2Unchanged — Status Quo):- Leaves the
v2.8.0telemetry tables and 6 KG gates undocumented.
- Leaves the
Audit Point 4: Unit E3 (quant-macro-and-bayesian-brief) — Dynamic Bar Count (472), LENS_REGISTRY Architecture & Zero-MP4 Canvas Tour Engine
- Strategy
4A(Replace Hardcoded440with Live472Bar Introspection + Add Section 3 CoveringLENS_REGISTRY, 27ⓘPopovers & Zero-MP4 25-Scenequant-tutorials.js— Recommended Candidate):- Dynamically interpolates live
472real exchange bars (19trading days across23public tickers +ANTHR-PVTprivate =null) and adds Section 3 coveringlenses/__init__.py(project_build_through_lens()),quant-app.js(QUANT_TERM_GLOSSARY27ⓘpopovers), andquant-tutorials.js(5-episode × 5-scene canvas choreographer + WebAudio fallback chime).
- Dynamically interpolates live
- Strategy
4B(Fix440 -> 472Count Only — Minimal Candidate):- Fixes the stale bar count without documenting
lenses/__init__.pyorquant-tutorials.js.
- Fixes the stale bar count without documenting
- Strategy
4C(LeaveE3Unchanged — Status Quo):- Retains the stale
440bar count.
- Retains the stale
Audit Point 5: Unit E4 (mcp-chatbot-rest-and-ipld) — HTTP ETag (304), 34x Stats-Card Fast-Path & 4-Ring Polyglot AST Sandbox (polyglot_sandbox.py)
- Strategy
5A(Document HTTPETag304,34xStats-Card Fast-Path & Add Section 3 on the 4-Ring Zero-Eval Polyglot AST Sandbox (polyglot_sandbox.py&hs-guile-scheme-repl.js) — Recommended Candidate):- Updates Section 1 with deterministic HTTP
ETag("<dag_json_cidv1>") +If-None-Match(304 Not Modified) caching inmcp/rest.pyandmcp/server.py(omitting self-referentialhs_inspect_engineering_and_math_docs/engineering-manifestfrom the prose examples), updates Section 2 with the34xstats-card fast-path (1,186 ms -> ~35 ms) inquant/cards.py, and adds Section 3 detailing the 4-Ring Zero-eval()Polyglot AST Sandbox (Ring 1Lexer Gate,Ring 2max_steps=2000Quota,Ring 3Pure AST/S-Expression Evaluator,Ring 4ReadOnlyIsolationGuard).
- Updates Section 1 with deterministic HTTP
- Strategy
5B(Update Section 1 & 2 Prose Only — Partial Candidate):- Adds
ETag304and the34xfast-path without Section 3 onpolyglot_sandbox.py.
- Adds
- Strategy
5C(LeaveE4Unchanged — Status Quo):- Leaves
ETag304andpolyglot_sandbox.pyundocumented.
- Leaves
Audit Point 6: Unit E5 (cicd-vps-tmpfs-and-regression) — ProtectSystem=strict (EROFS) Syscall Harness, hs-readme-sync + Git Hooks, hs-citations & Group 3 Frontend Engine
- Strategy
6A(Addv2.8.1--hooks-onlyVPS Merge Fix + Section 3 onci/erofs_harness.py&ci/citation_sources.py+ Section 4 onreadme_sync.py,commit-msgGate,highlights.py --corpus-delta&hs-matrix-coderain.js— Recommended Candidate):- Updates Section 1 with the
v2.8.1VPS fast-forward merge protection (git checkout -- README.md+hs-readme-sync --hooks-only), adds Section 3 coveringsimulate_protect_system_strict()(ci/erofs_harness.py) andverify_draft()(ci/citation_sources.py), and adds Section 4 coveringreadme_sync.py(.git/hooks/{pre-commit,commit-msg}),highlights.py --corpus-delta, and the Group 3 +hs-matrix-coderain.js(matrix-font.woff2,12.5 fps,-60%center-well vignette) frontend engine.
- Updates Section 1 with the
- Strategy
6B(Adderofs_harness.py&readme_sync.pyOnly — Partial Candidate):- Documents
erofs_harness.pyandreadme_sync.pywithoutcitation_sources.pyorhs-matrix-coderain.js.
- Documents
- Strategy
6C(LeaveE5at 2 Sections — Status Quo):- Leaves
erofs_harness.py,readme_sync.py,citation_sources.py, andhs-matrix-coderain.jsundocumented.
- Leaves