"A new child pays its own parsing, permission, change and undo obligations." — Tinker architecture
The Bill
Every capability that wants into Tinker's registry pays the same four obligations, in its own currency. Parsing: decode its own input from JSON, offer a harmless initialInput, and refuse bad input in validate before anything is saved. Permission: name every macOS permission it needs, so the engine can refuse before the first change rather than half-way. Change: prepare keyed, serialisable plans that mark already-satisfied targets with needsApply: false, and apply exactly one plan per call. Undo: reverse a change from its saved payload alone, report .noLongerApplicable when there is nothing left to reverse, and throw ChangeNotAttempted only with proof.
There is a fifth line on the bill for a particular kind of child. Tinker's first capability changes only application visibility; it never reads, types into, clicks or submits anything in another app's UI, and password and payment interfaces are entirely outside it. The architecture is explicit that any future capability touching application UI must implement its own protection policy before it may enter the registry. The broad Accessibility grant that makes hiding possible is not blanket permission to act.
The Free Part
In return, a child inherits everything that is hard to get right and identical for every action. The durable journal and its prepared/applied receipts. Shared ownership between overlapping presets. Rollback of confirmed changes when a later step fails. Emergency release, the two-step Quit and the restore-before-logout path. And — the part that makes the root pleasant to extend — a command, a shortcut slot, a tinker:// link and an app-door entry, before anyone writes any UI for it.
How a Command Appears From Nowhere
That last gift comes from completeBindings, which runs whenever settings load or are saved. For every registered capability that no command refers to yet, it appends a command whose ID is the capability's ID and whose operation is "run this capability with its initial input". For every preset it ensures the toggle, apply and restore commands exist, and it always ensures the Stop and restore everything command exists. Running a capability command is itself a toggle: its owner in the journal is command/<id>, so the first run applies and the next one restores that invocation.
The Cost of Saying No
The bill is deliberately not cheap. A capability that cannot describe its change before making it, or cannot undo from a receipt, does not get in — however useful it would be. That is the price of the sentence the whole design rests on: an actuator that might do things it cannot take back is no longer one Dad can hand a global shortcut to without thinking.