Core Application Architecture & Objective-C/SwiftUI Bridging Foundation #1
Notifications
Due Date
No due date set.
Blocks
#2 SMC Interface Engine (AppleSMC IOKit Client)
gronod/MacMonitor
#5 Host CPU Core Utilization, Frequency & Throttle Monitoring
gronod/MacMonitor
#6 Kernel Context Switching, Interrupts & System Call Counters
gronod/MacMonitor
#7 System Load Averages & Thread/Task Concurrency Telemetry
gronod/MacMonitor
#8 RAM Breakdown, Compression & Memory Pressure Monitoring
gronod/MacMonitor
#9 Storage Volumes, APFS Containers & Capacity Telemetry
gronod/MacMonitor
#11 Live Process Explorer & Resource Attribution Table
gronod/MacMonitor
#13 Screen Brightness & Display Hardware Management
gronod/MacMonitor
#14 Intel Integrated GPU & AMD Discrete GPU Telemetry
gronod/MacMonitor
#15 Real-Time Network Bandwidth & Interface Throughput
gronod/MacMonitor
#17 MacBook Battery Health, Cycle Count & Power Adapter Telemetry
gronod/MacMonitor
#20 Connected Peripherals & Bus Topology (USB, Thunderbolt, PCIe)
gronod/MacMonitor
#21 Audio Input/Output Device Status & Master Volume Monitor
gronod/MacMonitor
#22 Status Bar / Menu Bar Extra & Quick-Glance Popover
gronod/MacMonitor
#23 Historical Rolling Trend Charts (Swift Charts Engine)
gronod/MacMonitor
#25 Gitea Actions CI/CD Pipeline for Intel macOS Builds
gronod/MacMonitor
Reference: gronod/MacMonitor#1
Reference in New Issue
Block a user
Purpose
Establish the core macOS application architecture combining a SwiftUI presentation layer with an Objective-C low-level telemetry subsystem. This foundation serves as the backbone for all hardware, kernel, and process monitoring features on Intel Mac platforms running macOS 14 Sonoma or higher.
Priority
Critical (Foundation for all telemetry modules and UI)
Dependencies
Scope
x86_64architecture with a minimum deployment target of macOS 14.0 (Sonoma).MacMonitor-Bridging-Header.h) to encapsulate direct interactions with Mach kernel, IOKit, BSD sysctl, and CoreFoundation C APIs.Implementation Suggestions
ObservableObject/@Observableview models.dispatch_source_createtimer) running on dedicated quality-of-service queues (QOS_CLASS_UTILITY) to prevent UI hitching.gronod referenced this issue2026-09-08 10:18:37 +01:00
gronod referenced this issue2026-09-08 10:18:41 +01:00
gronod referenced this issue2026-09-08 10:28:45 +01:00
gronod referenced this issue2026-09-08 10:28:54 +01:00
gronod referenced this issue2026-09-08 10:29:00 +01:00
gronod referenced this issue2026-09-08 10:29:05 +01:00
gronod referenced this issue2026-09-08 10:29:18 +01:00
gronod referenced this issue2026-09-08 10:29:30 +01:00
gronod referenced this issue2026-09-08 10:29:35 +01:00
gronod referenced this issue2026-09-08 10:29:39 +01:00
gronod referenced this issue2026-09-08 10:29:43 +01:00
Technical Implementation Plan & Code Solution
1. Architecture Overview
The application follows a decoupled Unidirectional Data Flow (UDF) pattern:
MMTelemetryProviderprotocol. Each provider interacts with Mach, IOKit, or BSD APIs, returning thread-safe immutable snapshot dictionaries or structs.MMTelemetryCoordinator): A central engine running adispatch_source_ttimer onQOS_CLASS_UTILITY. Gathers snapshots asynchronously and broadcasts to Swift.@Observable/@MainActorstate store (SystemTelemetryStore) receiving snapshots, triggering 60 FPS SwiftUI updates without blocking the main thread.2. Objective-C / Swift Bridging Contracts
MacMonitor-Bridging-Header.hMMTelemetryProvider.h3. Dispatch Coordinator (
MMTelemetryCoordinator.m)4. Swift State Store (
SystemTelemetryStore.swift)5. Verification & Edge Cases
dispatch_source_set_event_handlerblock to release Mach port references and CoreFoundation allocations on each tick.NSWorkspace.willSleepNotificationandNSWorkspace.didWakeNotificationto suspend the timer and reconnect IOKit services cleanly.Implementation Completed (Milestone 1)
The Core Application Architecture & Objective-C/SwiftUI Bridging Foundation has been implemented in commit
4dedf17on branchfeat/1-core-architectureand merged intomilestone/m1-foundation(commit558a19f).Delivered Components:
project.yml): Declarative XcodeGen configuration for Intelx86_64macOS 14+ targets.MacMonitor.entitlements): Configured hardened runtime and disabled App Sandbox for low-level IOKit and Mach kernel access.MacMonitor-Bridging-Header.h): Exposing core contracts and domain models to Swift.MMTelemetryDomain.h,MMTelemetryProvider.h,MMTelemetryCoordinator.m): Central Grand Central Dispatch timer source executing on serialcom.i3omb.macmonitor.telemetry(QOS_CLASS_UTILITY) with scoped@autoreleasepool.SystemTelemetryStore.swift): Modern Swift@Observablestate repository ingesting background snapshots and publishing to SwiftUI.ContentView.swift,MacMonitorApp.swift): Real-time system identity card, coordinator engine controls, and provider health monitors.MacMonitorTests.swift): Verified coordinator timer lifecycle and domain conversions.