15 KiB
15 KiB
PLAN: Piecewise /quant/ Guided Tour Spoken Voice Narration, Explicit Per-Scene UI Element Indicators & Automatic Closeup Re-Rendering (Audit Points 1–4, Rule C Piecewise Specification)
Document ID: PLAN-PIECEWISE-QUANT-VOICE-NARRATION-AND-SCENE-UI-INDICATORS
Status: PENDING AUDIT PIECEWISE (0/4 AUDIT POINTS AFFIRMED — READY FOR STEPWISE REVIEW)
Target Ecosystem Version: v2.11.0
Target Repositories: hyperstitionstudio-core, encyclopedia-knowledge-graph
Author: m00t & Hermes Agent
Date: 2026-11-30
1. Ground-Truth Audit: Why Voice: ON Only Played Chimes & Why Ep 04 Failed to Indicate #lensSelect (Rule C.1)
Per Rule C of hyperstitionstudio-roadmap-and-release, we audited /workspace/hyperstitionstudio-core/site/quant/quant-tutorials.js, site/quant/quant-app.js, and src/hyperstitionstud_io/publishing/closeups_sync.py to pinpoint the exact root causes of the issues reported by the user:
| Audit Point & Surface | Root Cause Discovered in Live Code (v2.10.0) |
What Must Change to Fix It |
|---|---|---|
| Audit Point 1 Spoken Voice Narration ( #tutSpeechBtn "Voice: ON" in site/quant/quant-tutorials.js) |
1. Silent Abort When speechSynthesis.getVoices() Is Empty (lines 406–410):speakSubtitle() calls playWebAudioTelemetryChime(curStepIdx) and then immediately checks:`if (typeof window.speechSynthesis === "undefined" |
|
| Audit Point 2 Per-Scene UI Element Indicators ( Ep 01–05, especially Ep 04 #lensSelect Dropdown) |
1. highlightDomTarget() Only Knew 5 Bottom Panels (lines 454–466):map = { panel2: "heatmapTable", lensCard: "lensProjectionCard", docCard: "docReferencesCard", wireTape: "wireEqTape", panel4: "lagBarsContainer" }.• It never included #lensSelect (the Projection Lens dropdown list!), #guildFilterPills, #tickerSelect, #tickerQuickFilter, #metricModePills, #timeWindowPills, #openTradingViewBtn, #exportCsvBtn, #macroIndicatorsPanel, or #dailyBriefPanel!• As a result, all 5 scenes of Ep 04 (4.1–4.5) only put a faint box-shadow on #lensProjectionCard and never pointed to or highlighted the #lensSelect Projection Lens dropdown list in the toolbar! |
1. Explicit Floating UI Element Callout Badge (#tutUiElementIndicator) + Gold Pulse Ring on Every Scene's Target Control (25/25 Scenes):• Give every single scene ( 1.1 through 5.5) an explicit uiTargets: [...] array mapping to the exact DOM control(s) being taught (e.g., Ep 04 scenes 4.1–4.5 highlight both #lensSelect (Projection Lens Dropdown List) AND #lensProjectionCard with a glowing Gold border + floating ▼ ACTIVE UI ELEMENT: Projection Lens Dropdown (#lensSelect) badge and smooth scroll-into-view!). |
| Audit Point 3 Spoken Text Normalization for Math, Symbols & Tickers ( cleanTextForSpeech()) |
• Raw subtitle strings contain symbols like ` | Δbps_{i, t+tau} |
| Audit Point 4 Deepening hs-closeups-sync (src/hyperstitionstud_io/publishing/closeups_sync.py) for /quant/ & All Pages |
• While closeups_sync.py hashes HTML IDs/classes/buttons, it currently only inspects .html files (not quant-tutorials.js or quant-app.js dynamic pill arrays), and the Quadrant 02 closeups (quadrant-2-*.png) do not visually reflect the newly added /quant/ toolbar & tutorial controls (#quantTutorialBar, #lensSelect, #timeWindowPills, #tickerQuickFilter, #heatmapPaginationBar, #wireTapeFilterInput) when those elements are added or removed. |
• Upgrade closeups_sync.py so introspect_live_ui_elements() inspects both .html and companion .js files (quant-app.js, quant-tutorials.js, learn-app.js, hs-guile-scheme-repl.js) AND dynamically renders the live detected UI controls directly inside the 680×260 closeup canvases whenever any control is added or removed! |
2. Four Factual Binary Engineering Gates (G1–G4, Zero Synthetic Data)
Gate G1(100% Real Spoken Voice Output — Not Just Chimes): Clicking▶ Play Guided Touror🔊 Voice: ONmust produce real spoken human-intelligible voice narration of the scene's educational text (via pre-generated offline.mp3voice clips + synchronous Web Speech APISpeechSynthesisUtterancewithout blocking oncachedVoices.length === 0).Gate G2(25/25Scenes Explicitly Indicate Their Target DOM UI Element(s)): Every scene (1.1–5.5) highlights its exact DOM control(s) (including#lensSelectinEp 04,#guildFilterPillsinEp 01,#metricModePillsinEp 02,#openTradingViewBtn/#heatmapTableinEp 03, and#exportCsvBtn/#lagBarsContainerinEp 05) with a high-visibility.tut-active-ui-highlightring and a floating#tutUiElementCalloutpointer banner.Gate G3(100% Dynamichs-closeups-syncReactivity Across HTML + JS): Adding or removing any UI element in/quant/,/learn/,/graph/,/calc/,/engineering/, or/math/(in either.htmlor.js) triggershs-closeups-syncand updates the rendered elements insidesite/assets/closeups/*.png.Gate G4(ProtectSystem=strictEROFS& Offlinefile://Safe): Works 100% offline over both HTTP andfile://.
3. Piecewise Audit Points & Candidate Strategies (Strategies 1A–1C through 4A–4C)
Audit Point 1: Real Spoken Voice Narration for /quant/ Guided Tour (#tutSpeechBtn & speakSubtitle())
- Strategy
1A(Dual-Engine Spoken Voice: Pre-Generated Offline Neural TTS.mp3Clips for All 25 Scenes + Unblocked Synchronous BrowserspeechSynthesis.speak()Fallback — Recommended Candidate):- Uses the
text_to_speechtool to generate crisp, offline-bundled spoken audio tracks (site/quant/audio/ep01-s1.mp3..ep05-s5.mp3) for all 25 scenes and plays them through a dedicated<audio id="tutVoicePlayer">element whenVoice: ONis enabled. - Simultaneously fixes the Web Speech API fallback in
quant-tutorials.jsby:- Removing the fatal
if (cachedVoices.length === 0) return;guard (callingwindow.speechSynthesis.speak(u)with the browser's default voice even whengetVoices()is initially empty), - Calling
speechSynthesis.speak(u)synchronously inside the user click handler (instead of insidesetTimeout(..., 60)), and - Lowering or removing the chime so the spoken voice is the primary audio output controlled by
🔊 Voice: ON / 🔇 Voice: OFF.
- Removing the fatal
- Uses the
- Strategy
1B(Fix Browserwindow.speechSynthesisGuard & Synchronous Call Only — Zero.mp3Files Candidate):- Fixes
speakSubtitle()inquant-tutorials.jssowindow.speechSynthesis.speak(u)is called synchronously without aborting oncachedVoices.length === 0and adds a spoken math/symbol normalizer, without bundling.mp3files.
- Fixes
- Strategy
1C(Keep WebAudio Chimes Only — Status Quo):- Plays only synthetic sine/triangle chimes when
getVoices()is empty.
- Plays only synthetic sine/triangle chimes when
Audit Point 2: Explicit UI Element Indication Across All 25 Scenes (Especially Ep 04 #lensSelect Projection Lens Dropdown)
- Strategy
2A(High-Visibility Gold Callout Ring.tut-ui-highlight+ Floating▼ INSPECTING UI ELEMENTPointer Badge on Every Scene's Target Control(s), Including#lensSelectinEp 04— Recommended Candidate):- Expands
highlightDomTarget()insite/quant/quant-tutorials.jsto support all 18 interactive DOM controls on/quant/:Ep 01(1.1–1.5): Highlights#guildFilterPills(and the specific active pillALL / S1 / S3 / S6),#tickerQuickFilter,#tickerSelect, and#periodicityAuditFooter.Ep 02(2.1–2.5): Highlights#metricModePills(Close Price (USD)/Move (BPS)/Spoken AQ),#timeWindowPills,#activeDateBadge, and the specific Top/Middle/Bottom pane of#tsCanvas.Ep 03(3.1–3.5): Highlights#heatmapTable(Panel 2),#openTradingViewBtn&#panel3TvBtn(TradingView ↗),#docReferencesCard, and#wireEqTape+#wireTapeFilterInput.Ep 04(4.1–4.5— Projection Lenses): Explicitly highlights BOTH the#lensSelectProjection Lens<select>dropdown list in the toolbar AND#lensProjectionCardin Panel 3, attaches a floating Gold badge (▼ UI ELEMENT: Projection Lens Dropdown (#lensSelect) -> Active: <Lens Name>) directly above#lensSelect, and pulses#lensSelectso the viewer immediately sees where to change lenses!Ep 05(5.1–5.5): Highlights#lagBarsContainer(Panel 4),#exportCsvBtn&#exportJsonBtn,#macroIndicatorsPanel(Panel 5), and#dailyBriefPanel(Panel 6).
- Expands
- Strategy
2B(Add#lensSelectBox-Shadow Only Without Floating Callout Badge — Minimal Candidate):- Adds
lensSelecttohighlightDomTarget()with a CSSbox-shadowonly, without a floating label badge or multi-control highlighting.
- Adds
- Strategy
2C(Keep Existing 5-Panel Highlight Map — Status Quo):- Leaves
#lensSelectand toolbar controls unhighlighted during the tour.
- Leaves
Audit Point 3: Spoken Script & Educational UI-Element Callout Normalization (speechText Per Keyframe)
- Strategy
3A(Dedicated Natural-EnglishspeechTextPer Scene Naming the Highlighted UI Control First — Recommended Candidate):- Adds a natural-English
speechTextfield (andcleanTextForSpeech()normalizer) to each of the 25 scenes so the voice explicitly names the highlighted UI element and explains its educational function in clear spoken words (e.g. forEp 04 Scene 4.1: "Scene 4.1. Highlighting the Projection Lens dropdown list in the top toolbar and the Lens Projection card in Panel 3. Under the hood, the workbench stores one hundred percent lens-neutral mathematical scores. Use the Projection Lens dropdown list to switch between Neutral Math, Fund Manager, Corporate Board, TierZoo, Fantasy Sabermetrics, and Pokedex Scanner.").
- Adds a natural-English
- Strategy
3B(Regex Strip Punctuation from ExistingsubtitleOnly — Partial Candidate):- Strips
_*|=characters fromkf.subtitlewithout explicitly naming the highlighted UI control in the spoken narration.
- Strips
- Strategy
3C(Pass Rawkf.subtitleDirectly to TTS — Status Quo):- Passes raw code/math strings like
|Δbps_{i, t+tau}|directly to TTS.
- Passes raw code/math strings like
Audit Point 4: Deepening hs-closeups-sync (closeups_sync.py) to Track JS-Rendered Controls & Visually Reflect /quant/ UI Elements
- Strategy
4A(Introspect Both.htmland.jsUI Control Definitions inhs-closeups-sync& Render Live Detected Controls Inside the680×260Closeup Canvases — Recommended Candidate):- Upgrades
introspect_live_ui_elements()insrc/hyperstitionstud_io/publishing/closeups_sync.pyso it fingerprints both.htmlfiles and companion.jsfiles (site/quant/quant-app.js,site/quant/quant-tutorials.js,site/learn/learn-app.js,site/assets/hs-guile-scheme-repl.js)—detecting any added/removed toolbar controls, tutorial episodes, lens options, or filter pills. - Updates the
Quadrant 02(quadrant-2-*.png) closeup renderer incloseups_sync.pyso that each tab closeup dynamically draws the live controls present insite/quant/index.htmlandquant-tutorials.js(e.g., showing the#lensSelectdropdown,#tutSpeechBtn🔊 Voice: ON,#timeWindowPills[30D|90D|180D|ALL], and#tickerQuickFilterwhen present in the live DOM, and omitting them if removed) and adds a unit test intests/test_core_suite.pyverifying that mutating a UI element triggershs-closeups-syncre-rendering!
- Upgrades
- Strategy
4B(Add.jsFile Hashing tocloseups_sync.pyOnly — Partial Candidate):- Hashes
.jsfiles to trigger re-renders without updating the visual control drawing insidequadrant-2-*.png.
- Hashes
- Strategy
4C(Leavecloseups_sync.pyHTML-Only — Status Quo):- Only inspects
.htmlfiles.
- Only inspects
4. Summary Matrix of Audit Points 1–4 for Stepwise Review
| Audit Point | Target /quant/ & Tooling Surface |
Strategy A (Complete Fix & Live Introspection — Recommended) |
Strategy B (Lightweight / Partial Alternative) |
Strategy C (Status Quo) |
|---|---|---|---|---|
| Point 1 | Spoken Voice Narration (#tutSpeechBtn) |
1A: Pre-generated offline neural TTS .mp3 clips (25 scenes) + unblocked synchronous window.speechSynthesis.speak() fallback |
1B: Unblocked synchronous window.speechSynthesis.speak() fix only (0 .mp3 files) |
1C: Chimes only when getVoices() is empty |
| Point 2 | Per-Scene UI Element Indicators (Ep 01–05 & Ep 04 #lensSelect) |
2A: Highlight all 18 DOM controls (including #lensSelect dropdown + #lensProjectionCard in Ep 04) with .tut-ui-highlight + floating ▼ UI ELEMENT pointer badge |
2B: Add #lensSelect box-shadow only (no floating pointer badge) |
2C: Keep 5-panel highlight map |
| Point 3 | Spoken Educational Script (speechText) |
3A: Dedicated natural-English speechText per scene naming the highlighted UI element first + math/symbol pronunciation normalizer |
3B: Regex punctuation strip on raw subtitle only |
3C: Raw subtitle string |
| Point 4 | hs-closeups-sync (closeups_sync.py) |
4A: Introspect both .html + .js (quant-app.js, quant-tutorials.js, learn-app.js), dynamically draw live /quant/ controls in quadrant-2-*.png, & add mutation test in test_core_suite.py |
4B: Hash .js files without updating quadrant-2-*.png control drawing |
4C: HTML-only fingerprinting |