//! `ops-agent` — the on-host half of the executor. //! //! One binary; behavior is set entirely by its local config (its own grant + //! which caller identities may reach it). It listens **only on the tailnet //! interface** and, on every request, resolves the caller via the local //! Tailscale LocalAPI `whois`, maps node/tags to a caller grant, and runs the //! step under the **intersection** of that grant with its own — the agent-side //! half of double enforcement. A buggy or compromised daemon cannot make this //! agent exceed its local grant. //! //! macOS deployment is an Aqua LaunchAgent (`LimitLoadToSessionType = Aqua`) so //! build+sign run in the GUI security session where codesign can use the key. //! //! ## Trust boundary (read before touching `/run`) //! //! The capability model gates the *action label* (`build`/`sign`/…), not the //! command bytes: a `Step` carries arbitrary `argv`/`shell_script` that the //! agent runs verbatim once the label is permitted. An allow-listed caller is //! therefore trusted to run **arbitrary code** on this host under any action it //! is granted — the perimeter is the Tailscale `whois` allow-list plus the //! tailnet-only bind (`ops-agent` refuses a non-tailnet `listen`), not the //! capability token. Do not treat a narrow grant as a command sandbox. Every //! request-facing route here (`/run`, `/pull`, `/health`) resolves identity and //! authorizes before doing work — there is no unauthenticated surface. //! //! For the high-risk actuating steps that *are* fixed recipes — `sign` on the //! signing-key host, `deploy` on a prod host — an optional [`ScriptPin`] narrows //! the surface further: the host pins the exact `/bin/sh -c