Files
hermeven/docs/handoff/2026-11-28-cody-round-17.md
2026-11-28 10:52:06 -08:00

76 lines
4.1 KiB
Markdown

# Handoff for Cody, Round 17
From: Claude (implementation). Date: 2026-11-28 (UTC).
**Not reviewed.** Round 16: `bb3a309` plus documentation, tip `75b7ea1`.
| Item | Value |
|---|---|
| Branch | `cody/droplet-deploy` |
| `main` | `f02715fb6487f4e2ff0adeccfaad2403e1724aa5` (unchanged) |
| Code change | `e1d183b54dc5aeb94822d8efeeeb358b6b14a664` |
| New head | the tip after this push (this file and evidence only on top of the code change) |
## What this is
A new feature for trial, 0.3.0: an opening menu, and a hands-free mode in which an agent is called
by name. Dan's requests are quoted in `docs/decisions/0004-always-listening.md`, which also lists
what the implementer chose ("Owner decisions pending") and what the change reverses. Under the
standing rule those are owner decisions pending the device trial.
It touches the **client**, the **bridge** (one new route, new config) and the **contract package**
(two new schemas). No database change. No existing route, schema or error code changed.
## Design in six lines
1. `AppState.mode` is `agents` or `handsfree`. Everything else (agents, conversations, turns) is
shared. A new `menu` phase is the root page; `back` at Ready returns to it and resets the mode.
2. Hands free: at rest the microphone is open. `core/vad.ts` (pure, loudness only) emits
utterances; each is sent to `POST /v1/wake`.
3. The bridge transcribes, and `wake.ts` matches a leading agent name, exactly. It answers
`{matched, agent_id, text, near_miss}` and creates nothing.
4. A match with text becomes an ordinary **text turn** (`wake_text`); a name alone starts an
ordinary **audio capture** that ends on a pause (`wake_listen`). Request-id persistence,
deduplication, cancel and recovery are the existing code.
5. The result of a wake check is dropped if the reducer generation changed meanwhile, so a tap,
a cancel or a new pairing always wins over what was heard.
6. With the `wake` option, all microphone opens and closes go through `Controller.syncMic()`,
one at a time, each deciding from the state at its turn. Without the option (every test
written before this round) the previous microphone code runs unchanged.
## Where to look hardest
- **A turn with tools can start with no button pressed** (security 3d). The guards are: first
word only, exact match, "Heard: ..." on the HUD, double tap to cancel. No confirmation step.
- **All nearby speech is uploaded while in hands free** (security 3c). `/v1/wake` returns empty
`text` unless matched and logs ids only; one test asserts unaddressed speech is in no log line.
- **One spoken word can reach the phone's Diagnostics**: a near miss, in memory only. This is a
deliberate exception to "Diagnostics never contain content".
- `syncMic` and `afterChange` in `core/controller.ts`: the ordering argument is in the comments.
- `startCapture(auto)` seeds the recording from speech already heard while the name was being
checked, capped at the capture limit.
- The exit rule: the menu is the root page, so the system exit dialog is two double taps from
Ready. Whether Even accepts that is unverified.
- The manifest's `g2-microphone` description changed.
## Known limits, stated
- The segmenter's thresholds are guesses; no G2 audio has been through it. Tests use a tone.
- The recogniser in the integration tests is the scripted fake. Whether Whisper writes "Wendy",
"Cody" and "Pepper" as configured from G2 audio is unknown; aliases exist for that.
- The simulator suite runs with `?wake=off&menu=off`: it still covers the tap path and idle exit
and does **not** exercise the menu or hands free.
- A wake check blocks further checks for that device until it returns; speech that ends during
one is kept one deep (the latest), older is dropped.
## State
Nothing deployed, uploaded or installed. Server and Even account as in Round 16. No Hermes
profile, credential or production state was read or changed for this round. An older bridge
answers 404 to `/v1/wake`, on which the client ends hands free for the session, so the bridge
must be deployed before 0.3.0 is useful.
## Checks
All pass, list and omissions in `docs/test-evidence.md`, "Round 17".