Address Cody review round 3: CODY-003 and CODY-006

CODY-003 Request identity is durable before submission. Storage results are
         explicit at the DevicePort boundary (storageSet resolves true only
         on the host's own timely confirmation; storageGet distinguishes
         unknown from empty). A request is not sent until the phone has
         confirmed storing its id; a timeout or refusal holds it back,
         unsent and retryable under the same id. Unreadable storage at
         start is not treated as unpaired; an unsaveable pairing is revoked.
CODY-006 The state directory is set to 0700 on every open, including when
         it already existed, and the bridge refuses to start with an
         operator-facing error if it cannot be. Deployment guide creates
         it with install -d -m 0700.

Checks: typecheck clean; npm test 194 passed; client build ok;
test:real-stt 11 passed; test:real-hermes 9 passed; test:simulator 6
passed; git diff --check clean.

Not reviewed. No physical-device, droplet or production evidence.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This commit is contained in:
Dan
2026-11-18 20:29:05 -08:00
co-authored by Claude Fable 5.2
parent e1c02d5266
commit 1507cea077
19 changed files with 759 additions and 45 deletions
+5 -1
View File
@@ -36,7 +36,8 @@ devices. Not reviewed by anyone but its author yet; see `docs/handoff/`.
| Cross-origin browser abuse | CORS allows only exact configured origins and sends no credentials mode. CORS is not treated as authentication: every route still needs the bearer credential. | yes |
| Secrets or content in logs | Logs carry ids, states, codes and timings. Request logging is off, a redaction list backs it up, and Hermes's own diagnostic text is never relayed or logged. | yes |
| Substituted speech-model files | The model is pinned to a commit id with a SHA-256 for every file. Files are fetched ahead of time and verified; the bridge re-verifies on every load, never downloads at run time, and reads from a directory that can be read-only. There is no unpinned mode. | yes, including with no network at all |
| State files readable by other users | The database is created owner-only before SQLite opens it (so its WAL and SHM files inherit that), in a 0700 directory; the systemd unit sets `UMask=0077`. | yes, under umask 0022 |
| State files readable by other users | The directory holding the database is set to 0700 at every start, whether it was just created or already existed, and the bridge refuses to start if it cannot be. The database is created owner-only before SQLite opens it (so its WAL and SHM files inherit that); the systemd unit sets `UMask=0077`. | yes, under umask 0022, for new and pre-existing directories |
| A running turn forgotten by the app | The request id is stored on the phone before anything is sent, and the request is not sent until the phone has confirmed the write. A write that times out or is refused holds the request back, unsent, for a retry under the same id. | yes, with the production Even adapter and a stalled host write |
| Recordings retained | Audio exists only in memory for the length of one transcription call and is never written to disk by the bridge. | by construction; not independently audited |
| Agent approves its own privileged action | The bridge never calls Hermes's approval endpoint. | yes |
| Markup injection from an agent answer into the phone page | The page is built with `textContent` only. | by construction |
@@ -71,6 +72,9 @@ Stated so they are not mistaken for protections.
4. **In the simulator, raw audio frames are echoed to the WebView console.** Whether the phone
does the same is unknown and is on the device checklist. If it does, recordings would be
visible to whoever can read that console.
4a. **The state directory must be the bridge's own.** Because it is forced to 0700, pointing
`HERMEVEN_DB_PATH` into a directory shared with other software will lock that software out;
a directory owned by another user is refused.
5. **TLS is not terminated by the bridge.** A reverse proxy or private network must provide it. A
misconfigured proxy could expose plain HTTP.
6. **Rate limits are in memory** and reset on restart. Behind a proxy, per-address limits are only