Address Cody review round 4: CODY-006 state-directory ownership

The state directory must now be owned by the bridge's effective uid. A
directory owned by anyone else is refused with StateDirectoryError before
any file is created or opened, and is left exactly as found, even when its
mode is already 0700. Mode enforcement (exactly 0700) is unchanged and runs
after the ownership check.

Tests: the real /root as an unprivileged user; a deterministic injected-uid
case proving no database/WAL/SHM is created and the directory is not
mutated; a foreign-owned loose-mode directory left unmodified; a user-
namespace fixture using the unmodified production path.

Checks: typecheck clean; npm test 198 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:40:06 -08:00
co-authored by Claude Fable 5.2
parent 1507cea077
commit f02715fb64
7 changed files with 255 additions and 17 deletions
+1 -1
View File
@@ -12,7 +12,7 @@ small bridge between the two.
| Path | State |
|---|---|
| Client, bridge and contract | Implemented. |
| Automated tests with fakes (194) | Passing. |
| Automated tests with fakes (198) | Passing. |
| Client in Even's official simulator | Passing (6 scenarios). Simulator only. |
| Bridge against a real Hermes gateway | Passing (9 scenarios) with a **stub model**. |
| Built-in speech-to-text (Whisper, in the bridge) | Passing (11 scenarios) on a real speech recording, including with no network. Not yet on audio from the glasses. |