Skip to content

fix(demo): re-anchor seed timestamps so the live dashboard never goes empty#235

Merged
beenuar merged 2 commits into
mainfrom
fix/demo-seed-reanchor-timestamps
May 29, 2026
Merged

fix(demo): re-anchor seed timestamps so the live dashboard never goes empty#235
beenuar merged 2 commits into
mainfrom
fix/demo-seed-reanchor-timestamps

Conversation

@beenuar

@beenuar beenuar commented May 29, 2026

Copy link
Copy Markdown
Owner

Summary

  • The hosted demo dashboard (tryaisoc.com/dashboard) was showing perpetual loading spinners and zero/empty values on the Operations Funnel and Efficiency Report tiles.
  • Root cause: the demo seed (seed_demo.py) is idempotent. Once the dataset exists, its timestamps freeze at first-seed time and age out of the rolling 24h / 7d / 30d windows that the dashboard, funnel, and SOC-performance queries filter on. The API returns 200 OK but with empty result sets.
  • Fix: add a non-destructive _reanchor_demo_data() step that slides every demo timestamp forward so the newest alert lands at "now". It preserves all rows, IDs, relationships, and relative event spacing. NULL timestamps stay NULL.
  • Wired into _run_full_seed (runs on every deploy + the daily cron). --demo-quick stays byte-stable for screencasts. A 30-minute floor skips churn on fresh seeds.

Tables / columns re-anchored

  • alerts: created_at, updated_at, event_time, first_seen, last_seen, first_seen_at, resolved_at, assigned_at, snoozed_until
  • cases: created_at, updated_at, closed_at, assigned_at, sla_deadline
  • case_tasks: created_at, due_date, completed_at
  • case_timeline: created_at
  • remediation_gate_log: created_at

Test plan

  • py_compile + ruff check pass
  • CI green
  • After deploy: confirm /api/v1/metrics/funnel and /api/v1/metrics/dashboard return non-zero values and the dashboard tiles populate

Made with Cursor

Beenu Arora and others added 2 commits May 28, 2026 19:01
… live

The hosted demo seed is idempotent, so once the dataset exists its
timestamps freeze at first-seed time and age out of the rolling 24h/7d/30d
windows that drive the dashboard, funnel, and SOC-performance queries. After
~24h the Operations Funnel and Efficiency tiles return zero/empty and the
console shows perpetual loading spinners.

Add a non-destructive _reanchor_demo_data() step that slides every demo
timestamp (alerts, cases, case_tasks, case_timeline, remediation_gate_log)
forward so the newest alert lands at "now", preserving all IDs, relationships,
and relative event spacing. Wired into _run_full_seed (which runs on every
deploy and the daily cron); --demo-quick stays byte-stable for screencasts.
A 30-minute floor skips pointless churn on fresh seeds.

Co-authored-by: Cursor <cursoragent@cursor.com>
Collapse the wrapped scalar()/join() calls onto single lines to match the
repo-root ruff.toml line length. Fixes the Python Lint & Type-check CI gate.

Co-authored-by: Cursor <cursoragent@cursor.com>
@beenuar beenuar merged commit 6d48067 into main May 29, 2026
26 checks passed
@beenuar beenuar deleted the fix/demo-seed-reanchor-timestamps branch May 29, 2026 02:10
@beenuar beenuar mentioned this pull request May 30, 2026
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant