FrankenTerm

IPC and Local Auth

210 words1 min read3 subsectionsFrom the README at ft 0.15.21

On this page3
SurfaceScopeWhy an IPC layer at all

ft exposes a local IPC surface so the Robot Mode CLI and the watcher can talk to each other without going through the database for every request (the GUI does not use it yet).

Surface

The IPC server (ipc.rs) listens on a Unix domain socket configured via [ipc] (Windows uses an AF_UNIX socket too, through the in-tree frankenterm-uds transport). The socket is created with mode 0600. Token authentication is opt-in: set [ipc].tokens (each with a scope) and clients present FT_IPC_TOKEN; with no tokens configured (the default), socket file permissions are the only access control and read/write scopes are not enforced.

Scope

IpcScope is a per-token permission level: read, write, or all. Each request declares the scope it needs (mutating RPCs need write), and the watcher checks it against the presenting token before dispatch, but only when tokens are configured. The socket itself is always local (a Unix domain socket on every platform).

Why an IPC layer at all

  • Faster than SQLite-mediated coordination for high-frequency reads such as pane state and health (a future GUI consumer could read the current pressure tier this way).
  • Push-based. Subscribers get notified when state changes, instead of polling.
  • Bounded blast radius. A bad client request returns a typed error envelope; it doesn't corrupt the database.