feat(audit): Batch 24 — one validate-and-coerce schema layer for settings (CC9)

zod field schemas in settingsSchema.ts replace setSettings' bespoke
per-key switch: parse → skip-on-fail → store, side effects (secret
encryption, launch-at-startup sync) kept in settings.ts. sanitizeOptions
extracted to settingsOptions.ts to break the import cycle; backup import
flows through the same schema. Field-by-field parity pinned in
test/settingsSchema.test.ts (15 tests); full suite unchanged.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
2026-07-02 12:41:00 -04:00
parent 6abed2064d
commit 8f6b2a761b
7 changed files with 330 additions and 197 deletions
+1
View File
@@ -40,6 +40,7 @@
"electron-store": "^11.0.2",
"react": "^19.2.7",
"react-dom": "^19.2.7",
"zod": "^4.4.3",
"zustand": "^5.0.14"
},
"devDependencies": {