Address Cody review round 2: all ten findings (CODY-001 to CODY-010)
CODY-001 Bridge URL must be HTTPS (HTTP only to loopback), in the client and
in manifest generation.
CODY-002 Even host calls stay serialised until the SDK call really settles;
a microphone start that completes after its timeout is followed by
a stop.
CODY-003 Request id is stored before the first submit and cleared only on a
definitive answer; lost replies are treated as ambiguous and
reconciled under the same id; HUD no longer claims "not sent".
CODY-004 Revoking a device cancels its in-flight turns, aborts
transcription and asks Hermes to stop, from HTTP and CLI paths.
CODY-005 Speech model pinned to a commit with per-file SHA-256; fetched and
verified ahead of time; verified on every load; never downloaded
at run time; no unpinned configuration.
CODY-006 State directory 0700, database/WAL/SHM 0600 regardless of umask.
CODY-007 credential_expired handled like unauthorized on every path.
CODY-008 Approval wait start and paused agent deadline persisted and
restored across restarts (schema v2).
CODY-009 Exactly one conversation create per epoch, sent in sequence, with
stale results dropped before persistence.
CODY-010 Wrong pairing guesses no longer consume the outstanding code;
failures are indistinguishable.
Checks: typecheck clean; npm test 182 passed; client build ok;
test:real-stt 11 passed (including with no network); 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:
@@ -253,3 +253,62 @@ unauthenticated `/v1/device` answered 401, `bridge:cli -- pair` printed a code,
|
||||
- Selecting a contextual-menu item.
|
||||
|
||||
The checklist for the hardware items is `docs/device-test-plan.md`.
|
||||
|
||||
## Round 3: after Cody's review (2026-11-18)
|
||||
|
||||
Cody reviewed `3d5691d` and returned NEEDS CHANGES with ten findings. This section records what
|
||||
was run after the fixes. Everything above this heading describes the code before them; where a
|
||||
number differs, this section is the current one.
|
||||
|
||||
```
|
||||
$ npm run typecheck exit 0
|
||||
$ npm test Test Files 10 passed (10) Tests 182 passed (182) (4 consecutive runs)
|
||||
$ npm run client:build built; the development pairing hook is absent from the bundle
|
||||
$ npm run test:real-stt Tests 11 passed (11)
|
||||
$ npm run test:real-hermes Tests 9 passed (9)
|
||||
$ npm run test:simulator Tests 6 passed (6) (3 consecutive runs)
|
||||
$ git diff --check clean
|
||||
```
|
||||
|
||||
No check was omitted. The offline speech test needs unprivileged network namespaces
|
||||
(`unshare -rn`); they were available here and the test ran. Where they are not, that test prints
|
||||
"OFFLINE CHECK NOT RUN" rather than passing silently.
|
||||
|
||||
### Regression tests added, by finding
|
||||
|
||||
| Finding | Test (file) | What it proves |
|
||||
|---|---|---|
|
||||
| CODY-001 | `tests/integration/clientSecurity.test.ts` | 15 public, private-LAN and look-alike HTTP addresses rejected; HTTPS accepted; HTTP accepted only for `localhost`, `127.x.x.x`, `[::1]`; the HTTP client refuses a remote HTTP base URL; manifest generation exits 1 and writes nothing for remote HTTP |
|
||||
| CODY-002 | same file, fake timers and a host whose calls settle on command | Start times out, host opens the microphone late: a stop follows and the microphone ends closed; at most one host call in flight throughout; stop requested during a pending start waits its turn; calls queued behind a stuck call are sent one at a time |
|
||||
| CODY-003 | `tests/integration/client-bridge.test.ts` | Every reply dropped after the bridge admitted the turn, then a client restart: one Hermes execution for that request, re-attached under the same request id, the HUD never said "not sent"; a request that truly never arrived is reported only after the bridge confirms it has no record; an undeliverable cancel is retried on the next start |
|
||||
| CODY-004 | `tests/integration/bridge.test.ts` | Revoking over HTTP during a hanging run: one stop request reaches Hermes, the turn settles as cancelled, every later request is 401; the same through the CLI path (database only); revocation during transcription aborts it within 250 ms, in-process and via the sweep; another device's turn is untouched |
|
||||
| CODY-005 | `services/bridge/test/modelStore.test.ts`, `tests/real-stt/realStt.test.ts` | Branch, tag and short revisions refused; unknown model without a manifest refused; a hub serving different bytes fails the fetch and leaves nothing behind; a changed or missing file refuses to load, with no network request; real pinned artifacts fetched from the real hub and verified; one flipped byte in the real model refuses to load; transcription from a read-only store; transcription inside a network namespace with no interfaces |
|
||||
| CODY-006 | `services/bridge/test/units.test.ts` | In a child process under umask 0022: directory 0700, database, WAL and SHM 0600, and none of the three was group- or world-accessible at any point observed during creation |
|
||||
| CODY-007 | `tests/integration/client-bridge.test.ts` | Credential expires during a live session: asking, waiting for an answer, status refresh, renew and new conversation each clear the stored pairing and return to the pairing screen; pairing again works |
|
||||
| CODY-008 | `tests/integration/bridge.test.ts` | Restart before the original agent deadline: approval timeout still fires 700 ms after the approval was first seen, not after the restart; restart after the original agent deadline: still classified `approval_timeout`; approved after a restart: the paused deadline is stored and survives a second restart; a run that never finishes afterwards ends as `agent_timeout` |
|
||||
| CODY-009 | `tests/integration/client-bridge.test.ts`, `apps/even-client/test/reducer.test.ts` | "New conversation" twice plus an immediate question with the reply delayed: one create, one stored id equal to the bridge's active conversation, the question succeeds; cancel-and-ask-again during a pending lazy create: one create; a reset during a pending create with the first reply arriving late: its result is dropped before persistence, the second create is not sent until the first settles, app and bridge agree |
|
||||
| CODY-010 | `tests/integration/bridge.test.ts` | 40 wrong guesses, then the real code still pairs; every failure (wrong, expired, used) is byte-identical; a client is cut off after its 5 attempts per minute |
|
||||
|
||||
### Did the new tests have teeth?
|
||||
|
||||
Each fix was removed or broken in turn, 20 ways, and the default suite re-run. 16 were caught
|
||||
at once. Two more exposed missing coverage (the CLI-path sweep during transcription; a database
|
||||
file created loose and tightened a moment later); tests were added and both are now caught.
|
||||
The remaining two are redundant safeguards whose removal changes nothing observable: the
|
||||
directory `chmod` after `mkdir` with mode 0700 (a umask can only remove permissions), and the
|
||||
final permission pass after a file that was already created owner-only.
|
||||
|
||||
### Real deployment sequence, run by hand on the development desktop
|
||||
|
||||
`verify-model` on an empty store exited 1 ("missing"). The bridge started without the model,
|
||||
answered `/healthz`, and logged `stt.load_failed` with `reason: missing` and the command to run.
|
||||
`fetch-model` downloaded 7 files (79 MB) from huggingface.co at the pinned commit in 4 s and
|
||||
verified them. `verify-model` then exited 0, and the bridge logged `stt.ready` in 1.1 s. The
|
||||
state directory was 700 and the database, WAL and SHM files 600.
|
||||
|
||||
This was not a droplet. `deploy/` and `docs/deploy-droplet.md` remain unrun.
|
||||
|
||||
### Still not tested
|
||||
|
||||
Unchanged from the list above: no physical G2, no audio from the glasses, no real model or tools
|
||||
behind Hermes, no approval prompt from a real Hermes, no droplet, no HTTPS termination.
|
||||
|
||||
Reference in New Issue
Block a user