feat: implement alert simulation sandbox#600
Merged
Mosas2000 merged 1 commit intoJun 17, 2026
Merged
Conversation
Closes StellaBridge#590 Adds a safe sandbox where operators can test alert routing rules against synthetic data before enabling them in production. Backend: - POST /api/v1/admin/alert-routing/simulate dry-runs the routing evaluation logic for all active rules without dispatching anything. Returns per-rule match results with human-readable reasons and a summary (wouldDispatch, effectiveChannels, suppressionWindow). Frontend: - AlertSimulationSandbox page at /alert-sandbox with a two-panel layout. - Left panel: admin token input, six scenario presets (critical bridge failure, token exploit, TVL anomaly, reserve drift, gas spike, maintenance), and a full parameter form (severity, assetCode, sourceType, metric, triggered value, threshold, owner, run label). - Right panel: Results tab showing summary cards, effective channels, per-rule breakdown with match/no-match indicators and condition explanations, inactive-rule disclosure; History tab listing past runs stored in localStorage (up to 20), clickable to restore. - useAlertSimulation hook manages API calls, error state, and localStorage persistence of simulation history. - Nav entry added to the Operations group in MobileNav navigation.ts and route registered in App.tsx.
Contributor
|
Nice flow, checked it all! |
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.
What was done
Added a complete alert simulation sandbox that lets operators safely test routing rules against synthetic data before enabling them in production. No real alerts are dispatched during simulation.
Backend —
POST /api/v1/admin/alert-routing/simulateownerAddress)Frontend —
AlertSimulationSandboxpage at/alert-sandboxLeft panel — configuration:
Right panel — Results tab:
Right panel — History tab:
localStorageviauseAlertSimulationhookNavigation
navigation.tsApp.tsxTest plan
/alert-sandbox— page renders with preset buttons and input formsuppressionWindowSeconds > 0Closes #590