| name | maintain-settings |
| description | Maintain persisted AppSettings, closed model catalogs, migration/recovery, thinking and Live controls, privacy disclosure, and settings UI wiring. Use when changing preferences, catalog entries, storage keys, or settings accessibility. |
Maintain Settings
Role and boundary
Keep src/settings.ts as the typed configuration source of truth and main.ts as its UI adapter. Persist only curated, validated values; native Rust remains authoritative for aliases, artifacts, endpoints, and runtime policy.
Source map
src/settings.ts: closed AssistantProviderId, AssistantModelId, VoiceInputModelId, VoiceOutputModelId, AppSettings v10, modelCatalog, defaults, ranges, migrations, recovery, persistence, and snapshotAssistantRoute.
src/assistant-provider-settings.ts: wireAssistantModelSetting, provider transition settlement, ChatGPT account lifecycle, and OpenRouter key lifecycle; src/main.ts: remaining preferences/model/Live controls, thinking controls, and Settings markup.
src/chatgpt-models.ts, src/chatgpt-account.ts, src/privacy-disclosure.ts: fixed ChatGPT model/effort choices, account reconciliation, and disclosure aria-expanded/hidden behavior.
src-tauri/src/models.rs, src-tauri/src/lib.rs: closed native IDs, command deserialization, and state registration; src/style.css: settings controls and responsive layout.
tests/settings.test.ts, tests/settings-headings.test.ts, tests/chatgpt-models.test.ts, and tests/privacy-disclosure.test.ts: catalog, migration, range, and disclosure contracts.
Cover
- Preserve exactly seven curated local model entries, typed IDs, current defaults, v10 storage key, and strict validation. Normalize legacy Pocket Bria to Alba while preserving valid fields; recover invalid/obsolete records to current defaults without reviving stale values.
- Keep Local as the default privacy route and experimental ChatGPT as explicit opt-in; keep system prompt scalar-bounded, verbosity closed, tool toggles/call budget bounded 1–5, and Live sensitivity/pause/minimum-utterance ranges stepped.
- Render settings options with DOM APIs and
textContent; present the fixed ChatGPT Luna model only after explicit account opt-in, retain unavailable saved IDs visibly, and never silently substitute a selected model.
- Snapshot settings at operation admission: generation, voice preparation/recording, Chat speech, and Live must not change when the user edits Settings. Keep the four-level thinking control and provider barrier behavior intact.
- Inspect current source and migrations before adding a field; update TypeScript and Rust closed IDs together. Never accept raw provider JSON, endpoints, paths, or credentials from the WebView.
Validate and accept
- Run
bun test tests/settings.test.ts tests/settings-headings.test.ts tests/chatgpt-models.test.ts tests/privacy-disclosure.test.ts.
- Run
git diff --check against the actual files changed; run just check when the change crosses TypeScript/Rust/build boundaries. Manually exercise storage migration/recovery, disclosure keyboard state, model/effort selection, and active-operation snapshotting.
- Treat real ChatGPT account behavior and packaged Settings accessibility as separate acceptance gates; use
$test-voice-layer-app and $maintain-assistant-providers where appropriate.
Relationships
Hand provider lifecycle to $maintain-assistant-providers, local tool toggles to $maintain-local-tools, voice model controls to $maintain-voice-input/$maintain-voice-output, and Live controls to $maintain-live.