{"modulePath":"github.com/txn2/mcp-data-platform","version":"v1.172.0","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package alertwire\n\nPackage alertwire assembles the platform's own alerts from the stores the platform holds (#803, #1694, #1724): the review-queue staleness check, the connection-revocation alert and its escalation, the scheduled-run failure alert's channels, and the admin API's view of all three beside the notification settings.\n\nIt was split from notifywire, which assembles the delivery substrate the alerts send through: the two share the delivery handle and nothing of each other's.\n\n## Constants\n\n```go\nconst EnvConnAlertInterval = \"MCP_PLATFORM_CONNECTION_ALERT_INTERVAL\"\n```\nEnvConnAlertInterval overrides how often an open connection revocation is checked for escalation (default every minute, connalert.DefaultSweepInterval), as a Go duration; an environment knob for the same reason (#2232).\n\n```go\nconst EnvReviewAlertInterval = \"MCP_PLATFORM_REVIEW_ALERT_INTERVAL\"\n```\nEnvReviewAlertInterval overrides how often the review queue is checked (default hourly), as a Go duration. It is an environment knob beside the other MCP\\_PLATFORM\\_\\* cadences rather than YAML: the hourly default is right for every deployment, and the knob exists so a local stack can be proved against in seconds rather than an hour.\n\n## Functions\n\n```go\nfunc AdminDeps(deps *admin.Deps, p *platform.Platform, notify *notifydelivery.Handle)\n```\nAdminDeps fills the admin API's notification dependencies: the SMTP settings and test send, the delivery history, the three alerts' settings, and the notification channels with their test send and activity. Every accessor is nil-safe, so a deployment with no database leaves the routes that need them unregistered.\n\n```go\nfunc BuildApprovalAlert(p *platform.Platform, notify *notifydelivery.Handle) *reviewalert.Checker\n```\nBuildApprovalAlert assembles the scheduled approvals queue staleness check (#2437), or nil when anything it needs is absent.\n\n```go\nfunc BuildReviewAlert(p *platform.Platform, notify *notifydelivery.Handle) *reviewalert.Checker\n```\nBuildReviewAlert assembles the scheduled knowledge review-queue staleness check. Returns nil (a no-op checker) when anything it needs is absent: no database, notifications off, no knowledge insight store -- an alert with nowhere to send is not an alert.\n\n```go\nfunc ConnAlertSettings(p *platform.Platform) connalert.SettingsStore\n```\nConnAlertSettings narrows the store to the half the admin settings surface needs, or nil when the alert cannot exist here. A nil result unmounts the admin routes: an operator must not be able to name recipients for an alert nothing will ever send. The explicit nil check keeps a typed nil out of the interface.\n\n```go\nfunc ConnAlertStore(p *platform.Platform) *connalert.PostgresStore\n```\nConnAlertStore builds the connection-revocation alert's persistence (#1694), or nil when the alert cannot exist in this deployment: no database, or notifications turned off in YAML. Like the review alert's store it is stateless over the pool, so the admin API and the sweep each build one rather than sharing a handle whose lifecycle it does not have.\n\n```go\nfunc ReviewAlertSettings(p *platform.Platform, target reviewalert.Target) reviewalert.SettingsStore\n```\nReviewAlertSettings narrows one queue's store to the half the admin settings surface needs, or nil when the alert cannot exist here. A nil result unmounts the admin routes, matching what the SMTP section already does in the same states: an operator must not be able to configure an alert nothing will ever send. The explicit nil check keeps a typed nil out of the interface.\n\n```go\nfunc ScriptRunAlertSettings(p *platform.Platform) scriptalert.SettingsStore\n```\nScriptRunAlertSettings is the scheduled-run failure alert's channel list (#1724), or nil when the alert cannot exist here. The explicit nil check keeps a typed nil out of the interface.\n\n```go\nfunc StartReviewAlerts(ctx context.Context, p *platform.Platform, notify *notifydelivery.Handle) func()\n```\nStartReviewAlerts starts the review-queue staleness checks, knowledge (#803) and approvals (#2437), and returns what stops them.\n\n```go\nfunc WireConnRevocationAlert(p *platform.Platform, notify *notifydelivery.Handle) *connalert.Escalator\n```\nWireConnRevocationAlert tells the auth-event writer where to announce a discarded credential (#1694), and returns the sweep that escalates one nobody has acted on. Both are nil when the alert cannot exist here.\n\nThe writer is built with the token store, long before the notification substrate exists, so the sink is attached here rather than at construction. It is the one dependency every connoauth.Source already carries, which is why the announcement rides it instead of being threaded a second time through every toolkit that wires OAuth.\n\n","path":"github.com/txn2/mcp-data-platform/internal/httpserver/alertwire","name":"alertwire","synopsis":"Package alertwire assembles the platform's own alerts from the stores the platform holds (#803, #1694, #1724): the review-queue staleness check, the connection-revocation alert and its escalation, the scheduled-run failure alert's channels, and the admin API's view of all three beside the notification settings.","isRedistributable":true}
