# frs0n/gestaltedit architecture

> Architecture diagram of the GitHub repository frs0n/gestaltedit, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-28). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/frs0n/gestaltedit
- Repository: https://github.com/frs0n/gestaltedit

## Overview

GestaltEdit is an on-device iOS/iPadOS utility for changing MobileGestalt capabilities and fields, with backup, import, export, and restore. The main workflow is user edits or selects presets in the UI, the view model stages changes, and GestaltAccess reads, writes, and verifies the system plist; backups preserve the original data. A separate launch-time command supports setting the Siri AI US-region values. Some source excerpts are partial, so uncertain UI-to-respring wiring is omitted.

Main entry points: [`GestaltEdit/GestaltViewModel.swift`](https://github.com/frs0n/gestaltedit/blob/main/GestaltEdit/GestaltViewModel.swift) (Workflow state), [`GestaltEdit/GestaltAccess.m`](https://github.com/frs0n/gestaltedit/blob/main/GestaltEdit/GestaltAccess.m) (Gestalt access), [`GestaltEdit/AutomationCommand.swift`](https://github.com/frs0n/gestaltedit/blob/main/GestaltEdit/AutomationCommand.swift) (Region command), [`GestaltEdit/GestaltBackupStore.swift`](https://github.com/frs0n/gestaltedit/blob/main/GestaltEdit/GestaltBackupStore.swift) (Backup store)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_presentation["App interface"]
  node_app["App entry"]
  node_ui["Tabbed editor<br/>[ContentView.swift]"]
end

subgraph group_editing["Gestalt editing"]
  node_viewmodel["Workflow state"]
  node_tweaks["Preset catalog"]
  node_models["Plist and values"]
end

subgraph group_persistence["System and backups"]
  node_access["Gestalt access<br/>[GestaltAccess.m]"]
  node_badquery["Access lease<br/>[BadQueryBridge.m]"]
  node_backupstore[("Backup store")]
end

subgraph group_operations["Automation and respring"]
  node_automation["Region command"]
  node_respring["Respring view"]
end

node_user(("Device user"))
node_systemplist[("MobileGestalt plist")]
node_backupfiles[("Backup files")]
node_ios["iOS services"]

node_user -->|"edits and selects"| node_ui
node_app -->|"creates state"| node_viewmodel
node_app -->|"checks arguments"| node_automation
node_ui -->|"dispatches actions"| node_viewmodel
node_viewmodel -->|"reads and saves"| node_access
node_viewmodel -->|"applies presets"| node_tweaks
node_viewmodel -->|"updates plist values"| node_models
node_viewmodel -->|"manages backups"| node_backupstore
node_access -->|"acquires lease"| node_badquery
node_badquery -->|"queries container"| node_ios
node_access -->|"reads and writes"| node_systemplist
node_access -->|"uses system APIs"| node_ios
node_backupstore -->|"stores and lists"| node_backupfiles
node_automation -->|"reads and saves"| node_access
node_automation -->|"creates backup"| node_backupstore
node_viewmodel -->|"respring state"| node_respring

click node_app "https://github.com/frs0n/gestaltedit/blob/main/GestaltEdit/GestaltEditApp.swift"
click node_ui "https://github.com/frs0n/gestaltedit/blob/main/GestaltEdit/ContentView.swift"
click node_viewmodel "https://github.com/frs0n/gestaltedit/blob/main/GestaltEdit/GestaltViewModel.swift"
click node_tweaks "https://github.com/frs0n/gestaltedit/blob/main/GestaltEdit/GestaltTweaks.swift"
click node_models "https://github.com/frs0n/gestaltedit/blob/main/GestaltEdit/GestaltModels.swift"
click node_access "https://github.com/frs0n/gestaltedit/blob/main/GestaltEdit/GestaltAccess.m"
click node_badquery "https://github.com/frs0n/gestaltedit/blob/main/GestaltEdit/BadQueryBridge.m"
click node_backupstore "https://github.com/frs0n/gestaltedit/blob/main/GestaltEdit/GestaltBackupStore.swift"
click node_automation "https://github.com/frs0n/gestaltedit/blob/main/GestaltEdit/AutomationCommand.swift"
click node_respring "https://github.com/frs0n/gestaltedit/blob/main/GestaltEdit/NeoSpringView.swift"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_app,node_ui,node_user toneBlue
class node_viewmodel,node_tweaks,node_models,node_systemplist,node_backupfiles toneAmber
class node_access,node_badquery,node_backupstore toneMint
class node_automation,node_respring toneRose
class node_ios toneIndigo
```

## Components

### App interface

- [App entry](https://github.com/frs0n/gestaltedit/blob/main/GestaltEdit/GestaltEditApp.swift): `GestaltEdit/GestaltEditApp.swift`
- [Tabbed editor](https://github.com/frs0n/gestaltedit/blob/main/GestaltEdit/ContentView.swift): `GestaltEdit/ContentView.swift`

### Gestalt editing

- [Workflow state](https://github.com/frs0n/gestaltedit/blob/main/GestaltEdit/GestaltViewModel.swift): `GestaltEdit/GestaltViewModel.swift`
- [Preset catalog](https://github.com/frs0n/gestaltedit/blob/main/GestaltEdit/GestaltTweaks.swift): `GestaltEdit/GestaltTweaks.swift`
- [Plist and values](https://github.com/frs0n/gestaltedit/blob/main/GestaltEdit/GestaltModels.swift): `GestaltEdit/GestaltModels.swift`

### System and backups

- [Gestalt access](https://github.com/frs0n/gestaltedit/blob/main/GestaltEdit/GestaltAccess.m): `GestaltEdit/GestaltAccess.m`
- [Access lease](https://github.com/frs0n/gestaltedit/blob/main/GestaltEdit/BadQueryBridge.m): `GestaltEdit/BadQueryBridge.m`
- [Backup store](https://github.com/frs0n/gestaltedit/blob/main/GestaltEdit/GestaltBackupStore.swift): `GestaltEdit/GestaltBackupStore.swift`

### Automation and respring

- [Region command](https://github.com/frs0n/gestaltedit/blob/main/GestaltEdit/AutomationCommand.swift): `GestaltEdit/AutomationCommand.swift`
- [Respring view](https://github.com/frs0n/gestaltedit/blob/main/GestaltEdit/NeoSpringView.swift): `GestaltEdit/NeoSpringView.swift`

### Other components

- **Device user**
- **MobileGestalt plist**
- **Backup files**
- **iOS services**

## Connections

- Device user → Tabbed editor: edits and selects
- App entry → Workflow state: creates state
- App entry → Region command: checks arguments
- Tabbed editor → Workflow state: dispatches actions
- Workflow state → Gestalt access: reads and saves
- Workflow state → Preset catalog: applies presets
- Workflow state → Plist and values: updates plist values
- Workflow state → Backup store: manages backups
- Gestalt access → Access lease: acquires lease
- Access lease → iOS services: queries container
- Gestalt access → MobileGestalt plist: reads and writes
- Gestalt access → iOS services: uses system APIs
- Backup store → Backup files: stores and lists
- Region command → Gestalt access: reads and saves
- Region command → Backup store: creates backup
- Workflow state → Respring view: respring state
