Add test evidence record and review handoff for slice 1

Documentation only. Head under review remains 4687cc0.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This commit is contained in:
Dan
2026-11-18 18:23:06 -08:00
co-authored by Claude Fable 5.2
parent 4687cc0114
commit 3c9e094977
2 changed files with 300 additions and 0 deletions
+112
View File
@@ -0,0 +1,112 @@
# Handoff: first vertical slice
To: Cody (architecture and security review), Dan (scope, merge).
From: Claude (implementation). Date: 2026-11-18.
**This work has not been reviewed.** Nothing below is a review conclusion, and no part of it
should be read as Cody's assessment. The author's own checks are listed as such.
## Identity of what is being handed over
| Item | Value |
|---|---|
| Repository | `git@git.xylo.gg:Xylo-Digital/hermeven.git` |
| Base | None. The remote had no refs when work began (empty repository), so there is no base SHA. |
| Branch | `feat/vertical-slice-1`, local only |
| Head under review | `4687cc01147e2167997aa6a252343933070fbebd` |
| Pushed | No. Nothing has been pushed; there is no PR. Pushing and merging are Dan's. |
| Follow-up commit | The commit that adds this file and `docs/test-evidence.md` changes documentation only. |
Repository instructions: there were none to follow (no `AGENTS.md`, `CLAUDE.md`, `README` or
`CONTRIBUTING` existed). The kickoff specification was the only instruction source.
## Changed files
Everything is new. 79 files at the head above.
| Area | Paths |
|---|---|
| Contract | `packages/contracts/src/{schemas,errors,index}.ts` |
| Bridge | `services/bridge/src/{config,db,devices,turns,server,app,main,cli,env,ratelimit}.ts`, `hermes/{adapter,runsAdapter}.ts`, `stt/{adapter,openaiCompatible}.ts` |
| Client | `apps/even-client/src/core/{reducer,controller,hud,paginate,plaintext}.ts`, `device/{port,events,evenAdapter,previewDevice}.ts`, `net/bridgeClient.ts`, `ui/phone.{ts,css}`, `main.ts`, `app.template.json`, `scripts/write-manifest.mjs` |
| Tests | `tests/fakes/*`, `tests/integration/*`, `tests/simulator/*`, `tests/real-hermes/*`, and `test/` in each package |
| Docs | `README.md`, `docs/*` |
Roughly 4,400 lines of source and 3,200 lines of tests.
## Commands and real results
Full detail, including failures along the way, is in `docs/test-evidence.md`.
| Command | Result |
|---|---|
| `npm ci` | clean install, 0 vulnerabilities reported |
| `npm run typecheck` | exit 0 |
| `npm test` | 122 passed, 0 failed (7 files) |
| `npm run test:simulator` | 6 passed, 0 failed; 10 consecutive runs of the final revision |
| `npm run test:real-hermes` | 9 passed, 0 failed |
| `npm run client:build` | built; bundle searched for server secrets, none |
| `evenhub pack ... --sdk-ver 0.0.16` | manifest accepted, `min_app_version 2.2.10`; not uploaded |
## Evidence by kind
| Kind | What exists |
|---|---|
| Fakes only | 122 tests |
| Even simulator 0.9.5 | 6 scenarios, screenshots in `docs/evidence/simulator/` |
| Real Hermes v0.23.1, stub model | 9 scenarios |
| Real STT | none |
| Real model or tools | none |
| Physical device | **none** |
## Where the specification was not followed as written, and why
1. **Hermes Runs API instead of `/v1/responses`.** `docs/decisions/0002-hermes-runs-api.md`.
2. **Two endpoints beyond the proposed list**: `POST /v1/pairing/claim` and `/v1/device`
(status, renew, revoke). The specification required pairing, status and disconnect but listed
no routes for them.
3. **Audio metadata in the query string** with a raw binary body, rather than multipart.
4. **No SSE endpoint.** Polling only.
5. **`approval_required` is a non-terminal state**, not a terminal outcome. An approval that
never arrives ends as `cancelled` with code `approval_timeout`.
6. **The bridge caches question and answer text for 15 minutes** so a client can poll for its
result and recover after a restart. The specification says the bridge stores opaque references,
not a transcript.
7. **The device token lasts 7 days**, renewable within a 90-day pairing. The specification
preferred short-lived.
8. **No latency percentiles are documented.** There is nothing real to measure yet.
9. **Not done from the implementation sequence:** step 2's "real G2 input and HUD" and step 3's
real microphone and real STT. They need the device and a provider.
## Things the author is unsure about
Offered as places to look, not as findings.
- Whether double tap as "cancel" away from the root page satisfies Even's exit rule.
- Whether classifying "stop requested but the run completed first" as `succeeded` is the right
thing to show a user who pressed cancel.
- Whether the fixed-window, in-memory rate limiter and the unbounded-by-IP pairing lockout (any
client can burn the owner's outstanding pairing code with five bad guesses) are acceptable.
- Token renewal that needs only the current token.
- `services/bridge/src/turns.ts` builds an `UPDATE` statement from object keys. The keys are
compile-time constants in this file, not request data.
- The Hermes adapter does not yet check `/v1/capabilities` for durable idempotency at startup.
- The client holds captured audio in memory for a possible resend until the user discards it.
- The real-Hermes test covers neither approvals nor the `unknown` status.
## Blockers and open decisions
| # | Item | Owner |
|---|---|---|
| 1 | Run `docs/device-test-plan.md`, starting with A13 (locked phone, pocket). | Dan |
| 2 | Choose an STT provider or a self-hosted endpoint. | Dan |
| 3 | Name the target Hermes deployment and a safe test profile. | Dan |
| 4 | Decide whether to push this branch and open a PR. | Dan |
| 5 | Independent architecture and security review of the head above. | Cody |
| 6 | Distribution model given Even's per-build network whitelist. | Dan, later |
## Not claimed
No deployment. No working hardware. No production change. No paid service used. No upload to
Even's portal. No change to any Hermes installation: the real-Hermes test used a throwaway home
directory that was deleted afterwards.
+188
View File
@@ -0,0 +1,188 @@
# Test evidence
Recorded 2026-11-18 on the development machine (Linux x64, Node 22.23.2) at commit `4687cc0`.
These are the results of commands that were actually run. Nothing here is device evidence.
## What kind of evidence each suite is
| Suite | Real | Fake or stubbed | Shows | Does not show |
|---|---|---|---|---|
| `npm test` | Client and bridge code, HTTP between them, SQLite, Even's `pretext` measurement, the SDK's event parser | Glasses, STT, Hermes | Hermeven's own logic and failure handling | Anything about Even hardware, real STT or real Hermes |
| `npm run test:simulator` | The client running in Even's simulator 0.9.5 through the real SDK bridge; the bridge | STT, Hermes; audio is ALSA's silent null device | The app boots, draws, takes gestures and uploads audio in Even's own simulator | Hardware behaviour, real audio pacing, lock screen, lifecycle |
| `npm run test:real-hermes` | The bridge and a real `hermes gateway` v0.23.1 | The language model behind Hermes | Hermes's admission, idempotency, session continuity and stop behave as the adapter assumes | A real model, tools, approvals, or Dan's deployment |
## Results
### Type check
```
$ npm run typecheck
```
Exit 0, no diagnostics, for contracts, bridge, client and tests.
### Unit and integration (fakes)
```
$ npm test
Test Files 7 passed (7)
Tests 122 passed (122)
```
Run after a clean `npm ci`. Six consecutive full runs were green after the fix described under
"Problems found" below.
| File | Tests | Covers |
|---|---|---|
| `packages/contracts/test/contracts.test.ts` | 4 | Schema acceptance and rejection, error-code retryability |
| `services/bridge/test/units.test.ts` | 13 | Config guards, credential expiry and renewal, pairing codes, adapter helpers |
| `apps/even-client/test/reducer.test.ts` | 24 | State transitions, cancellation, stale and late results, connection loss |
| `apps/even-client/test/layout.test.ts` | 16 | Pagination, Unicode, long answers, plain-text conversion, HUD frames fit |
| `apps/even-client/test/events.test.ts` | 8 | Gesture mapping through the SDK's parser, the tap-has-no-eventType quirk |
| `tests/integration/bridge.test.ts` | 40 | Auth, device binding, limits, rate limiting, STT and Hermes outcomes, duplicates, cancel, restart, redaction |
| `tests/integration/client-bridge.test.ts` | 17 | Whole software path: capture to paged answer, follow-up, cancel, loss, restart, revocation |
Requirements from spec section 9 and where they are tested:
| Requirement | Test |
|---|---|
| State machine, cancellation, stale-response races | `reducer.test.ts`; `client-bridge` "late answer never reaches the HUD" |
| Layout, pagination, Unicode, long answers | `layout.test.ts` |
| Contract validation, auth, device/profile binding, body limits, rate limiting, redaction | `bridge.test.ts`, `units.test.ts`, `contracts.test.ts` |
| STT failure and timeout | `bridge.test.ts` "STT failures" |
| Hermes failure, cancellation, incomplete, approval | `bridge.test.ts` "turn lifecycle" |
| Duplicate submit | 8 concurrent identical submits: 1 execution |
| Retry after network loss | Lost Hermes reply retried under one key; client resend of an undelivered request |
| Bridge restart | Mid-run re-attach; crash between send and recording the run id; restart during transcription |
| Repeated cancel | 5 concurrent cancels: one stop sent to Hermes |
| Unknown downstream outcome | Unanswered submit; Hermes `unknown`; run forgotten; unconfirmed stop |
### Did the tests have teeth?
Because the suites passed on first run, ten deliberate faults were injected one at a time and
the suite re-run. Eight were caught immediately. Two survived, which exposed two missing tests;
both were added and both faults are now caught.
| Injected fault | Caught |
|---|---|
| Client accepts stale turn results | Not at first; test added; now 2 failures |
| Bridge skips request-id deduplication | 3 failures |
| New idempotency key on every Hermes attempt | 3 failures |
| Cancel does not ask Hermes to stop | 5 failures |
| Turn lookup ignores device ownership | 1 failure |
| Unanswered submit treated as safely retryable | Not at first; test added; now 1 failure |
| Recovery discards an in-flight run | 2 failures |
| Microphone reopens on glasses reconnect | 2 failures |
| Transcript written to the log | 1 failure |
| Pagination ignores the line budget | 5 failures |
### Simulator
```
$ npm run test:simulator
Tests 6 passed (6)
```
Even Hub simulator 0.9.5, launched with `--automation-port`, `--no-glow`, `--aid alsa:null`.
Ten consecutive runs passed in the final form of the test.
| Scenario | Result |
|---|---|
| Boots through the SDK bridge, creates the HUD page (with the menu declaration), pairs | pass |
| Tap opens the microphone; frames arrive; capture is uploaded as 16 kHz mono 16-bit WAV; answer is drawn across pages | pass |
| Swipe down changes the page; swipe up returns a pixel-identical first page | pass |
| A second question continues the same Hermes session (fake) | pass |
| Double tap while recording cancels with no upload; double tap again returns to Ready | pass |
| No uncaught errors, unhandled rejections or failed fetches in the WebView | pass |
Screenshots from the simulator (not from glasses) are in `docs/evidence/simulator/`.
Caveats, all of them material:
- **Audio pacing was not tested.** The silent null device was chosen so the test would not open
the machine's real microphone. It is not paced in real time: between 19 and 120 "seconds" of
silence arrived within a few hundred milliseconds. So "tap again to stop" is sometimes pre-empted
by the capture cap in this test, and the elapsed-time display was never seen counting in real
time. The test asserts what holds on either path.
- **The simulator test was flaky before it was fixed.** Across three earlier revisions of the
test, 10 runs were made: 6 passed fully and 4 had one or two failing scenarios (the cap fired
before the scripted second tap; an instant second tap recorded nothing). Those were faults in
the test's timing assumptions, corrected as above; the app's behaviour in both cases was the
designed one. The 10 consecutive passes are of the final revision only.
- **The contextual menu was declared but no item was selected.**
- **Status events are not emitted by the simulator**, so glasses connect/disconnect is untested here.
- The simulator's event source is always the right temple. Ring and left temple are untested.
### Real Hermes, stub model
```
$ npm run test:real-hermes
Tests 9 passed (9)
```
hermes-agent v0.23.1 (`/health` reported `"version":"0.23.1"`), started with a throwaway
`HERMES_HOME` and pointed at a local stub model. The operator's own Hermes home was not read or
written (its `state.db`, `config.yaml` and `gateway_state.json` modification times were unchanged).
| Scenario | Result |
|---|---|
| Capabilities advertise run submission, status, stop, and durable idempotency (86,400 s retention) | pass |
| Device status reports the agent reachable | pass |
| Typed question answered through Hermes; Hermeven's per-request instructions reach the model's system prompt | pass |
| Follow-up: the model was handed both user turns by Hermes although the bridge sent only the new one; a new conversation starts clean | pass |
| Six concurrent identical submits reach the model once | pass |
| Hermes replays an identical keyed request and answers 409 to a changed one | pass |
| Cancel during a slow turn settles as cancelled with no answer | pass (about 200 ms to confirm) |
| Bridge restart mid-turn re-attaches; the model is called once | pass |
| Wrong Hermes key: rejected, nothing runs | pass |
Two of the nine failed on the first run because the stub model mistook Hermes's background
"name this chat" request for an agent turn. That was a fault in the stub, fixed.
Timings seen here (stub model, loopback, one sample each): first turn about 1.4 s in Hermes;
later turns well under 1 s. These are not performance figures for anything real.
### Build and packaging
```
$ npm run client:build # 291 kB JS (88 kB gzip), 2 kB CSS
$ HERMEVEN_BRIDGE_ORIGIN=https://bridge.example.invalid node apps/even-client/scripts/write-manifest.mjs
$ evenhub pack dist-manifest/app.json dist --sdk-ver 0.0.16
Stamped ... (95914 bytes) min_app_version 2.2.10
```
The official CLI accepted the generated manifest. The package was not uploaded anywhere. The
production bundle was searched for server key names and the development-only pairing hook; none
were present.
### Process smoke test
`npm run bridge` started, `/healthz` answered `{"status":"ok","schema_version":1}`, an
unauthenticated `/v1/device` answered 401, `bridge:cli -- pair` printed a code, and starting with
`HERMEVEN_HOST=0.0.0.0` was refused with the configuration error.
## Problems found while testing
| Problem | Kind | Resolution |
|---|---|---|
| A stopped client controller kept polling and could draw or emit afterwards | Product bug | `Controller.stop()` is now final; found by an intermittent cross-test failure |
| Two faults not detected by the suite | Test gap | Two tests added |
| `evenhub-simulator` command link missing after `npm ci` | Tooling quirk | `npm run simulate` calls the package directly |
| Simulator test timing assumptions | Test fault | Described above |
| Stub model counted housekeeping calls as turns | Test fault | Fixed |
## Not tested at all
- A physical G2, the R1 ring, the Even phone app, any phone.
- The microphone with the phone locked or the app in the background.
- Real speech-to-text, in any language.
- A real language model, real tools, a real approval prompt.
- Hermes `waiting_for_approval`, `unknown`, `interrupted` and stopped-short runs against real
Hermes (fake only).
- Dan's target Hermes deployment and any multi-profile routing.
- HTTPS termination, reverse proxy, or any network other than loopback.
- CORS from the real WebView origin; the network whitelist on a packaged build.
- Battery use, latency percentiles, legibility.
- Selecting a contextual-menu item.
The checklist for the hardware items is `docs/device-test-plan.md`.