{"ok":true,"service":"provider-health-latency-alert-readiness","mode":"latency-alert-readiness-layer","timestamp":"2026-06-26T15:10:13.515Z","latencyWatchDependency":{"latencyWatchReady":true,"alertingEnabled":false,"trendPersistenceEnabled":false,"totalProviders":9,"thresholds":{"excellentMs":250,"healthyMs":750,"watchMs":1000,"warningMs":1500,"criticalMs":3000}},"summary":{"totalRules":10,"ready":3,"reviewRequired":7,"blocked":0,"totalCandidateTypes":5,"candidateReady":0,"candidateReviewRequired":5,"latencyAlertReadinessReady":false,"automaticAlertingAllowed":false,"trendPersistenceRequired":true,"founderApprovalRequired":true,"productionMutation":false,"reason":"Latency alert readiness is intentionally not active until repeated-sample rules, cooldown windows, trend persistence, founder-approved channels, and recovery handoff boundaries are finalized."},"alertCandidateTypes":[{"candidate":"watch-streak","status":"review-required","severity":"notice","condition":"Repeated watch-zone latency across a short window.","example":"3 samples above watchMs within 5 minutes.","action":"Show cockpit notice only."},{"candidate":"warning-streak","status":"review-required","severity":"warning","condition":"Repeated warning-zone latency across a short window.","example":"2 samples above warningMs within 5 minutes.","action":"Show cockpit warning and recommend investigation."},{"candidate":"critical-spike","status":"review-required","severity":"critical","condition":"Critical latency on a Critical provider route.","example":"1 sample above critical threshold on system-heartbeat or command-center-status.","action":"Founder-visible escalation candidate."},{"candidate":"critical-route-drag","status":"review-required","severity":"warning","condition":"Multiple Critical provider routes remain in watch/warning zone together.","example":"3 Critical routes over watchMs during same polling window.","action":"Recommend cockpit load review."},{"candidate":"systemic-latency-drag","status":"review-required","severity":"warning","condition":"Most provider routes enter watch or warning zone together.","example":"6+ of 9 routes above watchMs.","action":"Recommend polling optimization or provider performance review."}],"rules":[{"rule":"Repeated Watch Events Required","status":"review-required","purpose":"A single watch-level latency event should not automatically alert. Alerts should require repeated watch-zone samples across a defined window.","futureTrigger":"3 watch samples within 5 minutes","safeguard":"Prevents noisy alerts from one-off slow responses."},{"rule":"Warning Streak Escalation","status":"review-required","purpose":"Warning-level latency should become an escalation candidate when it persists across repeated checks.","futureTrigger":"2 warning samples within 5 minutes","safeguard":"Healthy-but-slow routes get attention before they become failures."},{"rule":"Critical Spike Escalation","status":"review-required","purpose":"Critical latency should be eligible for immediate founder-visible escalation if it affects a critical route.","futureTrigger":"1 critical sample on Critical route or 2 critical samples on High route","safeguard":"Critical control surfaces should not drag silently."},{"rule":"Criticality Weighting","status":"ready","purpose":"Critical provider routes should have stronger alert sensitivity than high-priority routes.","futureTrigger":"Critical routes escalate faster than High routes.","safeguard":"Founder control and safe-mode surfaces stay prioritized."},{"rule":"Cooldown Window Required","status":"review-required","purpose":"Latency alerts need cooldown windows so the cockpit does not spam repeated warnings.","futureTrigger":"minimum 10 minute cooldown per provider/endpoint/classification","safeguard":"Alert fatigue kills operator trust."},{"rule":"No Secret Capture","status":"ready","purpose":"Latency alert readiness may reference provider names, endpoints, timings, and classifications only.","futureTrigger":"never store request payloads, tokens, cookies, credentials, or private logs","safeguard":"Performance monitoring must not become secret collection."},{"rule":"Trend Persistence Dependency","status":"review-required","purpose":"Reliable alerting needs trend history, but trend persistence must wait for audit persistence and redaction readiness.","futureTrigger":"append-only redacted trend store approved","safeguard":"No database write path until governance allows it."},{"rule":"Founder-Approved Alert Channels","status":"review-required","purpose":"Notification channels must be approved before alerts are sent externally.","futureTrigger":"approved channels: cockpit only, email, SMS, Slack, webhook, or future TheoB notification rail","safeguard":"No surprise outbound notifications."},{"rule":"Recommendation Only Until Activated","status":"ready","purpose":"This layer can recommend alert readiness but cannot send alerts or mutate providers.","futureTrigger":"manual founder activation required","safeguard":"Observation and recommendation are not execution."},{"rule":"Recovery Routing Handoff Boundary","status":"review-required","purpose":"Latency alerts may suggest recovery routing, but cannot trigger recovery actions until authority gates are ready.","futureTrigger":"alert-to-recovery handoff requires founder authority confirmation","safeguard":"Slow route detection cannot become automatic production mutation."}],"criticalMissing":["Repeated Watch Events Required","Warning Streak Escalation","Critical Spike Escalation","Cooldown Window Required","Trend Persistence Dependency","Founder-Approved Alert Channels","Recovery Routing Handoff Boundary"],"allowedNow":["Render latency alert readiness status.","Define future latency alert trigger candidates.","Show repeated watch/warning/critical escalation rules.","Keep alerting disabled.","Keep trend persistence disabled.","Use latency watch output manually for review."],"notAllowedYet":["Send automatic latency alerts.","Persist latency trend history.","Trigger recovery routing automatically.","Auto-disable providers.","Send outbound notifications.","Store request payloads, secrets, cookies, tokens, credentials, or private logs."],"futureAlertEventShape":{"latencyAlertId":"stable latency alert id","provider":"safe provider label","endpoint":"safe route label","criticality":"Critical/High/Medium/Low","severity":"notice/warning/critical","candidateType":"watch-streak/warning-streak/critical-spike/critical-route-drag/systemic-latency-drag","sampleWindow":"5m/15m/1h","sampleCount":"number","maxLatencyMs":"number","p95LatencyMs":"number","cooldownStatus":"eligible/in-cooldown","recommendedAction":"safe text recommendation","createdAt":"ISO timestamp","productionMutation":"false","redactionStatus":"redacted-safe"},"futureNotificationShape":{"notificationId":"stable notification id","latencyAlertId":"linked latency alert id","channel":"cockpit/email/sms/slack/webhook/theob-notification-rail","recipientScope":"founder/operator/reviewer","deliveryStatus":"queued/sent/failed/suppressed","cooldownApplied":"true/false","createdAt":"ISO timestamp"},"safeguard":"Provider Health Latency Alert Readiness Layer is read-only and non-destructive. It does not send alerts, persist trend history, mutate production, expose secrets, disable providers, or execute recovery actions."}