You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(security): US4 collapse scan-notification storm into one settled event (Spec 077, MCP-2207) (#794)
* feat(security): debounce scan notifications into one settled event per server
Related #786
Spec 077 US4 (MCP-2207): the security-scan notification storm came from
per-scanner scan_started/progress/completed/failed SSE events multiplied by
reconnect storms (prior partial fixes: #659, MCP-2223). Replace those per-scanner
lifecycle emissions with a single debounced security.scan_settled event per
server per scan.
## Changes
- Add scanNotifyDebouncer (internal/runtime/scan_notify.go): terminal-triggered
per-server debounce with a generation counter guarding the AfterFunc race;
only completed/failed arm the timer, started/progress are dropped.
- Add EventTypeSecurityScanSettled; route runtime EmitSecurityScan* through the
debouncer (started/progress become no-ops, completed/failed record terminal
state) and publish one settled event carrying the terminal findings summary.
- Wire scanNotify (750ms) into newRuntime alongside the existing coalescer.
- Collapse the activity log to one handleSecurityScanSettled record per scan,
removing the former started/completed/failed handlers.
## Testing
- scan_notify_test.go: a reconnect storm across N servers yields <= N settled
events (exactly one per server) and zero per-scanner lifecycle events;
settled event carries the terminal summary.
Related: Spec 077 (specs/077-scanner-simplification)
* feat(web-ui): consume debounced scan.settled event; drop per-scanner lifecycle
Related #786
Spec 077 US4 (MCP-2207): forward the new security.scan_settled SSE event from the
system store as a mcpproxy:scan-settled window event, and have
useSecurityScannerStatus refresh its cached scan totals off that single settled
signal instead of tracking per-scanner lifecycle events.
## Changes
- stores/system.ts: add a security.scan_settled SSE listener that dispatches
mcpproxy:scan-settled.
- composables/useSecurityScannerStatus.ts: register a module-scope
mcpproxy:scan-settled listener that triggers a status refresh.
## Testing
- frontend vue-tsc --noEmit clean; vite build succeeds.
Related: Spec 077 (specs/077-scanner-simplification)
0 commit comments