From 7e7fb52d320add0120525fe5ab881722b0295639 Mon Sep 17 00:00:00 2001 From: Max Gorog Date: Fri, 8 May 2026 16:29:13 -0500 Subject: [PATCH] demo mode: stop synthesizing episode + phase events MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Per the data-ownership scope: collect (episodes-ingested counter), hosts (per-host bars), and db (database explorer) all work fine in or out of demo mode — they read real values from the server's snapshot. Demo mode shouldn't be injecting fake `episode` records into them. Removed both dispatches from demoTick: - `episode` (was 70% per tick) — no longer clobbers collect/hosts/db - `phase` (was 50% per tick) — dead code anyway; baseline now consumes the dataset-derived `phase_mix` event, not raw `phase` demoTick is now just the model_metric jitter (5% per tick) so the sequence-model bars don't sit frozen during a long demo. Co-Authored-By: Claude Opus 4.7 (1M context) --- training/dashboard/static/dashboard.js | 19 +++++++------------ training/dashboard/static/index.html | 2 +- 2 files changed, 8 insertions(+), 13 deletions(-) diff --git a/training/dashboard/static/dashboard.js b/training/dashboard/static/dashboard.js index 275974b..901ad8b 100644 --- a/training/dashboard/static/dashboard.js +++ b/training/dashboard/static/dashboard.js @@ -224,19 +224,14 @@ const demoBtn = document.getElementById('demo-btn'); let demoTimer = null; let demoActive = false; - const HOSTS = ['elliott-lab', 'elliott-thinkpad', 'k-gamingcom']; - const PHASES = ['clean', 'armed', 'infecting', 'infected_running', 'dormant']; + // Demo mode is intentionally narrow: it does NOT synthesize + // `episode` events (those would clobber the real ingest counter, + // host bars, and database explorer — all of which work fine in or + // out of demo mode), and it does NOT synthesize `phase` events + // (the baseline scene reads dataset-derived `phase_mix` instead). + // The only periodic side-effect is occasional model_metric jitter + // so the bars don't sit frozen during a long talk. function demoTick() { - if (Math.random() < 0.7) { - const host = HOSTS[Math.floor(Math.random() * HOSTS.length)]; - dispatch({ type: 'episode', - episode_id: 'demo-' + Math.random().toString(36).slice(2, 12), - host_id: host, size_bytes: 30_000 + Math.random() * 20_000 }); - } - if (Math.random() < 0.5) { - dispatch({ type: 'phase', phase: PHASES[Math.floor(Math.random() * PHASES.length)] }); - } - // Occasionally tweak a model metric so the bars aren't static. if (Math.random() < 0.05) { const m = ['knn', 'rnn', 'gru', 'lstm', 'bert'][Math.floor(Math.random() * 5)]; const base = { knn: 0.736, rnn: 0.872, gru: 0.911, lstm: 0.928, bert: 0.954 }[m]; diff --git a/training/dashboard/static/index.html b/training/dashboard/static/index.html index 2705411..f42aa34 100644 --- a/training/dashboard/static/index.html +++ b/training/dashboard/static/index.html @@ -1314,6 +1314,6 @@ - +