fix(quant,tutorials,deploy): fix all 43 Encyclopedia PDF deep links, always restart hyperstition-mcp.service on sync, and enable default voice + WebAudio narration (v2.0.21)

This commit is contained in:
Hermes Agent committed 2026-11-30 07:39:44 +00:00
1 parent 1b232fe873
commit 95a5fc8618
25 files changed
+328 -175

No files matched your search

+140 -39
View File
@@ -1,5 +1,5 @@
// /workspace/hyperstitionstudio-core/site/quant/quant-tutorials.js
// Option B Zero-MP4 Interactive HTML5 Canvas Tutorial Player & Deep-Link Choreographer (v2.0.20)
// Option B Zero-MP4 Interactive HTML5 Canvas Tutorial Player & Deep-Link Choreographer (v2.0.21)
(function () {
"use strict";
@@ -28,7 +28,7 @@
spotlight: { target: "canvas", pane: "top", xRatio: 0.90, yRatio: 0.28, label: "S1 AI Guild Filter Active (292 Singularity)" },
subtitle: "Filtering by Guild S1 isolates the Autoregressive AI Syndicate anchored on Coordinate 292 (shizohnalizis == abstrakt masheen == sinthetik dayta == asset management [Gen 0]).",
citations: [
{ label: "Vol 03A PDF (S1 AI)", href: "/encyclopedia/03-machinic-phylum-singularities-s1-to-s5/s1-a-to-z-agentic-ai-to-weights.pdf#page=1&search=292" },
{ label: "Vol 03A PDF (S1 AI)", href: "/encyclopedia/03-machinic-phylum-guilds-s1-to-s5/class-s1-autoregressive-ai-and-abstract-machine-a-to-z.pdf#page=1&search=292" },
{ label: "Dossier 65 (292 Lock)", href: "/zoology/dossiers/65-dossier-technocapital-singularity-autoregressive-ai.md#:~:text=292" },
{ label: "Graph Build S1", href: "/graph/index.html?select=build:S1" }
]
@@ -39,7 +39,7 @@
spotlight: { target: "canvas", pane: "top", xRatio: 0.95, yRatio: 0.30, label: "S3 Isometric Chokepoint: ASML = asml = 81 (Δ = 0)" },
subtitle: "Guild S3 maps physical wafer and EUV lithography chokepoints: ASML (81, Δ = 0 isometric), TSMC (95, Δ = 0), and Nvidia (envideea = 137 [33rd Prime]).",
citations: [
{ label: "Vol 03C PDF (p.5 ASML/envideea)", href: "/encyclopedia/03-machinic-phylum-singularities-s1-to-s5/s3-a-to-z-asml-to-wor-masheen.pdf#page=5&search=envideea" },
{ label: "Vol 03C PDF (p.5 ASML/envideea)", href: "/encyclopedia/03-machinic-phylum-guilds-s1-to-s5/class-s3-silicon-war-machine-and-euv-swarm-a-to-z.pdf#page=5&search=envideea" },
{ label: "Dossier 67 (Silicon War Machine)", href: "/zoology/dossiers/67-dossier-technocapital-singularity-silicon-war-machine.md#:~:text=137" },
{ label: "Graph Hub aq:81", href: "/graph/index.html?select=aq:81" }
]
@@ -50,7 +50,7 @@
spotlight: { target: "canvas", pane: "top", xRatio: 0.86, yRatio: 0.26, label: "S6 Capture Ring: kapatal == kapcher == fohldz = 125" },
subtitle: "Guild S6 tracks sovereign and balance-sheet capture around Coordinate 125 (kapatal == kapcher == fohldz = 125) and charter/sloth (136).",
citations: [
{ label: "Vol 04A PDF (S6 Capture)", href: "/encyclopedia/04-apparatus-of-capture-s6/s6-a-to-m-acquisition-to-monopoly.pdf#page=1&search=125" },
{ label: "Vol 04A PDF (S6 Capture)", href: "/encyclopedia/04-capital-organizational-capture-s6/a-to-f-acquisition-to-fund.pdf#page=1&search=125" },
{ label: "Dossier 68 (Capture)", href: "/zoology/dossiers/68-dossier-technocapital-singularity-apparatus-of-capture.md#:~:text=125" },
{ label: "Graph Hub aq:125", href: "/graph/index.html?select=aq:125" }
]
@@ -61,6 +61,7 @@
spotlight: { target: "panel4", xRatio: 0.50, yRatio: 0.85, label: "Cryptographic CIDv1 & Periodicity Audit Footer" },
subtitle: "The bottom footer verifies 21 dated 00:00 UTC dossiers + 30 closing-bell bars, 0 non-periodic records, and the deterministic IPLD dag-json CIDv1 digest (baguqeera...).",
citations: [
{ label: "Static Bundle quant-timeseries.json", href: "/quant/quant-timeseries.json" },
{ label: "REST API /api/v1/quant/timeseries", href: "/api/v1/quant/timeseries?symbol=NVDA" },
{ label: "Schema quant-timeseries.schema.json", href: "/schemas/v1/quant-timeseries.schema.json" }
]
@@ -78,7 +79,7 @@
spotlight: { target: "canvas", pane: "top", xRatio: 0.96, yRatio: 0.25, label: "Scope 1 Self-Lock: NVDA Close $137.00 == envideea [137]" },
subtitle: "Notice the Gold Beacon Circle on Nov 30 ($137.00): NVDA's closing price lands directly on the dashed crimson threshold marking its own Gen 1 Ingglish name (envideea = 137 [33rd PRIME]).",
citations: [
{ label: "Vol 03C PDF (p.5 envideea)", href: "/encyclopedia/03-machinic-phylum-singularities-s1-to-s5/s3-a-to-z-asml-to-wor-masheen.pdf#page=5&search=envideea" },
{ label: "Vol 03C PDF (p.5 envideea)", href: "/encyclopedia/03-machinic-phylum-guilds-s1-to-s5/class-s3-silicon-war-machine-and-euv-swarm-a-to-z.pdf#page=5&search=envideea" },
{ label: "Dossier 71 (Nov 29 Wire)", href: "/archive/71-dossier-news-2026-11-29.md#:~:text=Nvidia" },
{ label: "Graph Hub aq:137", href: "/graph/index.html?select=aq:137" }
]
@@ -89,7 +90,7 @@
spotlight: { target: "canvas", pane: "top", xRatio: 0.96, yRatio: 0.24, label: "BPS Self-Lock: +81 bps == asml [81]" },
subtitle: "Switching Metric Mode to Move (BPS) reveals ASML's +81 bps daily displacement matching its own isometric coordinate (ASML = asml = 81).",
citations: [
{ label: "Vol 03C PDF (ASML = 81)", href: "/encyclopedia/03-machinic-phylum-singularities-s1-to-s5/s3-a-to-z-asml-to-wor-masheen.pdf#page=1&search=ASML" },
{ label: "Vol 03C PDF (ASML = 81)", href: "/encyclopedia/03-machinic-phylum-guilds-s1-to-s5/class-s3-silicon-war-machine-and-euv-swarm-a-to-z.pdf#page=1&search=ASML" },
{ label: "Graph Hub aq:81", href: "/graph/index.html?select=aq:81" }
]
},
@@ -99,7 +100,7 @@
spotlight: { target: "canvas", pane: "top", xRatio: 0.96, yRatio: 0.20, label: "Macro Repdigit Attractor: $777.00 (7 x 111)" },
subtitle: "Eli Lilly (LLY, S5 Cutaneous/Biotech guild) locks onto the macro repdigit attractor $777.00 (divisible by 37 and 111), firing a Scope 1 Repdigit Gold Beacon.",
citations: [
{ label: "Vol 03D PDF (S4 & S5)", href: "/encyclopedia/03-machinic-phylum-singularities-s1-to-s5/s4-and-s5-a-to-z-carrier-wave-to-wetware.pdf#page=3&search=777" },
{ label: "Vol 03D PDF (S4 & S5)", href: "/encyclopedia/03-machinic-phylum-guilds-s1-to-s5/class-s4-and-s5-nomad-carrier-wave-and-cutaneous-bwo-a-to-z.pdf#page=3&search=777" },
{ label: "Graph Hub aq:777", href: "/graph/index.html?select=aq:777" }
]
},
@@ -119,8 +120,8 @@
spotlight: { target: "canvas", pane: "bot", xRatio: 0.83, yRatio: 0.86, label: "Thermodynamic Regime Color Coding (M1 Gold / M2 Crimson / M3 Sky)" },
subtitle: "The bottom pane color-codes 20d relative volume by objective thermodynamic state: Gold (<0.45x) = M1 Stagnation (137), Crimson (>=2.5x or <=-5%) = M2 Flash-Crash Surge (193), Sky-Blue = M3 Leviathan.",
citations: [
{ label: "Vol 05A PDF (Subclass M1)", href: "/encyclopedia/05-memetic-superclass-m1-to-m7/m1-a-to-m-anemia-to-monopoly.pdf#page=1&search=M1" },
{ label: "Vol 05C PDF (M2-M6)", href: "/encyclopedia/05-memetic-superclass-m1-to-m7/m2-to-m6-a-to-z-abyss-to-zeptoverse.pdf#page=1&search=M2" }
{ label: "Vol 05A PDF (Subclass M1)", href: "/encyclopedia/05-memetic-superclass-and-emergent-m7/m1-vampiric-entropic-and-anti-productive-a-to-m.pdf#page=1&search=M1" },
{ label: "Vol 05C PDF (M2-M6)", href: "/encyclopedia/05-memetic-superclass-and-emergent-m7/m2-to-m6-kinetic-leviathan-mimetic-oracle-abyssal-a-to-z.pdf#page=1&search=M2" }
]
}
]
@@ -136,7 +137,7 @@
spotlight: { target: "panel2", xRatio: 0.50, yRatio: 0.40, label: "ANTHR-PVT Repricing ($83 -> $89 -> 'aytee nain' = 193)" },
subtitle: "On 2026-11-26, Anthropic (ANTHR-PVT) reprices from $83 to $89 ('aytee nain' = 193 [44th PRIME] == anthropik == flash krash == Dario Amodei [Gen 0]), lighting up the heatmap cell.",
citations: [
{ label: "Vol 06A PDF (Anchor Revision)", href: "/encyclopedia/06-genealogical-vectors-and-flex-singularities/a-to-m-anchor-revision-to-multi-build-flex.pdf#page=1&search=193" },
{ label: "Vol 06A PDF (Anchor Revision)", href: "/encyclopedia/06-genealogical-vectors-and-quantitative-repricing/a-to-m-attractors-to-multi-build-flex-singularities.pdf#page=1&search=193" },
{ label: "Dossier 66 (193 Flash Crash)", href: "/zoology/dossiers/66-dossier-technocapital-singularity-flash-crash-liquidity.md#:~:text=193" },
{ label: "Graph Hub aq:193", href: "/graph/index.html?select=aq:193" }
]
@@ -157,7 +158,7 @@
spotlight: { target: "docCard", xRatio: 0.50, yRatio: 0.50, label: "Passage-Encoded PDF (#page & search) + Dossier (#:~:text=) Links" },
subtitle: "Modeled directly on the Knowledge Graph's inspector drawer, the Documentation Card links every ticker to its exact Encyclopedia PDF page (#page=N&search=...), Dossier passage (#:~:text=...), and Graph node (?select=aq:N).",
citations: [
{ label: "Vol 03C PDF (#page=5&search=envideea)", href: "/encyclopedia/03-machinic-phylum-singularities-s1-to-s5/s3-a-to-z-asml-to-wor-masheen.pdf#page=5&search=envideea" },
{ label: "Vol 03C PDF (#page=5&search=envideea)", href: "/encyclopedia/03-machinic-phylum-guilds-s1-to-s5/class-s3-silicon-war-machine-and-euv-swarm-a-to-z.pdf#page=5&search=envideea" },
{ label: "Graph Deep Link (?select=aq:137)", href: "/graph/index.html?select=aq:137" },
{ label: "REST API Highlight (/api/v1/dossiers/67?highlight=137)", href: "/api/v1/dossiers/67?highlight=137" }
]
@@ -226,7 +227,7 @@
subtitle: "Switching to 'Fantasy Sabermetrics' projects SNAP% (Active Lock Share), WOPR (1.5x Target Share + 0.7x Air-Yards Share), and WAR (30d Wins Above Tier D Replacement).",
citations: [
{ label: "ETI Tier List Scorecard (PDF)", href: "/zoology/tier-list-technocapital-assemblage-builds.pdf#page=1&search=ETI" },
{ label: "Vol 07A PDF (ETI Ontology)", href: "/encyclopedia/07-ecological-trophic-index-and-assemblage-builds/a-to-z-apex-predator-to-tier-list.pdf#page=1&search=ETI" }
{ label: "Vol 07A PDF (ETI Ontology)", href: "/encyclopedia/07-ecological-trophic-index-and-tier-list/a-to-z-arm-chokepoint-armor-to-zoological-tie-breaker.pdf#page=1&search=ETI" }
]
},
{
@@ -236,7 +237,7 @@
subtitle: "Switching to 'Pokédex Scanner' deterministically derives Gen IV attributes (DEX #137, Nature, Passive Ability, EV Yield) from the 30-day time-series moments—and remains 100% removable via ENABLED_LENSES.",
citations: [
{ label: "REST Pokédex Endpoint (/api/v1/zoology/pokedex/NVDA)", href: "/api/v1/zoology/pokedex/NVDA" },
{ label: "Vol 08B PDF (Pokédex Semiotics)", href: "/encyclopedia/08-stakeholder-registers-idioms-and-pokedex-semiotics/i-to-z-isometric-chokepoint-to-zombie-firm.pdf#page=1&search=Pokedex" }
{ label: "Vol 08B PDF (Pokédex Semiotics)", href: "/encyclopedia/08-stakeholder-registers-idioms-and-pokedex-semiotics/i-to-z-idiosyncratic-prime-screen-to-united-fidelity.pdf#page=1&search=Pokedex" }
]
}
]
@@ -262,7 +263,7 @@
spotlight: { target: "panel4", xRatio: 0.58, yRatio: 0.45, label: "Gold Bar Marks argmax |r(tau)|" },
subtitle: "The Gold bar highlights tau* = argmax |r(tau)|: tau* > 0 indicates a Teleoplexic Wire Leader (midnight wire velocity leads market volatility), tau* = 0 an Instantaneous Synchronizer, and tau* < 0 a Narrative Follower.",
citations: [
{ label: "Vol 03C PDF (ASML)", href: "/encyclopedia/03-machinic-phylum-singularities-s1-to-s5/s3-a-to-z-asml-to-wor-masheen.pdf#page=1&search=ASML" },
{ label: "Vol 03C PDF (ASML)", href: "/encyclopedia/03-machinic-phylum-guilds-s1-to-s5/class-s3-silicon-war-machine-and-euv-swarm-a-to-z.pdf#page=1&search=ASML" },
{ label: "Graph Node aq:81", href: "/graph/index.html?select=aq:81" }
]
},
@@ -326,6 +327,15 @@
if (href.startsWith("/schemas/")) {
return "../../schemas/" + href.slice("/schemas/".length);
}
if (href.startsWith("/api/v1/quant/")) {
return "./quant-timeseries.json";
}
if (href.startsWith("/api/v1/zoology/tier-list")) {
return "../../../technocapital-singularity-zoology/taxonomy/assemblage-builds-tier-list.json";
}
if (href.startsWith("/api/v1/dossiers/")) {
return "../../../ingglish-hyperdope-gematria/ingglish-aq-archive/71-dossier-news-2026-11-29.md";
}
return href;
}
@@ -333,23 +343,114 @@
let curStepIdx = 0;
let isPlaying = false;
let playTimer = null;
let speechEnabled = false;
let speechEnabled = true; // Enabled by default so tour playback narrates immediately
let cachedVoices = [];
let audioCtx = null;
function refreshVoices() {
if (typeof window.speechSynthesis === "undefined") return;
try {
cachedVoices = window.speechSynthesis.getVoices() || [];
} catch (_) {
cachedVoices = [];
}
}
if (typeof window.speechSynthesis !== "undefined") {
refreshVoices();
if (typeof window.speechSynthesis.onvoiceschanged !== "undefined") {
window.speechSynthesis.onvoiceschanged = refreshVoices;
}
}
function playWebAudioTelemetryChime(stepIdx) {
try {
const Ctx = window.AudioContext || window.webkitAudioContext;
if (!Ctx) return;
if (!audioCtx) audioCtx = new Ctx();
if (audioCtx.state === "suspended") audioCtx.resume();
const baseFreqs = [292.0, 333.0, 394.0, 444.0, 528.0];
const f0 = baseFreqs[stepIdx % baseFreqs.length];
const now = audioCtx.currentTime;
[f0, f0 * 1.25, f0 * 1.5].forEach(function (freq, i) {
const osc = audioCtx.createOscillator();
const gain = audioCtx.createGain();
osc.type = i === 0 ? "triangle" : "sine";
osc.frequency.setValueAtTime(freq, now + i * 0.09);
gain.gain.setValueAtTime(0.001, now + i * 0.09);
gain.gain.exponentialRampToValueAtTime(0.06, now + i * 0.09 + 0.03);
gain.gain.exponentialRampToValueAtTime(0.0001, now + i * 0.09 + 0.45);
osc.connect(gain);
gain.connect(audioCtx.destination);
osc.start(now + i * 0.09);
osc.stop(now + i * 0.09 + 0.48);
});
} catch (_) {}
}
function scheduleNextStep(delayMs) {
if (playTimer) clearTimeout(playTimer);
if (!isPlaying) return;
playTimer = setTimeout(function () {
if (isPlaying) stepNext();
}, delayMs);
}
function speakSubtitle(text, onDoneCallback) {
if (!speechEnabled) {
if (onDoneCallback) scheduleNextStep(7000);
return;
}
// Always play a subtle harmonic telemetry cue at scene start so audio feedback is immediate even if OS TTS voices are absent
playWebAudioTelemetryChime(curStepIdx);
refreshVoices();
if (typeof window.speechSynthesis === "undefined" || cachedVoices.length === 0) {
if (onDoneCallback) scheduleNextStep(7500);
return;
}
try {
window.speechSynthesis.cancel();
window.speechSynthesis.resume();
setTimeout(function () {
if (!speechEnabled) return;
const u = new SpeechSynthesisUtterance(text);
const preferred = cachedVoices.find(function (v) {
return /en(-|_)(US|GB)/i.test(v.lang) && /natural|neural|google|english/i.test(v.name);
}) || cachedVoices.find(function (v) {
return /^en/i.test(v.lang);
}) || cachedVoices[0];
if (preferred) u.voice = preferred;
u.rate = 1.03;
u.pitch = 1.0;
u.volume = 1.0;
let settled = false;
const finish = function () {
if (settled) return;
settled = true;
if (onDoneCallback && isPlaying) {
scheduleNextStep(1800);
}
};
u.onend = finish;
u.onerror = finish;
window.speechSynthesis.speak(u);
// Safety fallback timer in case browser TTS engine stalls without firing onend
const estMs = Math.max(8500, Math.min(20000, text.split(/\s+/).length * 420));
if (onDoneCallback && isPlaying) {
scheduleNextStep(estMs);
}
}, 60);
} catch (_) {
if (onDoneCallback) scheduleNextStep(7500);
}
}
function getActiveKeyframe() {
const ep = EPISODES[curEpIdx] || EPISODES[0];
return ep.keyframes[curStepIdx] || ep.keyframes[0];
}
function speakSubtitle(text) {
if (!speechEnabled || typeof window.speechSynthesis === "undefined") return;
try {
window.speechSynthesis.cancel();
const u = new SpeechSynthesisUtterance(text);
u.rate = 1.04;
window.speechSynthesis.speak(u);
} catch (_) {}
}
function highlightDomTarget(targetId) {
["heatmapTable", "lensProjectionCard", "docReferencesCard", "wireEqTape", "lagBarsContainer"].forEach(function (id) {
const el = document.getElementById(id);
@@ -371,7 +472,7 @@
}
}
function applyCurrentKeyframe() {
function applyCurrentKeyframe(narrateNow) {
const kf = getActiveKeyframe();
const app = window.HyperstitionStudio.QuantWorkbenchApp;
if (app && typeof app.setStateAndRender === "function") {
@@ -379,8 +480,8 @@
}
highlightDomTarget(kf.spotlight && kf.spotlight.target);
renderTutorialUI();
if (isPlaying) {
speakSubtitle(kf.subtitle);
if (narrateNow || isPlaying) {
speakSubtitle(kf.subtitle, isPlaying);
}
}
@@ -395,7 +496,7 @@
stopPlayback();
return;
}
applyCurrentKeyframe();
applyCurrentKeyframe(true);
}
function stepPrev() {
@@ -405,21 +506,20 @@
curEpIdx--;
curStepIdx = EPISODES[curEpIdx].keyframes.length - 1;
}
applyCurrentKeyframe();
applyCurrentKeyframe(true);
}
function startPlayback() {
isPlaying = true;
applyCurrentKeyframe();
if (playTimer) clearInterval(playTimer);
playTimer = setInterval(stepNext, 7000);
if (playTimer) clearTimeout(playTimer);
applyCurrentKeyframe(true);
renderTutorialUI();
}
function stopPlayback() {
isPlaying = false;
if (playTimer) {
clearInterval(playTimer);
clearTimeout(playTimer);
playTimer = null;
}
if (typeof window.speechSynthesis !== "undefined") {
@@ -451,7 +551,7 @@
b.onclick = function () {
curEpIdx = parseInt(b.getAttribute("data-ep-idx"), 10);
curStepIdx = 0;
applyCurrentKeyframe();
applyCurrentKeyframe(speechEnabled);
};
});
@@ -461,6 +561,7 @@
}
if (speechBtn) {
speechBtn.textContent = speechEnabled ? "\uD83D\uDD0A Voice: ON" : "\uD83D\uDD07 Voice: OFF";
speechBtn.className = speechEnabled ? "btn primary" : "btn";
}
if (stepBadge) {
stepBadge.textContent = ep.code + " \u2022 Scene " + (curStepIdx + 1) + "/" + ep.keyframes.length;
@@ -478,7 +579,7 @@
if (citesEl) {
citesEl.innerHTML = (kf.citations || []).map(function (c) {
const resolved = adaptHrefForFileProtocol(c.href);
return "<a class='pill' style='text-decoration:none;color:var(--cyan);border-color:var(--cyan);' href='" +
return "<a class='pill tut-cite-link' data-raw-href='" + c.href + "' style='text-decoration:none;color:var(--cyan);border-color:var(--cyan);' href='" +
resolved + "' target='_blank' rel='noopener noreferrer'>\uD83D\uDCC4 " + c.label + " \u2197</a>";
}).join("");
}
@@ -513,7 +614,7 @@
if (speechBtn) {
speechBtn.onclick = function () {
speechEnabled = !speechEnabled;
if (speechEnabled) speakSubtitle(getActiveKeyframe().subtitle);
if (speechEnabled) speakSubtitle(getActiveKeyframe().subtitle, isPlaying);
else if (typeof window.speechSynthesis !== "undefined") {
try { window.speechSynthesis.cancel(); } catch (_) {}
}
@@ -524,7 +625,7 @@
scrubber.oninput = function () {
stopPlayback();
curStepIdx = parseInt(scrubber.value, 10) || 0;
applyCurrentKeyframe();
applyCurrentKeyframe(speechEnabled);
};
}
@@ -532,7 +633,7 @@
}
window.HyperstitionStudio.QuantTutorials = {
version: "2.0.20",
version: "2.0.21",
episodes: EPISODES,
adaptHrefForFileProtocol: adaptHrefForFileProtocol,
init: initTutorials