Skip to main content

Module app_open

Module app_open 

Source
Expand description

app.open starts a known operator app from its installed location. See the module for the ordered decision, the launch table, and the platform launchers. app.open: start a known operator app from its installed location.

The decision order is fixed and checked top to bottom: app_open_not_used on macOS (which never launches through the daemon) and on platforms without a launcher, app_open_disabled when the platform switch is off, app_unknown for an app the compiled table does not name, already_running while a launch entry is live, app_not_installed when the installed file is missing, and only then verification and launch.

Launch entries live in one table behind one lock. The lock is a leaf: take no other lock while holding it. An entry holds the daemon-generated incarnation id, the launched pid, and the platform liveness handle: a pidfd on Linux, the owned process handle on Windows. Liveness is read from that handle, never by reopening the numeric pid, so a reused pid confers nothing. On Windows the entry is published before the image is resumed, so a child that connects at once is matched. On Linux the entry is published after spawn and tracking, so the image may run first, which is safe because Linux connections are never stamped. Entries retire when no longer live. The table is memory-only: a daemon or installed-service restart drops it, and a relaunched daemon never mistakes an older process for its own launch. Connections from such a process are plain direct.

Starting the app grants nothing by itself: a shortcut still needs a stamped connection. (A Windows stamp records the live entry’s incarnation at connection time; nothing revalidates it yet.) So app.open is classified None in the privileged-operation classifier and neither prompts in enforce mode nor logs in log mode.

Structs§

WindowsVerifyRequest
The request passed to the injected Windows check, beside the held capture: the publisher the file’s signature must name, the floor its signed version must meet, and the installed path. The check receives the held capture and must read that, never reopen path, which is for messages only. Production carries no verifier yet and fails closed.