MacOptimizer Pro is designed with a Clean, Layered, Unidirectional Data Flow (UDF) architecture, ensuring high performance, memory safety, and defense-in-depth protection.
graph TD
subgraph UI ["🎨 SwiftUI Presentation Katmanı"]
Views["MainView / Dashboard / Memory / Cleaner / AppManager / Autonomous / Copilot"]
end
subgraph State ["🧠 State Management"]
AppState["AppState (@MainActor ObservableObject)"]
end
subgraph CoreSecurity ["🛡️ Security & Zero-Harm Engine"]
RiskClassifier["OperationRiskClassifier"]
SafetyEngine["SafetyPolicyEngine"]
Policies["PathProtection / ProcessProtection / AppProtection / LaunchProtection"]
SafeExec["SafeOperationExecutor (Atomic & Trash Fallback)"]
CmdSandbox["SandboxedCommandRunner (Whitelisted Executables)"]
end
subgraph CoreTelemetry ["📊 Observability & Telemetry"]
SysMon["SystemMonitorService (Mach host_statistics64 & sysctl)"]
TelemetryStore["TelemetryStore (SQLite WAL Time-Series)"]
end
subgraph AIPlatform ["🤖 AI & Diagnostics Platform"]
AIProvider["AIProvider Protocol"]
Heuristics["LocalHeuristicProvider (Offline)"]
Ollama["OllamaProvider (Local LLM)"]
NIM["NvidiaNIMProvider (Enterprise Cloud)"]
OpenAI["OpenAICompatibleProvider (Custom Endpoints)"]
end
subgraph Operations ["⚙️ Domain Operations"]
CleaningPlan["CleaningPlan Engine (Dry-Run Lifecycle)"]
AppScanner["AppScannerService (Mach-O Binary Parser)"]
Uninstaller["AppUninstallerService (Orphan File Hunter)"]
Updates["AppUpdateCheckerService (Sparkle & Homebrew)"]
Watchdog["AutonomousGuardService (Background Healer)"]
end
Views --> AppState
AppState --> CoreTelemetry
AppState --> AIPlatform
AppState --> Operations
Operations --> CoreSecurity
CoreSecurity --> Darwin["Darwin Mach Kernel & macOS FileSystem"]
- SwiftUI + Liquid Glass Design System: Dynamic blurred backgrounds, responsive grids (
LazyVGridwithGridItem(.adaptive(minimum: ...))), and smart toolbar folding withViewThatFits. - Zero UI Lag: All telemetry computations, directory tree scanning, and network requests are executed on background actors.
@MainActor ObservableObjectthat acts as the single source of truth for navigation, live gauges, AI recommendations, watchdog alarms, and background scan progress.
OperationRiskClassifier: Classifies operations into.safe,.low,.medium,.destructive, and.forbidden.PathProtectionPolicy: Canonicalizes paths withURL.resolvingSymlinksInPath()and protects system roots and user personal directories.ProcessProtectionPolicy: Shields PID 0/1 and 35+ critical macOS daemons from being killed.SafeOperationExecutor: Governs actual file removals and process termination.
SystemMonitorService: Reads Mach VM statistics (host_statistics64) and kernel sysctl values in microseconds with near-zero CPU and battery footprint.TelemetryStore: Embedded SQLite database operating in WAL (Write-Ahead Logging) mode for thread-safe downsampled historical metrics.
- Completely decoupled from raw system commands. AI generates structured
AIInsightandAIActionrecommendations which must pass through theSafetyPolicyEngineand require user confirmation before execution.