refactor(settings): declare settings once and admit them per setting

TH
38m ago
+1480-1779

Summary

settings now declares every setting once and lets admission check support per setting.

  • One table. contracts/src/settings-catalog.ts holds each setting's forms, app source, app scope and help. CLI/daemon parsing (one parser), usage, the invalid-args message, settingsAppScope, the client type, the MCP setting enum and settings --help derive from it.
  • Per-setting admission. Owners declare settingsRuntimeOperationFacts({ target, unsupported, write, read }); admission checks the requested setting before binding, so a refusal never expires the ref frame. Each owner's fact record is keyed by the setting list its dispatch switch is exhaustive over, so the two cannot drift. This removes the daemon's pre-admission refusals and the Apple leaf guards (ADR 0019 note added).
  • pollUntilSettled in host-kit/retry replaces the Android alert and fill-verification loops.

Public changes (CHANGELOG): an unserved setting answers UNSUPPORTED_OPERATION with the owner's reason, replacing macOS INVALID_ARGS and setting-unsupported-on-leaf; the parser refuses a permission action or mode its target does not take and stray extra arguments; Android alert wait 0 reports a visible alert.

agent-device settings wifi on --platform macos   # UNSUPPORTED_OPERATION, reason unsupported-platform-leaf

51 files, +1480/āˆ’1779: over the 2,500-line gross guide; one migration kept as one PR on request, net āˆ’299.

Validation

  • pnpm check:affected --run passed at 38bfc3a60.
  • Live run at 38bfc3a60 on an Android 15 emulator, an iPhone 17 Pro simulator (iOS 27.0) and the macOS host; transcript in the PR comments.

šŸ¤– Generated with Claude Code