Skip to content

A personal assistant that lives on your desktop, remembers what matters, and can use your Mac for you.

TypeScript

docs(odd): refine S25 with the trust boundary and the user's choices (L109)

Alan Buscaglia7cde26d7f980
diff --git a/odd/tasks/gentle-dot.md b/odd/tasks/gentle-dot.md
index 75a83ae..30a0c42 100644
--- a/odd/tasks/gentle-dot.md
+++ b/odd/tasks/gentle-dot.md
@@ -90,6 +90,17 @@ Branch: `feat/gentle-dot` · Delivery strategy: `single-pr` (user choice, L7; fo
- **S25 — Connector enforcement outside the agent's reach (stage 2, before publishing to other users).** Decided in L48. The daemon proxies MCP traffic: connector tokens live in the OS secure store (macOS Keychain, with an equivalent on Linux and the VPS), the engine sees only local proxy URLs, and enabled state, mode, and approvals are enforced by the daemon, not by files or an in-engine hook. Subagent child processes are covered too. Approvals must reach the user through a channel the agent cannot reach (L49: with the daemon access key, the agent could connect to the WebSocket and answer its own approval cards), for example a native OS dialog shown by the desktop app, or a per-window key never stored in a file the agent can read.
+ - **Refined in L109** (map: L109; user choices: "Mac primero, Linux documentado (recomendado)", "Motor con otro usuario + PIN (recomendado)"). Trust boundary: the agent is a same-user process with a shell, so files and environment variables are never secrets. What it cannot reach on macOS: Keychain items owned by the signed app (other readers trigger a SecurityAgent prompt, which computer control blocks), the app's native dialogs, and a secret handed from the app to the daemon over an inherited pipe and closed before any child spawns.
+ - **S25.1 App key.** The desktop app generates a per-launch key and passes it to a daemon it launched through an inherited file descriptor (never a file or env var); the daemon reads it and closes the descriptor before spawning anything. A daemon the app merely attached to (already running) gets no key and none of the privileges below.
+ - **S25.2 Privileged actions only through the app.** Answering a connector approval, changing a connector's mode, enabling, connecting, or removing a connector, registering the computer helper, and storing or reading connector secrets are accepted only on a channel authenticated with the app key. The WebSocket access key (`<data>/token`) keeps chat, history, accounts, and read-only views; approval cards on the WebSocket become informational.
+ - **S25.3 Native approvals.** Connector approvals and mode changes are confirmed in a native dialog shown by the desktop app (as computer control does), with the action's full preview; declining or no answer refuses; if the app or the channel is gone, the action is refused (fail closed).
+ - **S25.4 MCP proxy.** The engine's `mcp.json` lists only `http://127.0.0.1:<port>/mcp/<id>` entries with a per-engine-launch key; the daemon fronts every connector (remote HTTP with tokens it injects upstream, stdio servers it runs itself), filters `tools/list` by mode, refuses hidden tools on `tools/call`, filters resources and prompts the same way, and asks S25.3 before every sending action. Subagents reach connectors only through the proxy, so they can be enabled again (`GENTLE_PI_AGENTS`).
+ - **S25.5 Secrets in the Keychain (macOS).** Connector tokens (OAuth, bot tokens, client secrets, imported headers) live in Keychain items created by the signed app (stable identity from S29.2) and reach the daemon in memory over the app channel; OAuth sign-in and refresh move into the daemon (pi-mcp OAuth with a store backed by the app). Existing secrets in `mcp-auth.json`, `connectors.json`, and `mcp.json` are migrated once and removed from the files.
+ - **S25.6 Integrity.** `connectors.json` carries an HMAC with a key kept in the Keychain; a file changed while the daemon was down is refused and reported instead of loaded.
+ - **S25.7 Linux desktop (documented limit).** The proxy, the app key, and native approvals work as on macOS; secrets are stored with the Secret Service (encrypted at rest), and the docs state plainly that a same-user agent could read unlocked Secret Service items.
+ - **S25.8 VPS / web.** In the container the engine runs as a different OS user than the daemon, so the daemon's files and secrets are outside its reach; secrets are encrypted at rest with a key from the daemon's environment only; approvals and mode changes in the web UI require a PIN the user sets, which the agent never sees (assumption: set on first use in the web UI, stored only as a salted hash, with a lockout after repeated failures).
+ - Accepted limits: the agent can still kill the app or the daemon (everything then fails closed); third-party stdio servers hold their own token in their process; a daemon started from Terminal inherits Terminal's macOS permissions.
+
- **S26 — Hide the rose and full-screen chat (L68).** User: "ah y pon un ocultar la rosa, que la puedas abrir bajo demanda y un full screen para el chat cuando quieras".
- **S26.1 Hide the rose.** A "Hide the rose" action (tray item, checkable, and a panel header option) hides the floating Dot window; the choice is remembered across restarts in the desktop config. While hidden, the panel still opens on demand with the global shortcut and the tray "Open" item, and the tray offers "Show the rose" to bring it back. Computer control's in-control and yolo states stay visible in the tray and the panel banner while the rose is hidden (assumption: the tray icon reflects in-control).
- **S26.2 Full-screen chat.** A header button (and ⌘⇧F while the panel has focus) expands the chat panel to fill the current display's visible area, and the same button or Esc returns it to its previous size and position; the full-screen layout gives the conversation a readable centered column. Assumption: it fills the screen in place rather than opening a separate macOS fullscreen Space, since the panel is an accessory window; the web UI already fills the browser window.
@@ -182,8 +193,16 @@ Branch: `feat/gentle-dot` · Delivery strategy: `single-pr` (user choice, L7; fo
| T32 | S24.10 | inline, after T31 | done (real NaN check pending) | `d9f0fa8`; RED 2 files failing → GREEN; pnpm test 584 | Model picker in the chat |
| T33 | S33 | delegated writer (context backstop; Rust + UI) | done (real Mac pending) | `2d1f5e4`; RED 51 compile errors + UI import → GREEN; cargo test 314, pnpm test 609 | Settings screen with a recordable, live-applied shortcut |
| T34 | S30.6 | delegated writer (Rust, `apps/desktop/src-tauri/src/voice/**`), parallel with the S25 map | in progress | — | Apple Speech fed with native buffers |
+| T23a | S25.4 | delegated writer (daemon proxy), parallel with T23b | in progress | — | MCP proxy in the daemon: list/call filtering, hidden-tool refusal, resources, upstream HTTP and stdio |
+| T23b | S25.5 (app side), S25.3 (dialogs) | delegated writer (Rust), parallel with T23a | in progress | — | Keychain store and native approval dialog in the app |
+| T23c | S25.1, S25.2 | after T23a/T23b | pending | — | App key over an inherited fd; privileged channel; WebSocket loses approval and mode rights |
+| T23d | S25.5 (daemon side) | after T23c | pending | — | OAuth in the daemon with the app-backed store; migration from files |
+| T23e | S25.6 | after T23d | pending | — | connectors.json HMAC |
+| T23f | S25.4 (subagents) | after T23c | pending | — | Enable subagents again behind the proxy; real-engine probe |
+| T23g | S25.7 | after T23d | pending | — | Linux: Secret Service store and documented limit |
+| T23h | S25.8 | after T23c | pending | — | VPS: engine as another OS user, encrypted secrets, PIN approvals |
| T22 | S18 (hardening, L47 B1/B2) | delegated writer | done (accepted with documented gaps, L52) | `8651bba`; parent re-ran 328 tests + typecheck | Option A: authoritative in-memory connector state with revert, credential reads blocked, path-independent bash checks, full approval preview, redirect manual, private Engram stop, onboarding overlap fix |
-| T23 | S25 | explore (delegated, read-only) → spec → implement (stage 2) | in progress | — | Daemon-side MCP proxy with Keychain tokens |
+| T23 | S25 | explore (delegated, read-only) → spec → implement (stage 2) | in progress | map L109; units T23a–T23h | Daemon-side MCP proxy with Keychain tokens |
| T9 | S1–S6, S9–S12 | delegated verifier (high risk: process supervision, auth) | done | L24 + L31 | Full verification: unit, integration, Playwright, `@real-agent`, `tauri build` + launch, manual macOS checklist with observed results |
Environment notes: Node v24.14.1 and pnpm are present. `cargo` is on PATH but `rustc` is not, so T7 must first install or repair the Rust toolchain (rustup) and asks before installing. Xcode is present.
@@ -294,6 +313,7 @@ Environment notes: Node v24.14.1 and pnpm are present. `cargo` is on PATH but `r
- **L102 (2026-10-09, user):** "bien pero, mientras estoy hablando no me aparece lo que se va enviar como cuando uso el bui† in de mac" — Parakeet transcribes correctly with our capture, so the earlier garbage came from Apple Speech with our converted 16 kHz audio (open: feed Apple the device's native buffers). Live text with the local model (`e027b19`): the recording so far (last 30 s at most) is decoded again every 0.8 s of new audio, skipping when the model is still loading or a decode runs (never blocking the audio thread), serialized with the final decode, and never shown after stop/cancel; RED (compile) → GREEN, cargo test 296. The Voice chip now names the engine ("Offline", "macOS", "Off"; `1396457`). Rebuilt, signed, restarted (also applies the model-chip fix `7ab0c0a`).
- **L103 (2026-10-09, user):** "estaria bueno que si pongo el boton de grabar de nuevo en vez de enviarlo, que se quede escrito en el input para confirmarlo, como se comporta ahora estaria bueno que sea una opcion que uno elijiese". S30.4 updated: review in the input is the default; "Send when I stop" (switch in the recording strip, stored in localStorage) keeps send-on-stop; the mic button reads "Stop and review" or "Stop and send". `e0010eb`: RED 3 failing → GREEN, pnpm test 593 (the earlier tests now cover the option). Rebuilt, signed, restarted.
- **L104 (2026-10-09, user):** "sube todo esto al repo y fijate el readme de gentle ai como es para copiar el estilo y hacer el propio para Gentle Dot"; choices "Gentleman-Programming/gentle-dot, público" and "main + feat/gentle-dot, y abro el PR (recomendado)"; then "usa la rosa con glow como banner". TruffleHog over the whole history: no verified secrets (unverified hits are masking-test fixtures). README rewritten in Gentle-AI's layout with an honest Security status; banner and divider rendered from the Dot's own rose strokes and glow (`docs/brand/tools/build-banner.mjs`); MIT LICENSE as in Gentle-AI. Created the public repo github.com/Gentleman-Programming/gentle-dot, `main` at the first commit `5ec596c`, pushed `feat/gentle-dot` (153 commits, 286 files, +57,416), and opened PR #1 (single-pr). Merge is the user's decision.
+- **L109 (2026-10-09):** S25 map (explorer without web; platform facts inferred): any WebSocket client with `<data>/token` can answer approvals and also switch a connector to read and send, connect, or remove it (bridge.ts:253-273); pi-mcp 1.0.4 is client-only (stdio, streamable HTTP, OAuth with an injectable state store), so the daemon writes its own MCP server side, as the Rust computer helper already does (plain JSON over POST, accepted by the engine); a Keychain item created through the `security` CLI does not protect from the agent, one created by the signed app does; Linux Secret Service has no per-caller ACL. User choices: "Mac primero, Linux documentado (recomendado)" and "Motor con otro usuario + PIN (recomendado)". S25 refined into S25.1–S25.8 and T23a–T23h; T23a and T23b launched in parallel. Also: T34 done (`7a8773c`, native buffers for Apple Speech) and Voice language in Settings (`b2b2c79`) after the writer found the Mac is set to en-US, so Apple Speech always listened in English; app rebuilt, signed, restarted.
- **L108 (2026-10-09, user):** "merge" — PR #3 merged (`231f413`). Then "da a todos" for: Apple Speech with native buffers (S30.6/T34, writer launched), S25 (T23, read-only map launched in parallel), and the real-hardware checks (need a second Mac, an x86_64 PC, and GNOME/Hyprland desktops: handed to the user and testers as a checklist).
- **L107 (2026-10-09):** User: "merge el pr" — PR #2 merged (`0c3a7a3`). T33 done (`2d1f5e4`): `shortcut_get`/`shortcut_set` (panel only), pure `shortcut.rs` rules, apply = register new → save → release old → tray label, rollback when saving fails, config.json read-modify-write 0600, Settings screen with a capture-phase recorder (event.code, so ⌥ does not change the key). Parent changes: the writer's proposal to refuse Shift-only combinations adopted (S33.2 updated: Shift+K would capture capital K everywhere); a pre-existing crash in VoiceModel on a null status (6 unhandled rejections making `pnpm test` exit 1) fixed (`bd819a8`). Known limits: macOS may accept a system-reserved combination (e.g. ⌘Space) that never fires; a combination already global cannot be recorded in the webview. Rebuilt, signed, restarted.
- **L106 (2026-10-09, user):** "porque tiene un space el banner?"; then "sacalo y creo que deberiamos de cambiar por otra cosa, que uno pueda configurar su atajo no siempre space"; placement "Nueva pantalla de ajustes (recomendado)". Banner regenerated without the key chip and README names ⌥ Space as the default (`2556674`, in PR #2). Recorded as S33/T33.