Skip to content

Policy: an organisation's profile pins the engine, forces polish, the learner and update checks, Clipboard mode - #119

Merged
dinooo13 merged 1 commit into
mainfrom
t3/managed-settings-reanalysis
Nov 7, 2026
Merged

dinooo13 merged 1 commit into
mainfrom
t3/managed-settings-reanalysis

Conversation

@dinooo13

@dinooo13 dinooo13 commented Nov 7, 2026 •

Copy link
Copy Markdown
Owner

Closes #109.

Why

Every choice about what Pladder reads and sends lived in settings.json, which the user owns. An organisation that has to answer "what does this app read and send where" had nothing to point at. The correction learner also had no switch: the only way to stop it reading other apps' fields was to revoke the grant the paste needs.

Main moved since the issue was written, and the implementation follows main:

  • Updates. The Sparkle updater landed after the issue and makes a request, so there is a sixth key, UpdateChecks.
  • No prompt at launch any more. Accessibility is asked for only from the Allow… buttons, so Clipboard mode hides those buttons.
  • Tabs. There is no Processing tab. The learner switch is in the Dictionary tab, beside the rules it adds.
  • Overlay. It reads the focused field through Accessibility to place itself, so Clipboard mode skips that read too.

Change

  • ManagedPolicy (Core) is the policy value.
    • read turns forced property-list values into it. An unknown ID, an empty list or a wrong type (an <integer> for a Boolean too) is ignored and reported as a Problem. A list with no known ID is ignored whole, so a typo never leaves the app without an engine.
    • apply(to:) gives the settings in effect.
    • userSettings(from:stored:) turns a view's edit back into the user's own, so a managed value never reaches the file.
  • ManagedPolicySource (System) reads values with CFPreferencesCopyAppValue, but only those CFPreferencesAppValueIsForced reports. It synchronizes before each read, so a profile installed while the app runs is seen.
  • AppModel keeps the user's settings and the settings in effect. The coordinator, the polish controller, the inbox, the updater and the views see only the latter. The policy is read at launch, before the monitors are built, and on the two-second permission poll. A new policy goes through the same SettingsChange reactions as a user's edit.
  • Clipboard mode (ClipboardMode = true):
    • PermissionMonitor reports the grant as absent without checking it and never asks for it.
    • HotkeyRouting therefore picks Carbon, so no event tap is installed.
    • PasteboardOutput.setClipboardMode copies instead of posting ⌘V.
    • The overlay reads no focused field.
  • UpdateChecks = false forces automatic checks off, never starts Sparkle and removes Check for Updates… from the menu, so no update request is ever made.
  • learnCorrections is a new setting, on by default, shown in the Dictionary tab only where the learner can run. CorrectionInbox.isLearning gates each paste and drops proposals still on their way.
  • Settings UI. A managed control is disabled, never hidden, and pickers offer only the allowed entries. "Managed by your organisation." goes under the group, or under the control itself when the rest of its group is the user's (the update toggle). There are Clipboard-mode wordings for the three hotkey warnings that said "until you allow it". German strings are added.
  • Menu. The ready line says "then press ⌘V" whenever Accessibility is missing. Before, it said so only when a stand-in chord was active, so an Option+Space user without the grant was never told about ⌘V.
  • Docs.
    • docs/MANAGED.md is the admin guide: domain, keys, Clipboard mode, an example .mobileconfig, permissions, what is not covered.
    • ARCHITECTURE.md gains "Managed policy".
    • CLAUDE.md gets a Decisions row, and its learner row loses "no setting".
    • DESIGN.md gains the managed-control rule.
    • USAGE, INSTALL and PRIVACY name the switch and the guide.
  • make-screenshots.sh --managed captures any scene under a sample policy.
  • Dropped from the issue: a separate "Clipboard mode — managed by your organisation" menu line. The ready line already says to press ⌘V.

Verified

  • swift test: every suite passes, including the new ones:
    • ManagedPolicyTests: every key, an unknown engine, an empty list, wrong types, edits keeping the user's own values.
    • ManagedPolicySourceTests: a value written to the user domain is not forced, so it is ignored.
    • CorrectionInboxTests: switched off, the fake observer is never called and waiting proposals are dropped.
    • PasteFlowTests: Clipboard mode copies with the grant and posts no key.
  • The CFPreferencesAppValueIsForced mechanism, checked against the Screen Time profile on the developer's Mac: its values report forced, and Booleans arrive as CFBoolean.
  • scripts/make-screenshots.sh --settings-scene --managed and the same without --managed, light and dark: pinned pickers and forced toggles are disabled on their values with the footer, and without a profile the window is as before plus the learner switch.
  • The example profile passes plutil -lint.
  • check-doc-pointers.sh, check-site-numbers.sh and shellcheck pass.
  • The example profile from docs/MANAGED.md, installed by hand on a Mac without MDM, with this build in /Applications:
    • At launch the app logged managed policy: AllowedEngines, PolishDictations, LearnCorrections, UpdateChecks.
    • The managed controls showed disabled with the footer, while settings.json still named Ultra and automatic checks on.
    • Removing the profile while the app ran gave the user's own choices back without a relaunch.
  • Still open: Clipboard mode on a running copy; it is covered by unit tests only.

Benchmark

DictationCoordinator is untouched, and nothing is read per dictation. The one change on the release path is a relaxed atomic load before the AXIsProcessTrusted() check in PasteboardOutput.insert. No existing benchmark covers the real paste (bench-coordinator and bench-release use a stand-in output), so here is a micro-benchmark, -O, 1,000,000 calls, on an M1 MacBook Air:

per call
AXIsProcessTrusted() 0.536 µs, 0.508 µs
atomic load + AXIsProcessTrusted() 0.508 µs, 0.519 µs

That is within noise, on a release-to-paste of about 195 ms.

🤖 Generated with Claude Code

… learner and update checks, Clipboard mode

A configuration profile's Custom Settings payload for de.dinooo13.pladder,
forced values only: AllowedEngines, AllowedPolishModels, PolishDictations,
LearnCorrections, UpdateChecks and ClipboardMode. ManagedPolicy in Core applies
it on top of the user's settings, which stay all the file holds; it is read at
launch and on the two-second permission poll. Managed controls are disabled
with "Managed by your organisation." Clipboard mode keeps the app off
Accessibility even with the grant: no prompt, no tap, no Cmd+V, no field read.

The correction learner gets a switch in the Dictionary tab, on by default.
docs/MANAGED.md is the admin guide, with an example profile.

Refs #109

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@dinooo13
dinooo13 merged commit 8e9de37 into main Nov 7, 2026
4 checks passed
@dinooo13
dinooo13 deleted the t3/managed-settings-reanalysis branch November 7, 2026 01:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Managed policy for organisations: pin the engine, force polish and the correction learner on or off, Clipboard mode without Accessibility

1 participant