- prune expired recovery items on load/save and reject expired restores at worker boundary - add restoreExpired and restoreConflict protocol/application error mapping - disable expired restore actions in History and reload persisted state after restore failures - add recovery expiry/conflict coverage plus sync protocol, architecture, state-machine, and recovery contract docs - wire AtlasAppTests into the shared Xcode scheme and add app-layer regression coverage for expired restore reload behavior Refs: ATL-221 ATL-222 ATL-223 ATL-224 ATL-225, vibe-kanban SID-9
3.7 KiB
3.7 KiB
Architecture
High-Level Topology
AtlasApp— main macOS application shellAtlasWorkerXPC— non-privileged worker serviceAtlasPrivilegedHelper— allowlisted helper executable for structured destructive actionsAtlasCoreAdapters— wrappers around reusable upstream and local system capabilitiesAtlasStore— persistence for runs, rules, recovery, settings, diagnostics, and the app-language preference
Layering
Presentation
- SwiftUI scenes and views
- Navigation state
- View models or reducers
- App-language selection and locale injection at the app shell
Application
- Use cases such as
StartScan,PreviewPlan,ExecutePlan,RestoreItems - App uninstall flows:
ListApps,PreviewAppUninstall,ExecuteAppUninstall - Settings flows:
GetSettings,UpdateSettings
Domain
FindingActionPlanActionItemTaskRunRecoveryItemRecoveryPayloadAppFootprintPermissionStateAtlasSettingsAtlasLanguage
Infrastructure
- XPC transport
- JSON-backed workspace state persistence
- Recovery-state normalization that prunes expired recovery entries on load/save
- Logging and audit events
- Best-effort permission inspection
- Helper executable client
- Process orchestration
Execution
- Upstream adapters:
MoleHealthAdapter,MoleSmartCleanAdapter - Release and packaged worker flows load upstream shell runtime from bundled
MoleRuntimeresources instead of source-tree paths - Local adapters:
MacAppsInventoryAdapter - Recovery-first state mutation for Smart Clean and app uninstall flows
- Allowlisted helper actions for bundle trashing, restoration, and launch-service removal
- Release-facing execution must fail closed when real worker/adapter/helper capability is unavailable; scaffold fallback is development-only by opt-in
- Smart Clean now supports a real Trash-based execution path for a safe structured subset of user-owned targets, plus physical restoration when recovery mappings are present
- Restore requests recheck expiry and destination conflicts before side effects, so expired or conflicting recovery items fail closed
Process Boundaries
- UI must not parse shell output directly.
- UI must not execute privileged shell commands directly.
AtlasWorkerXPCowns long-running task orchestration and progress events.- Direct-distribution builds default to the same real worker implementation in-process;
AtlasWorkerXPCremains available behindATLAS_PREFER_XPC_WORKER=1for explicit runtime validation. AtlasPrivilegedHelperaccepts structured actions only and validates paths before acting.- Persistent workspace mutation belongs behind the repository/worker boundary rather than ad hoc UI state.
- UI copy localization is sourced from structured package resources instead of hard-coded per-screen strings.
Distribution Direction
- Distribution target:
Developer ID + Hardened Runtime + Notarization - Initial release target: direct distribution, not Mac App Store
- Native packaging currently uses
xcodegen + xcodebuild, embeds the helper intoContents/Helpers/, and emits.zip,.dmg, and.pkgdistribution artifacts. - Local internal packaging now prefers a stable non-ad-hoc app signature when a usable identity is available, so macOS TCC decisions can survive rebuilds more reliably during development.
- If Apple release certificates are unavailable, Atlas can fall back to a repo-managed local signing keychain for stable app-bundle identity; public release artifacts still require
Developer ID.
Security Principles
- Least privilege by default
- Explain permission need before request
- Prefer
Trashor recovery-backed restore paths - Audit all destructive actions