-
Notifications
You must be signed in to change notification settings - Fork 2
files core monitor alertengine swift 2bd957d1
ventaphobia edited this page Apr 23, 2026
·
1 revision
- Legacy pure alert-evaluation logic retained for tests and possible future alert reintroduction.
- The current UI removed the old alerts screen surface; do not extend this path casually.
| Field | Value |
|---|---|
| Source path | Core-Monitor/AlertEngine.swift |
| Wiki area | Legacy alert system |
| Exists in current checkout | True |
| Size | 27493 bytes |
| Binary | False |
| Line count | 675 |
| Extension | .swift |
Foundation
| Kind | Name | Line |
|---|---|---|
| struct | AlertEvaluationInput |
2 |
| struct | AlertMeasurement |
12 |
| struct | AlertEvaluationOutcome |
22 |
| enum | AlertEvaluator |
30 |
| Commit | Date | Subject |
|---|---|---|
ce9e812 |
2026-04-16 | Fix Xcode 16.2 CI compatibility |
5b96f6f |
2026-04-16 | Fix Xcode 16.2 CI compatibility |
5dc29ed |
2026-04-16 | Add privacy controls and refine Core Monitor presentation |
3c34251 |
2026-04-16 | Refine helper reachability across alerts and menu bar |
1ff7bdb |
2026-04-16 | Refine helper health states and service alerts |
7185d36 |
2026-04-15 | Improve fan control and alert surfaces |
- Prefer focused changes that respect the ownership described above.
- If this file touches helper trust, SMC writes, startup, or permissions, update the relevant support docs and tests.
- If this file is generated or an asset manifest, verify the producing workflow instead of hand-editing generated payloads.
import Foundation
struct AlertEvaluationInput {
let snapshot: SystemMonitorSnapshot
let fanMode: FanControlMode
let helperInstalled: Bool
let helperConnectionState: SMCHelperManager.ConnectionState
let helperStatusMessage: String?
let processInsightsEnabled: Bool
let now: Date
}
struct AlertMeasurement {
let severity: AlertSeverity
let metricValue: Double?
let title: String
let message: String
let context: String?
let isAvailable: Bool
let unavailableReason: String?
}
struct AlertEvaluationOutcome {
let runtime: AlertRuleRuntime
let activeState: AlertActiveState?
let event: AlertEvent?
let shouldNotify: Bool
let availabilityReason: String?
}
enum AlertEvaluator {
static func evaluate(
config: AlertRuleConfig,
runtime: AlertRuleRuntime,
input: AlertEvaluationInput
) -> AlertEvaluationOutcome {
guard config.isEnabled else {
return AlertEvaluationOutcome(
runtime: runtimeReset(from: runtime),
activeState: nil,
- Home
- Start Here
- Product Overview
- Runtime Architecture
- Monitoring Pipeline
- Fan Control
- Privileged Helper
- Touch Bar
- Release Automation
- Security Model
- File Index (279)
- Every Commit (401)
- Chronological Change Log
- Removed Parts
- All Deleted Paths
- Branches And Tags
- Wiki Manifest
- Start Here
- Product Overview
- Source Map
- Runtime Architecture
- App Startup And Lifecycle
- Dashboard Architecture
- Menu Bar Architecture
- Monitoring Pipeline
- Snapshot Trends And Freshness
- CPU GPU Memory Disk Network
- Battery Power And Thermals
- SMC And Apple Silicon
- Fan Control
- Custom Fan Curves
- Privileged Helper
- XPC Trust Boundary
- Helper Diagnostics
- Touch Bar Architecture
- Touch Bar Customization
- Weather And Location
- Privacy And Permissions
- Onboarding And Help
- Legacy Alerts
- Kernel Panic Weird Mode