From 58747313957e6f75098fc6f54d7baf72f0dea7c0 Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Fri, 20 Nov 2026 22:07:38 -0500 Subject: [PATCH 1/2] fix(window): the built-in browser's frame is shown only in the FormAT window The engine already made one key at each launch, gave it once to the first page, and asked for it on every write; calls without it follow the Outside agents choice. Reads were all open. Now the reads the window alone should make need the key too: GET /api/browser/frame answers 403 without it, and the Browser pane sends it with each frame. Every read route is classified in tests/test_window_key.py (public, addressed by a random id, or needing the key), and a new read that is in none of the lists fails the walk, as a new write route that answers without the key fails the write walk. The open lists are pinned. --- backend/HASHOUT_LOG.md | 15 +++++++++++++++ backend/app/core/window_key.py | 9 ++++++++- backend/tests/test_window_key.py | 26 ++++++++++++++++++++++++++ frontend/HASHOUT_LOG.md | 7 +++++++ frontend/src/ui/browser-pane.ts | 3 ++- 5 files changed, 58 insertions(+), 2 deletions(-) diff --git a/backend/HASHOUT_LOG.md b/backend/HASHOUT_LOG.md index 65e1995..6e0706f 100644 --- a/backend/HASHOUT_LOG.md +++ b/backend/HASHOUT_LOG.md @@ -1311,3 +1311,18 @@ Every install path, read on each system. `./format install` and `format_oc_insta The test. `test_requirements_lists.py` reads both lists: every requirement of `requirements.txt` whose marker is not `sys_platform == "win32"` must be in `requirements_macos.txt` with the same extras and pin (markers aside: the macOS list needs none). It reads both freeze scripts for every name given to `--copy-metadata`, `--collect-submodules`, `--collect-data` and `--hidden-import` (the engine's own `app` aside), finds the distribution of each module from the installed metadata (docx is python-docx, multipart is python-multipart), and wants each in both lists; websockets and certifi come with uvicorn[standard] and httpx, and a fourth test proves from the installed metadata that they still do. Seen: with the test copied into a copy of origin/main, the first and third tests fail, naming keyring; on this branch all four pass. What a person running the engine from source on macOS saw from 0.27.0 to 0.30.0: no error. `_load` imports keyring inside its try, so the import failed quietly, the seal was `unavailable`, the engine started, and the Outside agents choice stood as saved with no seal. Now keyring is there, the choice is sealed in the macOS keychain, and a saved Allowed that has no seal yet reads as Ask, with the window's sentence, until it is chosen again (read in `effective` and seen on Linux with a stand-in keychain in test_window_key.py; not run on a Mac). + +### app/core/window_key.py and tests/test_window_key.py · the built-in browser's frame is read only by the window +- refers-to: app/core/window_key.py :: PRIVATE_READS, needs_key, WindowKeyGuard; app/engine/browser.py :: frame; frontend/src/ui/browser-pane.ts :: loadFrame; tests/test_window_key.py :: PUBLIC_READS, ID_READS, test_the_open_lists_are_exactly_the_named_routes, test_every_read_route_is_public_addressed_by_a_random_id_or_refused_without_the_window_key, test_the_window_reads_the_built_in_browser_frame_with_its_key +- kind: decision +- logged: v0.32.0 · 2026-11-20 + +What the engine listens on. 127.0.0.1 on FORMAT_PORT (8490, or the next free port), with the HTTP routes, `/mcp`, and the two sockets `/api/events` and `/api/terminal/{id}`; and, only after the window turns Other devices on, 0.0.0.0 on FORMAT_LAN_PORT (8492) behind the pairing Gate, where a paired request counts as the window. The stdio bridge (`./format mcp`) is a separate process that calls the HTTP port with `x-format-agent`. + +The rule now. The guard asks for the key on every method other than GET, HEAD and OPTIONS, except the open list (`/mcp`, `/api/window/key`, and `/api/commands/`, whose keyless calls follow the Outside agents choice), and also on the reads in `PRIVATE_READS`. `needs_key` is the one place that decides. The only private read is `GET /api/browser/frame`: it answers the built-in browser's current screen with no id, so before this any local program could watch the page shown in the Browser pane; now it answers 403 "Only the FormAT window can do this" without the key. The Browser pane sends the key with each frame request (frontend log). + +Every read, classified. Public: `/api/health`, `/api/commands`, `/api/commands/{cid}` (the catalogue), `/api/voice` (which speech engines are installed), `/api/connectors/oauth/callback` (the person's browser comes back here from a sign-in page and cannot hold the key; it needs the random `state` of a sign-in the window started). Addressed by a random id: uploads (64-bit), chat files and Download all (the chat's 128-bit id), artifact pages, sources and exports (128-bit ids), native snapshots (48 random bits and a time), shared links (`/s/{token}`). These are opened by ``, `