fix(demo): re-anchor seed timestamps so the live dashboard never goes empty#235
Merged
Conversation
… 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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
tryaisoc.com/dashboard) was showing perpetual loading spinners and zero/empty values on the Operations Funnel and Efficiency Report tiles.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 returns200 OKbut with empty result sets._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._run_full_seed(runs on every deploy + the daily cron).--demo-quickstays 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_untilcases: created_at, updated_at, closed_at, assigned_at, sla_deadlinecase_tasks: created_at, due_date, completed_atcase_timeline: created_atremediation_gate_log: created_atTest plan
py_compile+ruff checkpass/api/v1/metrics/funneland/api/v1/metrics/dashboardreturn non-zero values and the dashboard tiles populateMade with Cursor