A personal assistant that lives on your desktop, remembers what matters, and can use your Mac for you.
TypeScript
docs(odd): record the approval guard blockers
Alan Buscaglia6866bab735a8
diff --git a/odd/tasks/gentle-dot.md b/odd/tasks/gentle-dot.mdindex d37d90e..dc73a38 100644--- a/odd/tasks/gentle-dot.md+++ b/odd/tasks/gentle-dot.md@@ -154,4 +154,5 @@ Environment notes: Node v24.14.1 and pnpm are present. `cargo` is on PATH but `r- **L44 (2026-10-08, T19 evidence):** The UI hides conversations behind `ready.features.conversations` (default off; `GENTLE_DOT_CONVERSATIONS=1`), and the daemon refuses `new_conversation`/`open_conversation` with `conversations_off` when off. Rotation (`rotation.ts`) triggers on 20 MB or 10 compactions, only when idle. The handoff is a hand-written Pi v3 session file (header with `parentSession` plus one `custom_message`, `display:false`, `customType gentle-dot.handoff`) followed by `switch_session`, with a verification of `get_state` and `get_messages` and a `new_session` fallback; formats are copied from `session-manager.js` with paths cited. History now reads the session files (including pre-compaction messages) with 100-message pages, `hasEarlier`, and `get_earlier` across the chain persisted in `state.json`. Finding: Pi emits `message_end` on stdout before writing the entry to the file, so history reads do a `get_state` round trip first. The Stop pill is centered (inline-flex, no vertical padding; measured 7/8 px). Design §4/§6/§7/§9/§10 and the README were updated. RED → GREEN for protocol, UI, and the daemon module; e2e written after the code. 260 tests, typecheck, lint, e2e 14/14. Parent real-engine probe (bundled engine, temp HOME/data, private Engram on a temp port, stopped by PID): `switch_session` to the hand-written file returned `cancelled:false`, `get_state.sessionFile` equals the file, and `get_messages` holds one `custom` message of type `gentle-dot.handoff` with the probe text. Open: the tray still shows "New conversation" (apps/desktop follow-up); with the flag on, conversation switches combined with the chain are untested.- **L45 (2026-10-08, T18a finding):** The T18a writer found `rotation.test.ts` flaky in full runs (4/4 runs on a clean `git archive HEAD` copy, each time a different rotation test timing out; 3/3 in isolation). The likely cause is a T19 race in bridge.ts: when the prompt response and `agent_settled` arrive in one stdout chunk, `rotateWhenIdle` runs while `sending` is still 1, so rotation is skipped until the next run settles. In production this only delays rotation to the next run, but it is a real defect. Decision: fix in T18a, test first, with a single in-flight rotation flag and at least 3 full runs. The parent's two earlier green full runs were luck.- **L46 (2026-10-08, T18a evidence):** Commit `e49bd9d`. Catalog: Notion, Linear `https://mcp.linear.app/mcp` (verified), and Atlassian v2, with curated read-only lists (fail closed). The daemon is the only writer of `mcp.json` (`exposure: direct`, read-only mode as `toolExposure {"*":"hidden", curated:"direct"}`, validated with the engine's own `validateMcpServerConfig`), restored by hash in a new supervisor `prepareSpawn` hook before every spawn. The guard policy JSON travels in the engine env (`GENTLE_DOT_CONNECTOR_POLICY`); missing or malformed means everything asks. Sign-in runs the engine CLI `mcp login` as a child process; the daemon completes a pasted redirect only after validating origin, path, and state, and cancel kills the CLI by PID. The approval guard (`-e`, `tool_call` hook) asks with a preview and blocks writes to control files; the real-engine probe found and fixed a `/var` vs `/private/var` bypass (realpath compare). Tray "New conversation" only with conversations on. The L45 rotation race was fixed test-first (`rotationDeferred`, 14/14 ×3; the writer reported 6 green full runs). RED → GREEN per layer; e2e written after the code. Parent re-ran: 312 tests twice, typecheck, cargo 42/42. Risks reported: bash blocking is textual, the agent can read `mcp-auth.json`, separate sign-in queues for models and connectors, and the browser may open twice. Parent-observed UI defect: the onboarding banner overlaps the first chat message. Risk tier high (security) → an independent adversarial verifier is running.-- **Next step:** the T18a security verification; then T18b (Discord/Slack/Gmail guides, S19, S20) plus the onboarding overlap fix; then T14 (Linux) and T21; a Docker build check when Docker runs.+- **L47 (2026-10-08, T18a adversarial verification):** 2 BLOCKERS, reproduced with the real engine (scratch copy, fake model/MCP/CLI, temp HOME). B1: with one bash call from `<data>/workspace`, the agent edited `../agent/mcp.json` and `../connectors.json` (enabled, recomputed sha256 or deleted hash), ran `kill $PPID`, and the supervisor restarted it; `prepareSpawn` trusted the altered registry and `notion-search` ran without a card on a connector the user had disabled (catalog-only; sends still ask after the mode flip). B2: `read ../agent/mcp-auth.json` (the guard checks only write/edit) and `cat` returned the token to the model. Root cause: textual bash blocking (`approval-guard.ts:113-119`) and an integrity hash stored in the same agent-writable file. Passing: write asks/decline blocks/no UI blocks; read-only hides write tools; curated-list fail-closed; malformed policy asks; sign-in redirect validation against all variants; one flow at a time; clean logs; mcp.json valid and restored; rotation 3/3 at HEAD vs 2/3 failing at baseline; typecheck, lint, e2e 16/16, cargo 42/42. Advisories: gentle-pi subagent children do not load the guard (subagent tools not exposed today); project `.pi/mcp.json` and session_start re-reads bypass the restore; the preview shows at most 6 fields × 160 chars; orphaned private Engram; `fetch` follows redirects; the guard loads only with `agentHome`. Fundamental limit: the agent runs as the user with unrestricted bash, so file-based protections cannot be airtight.+- **Next step:** user decision between hardening now (A) and a daemon-side MCP proxy with Keychain tokens (B); then the correction batch, T18b, T14, T21.