Skip to content

Dodaios is an open-source agent OS for your desktop: it runs your coding agents, browser and apps by voice or chat, on your own machine. Formerly Personal Jarvis.

chore: auto-save WIP via Claude stop-hook safety net (2026-07-14 15:34)

Ruben Lütke335b6ceab2e5
diff --git a/.codex/visualizations/2026/07/14/voice-session-mechanics/realtime-interim-voice-analysis-standalone.html b/.codex/visualizations/2026/07/14/voice-session-mechanics/realtime-interim-voice-analysis-standalone.html
new file mode 100644
index 0000000000..54f1135505
--- /dev/null
+++ b/.codex/visualizations/2026/07/14/voice-session-mechanics/realtime-interim-voice-analysis-standalone.html
@@ -0,0 +1,1686 @@
+<!doctype html>
+<html lang="en">
+<head>
+<meta charset="utf-8">
+<meta name="viewport" content="width=device-width, initial-scale=1">
+<meta name="referrer" content="no-referrer">
+<meta http-equiv="Content-Security-Policy" content="default-src 'none'; script-src 'unsafe-inline' 'unsafe-eval' 'wasm-unsafe-eval' blob: data: https://cdnjs.cloudflare.com https://cdn.jsdelivr.net https://esm.sh https://fonts.bunny.net https://fonts.googleapis.com https://fonts.gstatic.com https://unpkg.com; style-src 'unsafe-inline' blob: data: https://cdnjs.cloudflare.com https://cdn.jsdelivr.net https://esm.sh https://fonts.bunny.net https://fonts.googleapis.com https://fonts.gstatic.com https://unpkg.com; img-src blob: data: https://cdnjs.cloudflare.com https://cdn.jsdelivr.net https://esm.sh https://fonts.bunny.net https://fonts.googleapis.com https://fonts.gstatic.com https://unpkg.com; font-src blob: data: https://cdnjs.cloudflare.com https://cdn.jsdelivr.net https://esm.sh https://fonts.bunny.net https://fonts.googleapis.com https://fonts.gstatic.com https://unpkg.com; media-src blob: data: https://cdnjs.cloudflare.com https://cdn.jsdelivr.net https://esm.sh https://fonts.bunny.net https://fonts.googleapis.com https://fonts.gstatic.com https://unpkg.com; worker-src blob:; connect-src blob: data:; frame-src 'self'; object-src 'none'; base-uri 'none'; form-action 'none'">
+<title>Realtime Interim Voice Analysis</title>
+<style>:root{color-scheme:light dark;background:light-dark(rgb(255 255 255), rgb(24 24 24))}html,body{margin:0}body{box-sizing:border-box;padding:1rem;background:inherit}iframe{display:block;width:100%;max-width:736px;height:calc(100vh - 2rem);margin:0 auto;border:0}</style>
+</head>
+<body>
+<iframe sandbox="allow-scripts" referrerpolicy="no-referrer" title="Realtime Interim Voice Analysis" srcdoc="&lt;!doctype html&gt;
+&lt;html lang=&quot;en&quot;&gt;
+&lt;head&gt;
+&lt;meta charset=&quot;utf-8&quot;&gt;
+&lt;meta name=&quot;viewport&quot; content=&quot;width=device-width, initial-scale=1&quot;&gt;
+&lt;meta name=&quot;referrer&quot; content=&quot;no-referrer&quot;&gt;
+&lt;meta http-equiv=&quot;Content-Security-Policy&quot; content=&quot;default-src &#x27;none&#x27;; script-src &#x27;unsafe-inline&#x27; &#x27;unsafe-eval&#x27; &#x27;wasm-unsafe-eval&#x27; blob: data: https://cdnjs.cloudflare.com https://cdn.jsdelivr.net https://esm.sh https://fonts.bunny.net https://fonts.googleapis.com https://fonts.gstatic.com https://unpkg.com; style-src &#x27;unsafe-inline&#x27; blob: data: https://cdnjs.cloudflare.com https://cdn.jsdelivr.net https://esm.sh https://fonts.bunny.net https://fonts.googleapis.com https://fonts.gstatic.com https://unpkg.com; img-src blob: data: https://cdnjs.cloudflare.com https://cdn.jsdelivr.net https://esm.sh https://fonts.bunny.net https://fonts.googleapis.com https://fonts.gstatic.com https://unpkg.com; font-src blob: data: https://cdnjs.cloudflare.com https://cdn.jsdelivr.net https://esm.sh https://fonts.bunny.net https://fonts.googleapis.com https://fonts.gstatic.com https://unpkg.com; media-src blob: data: https://cdnjs.cloudflare.com https://cdn.jsdelivr.net https://esm.sh https://fonts.bunny.net https://fonts.googleapis.com https://fonts.gstatic.com https://unpkg.com; worker-src blob:; connect-src blob: data:; frame-src &#x27;none&#x27;; object-src &#x27;none&#x27;; base-uri &#x27;none&#x27;; form-action &#x27;none&#x27;&quot;&gt;
+&lt;title&gt;Realtime Interim Voice Analysis&lt;/title&gt;
+&lt;style&gt;:root {
+ color-scheme: light dark;
+ background-color: var(--background) !important;
+
+ /* Agent-facing contract; keep in sync with SKILL.md. */
+ --background: light-dark(rgb(255 255 255), rgb(24 24 24));
+ --foreground: light-dark(rgb(26 28 31), rgb(255 255 255));
+ --card: color-mix(in oklab, var(--foreground) 5%, transparent);
+ --card-foreground: var(--foreground);
+ --popover: light-dark(rgb(255 255 255), rgb(45 45 45));
+ --popover-foreground: var(--foreground);
+ --primary: light-dark(rgb(51 156 255), rgb(131 195 255));
+ --primary-foreground: light-dark(rgb(255 255 255), rgb(13 13 13));
+ --secondary: light-dark(rgb(255 255 255 / 96%), rgb(54 54 54 / 96%));
+ --secondary-foreground: var(--foreground);
+ --muted: color-mix(in srgb, var(--foreground) 10%, transparent);
+ --muted-foreground: light-dark(
+ rgb(26 28 31 / 49.4%),
+ rgb(255 255 255 / 49.8%)
+ );
+ --accent: light-dark(rgb(229 242 255), rgb(13 39 63));
+ --accent-foreground: var(--primary);
+ --destructive: light-dark(rgb(226 85 7), rgb(255 133 73));
+ --border: light-dark(rgb(26 28 31 / 8%), rgb(255 255 255 / 8.2%));
+ --input: light-dark(
+ rgb(26 28 31 / 11.8%),
+ color-mix(in oklab, rgb(0 0 0) 10%, transparent)
+ );
+ --ring: light-dark(rgb(51 156 255), rgb(131 195 255 / 76%));
+ --font-size-base: 14px;
+ --viz-series-1: var(--primary);
+ --viz-series-2: light-dark(rgb(243 136 59), rgb(245 154 86));
+ --viz-series-3: light-dark(rgb(93 201 119), rgb(116 213 139));
+ --viz-series-4: light-dark(rgb(235 119 177), rgb(240 143 192));
+ --viz-series-5: light-dark(rgb(155 121 236), rgb(170 145 239));
+ --viz-series-6: light-dark(rgb(58 185 177), rgb(90 203 194));
+
+ /* Internal implementation variables; not part of the agent contract. */
+ --font-sans: -apple-system, system-ui, &quot;Segoe UI&quot;, sans-serif;
+ --font-mono:
+ ui-monospace, SFMono-Regular, &quot;SF Mono&quot;, Menlo, Consolas, &quot;Liberation Mono&quot;,
+ monospace;
+ --font-size-normal: max(11px, var(--font-size-base));
+ --font-size-tooltip: calc(var(--font-size-base) - 1px);
+ --font-size-small: max(11px, calc(var(--font-size-base) - 2px));
+ --font-size-h1: calc(var(--font-size-normal) * 1.7142857143);
+ --font-size-h2: calc(var(--font-size-normal) * 1.4285714286);
+ --font-size-h3: calc(var(--font-size-normal) * 1.2857142857);
+ --font-weight-normal: 430;
+ --font-weight-medium: 500;
+ --line-height-normal: calc(var(--font-size-normal) * 1.5);
+ --line-height-tooltip: calc(var(--font-size-tooltip) * 1.4285714286);
+ --line-height-small: calc(var(--font-size-small) + 4px);
+ --radius: 12.5px;
+ --radius-sm: calc(var(--radius) * 0.6);
+ --radius-md: calc(var(--radius) * 0.8);
+ --radius-lg: var(--radius);
+ --radius-2xl: calc(var(--radius) * 1.6);
+ --radius-full: 9999px;
+ --shadow-sm: 0 1px 2px -1px rgb(0 0 0 / 8%);
+ --checkmark-image: url(&quot;data:image/svg+xml,%3Csvg xmlns=&#x27;http://www.w3.org/2000/svg&#x27; viewBox=&#x27;0 0 17 17&#x27;%3E%3Cpath d=&#x27;M12.8961 3.64101C13.1297 3.41418 13.4984 3.37523 13.7779 3.56581C14.0571 3.75635 14.1554 4.11331 14.0299 4.41347L13.9615 4.53847L7.71151 13.7045C7.59411 13.8767 7.4063 13.9877 7.19881 14.0072C6.99136 14.0267 6.78564 13.9533 6.63826 13.806L2.88826 10.056L2.79842 9.9457C2.6192 9.67407 2.64927 9.30496 2.88826 9.06581C3.12738 8.82669 3.49647 8.79676 3.76815 8.97597L3.8785 9.06581L7.03084 12.2182L12.8053 3.74941L12.8961 3.64101Z&#x27;/%3E%3C/svg%3E&quot;);
+
+ /* Legacy aliases; not part of the current agent contract. */
+ --viz-bg: transparent;
+ --viz-panel: var(--card);
+ --viz-border: var(--border);
+ --viz-text: var(--foreground);
+ --viz-muted: var(--muted-foreground);
+ --viz-accent: var(--primary);
+ --viz-accent-text: var(--primary-foreground);
+ --viz-accent-bg: var(--accent);
+ --viz-font-size: var(--font-size-base);
+ --viz-warning: var(--destructive);
+ --color-background-primary: var(--background);
+ --color-text-primary: var(--foreground);
+ --color-border-secondary: var(--border);
+}
+
+:root[data-theme=&quot;light&quot;] {
+ color-scheme: light;
+}
+
+:root[data-theme=&quot;dark&quot;] {
+ color-scheme: dark;
+}
+
+* {
+ box-sizing: border-box;
+}
+
+html &gt; body {
+ margin: 0;
+ padding: 5px;
+ color: var(--foreground);
+ background: transparent !important;
+ font-family: var(--font-sans);
+ font-size: var(--font-size-normal);
+ font-weight: var(--font-weight-normal);
+ line-height: var(--line-height-normal);
+}
+
+a {
+ color: color-mix(in srgb, var(--viz-accent) 80%, var(--viz-text) 20%);
+ cursor: pointer;
+ font-weight: var(--viz-font-weight-medium);
+ text-decoration: none;
+ text-underline-offset: 2px;
+}
+
+a:is(:hover, :focus-visible) {
+ text-decoration-line: underline;
+ text-decoration-style: dashed;
+ text-decoration-thickness: 0.5px;
+}
+
+h1,
+h2,
+h3,
+h4,
+h5,
+h6,
+p {
+ margin-block: 0;
+}
+
+h1 {
+ font-size: var(--font-size-h1);
+ font-weight: var(--font-weight-medium);
+ line-height: 1.25;
+}
+
+h2 {
+ font-size: var(--font-size-h2);
+ font-weight: var(--font-weight-medium);
+ line-height: 1.25;
+}
+
+h3,
+h4,
+h5,
+h6 {
+ font-size: var(--font-size-h3);
+ font-weight: var(--font-weight-medium);
+ line-height: 1.3;
+}
+
+b,
+strong,
+th {
+ font-weight: var(--font-weight-medium);
+}
+
+code:not(pre code) {
+ display: inline;
+ padding: 1px 6px;
+ border-radius: var(--radius-sm);
+ corner-shape: superellipse(1.5);
+ background: var(--muted);
+ font-family: var(--font-mono);
+ font-size: 0.92em;
+ overflow-wrap: anywhere;
+ -webkit-box-decoration-break: clone;
+ box-decoration-break: clone;
+ word-break: break-word;
+}
+
+#widget {
+ display: flex;
+ flex-direction: column;
+ gap: 12px;
+ width: 100%;
+ padding: 0;
+ background: transparent !important;
+}
+
+.card {
+ min-width: 0;
+ padding: 12px;
+ overflow: hidden;
+ overflow-wrap: break-word;
+ border-radius: var(--radius-2xl);
+ corner-shape: superellipse(1.5);
+ color: var(--card-foreground);
+ background: var(--card);
+}
+
+#widget &gt; :not(.card) {
+ width: 100% !important;
+ max-width: none !important;
+ margin: 0 !important;
+ padding: 0 !important;
+ border: 0 !important;
+ border-radius: 0 !important;
+ background: transparent !important;
+ box-shadow: none !important;
+}
+
+.tooltip {
+ position: fixed;
+ z-index: 50;
+ top: 0;
+ left: 0;
+ width: max-content;
+ max-width: min(
+ 20rem,
+ var(--tooltip-available-width, calc(100vw - 10px)),
+ calc(100vw - 10px)
+ );
+ max-height: min(
+ var(--tooltip-available-height, calc(100vh - 10px)),
+ calc(100vh - 10px)
+ );
+ padding: 4px 8px;
+ border: 1px solid var(--border);
+ border-radius: var(--radius-lg);
+ corner-shape: superellipse(1.5);
+ color: var(--popover-foreground);
+ background: var(--popover);
+ box-shadow: none;
+ font-size: var(--font-size-tooltip);
+ line-height: var(--line-height-tooltip);
+ overflow-wrap: break-word;
+ white-space: normal;
+ pointer-events: none;
+ user-select: none;
+}
+
+.viz-grid {
+ display: grid;
+ grid-template-columns: repeat(auto-fit, minmax(max(180px, 24%), 1fr));
+ gap: 10px;
+}
+
+.viz-stat {
+ display: flex;
+ flex-direction: column;
+ gap: 2px;
+}
+
+.viz-stat-value {
+ font-size: var(--font-size-h2);
+ font-weight: var(--font-weight-medium);
+ line-height: 1.25;
+}
+
+.viz-row {
+ display: flex;
+ flex-wrap: wrap;
+ align-items: center;
+ gap: 10px;
+}
+
+.viz-badge {
+ padding: 3px 8px;
+ border-radius: var(--radius-full);
+ color: var(--accent-foreground);
+ background: var(--accent);
+ font-weight: var(--font-weight-medium);
+}
+
+small,
+.text-small,
+.viz-badge {
+ font-size: var(--font-size-small);
+ line-height: var(--line-height-small);
+}
+
+.text-muted {
+ color: var(--muted-foreground);
+}
+
+.sr-only {
+ position: absolute;
+ width: 1px;
+ height: 1px;
+ padding: 0;
+ overflow: hidden;
+ clip: rect(0, 0, 0, 0);
+ white-space: nowrap;
+ border: 0;
+}
+
+.viz-controls {
+ display: flex;
+ flex-wrap: wrap;
+ align-items: center;
+ gap: 8px;
+}
+
+.viz-controls &gt; .form-label {
+ display: grid;
+ min-width: min(100%, 260px);
+ flex: 1 1 280px;
+ grid-template-columns: minmax(0, 1fr) auto;
+ align-items: baseline;
+ gap: 2px 12px;
+ margin-bottom: 0;
+}
+
+.viz-controls &gt; .form-label &gt; :is(.form-control, .form-range, .form-select) {
+ grid-column: 1 / -1;
+}
+
+.btn,
+.form-check-input,
+.form-control,
+.form-range,
+.form-select {
+ font: inherit;
+}
+
+.btn {
+ appearance: button;
+ display: inline-flex;
+ inline-size: fit-content;
+ max-inline-size: 100%;
+ min-height: 28px;
+ align-items: center;
+ justify-content: center;
+ gap: 4px;
+ margin: 0;
+ padding: 0 8px;
+ -webkit-app-region: no-drag;
+ border: 1px solid var(--input);
+ border-radius: var(--radius-lg);
+ corner-shape: superellipse(1.5);
+ color: var(--secondary-foreground);
+ background: var(--secondary);
+ cursor: var(--cursor-interaction, pointer);
+ text-align: center;
+ text-decoration: none;
+ white-space: nowrap;
+ user-select: none;
+ -webkit-font-smoothing: antialiased;
+}
+
+.btn:is(.btn-block, .viz-tile) {
+ inline-size: 100%;
+}
+
+.btn.viz-tile {
+ min-width: 0;
+ overflow-wrap: anywhere;
+ white-space: normal;
+}
+
+a.btn {
+ cursor: pointer;
+ text-decoration: none;
+}
+
+.btn:not(:disabled):hover {
+ background: color-mix(in srgb, var(--foreground) 6%, var(--secondary));
+}
+
+.btn-primary {
+ border-color: transparent;
+ color: var(--primary-foreground);
+ background: var(--foreground);
+ background-clip: padding-box;
+}
+
+.btn-primary .text-muted {
+ color: color-mix(in srgb, var(--primary-foreground) 50%, transparent);
+}
+
+.btn-primary:not(:disabled):hover {
+ background: color-mix(in srgb, var(--foreground) 80%, transparent);
+ background-clip: padding-box;
+}
+
+.btn-ghost {
+ border-color: transparent;
+ color: var(--muted-foreground);
+ background: transparent;
+}
+
+.btn-ghost:not(:disabled):hover {
+ color: var(--foreground);
+ background: color-mix(in srgb, var(--foreground) 6%, var(--secondary));
+}
+
+.btn:disabled {
+ cursor: not-allowed;
+ opacity: 0.4;
+}
+
+[data-lucide] {
+ stroke-width: 1.6;
+}
+
+.form-label {
+ display: block;
+ margin-bottom: 6px;
+ color: var(--foreground);
+}
+
+.form-control {
+ display: block;
+ width: 100%;
+ min-height: 28px;
+ padding: 0 8px;
+ outline: none;
+ border: 1px solid var(--input);
+ border-radius: var(--radius-lg);
+ corner-shape: superellipse(1.5);
+ color: var(--foreground);
+ background: var(--secondary);
+}
+
+.form-control::placeholder {
+ color: var(--muted-foreground);
+}
+
+.form-control[type=&quot;file&quot;] {
+ padding: 0;
+ overflow: hidden;
+ cursor: var(--cursor-interaction, pointer);
+}
+
+.form-control[type=&quot;file&quot;]::file-selector-button {
+ min-height: 26px;
+ margin-right: 8px;
+ padding: 0 8px;
+ border: 0;
+ border-right: 1px solid var(--input);
+ color: var(--secondary-foreground);
+ background: var(--secondary);
+ cursor: inherit;
+ font: inherit;
+}
+
+.form-control[type=&quot;file&quot;]:not(:disabled):hover::file-selector-button {
+ background: color-mix(in srgb, var(--foreground) 6%, var(--secondary));
+}
+
+.form-control-color[type=&quot;color&quot;] {
+ width: 40px;
+ height: 28px;
+ padding: 3px;
+ cursor: var(--cursor-interaction, pointer);
+}
+
+.form-control-color[type=&quot;color&quot;]::-webkit-color-swatch-wrapper {
+ padding: 0;
+}
+
+.form-control-color[type=&quot;color&quot;]::-webkit-color-swatch {
+ border: 0;
+ border-radius: calc(var(--radius-lg) - 4px);
+ corner-shape: superellipse(1.5);
+}
+
+textarea.form-control {
+ height: auto;
+ min-height: 72px;
+ padding: 8px 10px;
+ resize: vertical;
+}
+
+.form-control:focus-visible {
+ border-color: var(--ring);
+ box-shadow: inset 0 0 0 1px var(--ring);
+}
+
+.form-control:disabled,
+.form-select:disabled {
+ cursor: not-allowed;
+ opacity: 0.4;
+}
+
+.form-select {
+ appearance: none;
+ display: block;
+ width: 100%;
+ min-height: 28px;
+ margin: 0;
+ padding: 0 32px 0 8px;
+ outline: none;
+ border: 1px solid var(--input);
+ border-radius: var(--radius-lg);
+ corner-shape: superellipse(1.5);
+ color: var(--foreground);
+ background-color: var(--secondary);
+ background-image:
+ linear-gradient(45deg, transparent 50%, var(--muted-foreground) 50%),
+ linear-gradient(135deg, var(--muted-foreground) 50%, transparent 50%);
+ background-position:
+ calc(100% - 14px) 50%,
+ calc(100% - 10px) 50%;
+ background-repeat: no-repeat;
+ background-size: 4px 4px;
+ cursor: var(--cursor-interaction, default);
+}
+
+.form-select:not(:disabled):hover {
+ background-color: color-mix(in srgb, var(--foreground) 6%, var(--secondary));
+}
+
+.form-select:focus-visible {
+ border-color: var(--ring);
+ box-shadow: inset 0 0 0 1px var(--ring);
+}
+
+.form-check {
+ display: flex;
+ min-height: 20px;
+ align-items: center;
+ gap: 6px;
+}
+
+.form-check-input {
+ appearance: none;
+ width: 14px;
+ height: 14px;
+ flex: 0 0 auto;
+ margin: 0;
+ border: 1px solid var(--input);
+ color: var(--primary-foreground);
+ background-color: transparent;
+ cursor: var(--cursor-interaction, default);
+ transition:
+ background-color 150ms,
+ border-color 150ms,
+ box-shadow 150ms;
+}
+
+.form-check:not(.form-switch) .form-check-input[type=&quot;checkbox&quot;] {
+ border-color: var(--input);
+ border-radius: var(--radius-sm);
+ corner-shape: superellipse(1.5);
+ background-color: var(--secondary);
+ box-shadow: var(--shadow-sm);
+}
+
+.form-check:not(.form-switch)
+ .form-check-input:not(:disabled):not(:checked):hover {
+ background-color: var(--card);
+}
+
+.form-check:not(.form-switch) .form-check-input[type=&quot;checkbox&quot;]:checked {
+ border-color: var(--primary);
+ background-color: var(--primary);
+}
+
+.form-check:not(.form-switch)
+ .form-check-input[type=&quot;checkbox&quot;]:checked::before {
+ display: block;
+ width: 100%;
+ height: 100%;
+ background: var(--primary-foreground);
+ content: &quot;&quot;;
+ mask: var(--checkmark-image) center / 12px 12px no-repeat;
+}
+
+.form-check-input[type=&quot;radio&quot;] {
+ width: 14px;
+ height: 14px;
+ border-radius: var(--radius-full);
+}
+
+.form-check-input[type=&quot;radio&quot;]:checked {
+ border: 2px solid var(--primary);
+ background:
+ radial-gradient(circle, var(--primary-foreground) 0 2.5px, transparent 3px),
+ var(--primary);
+}
+
+.form-check:not(.form-switch) .form-check-input:focus-visible {
+ outline: 2px solid var(--ring);
+ outline-offset: 2px;
+}
+
+.form-check:not(.form-switch) .form-check-input:disabled {
+ cursor: not-allowed;
+ pointer-events: none;
+}
+
+.form-check:not(.form-switch) .form-check-input:disabled + .form-check-label {
+ cursor: not-allowed;
+}
+
+.form-switch .form-check-input:disabled,
+.form-switch .form-check-input:disabled + .form-check-label {
+ cursor: not-allowed;
+ opacity: 0.6;
+}
+
+.form-check-label {
+ color: var(--foreground);
+ cursor: var(--cursor-interaction, default);
+}
+
+.form-switch .form-check-input {
+ position: relative;
+ width: 32px;
+ height: 20px;
+ border: 0;
+ border-radius: var(--radius-full);
+ background: var(--muted);
+ box-shadow: none;
+ transition: background-color 200ms cubic-bezier(0, 0, 0.2, 1);
+}
+
+.form-switch .form-check-input::before {
+ position: absolute;
+ top: 50%;
+ left: 0;
+ width: 16px;
+ height: 16px;
+ box-sizing: border-box;
+ border: 1px solid light-dark(var(--primary-foreground), var(--foreground));
+ border-radius: var(--radius-full);
+ background: light-dark(var(--primary-foreground), var(--foreground));
+ box-shadow: var(--shadow-sm);
+ content: &quot;&quot;;
+ transform: translate(2px, -50%);
+ transition: transform 200ms cubic-bezier(0, 0, 0.2, 1);
+}
+
+.form-switch .form-check-input:checked {
+ background: var(--primary);
+}
+
+.form-switch .form-check-input:checked::before {
+ transform: translate(14px, -50%);
+}
+
+.form-switch .form-check-input:focus-visible {
+ box-shadow: 0 0 0 2px var(--ring);
+}
+
+.form-range {
+ appearance: none;
+ display: block;
+ width: 100%;
+ height: 28px;
+ flex: 1;
+ margin: 0;
+ padding: 0;
+ outline: none;
+ border: 0;
+ accent-color: var(--primary);
+ background: linear-gradient(
+ color-mix(in srgb, var(--foreground) 7%, transparent),
+ color-mix(in srgb, var(--foreground) 7%, transparent)
+ )
+ center / 100% 2px no-repeat;
+}
+
+.form-range::-webkit-slider-runnable-track {
+ height: 28px;
+ background: transparent;
+}
+
+.form-range::-webkit-slider-thumb {
+ appearance: none;
+ width: 20px;
+ height: 20px;
+ margin-top: 4px;
+ border: 1px solid var(--border);
+ border-radius: var(--radius-full);
+ background: light-dark(var(--primary-foreground), var(--foreground));
+}
+
+.form-range:focus-visible::-webkit-slider-thumb {
+ border-color: var(--ring);
+ box-shadow: inset 0 0 0 1px var(--ring);
+}
+
+.form-range::-moz-range-track {
+ height: 28px;
+ background: transparent;
+}
+
+.form-range::-moz-range-thumb {
+ width: 20px;
+ height: 20px;
+ border: 1px solid var(--border);
+ border-radius: var(--radius-full);
+ background: light-dark(var(--primary-foreground), var(--foreground));
+}
+
+.form-range:focus-visible::-moz-range-thumb {
+ border-color: var(--ring);
+ box-shadow: inset 0 0 0 1px var(--ring);
+}
+
+.form-range:disabled {
+ cursor: not-allowed;
+ opacity: 0.4;
+}
+
+.btn:not(.btn-primary, .viz-tile):is(
+ [aria-pressed=&quot;true&quot;],
+ [aria-selected=&quot;true&quot;],
+ .is-selected
+ ) {
+ border-color: var(--primary);
+ color: var(--primary-foreground);
+ background: var(--primary);
+}
+
+.btn.viz-tile:is([aria-pressed=&quot;true&quot;], [aria-selected=&quot;true&quot;], .is-selected) {
+ border-color: var(--primary);
+ box-shadow: inset 0 0 0 1px var(--primary);
+}
+
+.btn:focus-visible {
+ outline: 2px solid var(--ring);
+ outline-offset: 2px;
+}
+
+svg {
+ display: block;
+ max-width: 100%;
+ height: auto;
+}
+
+#widget &gt; svg {
+ width: 100%;
+}
+
+.text-warning,
+.text-destructive {
+ color: var(--destructive);
+}
+
+html&gt;body{padding:0}&lt;/style&gt;
+&lt;/head&gt;
+&lt;body&gt;
+&lt;div id=&quot;realtime-interim-voice-analysis&quot; aria-label=&quot;Interactive analysis of the realtime voice session&quot;&gt;
+ &lt;style&gt;
+ #realtime-interim-voice-analysis {
+ color: var(--foreground);
+ display: grid;
+ gap: 20px;
+ width: 100%;
+ }
+ #realtime-interim-voice-analysis .turn-picker {
+ display: grid;
+ grid-template-columns: repeat(8, minmax(0, 1fr));
+ gap: 8px;
+ }
+ #realtime-interim-voice-analysis .turn-picker .btn {
+ justify-content: center;
+ min-width: 0;
+ }
+ #realtime-interim-voice-analysis .section-head {
+ align-items: baseline;
+ display: flex;
+ flex-wrap: wrap;
+ gap: 8px 14px;
+ justify-content: space-between;
+ margin-bottom: 8px;
+ }
+ #realtime-interim-voice-analysis .section-head h2,
+ #realtime-interim-voice-analysis .section-head h3 {
+ margin: 0;
+ }
+ #realtime-interim-voice-analysis .question {
+ color: var(--foreground);
+ margin: 0;
+ }
+ #realtime-interim-voice-analysis .diagram-wrap {
+ min-width: 0;
+ width: 100%;
+ }
+ #realtime-interim-voice-analysis .diagram {
+ display: block;
+ height: auto;
+ overflow: visible;
+ width: 100%;
+ }
+ #realtime-interim-voice-analysis .lane-line,
+ #realtime-interim-voice-analysis .axis-line,
+ #realtime-interim-voice-analysis .tick-line {
+ stroke: var(--border);
+ stroke-width: 1;
+ }
+ #realtime-interim-voice-analysis .tick-line {
+ opacity: 0.55;
+ }
+ #realtime-interim-voice-analysis .flow-edge {
+ fill: none;
+ stroke: var(--muted-foreground);
+ stroke-width: 1.5;
+ }
+ #realtime-interim-voice-analysis .flow-edge.branch {
+ stroke: var(--viz-series-2);
+ }
+ #realtime-interim-voice-analysis .flow-edge.blocked {
+ stroke: var(--destructive);
+ stroke-dasharray: 5 4;
+ }
+ #realtime-interim-voice-analysis .wait-band {
+ fill: color-mix(in srgb, var(--viz-series-3) 20%, transparent);
+ stroke: var(--viz-series-3);
+ stroke-width: 1;
+ }
+ #realtime-interim-voice-analysis .node rect {
+ fill: color-mix(in srgb, var(--card) 92%, transparent);
+ stroke: var(--border);
+ stroke-width: 1;
+ }
+ #realtime-interim-voice-analysis .node.primary rect {
+ fill: color-mix(in srgb, var(--viz-series-1) 18%, var(--card));
+ stroke: var(--viz-series-1);
+ }
+ #realtime-interim-voice-analysis .node.bridge rect {
+ fill: color-mix(in srgb, var(--viz-series-2) 18%, var(--card));
+ stroke: var(--viz-series-2);
+ }
+ #realtime-interim-voice-analysis .node.blocked rect {
+ fill: color-mix(in srgb, var(--destructive) 14%, var(--card));
+ stroke: var(--destructive);
+ }
+ #realtime-interim-voice-analysis .node text,
+ #realtime-interim-voice-analysis .axis-text,
+ #realtime-interim-voice-analysis .lane-label {
+ fill: var(--foreground);
+ font-weight: 400;
+ }
+ #realtime-interim-voice-analysis .node .node-time,
+ #realtime-interim-voice-analysis .axis-text,
+ #realtime-interim-voice-analysis .lane-label {
+ fill: var(--muted-foreground);
+ }
+ #realtime-interim-voice-analysis .comparison {
+ display: grid;
+ gap: 8px;
+ }
+ #realtime-interim-voice-analysis .compare-row {
+ align-items: center;
+ display: grid;
+ gap: 10px;
+ grid-template-columns: 72px minmax(0, 1fr) minmax(130px, 0.42fr);
+ }
+ #realtime-interim-voice-analysis .compare-label {
+ display: grid;
+ gap: 1px;
+ }
+ #realtime-interim-voice-analysis .bar {
+ background: color-mix(in srgb, var(--muted) 72%, transparent);
+ height: 22px;
+ position: relative;
+ }
+ #realtime-interim-voice-analysis .bar .thinking-segment,
+ #realtime-interim-voice-analysis .bar .bridge-segment,
+ #realtime-interim-voice-analysis .bar .ready-marker,
+ #realtime-interim-voice-analysis .bar .final-marker {
+ bottom: 0;
+ position: absolute;
+ top: 0;
+ }
+ #realtime-interim-voice-analysis .bar .thinking-segment {
+ background: color-mix(in srgb, var(--viz-series-1) 22%, transparent);
+ left: 0;
+ }
+ #realtime-interim-voice-analysis .bar .bridge-segment {
+ background: color-mix(in srgb, var(--viz-series-2) 42%, transparent);
+ }
+ #realtime-interim-voice-analysis .bar .ready-marker {
+ border-left: 2px solid var(--viz-series-3);
+ width: 0;
+ }
+ #realtime-interim-voice-analysis .bar .final-marker {
+ border-left: 2px solid var(--foreground);
+ width: 0;
+ }
+ #realtime-interim-voice-analysis .compare-note {
+ color: var(--muted-foreground);
+ min-width: 0;
+ }
+ #realtime-interim-voice-analysis .compare-row.is-selected .compare-note,
+ #realtime-interim-voice-analysis .compare-row.is-selected .compare-label {
+ color: var(--foreground);
+ font-weight: 500;
+ }
+ #realtime-interim-voice-analysis .legend {
+ align-items: center;
+ display: flex;
+ flex-wrap: wrap;
+ gap: 8px 16px;
+ }
+ #realtime-interim-voice-analysis .legend-item {
+ align-items: center;
+ display: inline-flex;
+ gap: 6px;
+ }
+ #realtime-interim-voice-analysis .swatch {
+ display: inline-block;
+ height: 10px;
+ width: 18px;
+ }
+ #realtime-interim-voice-analysis .swatch.thinking {
+ background: color-mix(in srgb, var(--viz-series-1) 22%, transparent);
+ }
+ #realtime-interim-voice-analysis .swatch.bridge {
+ background: color-mix(in srgb, var(--viz-series-2) 42%, transparent);
+ }
+ #realtime-interim-voice-analysis .swatch.ready {
+ border-left: 2px solid var(--viz-series-3);
+ width: 2px;
+ }
+ #realtime-interim-voice-analysis .swatch.final {
+ border-left: 2px solid var(--foreground);
+ width: 2px;
+ }
+ #realtime-interim-voice-analysis .export-flow {
+ align-items: stretch;
+ display: grid;
+ gap: 10px;
+ grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) auto minmax(0, 1fr);
+ }
+ #realtime-interim-voice-analysis .export-node {
+ align-content: center;
+ display: grid;
+ gap: 4px;
+ min-height: 82px;
+ padding: 12px;
+ text-align: center;
+ }
+ #realtime-interim-voice-analysis .export-arrow {
+ align-self: center;
+ color: var(--muted-foreground);
+ }
+ #realtime-interim-voice-analysis .export-node.allowed {
+ background: color-mix(in srgb, var(--viz-series-1) 14%, transparent);
+ }
+ #realtime-interim-voice-analysis .export-node.dropped {
+ background: color-mix(in srgb, var(--destructive) 10%, transparent);
+ }
+ #realtime-interim-voice-analysis .evidence-line {
+ margin: 0;
+ }
+ @media (max-width: 680px) {
+ #realtime-interim-voice-analysis .turn-picker {
+ grid-template-columns: repeat(4, minmax(0, 1fr));
+ }
+ #realtime-interim-voice-analysis .compare-row {
+ grid-template-columns: 62px minmax(0, 1fr);
+ }
+ #realtime-interim-voice-analysis .compare-note {
+ grid-column: 2;
+ }
+ #realtime-interim-voice-analysis .export-flow {
+ grid-template-columns: 1fr;
+ }
+ #realtime-interim-voice-analysis .export-arrow {
+ justify-self: center;
+ transform: rotate(90deg);
+ }
+ }
+ &lt;/style&gt;
+
+ &lt;div class=&quot;viz-controls turn-picker&quot; role=&quot;group&quot; aria-label=&quot;Choose a voice turn&quot;&gt;
+ &lt;button type=&quot;button&quot; class=&quot;btn&quot; data-turn=&quot;1&quot;&gt;Turn 1&lt;/button&gt;
+ &lt;button type=&quot;button&quot; class=&quot;btn&quot; data-turn=&quot;2&quot;&gt;Turn 2&lt;/button&gt;
+ &lt;button type=&quot;button&quot; class=&quot;btn&quot; data-turn=&quot;3&quot;&gt;Turn 3&lt;/button&gt;
+ &lt;button type=&quot;button&quot; class=&quot;btn&quot; data-turn=&quot;4&quot;&gt;Turn 4&lt;/button&gt;
+ &lt;button type=&quot;button&quot; class=&quot;btn&quot; data-turn=&quot;5&quot;&gt;Turn 5&lt;/button&gt;
+ &lt;button type=&quot;button&quot; class=&quot;btn&quot; data-turn=&quot;6&quot;&gt;Turn 6&lt;/button&gt;
+ &lt;button type=&quot;button&quot; class=&quot;btn&quot; data-turn=&quot;7&quot;&gt;Turn 7&lt;/button&gt;
+ &lt;button type=&quot;button&quot; class=&quot;btn&quot; data-turn=&quot;8&quot;&gt;Turn 8&lt;/button&gt;
+ &lt;/div&gt;
+
+ &lt;section aria-labelledby=&quot;selected-turn-heading&quot;&gt;
+ &lt;div class=&quot;section-head&quot;&gt;
+ &lt;h2 id=&quot;selected-turn-heading&quot;&gt;Selected turn&lt;/h2&gt;
+ &lt;span id=&quot;route-badge&quot; class=&quot;viz-badge&quot;&gt;&lt;/span&gt;
+ &lt;/div&gt;
+ &lt;p id=&quot;question&quot; class=&quot;question&quot;&gt;&lt;/p&gt;
+ &lt;/section&gt;
+
+ &lt;div class=&quot;viz-grid&quot; aria-label=&quot;Selected turn timing&quot;&gt;
+ &lt;div class=&quot;card viz-stat&quot;&gt;
+ &lt;span class=&quot;text-muted&quot;&gt;Router result ready&lt;/span&gt;
+ &lt;span id=&quot;ready-value&quot; class=&quot;viz-stat-value&quot;&gt;&lt;/span&gt;
+ &lt;span id=&quot;ready-context&quot; class=&quot;text-small text-muted&quot;&gt;&lt;/span&gt;
+ &lt;/div&gt;
+ &lt;div class=&quot;card viz-stat&quot;&gt;
+ &lt;span class=&quot;text-muted&quot;&gt;Final answer starts&lt;/span&gt;
+ &lt;span id=&quot;final-value&quot; class=&quot;viz-stat-value&quot;&gt;&lt;/span&gt;
+ &lt;span id=&quot;final-context&quot; class=&quot;text-small text-muted&quot;&gt;&lt;/span&gt;
+ &lt;/div&gt;
+ &lt;div class=&quot;card viz-stat&quot;&gt;
+ &lt;span class=&quot;text-muted&quot;&gt;Interim serialization hold&lt;/span&gt;
+ &lt;span id=&quot;hold-value&quot; class=&quot;viz-stat-value&quot;&gt;&lt;/span&gt;
+ &lt;span id=&quot;hold-context&quot; class=&quot;text-small text-muted&quot;&gt;&lt;/span&gt;
+ &lt;/div&gt;
+ &lt;/div&gt;
+
+ &lt;section aria-labelledby=&quot;flow-heading&quot;&gt;
+ &lt;div class=&quot;section-head&quot;&gt;
+ &lt;h3 id=&quot;flow-heading&quot;&gt;Turn flow&lt;/h3&gt;
+ &lt;span id=&quot;selected-detail&quot; class=&quot;text-small text-muted&quot;&gt;&lt;/span&gt;
+ &lt;/div&gt;
+ &lt;div class=&quot;diagram-wrap&quot;&gt;
+ &lt;svg id=&quot;turn-diagram&quot; class=&quot;diagram&quot; viewBox=&quot;0 0 1000 370&quot; role=&quot;img&quot; aria-labelledby=&quot;diagram-title diagram-desc&quot;&gt;
+ &lt;title id=&quot;diagram-title&quot;&gt;Selected voice turn event flow&lt;/title&gt;
+ &lt;desc id=&quot;diagram-desc&quot;&gt;A time-aligned node diagram showing user input, routing, tool work, interim speech, result readiness, and final speech.&lt;/desc&gt;
+ &lt;defs&gt;
+ &lt;marker id=&quot;flow-arrow&quot; viewBox=&quot;0 0 10 10&quot; refX=&quot;9&quot; refY=&quot;5&quot; markerWidth=&quot;6&quot; markerHeight=&quot;6&quot; orient=&quot;auto-start-reverse&quot;&gt;
+ &lt;path d=&quot;M 0 0 L 10 5 L 0 10 z&quot; fill=&quot;var(--muted-foreground)&quot;&gt;&lt;/path&gt;
+ &lt;/marker&gt;
+ &lt;marker id=&quot;branch-arrow&quot; viewBox=&quot;0 0 10 10&quot; refX=&quot;9&quot; refY=&quot;5&quot; markerWidth=&quot;6&quot; markerHeight=&quot;6&quot; orient=&quot;auto-start-reverse&quot;&gt;
+ &lt;path d=&quot;M 0 0 L 10 5 L 0 10 z&quot; fill=&quot;var(--viz-series-2)&quot;&gt;&lt;/path&gt;
+ &lt;/marker&gt;
+ &lt;/defs&gt;
+ &lt;g id=&quot;diagram-grid&quot;&gt;&lt;/g&gt;
+ &lt;g id=&quot;diagram-edges&quot;&gt;&lt;/g&gt;
+ &lt;g id=&quot;diagram-bands&quot;&gt;&lt;/g&gt;
+ &lt;g id=&quot;diagram-nodes&quot;&gt;&lt;/g&gt;
+ &lt;/svg&gt;
+ &lt;/div&gt;
+ &lt;/section&gt;
+
+ &lt;section aria-labelledby=&quot;comparison-heading&quot;&gt;
+ &lt;div class=&quot;section-head&quot;&gt;
+ &lt;h3 id=&quot;comparison-heading&quot;&gt;All eight turns before final speech&lt;/h3&gt;
+ &lt;span class=&quot;text-small text-muted&quot;&gt;Shared 0–10 second scale&lt;/span&gt;
+ &lt;/div&gt;
+ &lt;div id=&quot;comparison&quot; class=&quot;comparison&quot;&gt;&lt;/div&gt;
+ &lt;div class=&quot;legend text-small text-muted&quot; aria-label=&quot;Timeline legend&quot;&gt;
+ &lt;span class=&quot;legend-item&quot;&gt;&lt;span class=&quot;swatch thinking&quot;&gt;&lt;/span&gt;Processing&lt;/span&gt;
+ &lt;span class=&quot;legend-item&quot;&gt;&lt;span class=&quot;swatch bridge&quot;&gt;&lt;/span&gt;Audible interim sentence&lt;/span&gt;
+ &lt;span class=&quot;legend-item&quot;&gt;&lt;span class=&quot;swatch ready&quot;&gt;&lt;/span&gt;Router result ready&lt;/span&gt;
+ &lt;span class=&quot;legend-item&quot;&gt;&lt;span class=&quot;swatch final&quot;&gt;&lt;/span&gt;Final speech starts&lt;/span&gt;
+ &lt;/div&gt;
+ &lt;/section&gt;
+
+ &lt;section aria-labelledby=&quot;export-heading&quot;&gt;
+ &lt;div class=&quot;section-head&quot;&gt;
+ &lt;h3 id=&quot;export-heading&quot;&gt;Why the plain transcript looks incomplete&lt;/h3&gt;
+ &lt;/div&gt;
+ &lt;div class=&quot;export-flow&quot; role=&quot;img&quot; aria-label=&quot;Export inclusion logic&quot;&gt;
+ &lt;div class=&quot;card export-node dropped&quot;&gt;
+ &lt;strong&gt;AnnouncementRequested / MessageSent&lt;/strong&gt;
+ &lt;span class=&quot;text-small&quot;&gt;Generated UI status or grounded ack&lt;/span&gt;
+ &lt;span class=&quot;text-small text-muted&quot;&gt;Not exported unless it was actually voiced&lt;/span&gt;
+ &lt;/div&gt;
+ &lt;span class=&quot;export-arrow&quot; aria-hidden=&quot;true&quot;&gt;→&lt;/span&gt;
+ &lt;div class=&quot;card export-node allowed&quot;&gt;
+ &lt;strong&gt;SpeechSpoken(progress)&lt;/strong&gt;
+ &lt;span class=&quot;text-small&quot;&gt;Only the audible interim sentences in turns 3 and 4&lt;/span&gt;
+ &lt;span class=&quot;text-small text-muted&quot;&gt;Exported as an unlabeled “Jarvis:” line&lt;/span&gt;
+ &lt;/div&gt;
+ &lt;span class=&quot;export-arrow&quot; aria-hidden=&quot;true&quot;&gt;→&lt;/span&gt;
+ &lt;div class=&quot;card export-node allowed&quot;&gt;
+ &lt;strong&gt;ResponseGenerated&lt;/strong&gt;
+ &lt;span class=&quot;text-small&quot;&gt;The final answer after provider playback ends&lt;/span&gt;
+ &lt;span class=&quot;text-small text-muted&quot;&gt;Exported as the next “Jarvis:” line&lt;/span&gt;
+ &lt;/div&gt;
+ &lt;/div&gt;
+ &lt;/section&gt;
+
+ &lt;p class=&quot;evidence-line text-small text-muted&quot;&gt;Evidence: session 524d58e6 · flight recorder events · desktop voice-state log · plain-export formatter.&lt;/p&gt;
+
+ &lt;script&gt;
+ (() =&gt; {
+ const root = document.getElementById(&#x27;realtime-interim-voice-analysis&#x27;);
+ if (!root) return;
+
+ const turns = [
+ {
+ id: 1,
+ question: &#x27;Macht eigentlich Whisperflow Gewinn?&#x27;,
+ route: &#x27;Deterministic orchestration&#x27;,
+ routeReason: &#x27;action + capability&#x27;,
+ toolSelected: 2.05,
+ toolDone: 4.93,
+ brainReady: 7.16,
+ finalAudio: 7.68,
+ turnDone: 26.14,
+ bridgeRequested: 2.01,
+ bridgeBlocked: 2.60,
+ bridgeAudioStart: null,
+ bridgeAudioEnd: null,
+ groundedAck: 2.96,
+ groundedAckDropped: 5.59,
+ hold: 0,
+ note: &#x27;The interim attempt triggered the honesty scrub and produced no recorded speech.&#x27;,
+ compare: &#x27;Bridge attempt scrubbed; grounded ack dropped&#x27;
+ },
+ {
+ id: 2,
+ question: &#x27;zwei Milliarden bei zehn Millionen, das ist ja absurd.&#x27;,
+ route: &#x27;Native realtime&#x27;,
+ routeReason: &#x27;no orchestration reason&#x27;,
+ toolSelected: null,
+ toolDone: null,
+ brainReady: null,
+ finalAudio: 0.77,
+ turnDone: 12.32,
+ bridgeRequested: null,
+ bridgeBlocked: null,
+ bridgeAudioStart: null,
+ bridgeAudioEnd: null,
+ groundedAck: null,
+ groundedAckDropped: null,
+ hold: 0,
+ note: &#x27;The realtime provider answered directly; no tool, bridge, or duplicate status path ran.&#x27;,
+ compare: &#x27;Direct native reply&#x27;
+ },
+ {
+ id: 3,
+ question: &#x27;Was aktuell ist, was sind noch so absurde Kapitalisierungen?&#x27;,
+ route: &#x27;Deterministic orchestration&#x27;,
+ routeReason: &#x27;current data&#x27;,
+ toolSelected: 1.71,
+ toolDone: 2.97,
+ brainReady: 5.61,
+ finalAudio: 7.09,
+ turnDone: 22.72,
+ bridgeRequested: 2.01,
+ bridgeBlocked: null,
+ bridgeAudioStart: 2.58,
+ bridgeAudioEnd: 7.08,
+ groundedAck: 2.56,
+ groundedAckDropped: null,
+ hold: 1.47,
+ note: &#x27;The result was ready while the interim response was still speaking; final delivery waited for that response boundary.&#x27;,
+ compare: &#x27;Audible interim; final held 1.47 s&#x27;
+ },
+ {
+ id: 4,
+ question: &#x27;Gibt es überhaupt ein KI-Unternehmen, was Gewinne macht?&#x27;,
+ route: &#x27;Deterministic orchestration&#x27;,
+ routeReason: &#x27;action + capability + connected data&#x27;,
+ toolSelected: 1.74,
+ toolDone: 3.28,
+ brainReady: 5.35,
+ finalAudio: 7.68,
+ turnDone: 17.83,
+ bridgeRequested: 2.23,
+ bridgeBlocked: null,
+ bridgeAudioStart: 2.86,
+ bridgeAudioEnd: 7.64,
+ groundedAck: 2.84,
+ groundedAckDropped: null,
+ hold: 2.30,
+ note: &#x27;The same serialization happened again, with a longer wait after the router result was complete.&#x27;,
+ compare: &#x27;Audible interim; final held 2.30 s&#x27;
+ },
+ {
+ id: 5,
+ question: &#x27;Wie viel hat Nvidia Gewinn gemacht?&#x27;,
+ route: &#x27;Provider-requested delegation&#x27;,
+ routeReason: &#x27;native route escalated to tool&#x27;,
+ toolSelected: 2.32,
+ toolDone: 3.53,
+ brainReady: 5.47,
+ finalAudio: 6.01,
+ turnDone: 17.90,
+ bridgeRequested: null,
+ bridgeBlocked: null,
+ bridgeAudioStart: null,
+ bridgeAudioEnd: null,
+ groundedAck: null,
+ groundedAckDropped: null,
+ hold: 0,
+ note: &#x27;The provider requested the tool after the native route; this path did not schedule the two-second bridge.&#x27;,
+ compare: &#x27;Tool delegation without interim bridge&#x27;
+ },
+ {
+ id: 6,
+ question: &#x27;Vergleich das mal mit Alphabet.&#x27;,
+ route: &#x27;Provider-requested delegation&#x27;,
+ routeReason: &#x27;native route escalated to tool&#x27;,
+ toolSelected: 2.53,
+ toolDone: 3.93,
+ brainReady: 5.75,
+ finalAudio: 6.35,
+ turnDone: 22.81,
+ bridgeRequested: null,
+ bridgeBlocked: null,
+ bridgeAudioStart: null,
+ bridgeAudioEnd: null,
+ groundedAck: 3.70,
+ groundedAckDropped: 6.05,
+ hold: 0,
+ note: &#x27;A separate grounded ack was generated, then dropped because the live realtime call still owned the voice.&#x27;,
+ compare: &#x27;Grounded ack generated, then dropped&#x27;
+ },
+ {
+ id: 7,
+ question: &#x27;Wie ist dann immer der meisten Gewinner auf der Welt?&#x27;,
+ route: &#x27;Provider-requested delegation&#x27;,
+ routeReason: &#x27;native route escalated to tool&#x27;,
+ toolSelected: 2.38,
+ toolDone: 3.59,
+ brainReady: 5.55,
+ finalAudio: 6.16,
+ turnDone: 22.86,
+ bridgeRequested: null,
+ bridgeBlocked: null,
+ bridgeAudioStart: null,
+ bridgeAudioEnd: null,
+ groundedAck: null,
+ groundedAckDropped: null,
+ hold: 0,
+ note: &#x27;The delegated result moved directly into final realtime rendering once the provider boundary was free.&#x27;,
+ compare: &#x27;Tool delegation without interim bridge&#x27;
+ },
+ {
+ id: 8,
+ question: &quot;Wie sieht&#x27;s mit TSMC aus?&quot;,
+ route: &#x27;Provider-requested delegation&#x27;,
+ routeReason: &#x27;native route escalated to two searches&#x27;,
+ toolSelected: 2.22,
+ toolDone: 7.35,
+ brainReady: 8.84,
+ finalAudio: 9.37,
+ turnDone: 24.21,
+ bridgeRequested: null,
+ bridgeBlocked: null,
+ bridgeAudioStart: null,
+ bridgeAudioEnd: null,
+ groundedAck: 3.42,
+ groundedAckDropped: 6.75,
+ hold: 0,
+ note: &#x27;Two searches extended processing; the parallel grounded ack was dropped rather than spoken into the live call.&#x27;,
+ compare: &#x27;Two searches; grounded ack dropped&#x27;
+ }
+ ];
+
+ const ns = &#x27;http://www.w3.org/2000/svg&#x27;;
+ const q = (selector) =&gt; root.querySelector(selector);
+ const fmt = (value) =&gt; value == null ? &#x27;—&#x27; : `+${value.toFixed(2)} s`;
+
+ function svgEl(name, attrs = {}, text = &#x27;&#x27;) {
+ const el = document.createElementNS(ns, name);
+ Object.entries(attrs).forEach(([key, value]) =&gt; el.setAttribute(key, String(value)));
+ if (text) el.textContent = text;
+ return el;
+ }
+
+ function addNode(group, x, y, label, time, variant = &#x27;&#x27;) {
+ const width = Math.max(116, Math.min(184, label.length * 7.1 + 24));
+ const node = svgEl(&#x27;g&#x27;, { class: `node ${variant}`.trim(), transform: `translate(${x - width / 2} ${y - 25})` });
+ node.appendChild(svgEl(&#x27;rect&#x27;, { width, height: 50, rx: 8 }));
+ node.appendChild(svgEl(&#x27;text&#x27;, { x: width / 2, y: 21, &#x27;text-anchor&#x27;: &#x27;middle&#x27; }, label));
+ node.appendChild(svgEl(&#x27;text&#x27;, { class: &#x27;node-time&#x27;, x: width / 2, y: 38, &#x27;text-anchor&#x27;: &#x27;middle&#x27; }, fmt(time)));
+ group.appendChild(node);
+ return { x, y, width };
+ }
+
+ function addEdge(group, from, to, variant = &#x27;&#x27;) {
+ const startX = from.x + Math.min(from.width / 2, Math.max(20, (to.x - from.x) * 0.22));
+ const endX = to.x - Math.min(to.width / 2, Math.max(20, (to.x - from.x) * 0.22));
+ const midX = (startX + endX) / 2;
+ const marker = variant === &#x27;branch&#x27; ? &#x27;url(#branch-arrow)&#x27; : &#x27;url(#flow-arrow)&#x27;;
+ group.appendChild(svgEl(&#x27;path&#x27;, {
+ class: `flow-edge ${variant}`.trim(),
+ d: `M ${startX} ${from.y} C ${midX} ${from.y}, ${midX} ${to.y}, ${endX} ${to.y}`,
+ &#x27;marker-end&#x27;: marker
+ }));
+ }
+
+ function renderDiagram(turn) {
+ const grid = q(&#x27;#diagram-grid&#x27;);
+ const edges = q(&#x27;#diagram-edges&#x27;);
+ const bands = q(&#x27;#diagram-bands&#x27;);
+ const nodes = q(&#x27;#diagram-nodes&#x27;);
+ [grid, edges, bands, nodes].forEach((group) =&gt; group.replaceChildren());
+
+ const left = 150;
+ const right = 950;
+ const domain = Math.max(10, Math.ceil(turn.finalAudio + 0.6));
+ const x = (time) =&gt; left + (Math.max(0, time) / domain) * (right - left);
+ const laneY = { route: 72, work: 176, voice: 280 };
+
+ [&#x27;User + route&#x27;, &#x27;Router + tools&#x27;, &#x27;Realtime voice&#x27;].forEach((label, index) =&gt; {
+ const y = [laneY.route, laneY.work, laneY.voice][index];
+ grid.appendChild(svgEl(&#x27;text&#x27;, { class: &#x27;lane-label&#x27;, x: 12, y: y + 4 }, label));
+ grid.appendChild(svgEl(&#x27;line&#x27;, { class: &#x27;lane-line&#x27;, x1: left, y1: y, x2: right, y2: y }));
+ });
+ grid.appendChild(svgEl(&#x27;line&#x27;, { class: &#x27;axis-line&#x27;, x1: left, y1: 342, x2: right, y2: 342 }));
+ for (let tick = 0; tick &lt;= domain; tick += 2) {
+ const tx = x(tick);
+ grid.appendChild(svgEl(&#x27;line&#x27;, { class: &#x27;tick-line&#x27;, x1: tx, y1: 48, x2: tx, y2: 342 }));
+ grid.appendChild(svgEl(&#x27;text&#x27;, { class: &#x27;axis-text&#x27;, x: tx, y: 362, &#x27;text-anchor&#x27;: &#x27;middle&#x27; }, `+${tick}s`));
+ }
+
+ const input = addNode(nodes, x(0), laneY.route, &#x27;Input committed&#x27;, 0, &#x27;primary&#x27;);
+ const route = addNode(nodes, x(Math.min(0.55, turn.finalAudio * 0.18)), laneY.route, turn.route.includes(&#x27;Native&#x27;) ? &#x27;Native route&#x27; : &#x27;Route decision&#x27;, Math.min(0.55, turn.finalAudio * 0.18));
+ addEdge(edges, input, route);
+
+ let tool = null;
+ let toolDone = null;
+ let ready = null;
+ if (turn.toolSelected != null) {
+ tool = addNode(nodes, x(turn.toolSelected), laneY.work, &#x27;Search selected&#x27;, turn.toolSelected);
+ addEdge(edges, route, tool);
+ }
+ if (turn.toolDone != null) {
+ toolDone = addNode(nodes, x(turn.toolDone), laneY.work, turn.id === 8 ? &#x27;Second search done&#x27; : &#x27;Search done&#x27;, turn.toolDone);
+ if (tool) addEdge(edges, tool, toolDone);
+ }
+ if (turn.brainReady != null) {
+ ready = addNode(nodes, x(turn.brainReady), laneY.work, &#x27;Router result ready&#x27;, turn.brainReady, &#x27;primary&#x27;);
+ if (toolDone) addEdge(edges, toolDone, ready);
+ }
+
+ let bridgeStart = null;
+ let bridgeEnd = null;
+ if (turn.bridgeAudioStart != null) {
+ bridgeStart = addNode(nodes, x(turn.bridgeAudioStart), laneY.voice, &#x27;Interim starts&#x27;, turn.bridgeAudioStart, &#x27;bridge&#x27;);
+ bridgeEnd = addNode(nodes, x(turn.bridgeAudioEnd), laneY.voice, &#x27;Interim ends&#x27;, turn.bridgeAudioEnd, &#x27;bridge&#x27;);
+ addEdge(edges, route, bridgeStart, &#x27;branch&#x27;);
+ addEdge(edges, bridgeStart, bridgeEnd, &#x27;branch&#x27;);
+ } else if (turn.bridgeBlocked != null) {
+ const bridgeAttempt = addNode(nodes, x(turn.bridgeRequested), laneY.voice, &#x27;Interim requested&#x27;, turn.bridgeRequested, &#x27;bridge&#x27;);
+ const blocked = addNode(nodes, x(turn.bridgeBlocked), laneY.voice, &#x27;Honesty scrub blocks it&#x27;, turn.bridgeBlocked, &#x27;blocked&#x27;);
+ addEdge(edges, route, bridgeAttempt, &#x27;branch&#x27;);
+ addEdge(edges, bridgeAttempt, blocked, &#x27;blocked&#x27;);
+ }
+
+ if (turn.groundedAck != null) {
+ const ack = addNode(nodes, x(turn.groundedAck), laneY.route, &#x27;Parallel grounded ack&#x27;, turn.groundedAck);
+ addEdge(edges, route, ack);
+ if (turn.groundedAckDropped != null) {
+ const dropped = addNode(nodes, x(turn.groundedAckDropped), laneY.route, &#x27;Ack dropped&#x27;, turn.groundedAckDropped, &#x27;blocked&#x27;);
+ addEdge(edges, ack, dropped, &#x27;blocked&#x27;);
+ }
+ }
+
+ const final = addNode(nodes, x(turn.finalAudio), laneY.voice, &#x27;Final answer starts&#x27;, turn.finalAudio, &#x27;primary&#x27;);
+ if (ready) addEdge(edges, ready, final);
+ else addEdge(edges, route, final);
+ if (bridgeEnd) addEdge(edges, bridgeEnd, final, &#x27;branch&#x27;);
+
+ if (turn.hold &gt; 0 &amp;&amp; turn.brainReady != null) {
+ const start = x(turn.brainReady);
+ const end = x(turn.finalAudio);
+ bands.appendChild(svgEl(&#x27;rect&#x27;, {
+ class: &#x27;wait-band&#x27;,
+ x: start,
+ y: laneY.work + 36,
+ width: Math.max(2, end - start),
+ height: 20,
+ rx: 6
+ }));
+ bands.appendChild(svgEl(&#x27;text&#x27;, {
+ class: &#x27;axis-text&#x27;,
+ x: (start + end) / 2,
+ y: laneY.work + 51,
+ &#x27;text-anchor&#x27;: &#x27;middle&#x27;
+ }, `result waits ${turn.hold.toFixed(2)}s`));
+ }
+ }
+
+ function renderComparison(selectedId) {
+ const comparison = q(&#x27;#comparison&#x27;);
+ comparison.replaceChildren();
+ const scale = 10;
+ turns.forEach((turn) =&gt; {
+ const row = document.createElement(&#x27;div&#x27;);
+ row.className = `compare-row${turn.id === selectedId ? &#x27; is-selected&#x27; : &#x27;&#x27;}`;
+ const label = document.createElement(&#x27;div&#x27;);
+ label.className = &#x27;compare-label&#x27;;
+ label.innerHTML = `&lt;span&gt;Turn ${turn.id}&lt;/span&gt;&lt;span class=&quot;text-small text-muted&quot;&gt;${turn.route.includes(&#x27;Native&#x27;) ? &#x27;native&#x27; : turn.route.includes(&#x27;Provider&#x27;) ? &#x27;tool-requested&#x27; : &#x27;deterministic&#x27;}&lt;/span&gt;`;
+ const bar = document.createElement(&#x27;div&#x27;);
+ bar.className = &#x27;bar&#x27;;
+ bar.setAttribute(&#x27;aria-label&#x27;, `Turn ${turn.id}: final speech starts at ${turn.finalAudio.toFixed(2)} seconds`);
+ const thinking = document.createElement(&#x27;span&#x27;);
+ thinking.className = &#x27;thinking-segment&#x27;;
+ thinking.style.width = `${Math.min(100, turn.finalAudio / scale * 100)}%`;
+ bar.appendChild(thinking);
+ if (turn.bridgeAudioStart != null) {
+ const bridge = document.createElement(&#x27;span&#x27;);
+ bridge.className = &#x27;bridge-segment&#x27;;
+ bridge.style.left = `${turn.bridgeAudioStart / scale * 100}%`;
+ bridge.style.width = `${(turn.bridgeAudioEnd - turn.bridgeAudioStart) / scale * 100}%`;
+ bar.appendChild(bridge);
+ }
+ if (turn.brainReady != null) {
+ const ready = document.createElement(&#x27;span&#x27;);
+ ready.className = &#x27;ready-marker&#x27;;
+ ready.style.left = `${turn.brainReady / scale * 100}%`;
+ bar.appendChild(ready);
+ }
+ const final = document.createElement(&#x27;span&#x27;);
+ final.className = &#x27;final-marker&#x27;;
+ final.style.left = `${turn.finalAudio / scale * 100}%`;
+ bar.appendChild(final);
+ const note = document.createElement(&#x27;div&#x27;);
+ note.className = &#x27;compare-note text-small&#x27;;
+ note.textContent = turn.compare;
+ row.append(label, bar, note);
+ comparison.appendChild(row);
+ });
+ }
+
+ function selectTurn(id) {
+ const turn = turns.find((item) =&gt; item.id === id) || turns[2];
+ root.querySelectorAll(&#x27;[data-turn]&#x27;).forEach((button) =&gt; {
+ const selected = Number(button.dataset.turn) === turn.id;
+ button.classList.toggle(&#x27;btn-primary&#x27;, selected);
+ button.setAttribute(&#x27;aria-pressed&#x27;, selected ? &#x27;true&#x27; : &#x27;false&#x27;);
+ });
+ q(&#x27;#route-badge&#x27;).textContent = `${turn.route} · ${turn.routeReason}`;
+ q(&#x27;#question&#x27;).textContent = turn.question;
+ q(&#x27;#ready-value&#x27;).textContent = fmt(turn.brainReady);
+ q(&#x27;#ready-context&#x27;).textContent = turn.brainReady == null ? &#x27;No delegated router result&#x27; : &#x27;Delegated result completion&#x27;;
+ q(&#x27;#final-value&#x27;).textContent = fmt(turn.finalAudio);
+ q(&#x27;#final-context&#x27;).textContent = `Turn completes at ${fmt(turn.turnDone)}`;
+ q(&#x27;#hold-value&#x27;).textContent = turn.hold &gt; 0 ? `${turn.hold.toFixed(2)} s` : &#x27;0 s&#x27;;
+ q(&#x27;#hold-context&#x27;).textContent = turn.hold &gt; 0 ? &#x27;Result ready before interim response ended&#x27; : &#x27;No audible interim blocked final delivery&#x27;;
+ q(&#x27;#selected-detail&#x27;).textContent = turn.note;
+ renderDiagram(turn);
+ renderComparison(turn.id);
+ }
+
+ root.querySelectorAll(&#x27;[data-turn]&#x27;).forEach((button) =&gt; {
+ button.addEventListener(&#x27;click&#x27;, () =&gt; selectTurn(Number(button.dataset.turn)));
+ });
+ selectTurn(3);
+ })();
+ &lt;/script&gt;
+&lt;/div&gt;
+
+&lt;script src=&quot;https://unpkg.com/@floating-ui/[email protected]/dist/floating-ui.core.umd.min.js&quot;&gt;&lt;/script&gt;
+&lt;script src=&quot;https://unpkg.com/@floating-ui/[email protected]/dist/floating-ui.dom.umd.min.js&quot;&gt;&lt;/script&gt;
+&lt;script&gt;
+(() =&gt; {
+ if (window.FloatingUIDOM == null) {
+ return;
+ }
+ const { autoUpdate, computePosition, flip, offset, shift, size } =
+ window.FloatingUIDOM;
+ const tooltipPlacements = new Set([&quot;top&quot;, &quot;right&quot;, &quot;bottom&quot;, &quot;left&quot;]);
+ const tooltipId = `codex-visualization-tooltip-${
+ window.crypto?.randomUUID?.() ?? Date.now().toString(36)
+ }`;
+ const tooltipGap = 5;
+ const hoverDelay = 700;
+ const skipDelay = 300;
+ let activeTrigger = null;
+ let pendingTrigger = null;
+ let tooltip = null;
+ let openTimeout = null;
+ let autoUpdateCleanup = null;
+ let positionRequest = 0;
+ let skipDelayUntil = 0;
+
+ const getTrigger = (target) =&gt;
+ target?.nodeType === Node.ELEMENT_NODE
+ ? target.closest(&quot;[data-tooltip]&quot;)
+ : null;
+ const containsTarget = (trigger, target) =&gt;
+ target?.nodeType != null &amp;&amp; trigger.contains(target);
+ const getContent = (trigger) =&gt;
+ trigger.getAttribute(&quot;data-tooltip&quot;)?.trim() ?? &quot;&quot;;
+ const getPlacement = (trigger) =&gt; {
+ const placement = trigger.getAttribute(&quot;data-tooltip-placement&quot;);
+ return tooltipPlacements.has(placement) ? placement : &quot;top&quot;;
+ };
+ const getTooltip = () =&gt; {
+ if (tooltip == null) {
+ tooltip = document.createElement(&quot;div&quot;);
+ tooltip.id = tooltipId;
+ tooltip.className = &quot;tooltip&quot;;
+ tooltip.setAttribute(&quot;role&quot;, &quot;tooltip&quot;);
+ }
+ return tooltip;
+ };
+ const setDescribedBy = (trigger, described) =&gt; {
+ const ids = new Set(
+ (trigger.getAttribute(&quot;aria-describedby&quot;) ?? &quot;&quot;)
+ .split(/\s+/)
+ .filter(Boolean),
+ );
+ if (described) {
+ ids.add(tooltipId);
+ } else {
+ ids.delete(tooltipId);
+ }
+ if (ids.size === 0) {
+ trigger.removeAttribute(&quot;aria-describedby&quot;);
+ } else {
+ trigger.setAttribute(&quot;aria-describedby&quot;, [...ids].join(&quot; &quot;));
+ }
+ };
+ const clearOpenTimeout = () =&gt; {
+ if (openTimeout != null) {
+ window.clearTimeout(openTimeout);
+ openTimeout = null;
+ }
+ pendingTrigger = null;
+ };
+ const closeTooltip = (activateSkipDelay = true) =&gt; {
+ clearOpenTimeout();
+ positionRequest += 1;
+ autoUpdateCleanup?.();
+ autoUpdateCleanup = null;
+ if (activeTrigger == null) {
+ return;
+ }
+ setDescribedBy(activeTrigger, false);
+ activeTrigger = null;
+ tooltip?.remove();
+ if (activateSkipDelay) {
+ skipDelayUntil = Date.now() + skipDelay;
+ }
+ };
+ const updatePosition = (trigger, floating) =&gt; {
+ const request = ++positionRequest;
+ void computePosition(trigger, floating, {
+ middleware: [
+ offset(tooltipGap),
+ flip({ padding: tooltipGap }),
+ shift({ padding: tooltipGap }),
+ size({
+ padding: tooltipGap,
+ apply({ availableHeight, availableWidth, elements }) {
+ elements.floating.style.setProperty(
+ &quot;--tooltip-available-width&quot;,
+ `${Math.max(0, availableWidth)}px`,
+ );
+ elements.floating.style.setProperty(
+ &quot;--tooltip-available-height&quot;,
+ `${Math.max(0, availableHeight)}px`,
+ );
+ },
+ }),
+ ],
+ placement: getPlacement(trigger),
+ strategy: &quot;fixed&quot;,
+ })
+ .then(({ x, y }) =&gt; {
+ if (activeTrigger !== trigger || request !== positionRequest) {
+ return;
+ }
+ const scale = window.devicePixelRatio || 1;
+ floating.style.transform = `translate(${Math.round(x * scale) / scale}px, ${Math.round(y * scale) / scale}px)`;
+ floating.style.visibility = &quot;visible&quot;;
+ })
+ .catch(() =&gt; {
+ if (activeTrigger === trigger &amp;&amp; request === positionRequest) {
+ closeTooltip(false);
+ }
+ });
+ };
+ const openTooltip = (trigger) =&gt; {
+ const content = getContent(trigger);
+ if (!trigger.isConnected || content.length === 0) {
+ return;
+ }
+ clearOpenTimeout();
+ if (activeTrigger === trigger) {
+ return;
+ }
+ closeTooltip();
+ const floating = getTooltip();
+ floating.textContent = content;
+ floating.style.visibility = &quot;hidden&quot;;
+ floating.style.transform = &quot;translate(0, 0)&quot;;
+ document.body.appendChild(floating);
+ activeTrigger = trigger;
+ setDescribedBy(trigger, true);
+ autoUpdateCleanup = autoUpdate(trigger, floating, () =&gt; {
+ updatePosition(trigger, floating);
+ });
+ };
+ const requestOpen = (trigger, immediate = false) =&gt; {
+ if (
+ getContent(trigger).length === 0 ||
+ activeTrigger === trigger ||
+ pendingTrigger === trigger
+ ) {
+ return;
+ }
+ clearOpenTimeout();
+ pendingTrigger = trigger;
+ const delay =
+ immediate || activeTrigger != null || Date.now() &lt; skipDelayUntil
+ ? 0
+ : hoverDelay;
+ if (delay === 0) {
+ openTooltip(trigger);
+ return;
+ }
+ openTimeout = window.setTimeout(() =&gt; {
+ openTimeout = null;
+ pendingTrigger = null;
+ openTooltip(trigger);
+ }, delay);
+ };
+ const handlePointerOpen = (event) =&gt; {
+ if (event.pointerType === &quot;touch&quot;) {
+ return;
+ }
+ const trigger = getTrigger(event.target);
+ if (trigger == null || containsTarget(trigger, event.relatedTarget)) {
+ return;
+ }
+ requestOpen(trigger);
+ };
+ const handleLeave = (event) =&gt; {
+ const trigger = getTrigger(event.target);
+ if (trigger == null || containsTarget(trigger, event.relatedTarget)) {
+ return;
+ }
+ if (activeTrigger === trigger || pendingTrigger === trigger) {
+ closeTooltip();
+ }
+ };
+ const handleFocusIn = (event) =&gt; {
+ const trigger = getTrigger(event.target);
+ if (trigger?.matches(&quot;:focus-visible&quot;)) {
+ requestOpen(trigger, true);
+ }
+ };
+ const handleKeyDown = (event) =&gt; {
+ if (event.key === &quot;Escape&quot;) {
+ closeTooltip();
+ }
+ };
+ const handleContextMenu = (event) =&gt; {
+ const trigger = getTrigger(event.target);
+ if (activeTrigger === trigger || pendingTrigger === trigger) {
+ closeTooltip();
+ }
+ };
+ const destroy = () =&gt; {
+ closeTooltip(false);
+ document.removeEventListener(&quot;pointerover&quot;, handlePointerOpen);
+ document.removeEventListener(&quot;pointerout&quot;, handleLeave);
+ document.removeEventListener(&quot;focusin&quot;, handleFocusIn);
+ document.removeEventListener(&quot;focusout&quot;, handleLeave);
+ document.removeEventListener(&quot;keydown&quot;, handleKeyDown);
+ document.removeEventListener(&quot;contextmenu&quot;, handleContextMenu);
+ tooltip = null;
+ };
+
+ document.addEventListener(&quot;pointerover&quot;, handlePointerOpen);
+ document.addEventListener(&quot;pointerout&quot;, handleLeave);
+ document.addEventListener(&quot;focusin&quot;, handleFocusIn);
+ document.addEventListener(&quot;focusout&quot;, handleLeave);
+ document.addEventListener(&quot;keydown&quot;, handleKeyDown);
+ document.addEventListener(&quot;contextmenu&quot;, handleContextMenu);
+ window.addEventListener(&quot;pagehide&quot;, destroy, { once: true });
+})();
+&lt;/script&gt;
+&lt;script id=&quot;codex-visualization-lucide&quot; async src=&quot;https://unpkg.com/[email protected]/dist/umd/lucide.js&quot;&gt;&lt;/script&gt;
+&lt;script&gt;
+(() =&gt; {
+ const initialize = () =&gt; {
+ globalThis.lucide?.createIcons({ attrs: { width: 16, height: 16 } });
+ };
+ if (globalThis.lucide != null) {
+ initialize();
+ return;
+ }
+ document
+ .getElementById(&quot;codex-visualization-lucide&quot;)
+ ?.addEventListener(&quot;load&quot;, initialize, { once: true });
+})();
+&lt;/script&gt;
+
+&lt;/body&gt;
+&lt;/html&gt;
+"></iframe>
+</body>
+</html>
diff --git a/.codex/visualizations/2026/07/14/voice-session-mechanics/realtime-interim-voice-analysis.html b/.codex/visualizations/2026/07/14/voice-session-mechanics/realtime-interim-voice-analysis.html
new file mode 100644
index 0000000000..f98f7ba309
--- /dev/null
+++ b/.codex/visualizations/2026/07/14/voice-session-mechanics/realtime-interim-voice-analysis.html
@@ -0,0 +1,691 @@
+<div id="realtime-interim-voice-analysis" aria-label="Interactive analysis of the realtime voice session">
+ <style>
+ #realtime-interim-voice-analysis {
+ color: var(--foreground);
+ display: grid;
+ gap: 20px;
+ width: 100%;
+ }
+ #realtime-interim-voice-analysis .turn-picker {
+ display: grid;
+ grid-template-columns: repeat(8, minmax(0, 1fr));
+ gap: 8px;
+ }
+ #realtime-interim-voice-analysis .turn-picker .btn {
+ justify-content: center;
+ min-width: 0;
+ }
+ #realtime-interim-voice-analysis .section-head {
+ align-items: baseline;
+ display: flex;
+ flex-wrap: wrap;
+ gap: 8px 14px;
+ justify-content: space-between;
+ margin-bottom: 8px;
+ }
+ #realtime-interim-voice-analysis .section-head h2,
+ #realtime-interim-voice-analysis .section-head h3 {
+ margin: 0;
+ }
+ #realtime-interim-voice-analysis .question {
+ color: var(--foreground);
+ margin: 0;
+ }
+ #realtime-interim-voice-analysis .diagram-wrap {
+ min-width: 0;
+ width: 100%;
+ }
+ #realtime-interim-voice-analysis .diagram {
+ display: block;
+ height: auto;
+ overflow: visible;
+ width: 100%;
+ }
+ #realtime-interim-voice-analysis .lane-line,
+ #realtime-interim-voice-analysis .axis-line,
+ #realtime-interim-voice-analysis .tick-line {
+ stroke: var(--border);
+ stroke-width: 1;
+ }
+ #realtime-interim-voice-analysis .tick-line {
+ opacity: 0.55;
+ }
+ #realtime-interim-voice-analysis .flow-edge {
+ fill: none;
+ stroke: var(--muted-foreground);
+ stroke-width: 1.5;
+ }
+ #realtime-interim-voice-analysis .flow-edge.branch {
+ stroke: var(--viz-series-2);
+ }
+ #realtime-interim-voice-analysis .flow-edge.blocked {
+ stroke: var(--destructive);
+ stroke-dasharray: 5 4;
+ }
+ #realtime-interim-voice-analysis .wait-band {
+ fill: color-mix(in srgb, var(--viz-series-3) 20%, transparent);
+ stroke: var(--viz-series-3);
+ stroke-width: 1;
+ }
+ #realtime-interim-voice-analysis .node rect {
+ fill: color-mix(in srgb, var(--card) 92%, transparent);
+ stroke: var(--border);
+ stroke-width: 1;
+ }
+ #realtime-interim-voice-analysis .node.primary rect {
+ fill: color-mix(in srgb, var(--viz-series-1) 18%, var(--card));
+ stroke: var(--viz-series-1);
+ }
+ #realtime-interim-voice-analysis .node.bridge rect {
+ fill: color-mix(in srgb, var(--viz-series-2) 18%, var(--card));
+ stroke: var(--viz-series-2);
+ }
+ #realtime-interim-voice-analysis .node.blocked rect {
+ fill: color-mix(in srgb, var(--destructive) 14%, var(--card));
+ stroke: var(--destructive);
+ }
+ #realtime-interim-voice-analysis .node text,
+ #realtime-interim-voice-analysis .axis-text,
+ #realtime-interim-voice-analysis .lane-label {
+ fill: var(--foreground);
+ font-weight: 400;
+ }
+ #realtime-interim-voice-analysis .node .node-time,
+ #realtime-interim-voice-analysis .axis-text,
+ #realtime-interim-voice-analysis .lane-label {
+ fill: var(--muted-foreground);
+ }
+ #realtime-interim-voice-analysis .comparison {
+ display: grid;
+ gap: 8px;
+ }
+ #realtime-interim-voice-analysis .compare-row {
+ align-items: center;
+ display: grid;
+ gap: 10px;
+ grid-template-columns: 72px minmax(0, 1fr) minmax(130px, 0.42fr);
+ }
+ #realtime-interim-voice-analysis .compare-label {
+ display: grid;
+ gap: 1px;
+ }
+ #realtime-interim-voice-analysis .bar {
+ background: color-mix(in srgb, var(--muted) 72%, transparent);
+ height: 22px;
+ position: relative;
+ }
+ #realtime-interim-voice-analysis .bar .thinking-segment,
+ #realtime-interim-voice-analysis .bar .bridge-segment,
+ #realtime-interim-voice-analysis .bar .ready-marker,
+ #realtime-interim-voice-analysis .bar .final-marker {
+ bottom: 0;
+ position: absolute;
+ top: 0;
+ }
+ #realtime-interim-voice-analysis .bar .thinking-segment {
+ background: color-mix(in srgb, var(--viz-series-1) 22%, transparent);
+ left: 0;
+ }
+ #realtime-interim-voice-analysis .bar .bridge-segment {
+ background: color-mix(in srgb, var(--viz-series-2) 42%, transparent);
+ }
+ #realtime-interim-voice-analysis .bar .ready-marker {
+ border-left: 2px solid var(--viz-series-3);
+ width: 0;
+ }
+ #realtime-interim-voice-analysis .bar .final-marker {
+ border-left: 2px solid var(--foreground);
+ width: 0;
+ }
+ #realtime-interim-voice-analysis .compare-note {
+ color: var(--muted-foreground);
+ min-width: 0;
+ }
+ #realtime-interim-voice-analysis .compare-row.is-selected .compare-note,
+ #realtime-interim-voice-analysis .compare-row.is-selected .compare-label {
+ color: var(--foreground);
+ font-weight: 500;
+ }
+ #realtime-interim-voice-analysis .legend {
+ align-items: center;
+ display: flex;
+ flex-wrap: wrap;
+ gap: 8px 16px;
+ }
+ #realtime-interim-voice-analysis .legend-item {
+ align-items: center;
+ display: inline-flex;
+ gap: 6px;
+ }
+ #realtime-interim-voice-analysis .swatch {
+ display: inline-block;
+ height: 10px;
+ width: 18px;
+ }
+ #realtime-interim-voice-analysis .swatch.thinking {
+ background: color-mix(in srgb, var(--viz-series-1) 22%, transparent);
+ }
+ #realtime-interim-voice-analysis .swatch.bridge {
+ background: color-mix(in srgb, var(--viz-series-2) 42%, transparent);
+ }
+ #realtime-interim-voice-analysis .swatch.ready {
+ border-left: 2px solid var(--viz-series-3);
+ width: 2px;
+ }
+ #realtime-interim-voice-analysis .swatch.final {
+ border-left: 2px solid var(--foreground);
+ width: 2px;
+ }
+ #realtime-interim-voice-analysis .export-flow {
+ align-items: stretch;
+ display: grid;
+ gap: 10px;
+ grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) auto minmax(0, 1fr);
+ }
+ #realtime-interim-voice-analysis .export-node {
+ align-content: center;
+ display: grid;
+ gap: 4px;
+ min-height: 82px;
+ padding: 12px;
+ text-align: center;
+ }
+ #realtime-interim-voice-analysis .export-arrow {
+ align-self: center;
+ color: var(--muted-foreground);
+ }
+ #realtime-interim-voice-analysis .export-node.allowed {
+ background: color-mix(in srgb, var(--viz-series-1) 14%, transparent);
+ }
+ #realtime-interim-voice-analysis .export-node.dropped {
+ background: color-mix(in srgb, var(--destructive) 10%, transparent);
+ }
+ #realtime-interim-voice-analysis .evidence-line {
+ margin: 0;
+ }
+ @media (max-width: 680px) {
+ #realtime-interim-voice-analysis .turn-picker {
+ grid-template-columns: repeat(4, minmax(0, 1fr));
+ }
+ #realtime-interim-voice-analysis .compare-row {
+ grid-template-columns: 62px minmax(0, 1fr);
+ }
+ #realtime-interim-voice-analysis .compare-note {
+ grid-column: 2;
+ }
+ #realtime-interim-voice-analysis .export-flow {
+ grid-template-columns: 1fr;
+ }
+ #realtime-interim-voice-analysis .export-arrow {
+ justify-self: center;
+ transform: rotate(90deg);
+ }
+ }
+ </style>
+
+ <div class="viz-controls turn-picker" role="group" aria-label="Choose a voice turn">
+ <button type="button" class="btn" data-turn="1">Turn 1</button>
+ <button type="button" class="btn" data-turn="2">Turn 2</button>
+ <button type="button" class="btn" data-turn="3">Turn 3</button>
+ <button type="button" class="btn" data-turn="4">Turn 4</button>
+ <button type="button" class="btn" data-turn="5">Turn 5</button>
+ <button type="button" class="btn" data-turn="6">Turn 6</button>
+ <button type="button" class="btn" data-turn="7">Turn 7</button>
+ <button type="button" class="btn" data-turn="8">Turn 8</button>
+ </div>
+
+ <section aria-labelledby="selected-turn-heading">
+ <div class="section-head">
+ <h2 id="selected-turn-heading">Selected turn</h2>
+ <span id="route-badge" class="viz-badge"></span>
+ </div>
+ <p id="question" class="question"></p>
+ </section>
+
+ <div class="viz-grid" aria-label="Selected turn timing">
+ <div class="card viz-stat">
+ <span class="text-muted">Router result ready</span>
+ <span id="ready-value" class="viz-stat-value"></span>
+ <span id="ready-context" class="text-small text-muted"></span>
+ </div>
+ <div class="card viz-stat">
+ <span class="text-muted">Final answer starts</span>
+ <span id="final-value" class="viz-stat-value"></span>
+ <span id="final-context" class="text-small text-muted"></span>
+ </div>
+ <div class="card viz-stat">
+ <span class="text-muted">Interim serialization hold</span>
+ <span id="hold-value" class="viz-stat-value"></span>
+ <span id="hold-context" class="text-small text-muted"></span>
+ </div>
+ </div>
+
+ <section aria-labelledby="flow-heading">
+ <div class="section-head">
+ <h3 id="flow-heading">Turn flow</h3>
+ <span id="selected-detail" class="text-small text-muted"></span>
+ </div>
+ <div class="diagram-wrap">
+ <svg id="turn-diagram" class="diagram" viewBox="0 0 1000 370" role="img" aria-labelledby="diagram-title diagram-desc">
+ <title id="diagram-title">Selected voice turn event flow</title>
+ <desc id="diagram-desc">A time-aligned node diagram showing user input, routing, tool work, interim speech, result readiness, and final speech.</desc>
+ <defs>
+ <marker id="flow-arrow" viewBox="0 0 10 10" refX="9" refY="5" markerWidth="6" markerHeight="6" orient="auto-start-reverse">
+ <path d="M 0 0 L 10 5 L 0 10 z" fill="var(--muted-foreground)"></path>
+ </marker>
+ <marker id="branch-arrow" viewBox="0 0 10 10" refX="9" refY="5" markerWidth="6" markerHeight="6" orient="auto-start-reverse">
+ <path d="M 0 0 L 10 5 L 0 10 z" fill="var(--viz-series-2)"></path>
+ </marker>
+ </defs>
+ <g id="diagram-grid"></g>
+ <g id="diagram-edges"></g>
+ <g id="diagram-bands"></g>
+ <g id="diagram-nodes"></g>
+ </svg>
+ </div>
+ </section>
+
+ <section aria-labelledby="comparison-heading">
+ <div class="section-head">
+ <h3 id="comparison-heading">All eight turns before final speech</h3>
+ <span class="text-small text-muted">Shared 0–10 second scale</span>
+ </div>
+ <div id="comparison" class="comparison"></div>
+ <div class="legend text-small text-muted" aria-label="Timeline legend">
+ <span class="legend-item"><span class="swatch thinking"></span>Processing</span>
+ <span class="legend-item"><span class="swatch bridge"></span>Audible interim sentence</span>
+ <span class="legend-item"><span class="swatch ready"></span>Router result ready</span>
+ <span class="legend-item"><span class="swatch final"></span>Final speech starts</span>
+ </div>
+ </section>
+
+ <section aria-labelledby="export-heading">
+ <div class="section-head">
+ <h3 id="export-heading">Why the plain transcript looks incomplete</h3>
+ </div>
+ <div class="export-flow" role="img" aria-label="Export inclusion logic">
+ <div class="card export-node dropped">
+ <strong>AnnouncementRequested / MessageSent</strong>
+ <span class="text-small">Generated UI status or grounded ack</span>
+ <span class="text-small text-muted">Not exported unless it was actually voiced</span>
+ </div>
+ <span class="export-arrow" aria-hidden="true">→</span>
+ <div class="card export-node allowed">
+ <strong>SpeechSpoken(progress)</strong>
+ <span class="text-small">Only the audible interim sentences in turns 3 and 4</span>
+ <span class="text-small text-muted">Exported as an unlabeled “Jarvis:” line</span>
+ </div>
+ <span class="export-arrow" aria-hidden="true">→</span>
+ <div class="card export-node allowed">
+ <strong>ResponseGenerated</strong>
+ <span class="text-small">The final answer after provider playback ends</span>
+ <span class="text-small text-muted">Exported as the next “Jarvis:” line</span>
+ </div>
+ </div>
+ </section>
+
+ <p class="evidence-line text-small text-muted">Evidence: session 524d58e6 · flight recorder events · desktop voice-state log · plain-export formatter.</p>
+
+ <script>
+ (() => {
+ const root = document.getElementById('realtime-interim-voice-analysis');
+ if (!root) return;
+
+ const turns = [
+ {
+ id: 1,
+ question: 'Macht eigentlich Whisperflow Gewinn?',
+ route: 'Deterministic orchestration',
+ routeReason: 'action + capability',
+ toolSelected: 2.05,
+ toolDone: 4.93,
+ brainReady: 7.16,
+ finalAudio: 7.68,
+ turnDone: 26.14,
+ bridgeRequested: 2.01,
+ bridgeBlocked: 2.60,
+ bridgeAudioStart: null,
+ bridgeAudioEnd: null,
+ groundedAck: 2.96,
+ groundedAckDropped: 5.59,
+ hold: 0,
+ note: 'The interim attempt triggered the honesty scrub and produced no recorded speech.',
+ compare: 'Bridge attempt scrubbed; grounded ack dropped'
+ },
+ {
+ id: 2,
+ question: 'zwei Milliarden bei zehn Millionen, das ist ja absurd.',
+ route: 'Native realtime',
+ routeReason: 'no orchestration reason',
+ toolSelected: null,
+ toolDone: null,
+ brainReady: null,
+ finalAudio: 0.77,
+ turnDone: 12.32,
+ bridgeRequested: null,
+ bridgeBlocked: null,
+ bridgeAudioStart: null,
+ bridgeAudioEnd: null,
+ groundedAck: null,
+ groundedAckDropped: null,
+ hold: 0,
+ note: 'The realtime provider answered directly; no tool, bridge, or duplicate status path ran.',
+ compare: 'Direct native reply'
+ },
+ {
+ id: 3,
+ question: 'Was aktuell ist, was sind noch so absurde Kapitalisierungen?',
+ route: 'Deterministic orchestration',
+ routeReason: 'current data',
+ toolSelected: 1.71,
+ toolDone: 2.97,
+ brainReady: 5.61,
+ finalAudio: 7.09,
+ turnDone: 22.72,
+ bridgeRequested: 2.01,
+ bridgeBlocked: null,
+ bridgeAudioStart: 2.58,
+ bridgeAudioEnd: 7.08,
+ groundedAck: 2.56,
+ groundedAckDropped: null,
+ hold: 1.47,
+ note: 'The result was ready while the interim response was still speaking; final delivery waited for that response boundary.',
+ compare: 'Audible interim; final held 1.47 s'
+ },
+ {
+ id: 4,
+ question: 'Gibt es überhaupt ein KI-Unternehmen, was Gewinne macht?',
+ route: 'Deterministic orchestration',
+ routeReason: 'action + capability + connected data',
+ toolSelected: 1.74,
+ toolDone: 3.28,
+ brainReady: 5.35,
+ finalAudio: 7.68,
+ turnDone: 17.83,
+ bridgeRequested: 2.23,
+ bridgeBlocked: null,
+ bridgeAudioStart: 2.86,
+ bridgeAudioEnd: 7.64,
+ groundedAck: 2.84,
+ groundedAckDropped: null,
+ hold: 2.30,
+ note: 'The same serialization happened again, with a longer wait after the router result was complete.',
+ compare: 'Audible interim; final held 2.30 s'
+ },
+ {
+ id: 5,
+ question: 'Wie viel hat Nvidia Gewinn gemacht?',
+ route: 'Provider-requested delegation',
+ routeReason: 'native route escalated to tool',
+ toolSelected: 2.32,
+ toolDone: 3.53,
+ brainReady: 5.47,
+ finalAudio: 6.01,
+ turnDone: 17.90,
+ bridgeRequested: null,
+ bridgeBlocked: null,
+ bridgeAudioStart: null,
+ bridgeAudioEnd: null,
+ groundedAck: null,
+ groundedAckDropped: null,
+ hold: 0,
+ note: 'The provider requested the tool after the native route; this path did not schedule the two-second bridge.',
+ compare: 'Tool delegation without interim bridge'
+ },
+ {
+ id: 6,
+ question: 'Vergleich das mal mit Alphabet.',
+ route: 'Provider-requested delegation',
+ routeReason: 'native route escalated to tool',
+ toolSelected: 2.53,
+ toolDone: 3.93,
+ brainReady: 5.75,
+ finalAudio: 6.35,
+ turnDone: 22.81,
+ bridgeRequested: null,
+ bridgeBlocked: null,
+ bridgeAudioStart: null,
+ bridgeAudioEnd: null,
+ groundedAck: 3.70,
+ groundedAckDropped: 6.05,
+ hold: 0,
+ note: 'A separate grounded ack was generated, then dropped because the live realtime call still owned the voice.',
+ compare: 'Grounded ack generated, then dropped'
+ },
+ {
+ id: 7,
+ question: 'Wie ist dann immer der meisten Gewinner auf der Welt?',
+ route: 'Provider-requested delegation',
+ routeReason: 'native route escalated to tool',
+ toolSelected: 2.38,
+ toolDone: 3.59,
+ brainReady: 5.55,
+ finalAudio: 6.16,
+ turnDone: 22.86,
+ bridgeRequested: null,
+ bridgeBlocked: null,
+ bridgeAudioStart: null,
+ bridgeAudioEnd: null,
+ groundedAck: null,
+ groundedAckDropped: null,
+ hold: 0,
+ note: 'The delegated result moved directly into final realtime rendering once the provider boundary was free.',
+ compare: 'Tool delegation without interim bridge'
+ },
+ {
+ id: 8,
+ question: "Wie sieht's mit TSMC aus?",
+ route: 'Provider-requested delegation',
+ routeReason: 'native route escalated to two searches',
+ toolSelected: 2.22,
+ toolDone: 7.35,
+ brainReady: 8.84,
+ finalAudio: 9.37,
+ turnDone: 24.21,
+ bridgeRequested: null,
+ bridgeBlocked: null,
+ bridgeAudioStart: null,
+ bridgeAudioEnd: null,
+ groundedAck: 3.42,
+ groundedAckDropped: 6.75,
+ hold: 0,
+ note: 'Two searches extended processing; the parallel grounded ack was dropped rather than spoken into the live call.',
+ compare: 'Two searches; grounded ack dropped'
+ }
+ ];
+
+ const ns = 'http://www.w3.org/2000/svg';
+ const q = (selector) => root.querySelector(selector);
+ const fmt = (value) => value == null ? '—' : `+${value.toFixed(2)} s`;
+
+ function svgEl(name, attrs = {}, text = '') {
+ const el = document.createElementNS(ns, name);
+ Object.entries(attrs).forEach(([key, value]) => el.setAttribute(key, String(value)));
+ if (text) el.textContent = text;
+ return el;
+ }
+
+ function addNode(group, x, y, label, time, variant = '') {
+ const width = Math.max(116, Math.min(184, label.length * 7.1 + 24));
+ const node = svgEl('g', { class: `node ${variant}`.trim(), transform: `translate(${x - width / 2} ${y - 25})` });
+ node.appendChild(svgEl('rect', { width, height: 50, rx: 8 }));
+ node.appendChild(svgEl('text', { x: width / 2, y: 21, 'text-anchor': 'middle' }, label));
+ node.appendChild(svgEl('text', { class: 'node-time', x: width / 2, y: 38, 'text-anchor': 'middle' }, fmt(time)));
+ group.appendChild(node);
+ return { x, y, width };
+ }
+
+ function addEdge(group, from, to, variant = '') {
+ const startX = from.x + Math.min(from.width / 2, Math.max(20, (to.x - from.x) * 0.22));
+ const endX = to.x - Math.min(to.width / 2, Math.max(20, (to.x - from.x) * 0.22));
+ const midX = (startX + endX) / 2;
+ const marker = variant === 'branch' ? 'url(#branch-arrow)' : 'url(#flow-arrow)';
+ group.appendChild(svgEl('path', {
+ class: `flow-edge ${variant}`.trim(),
+ d: `M ${startX} ${from.y} C ${midX} ${from.y}, ${midX} ${to.y}, ${endX} ${to.y}`,
+ 'marker-end': marker
+ }));
+ }
+
+ function renderDiagram(turn) {
+ const grid = q('#diagram-grid');
+ const edges = q('#diagram-edges');
+ const bands = q('#diagram-bands');
+ const nodes = q('#diagram-nodes');
+ [grid, edges, bands, nodes].forEach((group) => group.replaceChildren());
+
+ const left = 150;
+ const right = 950;
+ const domain = Math.max(10, Math.ceil(turn.finalAudio + 0.6));
+ const x = (time) => left + (Math.max(0, time) / domain) * (right - left);
+ const laneY = { route: 72, work: 176, voice: 280 };
+
+ ['User + route', 'Router + tools', 'Realtime voice'].forEach((label, index) => {
+ const y = [laneY.route, laneY.work, laneY.voice][index];
+ grid.appendChild(svgEl('text', { class: 'lane-label', x: 12, y: y + 4 }, label));
+ grid.appendChild(svgEl('line', { class: 'lane-line', x1: left, y1: y, x2: right, y2: y }));
+ });
+ grid.appendChild(svgEl('line', { class: 'axis-line', x1: left, y1: 342, x2: right, y2: 342 }));
+ for (let tick = 0; tick <= domain; tick += 2) {
+ const tx = x(tick);
+ grid.appendChild(svgEl('line', { class: 'tick-line', x1: tx, y1: 48, x2: tx, y2: 342 }));
+ grid.appendChild(svgEl('text', { class: 'axis-text', x: tx, y: 362, 'text-anchor': 'middle' }, `+${tick}s`));
+ }
+
+ const input = addNode(nodes, x(0), laneY.route, 'Input committed', 0, 'primary');
+ const route = addNode(nodes, x(Math.min(0.55, turn.finalAudio * 0.18)), laneY.route, turn.route.includes('Native') ? 'Native route' : 'Route decision', Math.min(0.55, turn.finalAudio * 0.18));
+ addEdge(edges, input, route);
+
+ let tool = null;
+ let toolDone = null;
+ let ready = null;
+ if (turn.toolSelected != null) {
+ tool = addNode(nodes, x(turn.toolSelected), laneY.work, 'Search selected', turn.toolSelected);
+ addEdge(edges, route, tool);
+ }
+ if (turn.toolDone != null) {
+ toolDone = addNode(nodes, x(turn.toolDone), laneY.work, turn.id === 8 ? 'Second search done' : 'Search done', turn.toolDone);
+ if (tool) addEdge(edges, tool, toolDone);
+ }
+ if (turn.brainReady != null) {
+ ready = addNode(nodes, x(turn.brainReady), laneY.work, 'Router result ready', turn.brainReady, 'primary');
+ if (toolDone) addEdge(edges, toolDone, ready);
+ }
+
+ let bridgeStart = null;
+ let bridgeEnd = null;
+ if (turn.bridgeAudioStart != null) {
+ bridgeStart = addNode(nodes, x(turn.bridgeAudioStart), laneY.voice, 'Interim starts', turn.bridgeAudioStart, 'bridge');
+ bridgeEnd = addNode(nodes, x(turn.bridgeAudioEnd), laneY.voice, 'Interim ends', turn.bridgeAudioEnd, 'bridge');
+ addEdge(edges, route, bridgeStart, 'branch');
+ addEdge(edges, bridgeStart, bridgeEnd, 'branch');
+ } else if (turn.bridgeBlocked != null) {
+ const bridgeAttempt = addNode(nodes, x(turn.bridgeRequested), laneY.voice, 'Interim requested', turn.bridgeRequested, 'bridge');
+ const blocked = addNode(nodes, x(turn.bridgeBlocked), laneY.voice, 'Honesty scrub blocks it', turn.bridgeBlocked, 'blocked');
+ addEdge(edges, route, bridgeAttempt, 'branch');
+ addEdge(edges, bridgeAttempt, blocked, 'blocked');
+ }
+
+ if (turn.groundedAck != null) {
+ const ack = addNode(nodes, x(turn.groundedAck), laneY.route, 'Parallel grounded ack', turn.groundedAck);
+ addEdge(edges, route, ack);
+ if (turn.groundedAckDropped != null) {
+ const dropped = addNode(nodes, x(turn.groundedAckDropped), laneY.route, 'Ack dropped', turn.groundedAckDropped, 'blocked');
+ addEdge(edges, ack, dropped, 'blocked');
+ }
+ }
+
+ const final = addNode(nodes, x(turn.finalAudio), laneY.voice, 'Final answer starts', turn.finalAudio, 'primary');
+ if (ready) addEdge(edges, ready, final);
+ else addEdge(edges, route, final);
+ if (bridgeEnd) addEdge(edges, bridgeEnd, final, 'branch');
+
+ if (turn.hold > 0 && turn.brainReady != null) {
+ const start = x(turn.brainReady);
+ const end = x(turn.finalAudio);
+ bands.appendChild(svgEl('rect', {
+ class: 'wait-band',
+ x: start,
+ y: laneY.work + 36,
+ width: Math.max(2, end - start),
+ height: 20,
+ rx: 6
+ }));
+ bands.appendChild(svgEl('text', {
+ class: 'axis-text',
+ x: (start + end) / 2,
+ y: laneY.work + 51,
+ 'text-anchor': 'middle'
+ }, `result waits ${turn.hold.toFixed(2)}s`));
+ }
+ }
+
+ function renderComparison(selectedId) {
+ const comparison = q('#comparison');
+ comparison.replaceChildren();
+ const scale = 10;
+ turns.forEach((turn) => {
+ const row = document.createElement('div');
+ row.className = `compare-row${turn.id === selectedId ? ' is-selected' : ''}`;
+ const label = document.createElement('div');
+ label.className = 'compare-label';
+ label.innerHTML = `<span>Turn ${turn.id}</span><span class="text-small text-muted">${turn.route.includes('Native') ? 'native' : turn.route.includes('Provider') ? 'tool-requested' : 'deterministic'}</span>`;
+ const bar = document.createElement('div');
+ bar.className = 'bar';
+ bar.setAttribute('aria-label', `Turn ${turn.id}: final speech starts at ${turn.finalAudio.toFixed(2)} seconds`);
+ const thinking = document.createElement('span');
+ thinking.className = 'thinking-segment';
+ thinking.style.width = `${Math.min(100, turn.finalAudio / scale * 100)}%`;
+ bar.appendChild(thinking);
+ if (turn.bridgeAudioStart != null) {
+ const bridge = document.createElement('span');
+ bridge.className = 'bridge-segment';
+ bridge.style.left = `${turn.bridgeAudioStart / scale * 100}%`;
+ bridge.style.width = `${(turn.bridgeAudioEnd - turn.bridgeAudioStart) / scale * 100}%`;
+ bar.appendChild(bridge);
+ }
+ if (turn.brainReady != null) {
+ const ready = document.createElement('span');
+ ready.className = 'ready-marker';
+ ready.style.left = `${turn.brainReady / scale * 100}%`;
+ bar.appendChild(ready);
+ }
+ const final = document.createElement('span');
+ final.className = 'final-marker';
+ final.style.left = `${turn.finalAudio / scale * 100}%`;
+ bar.appendChild(final);
+ const note = document.createElement('div');
+ note.className = 'compare-note text-small';
+ note.textContent = turn.compare;
+ row.append(label, bar, note);
+ comparison.appendChild(row);
+ });
+ }
+
+ function selectTurn(id) {
+ const turn = turns.find((item) => item.id === id) || turns[2];
+ root.querySelectorAll('[data-turn]').forEach((button) => {
+ const selected = Number(button.dataset.turn) === turn.id;
+ button.classList.toggle('btn-primary', selected);
+ button.setAttribute('aria-pressed', selected ? 'true' : 'false');
+ });
+ q('#route-badge').textContent = `${turn.route} · ${turn.routeReason}`;
+ q('#question').textContent = turn.question;
+ q('#ready-value').textContent = fmt(turn.brainReady);
+ q('#ready-context').textContent = turn.brainReady == null ? 'No delegated router result' : 'Delegated result completion';
+ q('#final-value').textContent = fmt(turn.finalAudio);
+ q('#final-context').textContent = `Turn completes at ${fmt(turn.turnDone)}`;
+ q('#hold-value').textContent = turn.hold > 0 ? `${turn.hold.toFixed(2)} s` : '0 s';
+ q('#hold-context').textContent = turn.hold > 0 ? 'Result ready before interim response ended' : 'No audible interim blocked final delivery';
+ q('#selected-detail').textContent = turn.note;
+ renderDiagram(turn);
+ renderComparison(turn.id);
+ }
+
+ root.querySelectorAll('[data-turn]').forEach((button) => {
+ button.addEventListener('click', () => selectTurn(Number(button.dataset.turn)));
+ });
+ selectTurn(3);
+ })();
+ </script>
+</div>