First vertical slice: Even client, bridge, contract v1, tests, docs
Client (apps/even-client): pure interaction reducer with generation-based stale-result rejection, HUD renderer, measured pagination, Even Hub SDK 0.0.16 adapter, bridge HTTP client, phone pairing/status/diagnostics page. Bridge (services/bridge): device pairing and revocable expiring credentials, turn engine with idempotent submit, cancel, deadlines and restart recovery, Hermes Runs API adapter, OpenAI-compatible STT adapter, operator CLI. Contract (packages/contracts): versioned schemas, types and error codes. Tests: 122 unit/integration (fakes), 6 simulator scenarios (Even Hub simulator 0.9.5), 9 scenarios against a real Hermes v0.23.1 gateway with a stub model. No real STT, real model or physical device has been exercised; see docs/test-evidence.md and docs/device-test-plan.md. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,104 @@
|
||||
# Architecture
|
||||
|
||||
```
|
||||
G2 mic / touch / HUD
|
||||
| Bluetooth (Even's protocol, not ours)
|
||||
Even phone app -- WebView running apps/even-client (public Even Hub SDK)
|
||||
| HTTPS, device credential, polling
|
||||
services/bridge (Fastify + SQLite)
|
||||
|-- STT adapter --> an OpenAI-compatible transcription endpoint you choose
|
||||
|-- Hermes adapter --> Hermes API server (Runs API) for one configured profile
|
||||
```
|
||||
|
||||
## Who owns what
|
||||
|
||||
| Concern | Owner |
|
||||
|---|---|
|
||||
| Agent identity, memory, transcript, model, tools, approval policy | Hermes |
|
||||
| Device authorisation, request deduplication, turn lifecycle, deadlines | Bridge |
|
||||
| Microphone, gestures, HUD, app lifecycle | Even runtime on the phone |
|
||||
| Starting, cancelling, resetting, approving | The user |
|
||||
|
||||
The bridge stores references and a short-lived result cache, not a transcript. Question and
|
||||
answer text is erased from the bridge 15 minutes after a turn ends (configurable).
|
||||
|
||||
## Packages
|
||||
|
||||
| Path | Role |
|
||||
|---|---|
|
||||
| `packages/contracts` | Contract v1: JSON Schemas (TypeBox), types, stable error codes. Imported by both sides. |
|
||||
| `services/bridge` | HTTP API, pairing and credentials, turn engine, Hermes and STT adapters, operator CLI. |
|
||||
| `apps/even-client` | Pure state reducer, HUD renderer, pagination, Even adapter, bridge client, phone page. |
|
||||
| `tests/fakes` | Labelled fakes: Hermes Runs API, STT endpoint, glasses, stub model. |
|
||||
| `tests/integration` | Bridge over HTTP, and client-to-bridge end to end, against the fakes. |
|
||||
| `tests/simulator` | The real client in the official simulator. |
|
||||
| `tests/real-hermes` | The bridge against a real Hermes gateway with a stub model. |
|
||||
|
||||
## Client
|
||||
|
||||
`core/reducer.ts` is a pure function `(state, event) -> (state, effects)`. It has no clock, no
|
||||
network and no randomness: request ids arrive inside events and work leaves as effects.
|
||||
|
||||
```
|
||||
READY -> LISTENING -> TRANSCRIBING -> THINKING -> ANSWER
|
||||
plus APPROVAL, ERROR, DISCONNECTED, CANCELLED, UNPAIRED
|
||||
```
|
||||
|
||||
Every user action that starts, cancels or abandons something increments a **generation**
|
||||
counter. Each asynchronous effect carries the generation it started under, and the reducer drops
|
||||
any event whose generation is not current or whose request id is not the current one. That is the
|
||||
single mechanism behind "a late result must not replace a newer answer or resurrect a cancelled
|
||||
screen".
|
||||
|
||||
`core/controller.ts` runs the effects: microphone capture, submit with retry, polling, cancel,
|
||||
conversation creation, persistence. `device/port.ts` is the seam to the glasses; the Even adapter
|
||||
and the test fake both implement it.
|
||||
|
||||
## Bridge turn lifecycle
|
||||
|
||||
```
|
||||
accepted -> transcribing -> thinking -> done
|
||||
|-> approval_required -> thinking
|
||||
|-> cancelling -> done
|
||||
```
|
||||
|
||||
`done` always carries an outcome: `succeeded`, `incomplete`, `failed`, `cancelled` or `unknown`.
|
||||
|
||||
Order of operations for one turn:
|
||||
|
||||
1. Validate, authenticate, check the conversation belongs to the device and is open, and that no
|
||||
other turn is running in it. Insert the turn row keyed by the client's request id. A repeat of
|
||||
the same request id returns the existing turn.
|
||||
2. Audio only: wrap the PCM as WAV in memory, transcribe, drop the audio.
|
||||
3. Persist the exact Hermes request body, then send it with `Idempotency-Key`.
|
||||
4. Persist the returned run id and erase the stored body.
|
||||
5. Poll the run until it is terminal, a deadline passes, or a cancel is requested.
|
||||
|
||||
Why the order matters: after step 3 a crash can always be recovered by re-sending the identical
|
||||
body under the same key (Hermes returns the original run), and before step 3 nothing has reached
|
||||
Hermes, so failing the turn is provably safe.
|
||||
|
||||
## How ambiguous situations are classified
|
||||
|
||||
| Situation | Outcome | Retryable |
|
||||
|---|---|---|
|
||||
| STT error, timeout or empty transcript | failed | yes: nothing reached Hermes |
|
||||
| Bridge restarted before step 3 | failed (`interrupted_before_agent`) | yes |
|
||||
| Connection to Hermes refused on every attempt | failed (`agent_unreachable`) | yes |
|
||||
| Hermes answered 4xx | failed (`agent_rejected`) | no |
|
||||
| Request sent, no usable reply, deadline passed | **unknown** | no |
|
||||
| Hermes reports `unknown` or no longer knows the run | **unknown** | no |
|
||||
| Deadline passed, stop requested, Hermes confirmed | cancelled (`agent_timeout`) | no |
|
||||
| Stop requested, not confirmed within the grace period | **unknown** | no |
|
||||
| Cancel requested but the run completed first | succeeded, `cancel_requested: true` | n/a |
|
||||
|
||||
"Retryable" means a deliberate new question by the user is safe. Nothing is ever replayed
|
||||
automatically under a new request id.
|
||||
|
||||
## Deliberate limits of this slice
|
||||
|
||||
- One process, one profile, one active conversation per device.
|
||||
- Polling only; no streaming.
|
||||
- A second question while one is running in the same conversation is refused
|
||||
(`conversation_busy`), not queued.
|
||||
- Capture ends by tap or cap. There is no end-of-speech detection.
|
||||
@@ -0,0 +1,126 @@
|
||||
# Bridge API, contract v1
|
||||
|
||||
These endpoints are Hermeven's own. They are not Hermes or Even APIs. Schemas live in
|
||||
`packages/contracts/src/schemas.ts` and are enforced on every request; the client validates
|
||||
every response against the same schemas.
|
||||
|
||||
All routes except `/healthz` and `/v1/pairing/claim` require `Authorization: Bearer <device token>`.
|
||||
Every error has the shape:
|
||||
|
||||
```json
|
||||
{ "schema_version": 1, "error": { "code": "conversation_busy", "message": "...", "retryable": true } }
|
||||
```
|
||||
|
||||
| Method and path | Purpose | Success |
|
||||
|---|---|---|
|
||||
| `GET /healthz` | Liveness only. Returns `{"status":"ok","schema_version":1}` and nothing else. | 200 |
|
||||
| `POST /v1/pairing/claim` | Exchange a single-use pairing code for a device credential. | 201 |
|
||||
| `GET /v1/device` | Pairing status, limits, whether the agent is reachable and STT is configured. | 200 |
|
||||
| `POST /v1/device/renew` | Rotate the device token. The old token stops working at once. | 200 |
|
||||
| `DELETE /v1/device` | Revoke this device and close its conversation. | 200 |
|
||||
| `POST /v1/conversations` | Start a new conversation; closes the device's previous one. | 201 |
|
||||
| `POST /v1/turns` | Create one turn (text or audio). | 202, or 200 for a duplicate |
|
||||
| `GET /v1/turns/{request_id}` | Current state and result. | 200 |
|
||||
| `POST /v1/turns/{request_id}/cancel` | Request cancellation. Idempotent. | 200 |
|
||||
|
||||
There is no SSE endpoint. Streaming through the Even WebView is undocumented and untested, so
|
||||
polling is the supported path.
|
||||
|
||||
## Creating a turn
|
||||
|
||||
Typed text (`Content-Type: application/json`):
|
||||
|
||||
```json
|
||||
{
|
||||
"schema_version": 1,
|
||||
"request_id": "0b9f6c1e-3c1d-4b1e-9a51-2f6d0f4c8a11",
|
||||
"conversation_id": "5d0c2c35-6a8f-4f0e-8f55-0d1f7c0b2a90",
|
||||
"locale": "en-US",
|
||||
"input": { "kind": "text", "text": "What is on my calendar tomorrow?" }
|
||||
}
|
||||
```
|
||||
|
||||
Audio (`Content-Type: application/octet-stream`): the body is the raw PCM, and the metadata is in
|
||||
the query string. Audio is never placed in JSON.
|
||||
|
||||
```
|
||||
POST /v1/turns?schema_version=1&request_id=...&conversation_id=...&locale=en-US
|
||||
&input_kind=audio&encoding=pcm_s16le&sample_rate=16000&channels=1
|
||||
```
|
||||
|
||||
| Rule | Value |
|
||||
|---|---|
|
||||
| Accepted audio | `pcm_s16le`, 16000 Hz, 1 channel. Anything else: 415 `unsupported_media`. |
|
||||
| Maximum audio | capture cap + 1 second, 992,000 bytes at the default 30 s. Larger: 413. |
|
||||
| Maximum text | 4,000 characters |
|
||||
| Unknown fields | rejected (400). A client cannot name a Hermes session or profile. |
|
||||
| Rate | 20 new turns per minute per device by default. Duplicates do not count. |
|
||||
|
||||
`request_id` is generated by the client and is the idempotency identity. Submitting the same id
|
||||
with the same content returns the existing turn with `"replayed": true`. The same id with
|
||||
different content, or from another device, returns 409 `request_id_conflict`.
|
||||
|
||||
## Turn result
|
||||
|
||||
```json
|
||||
{
|
||||
"schema_version": 1,
|
||||
"request_id": "...",
|
||||
"conversation_id": "...",
|
||||
"state": "done",
|
||||
"terminal": true,
|
||||
"outcome": "succeeded",
|
||||
"cancel_requested": false,
|
||||
"input_text": "what is on my calendar tomorrow",
|
||||
"answer_text": "...",
|
||||
"error": null,
|
||||
"replayed": false,
|
||||
"created_at": "2026-11-18T18:00:00.000Z",
|
||||
"updated_at": "2026-11-18T18:00:04.210Z",
|
||||
"timings": { "transcribe_ms": 640, "agent_ms": 3410 }
|
||||
}
|
||||
```
|
||||
|
||||
- `state`: `accepted`, `transcribing`, `thinking`, `approval_required`, `cancelling`, `done`.
|
||||
- `outcome` (when `terminal`): `succeeded`, `incomplete`, `failed`, `cancelled`, `unknown`.
|
||||
- `answer_text` is the agent's complete answer. The bridge never shortens it.
|
||||
- `input_text` and `answer_text` become `null` once the retention window passes.
|
||||
- An HTTP 200 only means the bridge answered. Read `terminal` and `outcome`.
|
||||
|
||||
## Error codes
|
||||
|
||||
Defined in `packages/contracts/src/errors.ts`. Codes are stable; a code is never repurposed.
|
||||
|
||||
| Code | Meaning | Retryable |
|
||||
|---|---|---|
|
||||
| `invalid_request`, `unsupported_schema_version`, `unsupported_media`, `payload_too_large` | The request was malformed. | no |
|
||||
| `unauthorized`, `credential_expired`, `forbidden` | Credential missing, revoked or expired. | no |
|
||||
| `pairing_invalid`, `pairing_locked` | Wrong code; too many wrong codes. | no |
|
||||
| `not_found` | Unknown, or belongs to another device. | no |
|
||||
| `request_id_conflict` | Request id reused for different content. | no |
|
||||
| `conversation_busy` | A turn is still running in this conversation. | yes |
|
||||
| `conversation_closed` | The conversation was replaced or the device was revoked. | no |
|
||||
| `rate_limited` | Too many requests. | yes |
|
||||
| `stt_unavailable`, `stt_failed`, `stt_timeout`, `stt_empty` | Transcription did not produce text. Nothing reached the agent. | yes |
|
||||
| `interrupted_before_agent` | The bridge restarted before sending. Nothing ran. | yes |
|
||||
| `agent_unreachable` | Hermes never received the request. Nothing ran. | yes |
|
||||
| `agent_rejected` | Hermes refused the request. Nothing ran. | no |
|
||||
| `agent_failed`, `agent_interrupted` | The agent ran and failed or was interrupted. Actions already taken are not undone. | no |
|
||||
| `agent_timeout`, `approval_timeout` | The bridge stopped the run after a deadline. | no |
|
||||
| `agent_incomplete` | The agent stopped short; the answer is partial. | no |
|
||||
| `outcome_unknown` | The bridge cannot tell whether the turn ran. Check the agent first. | no |
|
||||
|
||||
## Operating budgets
|
||||
|
||||
Defaults, all configurable. These are limits, not measured performance.
|
||||
|
||||
| Budget | Default |
|
||||
|---|---|
|
||||
| Capture | 30 s |
|
||||
| Transcription deadline | 30 s |
|
||||
| Agent deadline | 120 s, paused while an approval is pending |
|
||||
| Approval wait | 300 s |
|
||||
| Grace period to confirm a stop | 30 s |
|
||||
|
||||
No latency percentiles are published because none have been measured against a real STT
|
||||
provider, a real model or a real device.
|
||||
@@ -0,0 +1,53 @@
|
||||
# Draft 01: A first slice, and what it does not prove yet
|
||||
|
||||
> Draft, written by Claude (an AI agent) on 2026-11-18. Not published anywhere. Not approved by
|
||||
> Dan. Not in Dan's voice. No part of this describes real glasses.
|
||||
|
||||
## What was attempted
|
||||
|
||||
A first end-to-end slice of Hermeven: tap the glasses, ask a question out loud, read a short
|
||||
answer on the display, ask a follow-up. The agent behind it is the user's own Hermes; a small
|
||||
bridge sits between the glasses app and Hermes.
|
||||
|
||||
## What actually ran
|
||||
|
||||
- The glasses app, inside Even's official simulator: it created its display page, opened the
|
||||
simulated microphone on a tap, sent the audio on a second tap, drew a multi-page answer, turned
|
||||
pages on a swipe, took a follow-up, and cancelled on a double tap.
|
||||
- The bridge, against a real Hermes gateway running a stand-in model: a typed question was
|
||||
answered, a follow-up carried the earlier turn, six identical submissions reached the model
|
||||
once, a cancel stopped the run, and a bridge restart mid-answer still delivered it once.
|
||||
- Automated tests of the awkward cases: lost replies, timeouts, duplicate taps, revoked
|
||||
credentials, late answers arriving after a cancel.
|
||||
|
||||
## What did not run
|
||||
|
||||
- Nothing ran on real glasses.
|
||||
- No real speech was transcribed. The recogniser in every test was a stand-in.
|
||||
- No real language model answered. No real tool was called.
|
||||
|
||||
## What was learned
|
||||
|
||||
- Even's public SDK hands apps raw audio, not text. Transcription has to happen elsewhere.
|
||||
- An Even Hub app may only call servers named in its package. So "bring your own agent" means
|
||||
a build per server for now.
|
||||
- Even's documentation says microphone capture stops when the phone app is suspended. The whole
|
||||
idea rests on asking with the phone locked in a pocket, and that is untested.
|
||||
- Two official sources disagreed with the published SDK about a background feature. The
|
||||
published package won.
|
||||
|
||||
## What failed along the way
|
||||
|
||||
- The first simulator run "recorded" 30 seconds in under two: the silent test audio device is not
|
||||
paced in real time. The test was wrong, not the app.
|
||||
- One test passed for the wrong reason and one failed for the wrong reason; deliberately breaking
|
||||
the code to see which tests noticed found two gaps, now covered.
|
||||
|
||||
## Next bounded step
|
||||
|
||||
Put it on the glasses and run the first checklist item that matters: phone locked, in a pocket,
|
||||
ask a question. Report what happens either way.
|
||||
|
||||
## Evidence
|
||||
|
||||
`docs/test-evidence.md`, `docs/evidence/simulator/` (simulator screenshots, labelled as such).
|
||||
@@ -0,0 +1,53 @@
|
||||
# Compatibility matrix
|
||||
|
||||
Recorded 2026-11-18. Versions are pinned in `package-lock.json`; the Even packages are pinned
|
||||
exactly in `apps/even-client/package.json`.
|
||||
|
||||
## Repository baseline
|
||||
|
||||
| Item | Value |
|
||||
|---|---|
|
||||
| Remote | `git@git.xylo.gg:Xylo-Digital/hermeven.git` |
|
||||
| State when work began | Empty repository: `git ls-remote` returned no refs, so there was no base branch, no base SHA and no repository instructions to follow. |
|
||||
| Working branch | `feat/vertical-slice-1` (local; nothing has been pushed) |
|
||||
|
||||
## Even
|
||||
|
||||
| Component | Version | How it was used |
|
||||
|---|---|---|
|
||||
| `@evenrealities/even_hub_sdk` | 0.0.16 | Client runtime. Declares minimum Even app 2.2.10. |
|
||||
| `@evenrealities/pretext` | 0.1.4 | Text measurement for pagination. |
|
||||
| `@evenrealities/evenhub-simulator` | 0.9.5 (linux-x64) | Simulator tests. |
|
||||
| `@evenrealities/evenhub-cli` | 0.2.0 | `evenhub pack` accepted the generated manifest and stamped `min_app_version 2.2.10`. |
|
||||
| Even phone app | not tested | Must be 2.2.10 or later per the SDK. |
|
||||
| G2 firmware, R1 ring | not tested | No device was available. |
|
||||
|
||||
## Hermes
|
||||
|
||||
| Component | Version | How it was used |
|
||||
|---|---|---|
|
||||
| hermes-agent | v0.23.1 (2026.9.24), commit `3b42157` | Docs and source read; a real gateway run in a throwaway `HERMES_HOME` with a stub model. |
|
||||
| API surface used | `GET /health`, `POST /v1/runs`, `GET /v1/runs/{id}`, `POST /v1/runs/{id}/stop` | See `docs/decisions/0002-hermes-runs-api.md`. |
|
||||
| Dan's target Hermes deployment | **not inspected** | No access. Version and configuration unverified. |
|
||||
|
||||
## Toolchain
|
||||
|
||||
| Component | Version |
|
||||
|---|---|
|
||||
| Node.js | 22.23.2 (requires 22.13 or later) |
|
||||
| TypeScript | 5.9.3 |
|
||||
| Vite / Vitest | 8.3.8 / 5.1.1 |
|
||||
| Fastify / @fastify/cors | 5.12.8 / 11.4.3 |
|
||||
| better-sqlite3 | 13.2.0 |
|
||||
| @sinclair/typebox | 0.34.52 |
|
||||
| pino | 10.4.0 |
|
||||
|
||||
## Known version hazards
|
||||
|
||||
- The official `everything-evenhub` skills describe SDK 0.0.12 and simulator 0.7.1 in places and
|
||||
are stale against 0.0.16. They name two functions (`setBackgroundState`,
|
||||
`onBackgroundRestore`) that SDK 0.0.16 does not export. See `docs/feasibility.md` item 8.
|
||||
- `evenhub pack` reads the SDK's minimum app version from npm `latest` unless `--sdk-ver` is
|
||||
given. The `pack` script passes `--sdk-ver 0.0.16` so builds are reproducible.
|
||||
- Hermes keeps a keyed run's idempotency record for 24 hours. The bridge finishes or abandons a
|
||||
turn within minutes, so the window is not a constraint today.
|
||||
@@ -0,0 +1,18 @@
|
||||
# 0001: TypeScript monorepo, SQLite, no new services
|
||||
|
||||
Status: accepted for the first slice. Date: 2026-11-18.
|
||||
|
||||
The repository was empty, so the layout proposed in the specification was adopted as written:
|
||||
`apps/even-client`, `services/bridge`, `packages/contracts`, `tests`, `docs`.
|
||||
|
||||
- One language end to end, so the client and the bridge compile against the same contract types
|
||||
and JSON Schemas (`@hermeven/contracts`, TypeBox).
|
||||
- npm workspaces, no build step for the bridge (run with `tsx`). A compiled build can come with
|
||||
packaging.
|
||||
- SQLite (better-sqlite3, WAL) for devices, conversation bindings and turn records. Single user,
|
||||
single process; no database service or queue.
|
||||
- The operator CLI writes to the SQLite file directly, so the bridge exposes no administrative
|
||||
endpoint at all.
|
||||
|
||||
Consequence: rate limits and in-flight turn workers are in-process. Running two bridge processes
|
||||
on one database is not supported.
|
||||
@@ -0,0 +1,51 @@
|
||||
# 0002: Use the Hermes Runs API, not `/v1/responses`
|
||||
|
||||
Status: accepted for the first slice; revisit if the target Hermes differs. Date: 2026-11-18.
|
||||
|
||||
## Context
|
||||
|
||||
The specification says to use the supported authenticated Hermes API, "normally
|
||||
`/v1/responses`", and to verify cancellation, idempotency and continuity before relying on it.
|
||||
Both were checked against hermes-agent v0.23.1 (docs and source), then against a running gateway.
|
||||
|
||||
| Need | `/v1/responses` | `/v1/runs` |
|
||||
|---|---|---|
|
||||
| Start a turn without holding a connection for its whole duration | No. Non-streaming blocks until the turn ends; streaming holds an SSE connection. | Yes. Returns 202 and a `run_id` at once. |
|
||||
| Read status later, including after a bridge restart | Only the finished response by id. | `GET /v1/runs/{id}`. |
|
||||
| Cancel | No endpoint. Only dropping a streaming connection interrupts the agent. | `POST /v1/runs/{id}/stop`; status settles as `cancelled`. |
|
||||
| Idempotent create | Yes, with replay rules that depend on the response store. | Yes: durable reservation, 24-hour retention, identical retry returns the same `run_id`. |
|
||||
| Approval-required visible | Not as a pollable state. | `waiting_for_approval`. |
|
||||
| "Outcome unknown" visible | 409 `unknown_execution` on retry. | `unknown` status. |
|
||||
| Continuity | `previous_response_id` or `conversation`. | `session_id` (loads that session's transcript). |
|
||||
|
||||
## Decision
|
||||
|
||||
One adapter (`services/bridge/src/hermes/runsAdapter.ts`) using `POST /v1/runs`,
|
||||
`GET /v1/runs/{id}` and `POST /v1/runs/{id}/stop`.
|
||||
|
||||
- Continuity: each Hermeven conversation owns one bridge-generated Hermes `session_id`
|
||||
(`hermeven-<uuid>`). It is never accepted from, or shown to, a client.
|
||||
- Idempotency: `Idempotency-Key: hermeven-turn-<request id>`. The exact request body is persisted
|
||||
before the first attempt so a retry is byte-identical, and erased once the run id is stored.
|
||||
- The bridge never calls the approval endpoint.
|
||||
|
||||
## Verified
|
||||
|
||||
Against a real gateway with a stub model: admission, identical replay
|
||||
(`Idempotency-Replayed: true`), 409 on a changed body, session continuity (the model received
|
||||
both user turns), stop settling as `cancelled`, and re-attachment after a bridge restart.
|
||||
|
||||
## Not verified
|
||||
|
||||
`waiting_for_approval`, `unknown`, `interrupted` and the stopped-short (`completed: false`) shape
|
||||
are implemented from the source and exercised only against the test fake, because the stub model
|
||||
calls no tools. They need a run against a real model with a tool that requires approval.
|
||||
|
||||
## Consequences
|
||||
|
||||
- Polling adds up to one poll interval (500 ms by default) of latency to every answer.
|
||||
- No token streaming to the HUD. Acceptable: the HUD shows whole pages, and streaming through the
|
||||
Even WebView is undocumented.
|
||||
- If the target Hermes runs without the durable run ledger, the idempotency guarantee weakens.
|
||||
The bridge should check `/v1/capabilities` `runs_idempotency.durable` at startup; that check is
|
||||
not implemented yet.
|
||||
@@ -0,0 +1,22 @@
|
||||
# 0003: Gesture binding for the first slice
|
||||
|
||||
Status: provisional until device-tested. Date: 2026-11-18.
|
||||
|
||||
The product contract is the set of semantic actions (activate, stop/submit, cancel/back,
|
||||
next/previous page, new conversation). Gestures are a replaceable binding.
|
||||
|
||||
| Action | Binding | Why |
|
||||
|---|---|---|
|
||||
| activate, stop/submit | tap | The only gesture every source agrees reaches the app. Tap to start and tap to stop makes the end of capture explicit and deterministic. |
|
||||
| cancel / back | double tap | Even's submission rules require double tap on the root page to open the OS exit dialog. Treating double tap as "back one level" everywhere makes that the natural end of the same gesture. |
|
||||
| next / previous page | swipe down / swipe up | Matches Even's text-heavy template. |
|
||||
| new conversation, cancel request | OS contextual menu items | Keeps a destructive-feeling action off a single accidental gesture. |
|
||||
|
||||
Rejected for now:
|
||||
|
||||
- **Hold to talk** (long press, release to send). Attractive, but the OS claims tap-then-long-press
|
||||
for its menu, and the two official sources disagree about how long-press events are routed.
|
||||
- **End-of-speech detection.** Not attempted. Capture ends on tap, cancel, or the visible cap.
|
||||
|
||||
Open for device testing: whether Even treats a double tap that cancels a request (not on the root
|
||||
page) as acceptable under its exit rule, accidental double-tap rate, and ring behaviour.
|
||||
@@ -0,0 +1,80 @@
|
||||
# Physical-device test plan
|
||||
|
||||
**Status: not started. No step below has been run.** Only Dan, or someone holding the G2, can run
|
||||
these and sign them off. A passing simulator or test suite does not count toward any item here.
|
||||
|
||||
Record results in a copy of this file under `docs/evidence/device/<date>.md`: for every step
|
||||
write pass, fail or not run, plus what you saw. Record failures as carefully as passes.
|
||||
|
||||
## Before you start: write these down
|
||||
|
||||
| Item | Value |
|
||||
|---|---|
|
||||
| Date and tester | |
|
||||
| Hermeven commit | |
|
||||
| G2 firmware version | |
|
||||
| R1 ring firmware (if used) | |
|
||||
| Even phone app version (needs 2.2.10+) | |
|
||||
| Phone model and OS version | |
|
||||
| Install method | QR sideload / private test / **beta channel** |
|
||||
| Bridge host, how the phone reaches it | |
|
||||
| Hermes version and profile (read-only or test profile) | |
|
||||
| STT provider and model | |
|
||||
|
||||
Lock-screen steps are only meaningful on a **beta-channel build**: Even's docs say sideloaded
|
||||
apps stop when the phone locks.
|
||||
|
||||
## A. Feasibility checks (do these first; each answers an open question)
|
||||
|
||||
| # | Step | What to record | Open question it answers |
|
||||
|---|---|---|---|
|
||||
| A1 | Open the phone page, Diagnostics. | The exact "Page origin" value. Put it in `HERMEVEN_ALLOWED_ORIGINS`. | WebView origin is undocumented. |
|
||||
| A2 | Pair with a code from `bridge:cli -- pair`. | Does pairing succeed? If not, the error text. | Whitelist and CORS on a real phone. |
|
||||
| A3 | Look at the HUD at rest. | Is "Hermeven / Ready." and the status line fully readable in your fitted position? Photo if possible. | Legibility, layout. |
|
||||
| A4 | Tap once on the right temple. | Does the HUD show `● REC` with a running timer? Was there a permission prompt? | Tap delivery; mic permission. |
|
||||
| A5 | Speak for about 5 seconds, tap again. | The timer value when you tapped, and "captured N s" in Diagnostics. Do they agree within a second? | Real frame pacing and size. |
|
||||
| A6 | Wait for the answer. | Was the transcript (phone page, "Sent to the agent") what you said? Time from tap to answer. | Real STT and Hermes path. |
|
||||
| A7 | Ask something with a long answer. Swipe down, then up. | Does each swipe turn exactly one page? Does any page scroll inside itself or cut a line? | Whether measurement matches firmware. |
|
||||
| A8 | Double tap on an answer, then double tap again at "Ready". | First returns to Ready; second shows the system exit dialog. | Double-tap delivery; exit rule. |
|
||||
| A9 | Tap, then long-press. | Does the OS menu show "New conversation" and "Cancel request"? Choose "New conversation". | Contextual menu, never exercised. |
|
||||
| A10 | Repeat A4 to A8 with the left temple, then the ring. | Any gesture that behaves differently. | Ring and left-temple parity. |
|
||||
| A11 | While recording, read the phone's developer console. | Is raw audio data being printed there? | Audio echo seen in the simulator. |
|
||||
| A12 | Start recording and say nothing for 35 seconds. | Does it stop by itself at 0:30 and submit? | Capture cap. |
|
||||
| A13 | **Lock the phone, put it in a pocket, tap, ask, tap.** | Does `● REC` appear? Does an answer arrive? If not, what does the HUD show? | **The first outcome.** |
|
||||
| A14 | With the phone locked for 5 minutes, tap. | Is the app still responsive? | Suspension. |
|
||||
| A15 | Try to start native captions while Hermeven is open, and Hermeven while captions run. | Exactly what happens and how you get back. | Coexistence with captions. |
|
||||
| A16 | Answer containing accents, a currency symbol, and non-Latin text. | Which characters appear, which are missing. | Glyph coverage. |
|
||||
|
||||
If A13 fails, stop and report it. It is a product-level blocker, not a bug to work around.
|
||||
|
||||
## B. Real integration (spec section 9)
|
||||
|
||||
| # | Step | Pass condition |
|
||||
|---|---|---|
|
||||
| B1 | One spoken question, real STT, real Hermes, answer on the HUD. | Answer is relevant to what was said. |
|
||||
| B2 | Say "My name is <name>." then ask "What is my name?" | Second answer uses the name. |
|
||||
| B3 | Choose "New conversation", ask "What is my name?" | The agent does not know. |
|
||||
| B4 | With a tool that leaves a countable trace (for example appending a line to a test file), ask once, and while it is thinking pull the phone's network for 5 seconds. | The trace shows exactly one execution. |
|
||||
| B5 | Ask for something that needs approval in the test profile. | HUD says approval required; nothing is approved from the glasses; approving on Hermes's own surface completes it. |
|
||||
| B6 | Start a long request, double tap. | HUD says Cancelled; the phone page shows the true outcome; no late answer appears. |
|
||||
|
||||
## C. Acceptance (do not call the MVP usable before these)
|
||||
|
||||
| # | Step | Record |
|
||||
|---|---|---|
|
||||
| C1 | 10 consecutive question and follow-up cycles, phone locked and pocketed. | Attempts, successes, and every failure with what the HUD showed. |
|
||||
| C2 | Turn Bluetooth off for 20 seconds while idle, and again while waiting for an answer. | What the HUD shows; whether the answer still arrives; that the microphone did not reopen. |
|
||||
| C3 | Walk out of range while recording, come back. | Recording stopped; nothing was sent; no automatic recording on return. |
|
||||
| C4 | Switch to another phone app for a minute and back, idle and mid-request. | State on return. |
|
||||
| C5 | Take a phone call mid-recording and mid-request. | State afterwards; no unintended recording. |
|
||||
| C6 | Restart the bridge mid-request. | The answer still arrives once; no duplicate tool run. |
|
||||
| C7 | Revoke the device on the bridge host, then tap and ask. | HUD says to pair again; nothing reaches the agent. |
|
||||
| C8 | Over the whole session: any unintended recording, any answer from the wrong conversation, any stale answer, any duplicate execution? | Each as yes or no with detail. |
|
||||
| C9 | Read a five-page answer in your normal fitted position. | Comfortable or not; what would change. |
|
||||
| C10 | Battery: glasses and phone percentage at start and after a stated duration and number of questions. | The four numbers and the duration. Do not extrapolate. |
|
||||
| C11 | Per question: seconds from second tap to answer, noted for at least 10 questions. | The raw list. The phone page shows the STT and agent split for each. |
|
||||
|
||||
## Reporting
|
||||
|
||||
Anything that fails in A13, A14, A15 or C1 is a blocker or a stated limitation of the product, to
|
||||
be written into the README as such.
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 5.0 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 6.8 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 19 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 6.0 KiB |
@@ -0,0 +1,282 @@
|
||||
# Feasibility report
|
||||
|
||||
Prepared 2026-11-18 for the first vertical slice. It answers the questions in section 2 of the
|
||||
kickoff specification.
|
||||
|
||||
## How to read this
|
||||
|
||||
Each finding carries one status:
|
||||
|
||||
| Status | Meaning |
|
||||
|---|---|
|
||||
| **documented** | Stated by an official Even or Hermes source, or by the published package's own types. Not exercised by us. |
|
||||
| **simulator-tested** | We ran it in the official Even Hub simulator 0.9.5 (see `docs/test-evidence.md`). |
|
||||
| **hermes-tested** | We ran it against a real `hermes gateway` v0.23.1 with a stub model. |
|
||||
| **device-tested** | Run on a physical G2. **Nothing in this report has this status.** |
|
||||
| **unsupported** | The public SDK does not offer it. |
|
||||
| **unknown** | Not documented and not something we could exercise. |
|
||||
|
||||
Simulator evidence is not device evidence. Even's own simulator README says the simulator
|
||||
"is a supplement to, not a replacement for, hardware testing".
|
||||
|
||||
## Sources
|
||||
|
||||
| Source | Version read |
|
||||
|---|---|
|
||||
| `@evenrealities/even_hub_sdk` (npm) | 0.0.16, README and `dist/index.d.ts` |
|
||||
| `@evenrealities/evenhub-simulator` (npm) | 0.9.5 |
|
||||
| `@evenrealities/evenhub-cli` (npm) | 0.2.0 |
|
||||
| `@evenrealities/pretext` (npm) | 0.1.4 |
|
||||
| `even-realities/everything-evenhub` (GitHub) | commit `cb8321f` (2026-10-21), all 13 skills |
|
||||
| `even-realities/evenhub-templates` (GitHub) | commit `8cb0135` (2026-08-07) |
|
||||
| hub.evenrealities.com/docs | all 48 sidebar pages, fetched 2026-11-18 |
|
||||
| hermes-agent (local install) | v0.23.1, commit `3b42157`, docs and `gateway/platforms/api_server*.py` |
|
||||
|
||||
Citations use `docs:<path>` for `https://hub.evenrealities.com/docs/<path>`, `skill:<name>` for
|
||||
`everything-evenhub/plugins/everything-evenhub/skills/<name>/SKILL.md`, `templates:<path>` for
|
||||
the templates repository, and `sdk:` for the published SDK package.
|
||||
|
||||
The official sources contradict each other in several places (they were written against
|
||||
different SDK versions). Where they do, both positions are given and the item is marked for
|
||||
device verification.
|
||||
|
||||
## Summary of what matters most
|
||||
|
||||
1. **The first outcome's hardest requirement, voice capture with the phone locked in a pocket,
|
||||
is not established.** The docs say microphone capture "Stops if the WebView is suspended".
|
||||
This needs a device test before anything else is built on it.
|
||||
2. **The public SDK provides raw PCM only.** There is no transcription API. STT has to be a
|
||||
server-side provider.
|
||||
3. **Every deployment needs its own app build.** Even Hub blocks network requests to any origin
|
||||
not listed in the packaged `app.json`. The bridge hostname therefore cannot be chosen at
|
||||
run time by the user of a store build. This affects distribution and is escalated below.
|
||||
4. **Hub apps are foreground-only on the glasses.** Running alongside native captions is not
|
||||
something the public SDK offers.
|
||||
5. Everything else the slice needs (text HUD, gestures, an OS menu, app storage, HTTPS fetch)
|
||||
is documented and works in the simulator.
|
||||
|
||||
## Findings
|
||||
|
||||
### 1. Microphone format and callbacks
|
||||
|
||||
| Finding | Status | Source |
|
||||
|---|---|---|
|
||||
| Audio arrives through `bridge.onEvenHubEvent` as `event.audioEvent.audioPcm` (`Uint8Array`). | documented, simulator-tested | sdk: README "MIC Source" |
|
||||
| Format is 16 kHz, signed 16-bit little-endian, mono, on both glasses and phone sources. | documented, simulator-tested | docs:build/device-apis, "Format on both sources: PCM 16 kHz, signed 16-bit little-endian, mono." |
|
||||
| Frames are 100 ms (3,200 bytes). | documented for the simulator, simulator-tested; **unknown on device** | docs:test/simulator says payloads "match what the device emits". No page states the device frame size independently. |
|
||||
| `audioEvent` also carries `source`, `direction` and `speakerRole`. `speakerRole` is "the App audio algorithm result, not a firmware identity assertion". | documented | sdk: README |
|
||||
|
||||
What we did about it: the client accepts frames of any size and only requires the total to be
|
||||
whole 16-bit samples. The bridge accepts exactly one declared format (`pcm_s16le`, 16000 Hz,
|
||||
1 channel) and refuses anything else with `unsupported_media`.
|
||||
|
||||
Observed in the simulator, source not determined: every hub event, **including each raw PCM
|
||||
frame**, is echoed to the WebView console with an `[EvenAppBridge]` prefix. We could not tell
|
||||
whether the SDK or the simulator's host shim prints it (the SDK bundle is minified and contains
|
||||
no such literal string). Whether the phone's developer console receives audio the same way is
|
||||
**unknown** and is on the device checklist, because the docs call console output
|
||||
"reviewer-visible".
|
||||
|
||||
### 2. Start/stop lifecycle
|
||||
|
||||
| Finding | Status | Source |
|
||||
|---|---|---|
|
||||
| `audioControl(true, AudioInputSource.Glasses)` starts, `audioControl(false)` stops. | documented, simulator-tested | sdk: README |
|
||||
| The glasses microphone requires `createStartUpPageContainer` to have succeeded first. | documented | docs:build/device-apis; skill:sdk-reference |
|
||||
| Permission `g2-microphone` must be declared; "Permission prompts fire on first invocation, not at launch." | documented | docs:test/private-testing |
|
||||
| `audioControl` returns `false` on failure. | documented | sdk: `audioControl(...): Promise<boolean>` |
|
||||
| Maximum capture duration imposed by the platform. | **unknown** | not documented |
|
||||
| The microphone may be left running if the app does not stop it on exit. | documented | skill:device-features |
|
||||
|
||||
What we did about it: the microphone opens only on a tap, closes on send, cancel, the capture
|
||||
cap (default 30 s), glasses disconnect, app exit and page unload. If no audio frame arrives for
|
||||
3 seconds while recording, the capture is ended with an error, which covers permission loss and
|
||||
a suspended stream. The microphone is never reopened without a new tap.
|
||||
|
||||
### 3. SDK-provided ASR versus raw audio
|
||||
|
||||
| Finding | Status | Source |
|
||||
|---|---|---|
|
||||
| The public SDK has no speech-to-text API. | **unsupported** | No ASR in `sdk:` types, docs or skills. The official `asr` template says "The STT client itself is a blank stub... You pick your own provider". |
|
||||
|
||||
Decision: one server-side adapter for any service that implements the OpenAI
|
||||
`POST /audio/transcriptions` contract (hosted or self-hosted Whisper). It is exercised only
|
||||
against a test fake so far. **No real STT provider has been run**; none was available on the
|
||||
development machine and choosing a paid one is Dan's decision (see "Decisions needed").
|
||||
|
||||
### 4. Input events
|
||||
|
||||
| Finding | Status | Source |
|
||||
|---|---|---|
|
||||
| G2 temples and the R1 ring give press, double press, swipe up, swipe down, long press and release. The ring has the "Same gesture set as Even G2, distinguishable by source". | documented | docs:build/device-apis |
|
||||
| Event type values 0 to 10 (`CLICK`, `SCROLL_TOP`, `SCROLL_BOTTOM`, `DOUBLE_CLICK`, lifecycle, `LONG_PRESS`, `LONG_PRESS_RELEASE`). | documented, verified against the SDK enum in tests | sdk: `OsEventTypeList` |
|
||||
| A tap arrives with **no `eventType`** because `CLICK_EVENT` is 0 and protobuf omits zero values. | documented, verified against the SDK parser in tests | templates:README.md |
|
||||
| Which envelope carries a tap on a text container: docs say `textEvent`, the skills and templates say `sysEvent`. | **conflicting**; simulator delivers gestures that our both-envelope reader handles | docs:build/device-apis vs skill:handle-input |
|
||||
| Tap, double tap, swipe up and swipe down reach the app. | simulator-tested | automation actions `click`, `double_click`, `up`, `down` |
|
||||
| Tap followed by long press is claimed by the OS and opens the contextual menu. App items are declared with `menuObject` (up to 10, names up to 32 UTF-8 bytes); a selection arrives as `menuItemClickEvent`. | documented; our menu declaration was accepted by the simulator; **selecting an item is not yet exercised** | docs:build/contextual-menu |
|
||||
| Double tap on the root page must call `shutDownPageContainer(1)`. Apps that do nothing or exit silently "are rejected". | documented | docs:ship/app-submission |
|
||||
| `FOREGROUND_ENTER`/`FOREGROUND_EXIT` also fire when the OS menu opens and closes. | documented | docs:build/contextual-menu |
|
||||
| Ring gestures behave the same as temple gestures in practice. | **unknown**; the simulator hard-codes the right-temple source | simulator README |
|
||||
|
||||
Mapping used by this slice (semantic action, then the gesture bound to it today):
|
||||
|
||||
| Semantic action | Gesture | Notes |
|
||||
|---|---|---|
|
||||
| activate | tap | at rest, on an answer (follow-up), or to resend an undelivered request |
|
||||
| stop and submit | tap | while recording |
|
||||
| cancel / back | double tap | cancels capture or request; at rest returns to the root page; on the root page asks the OS to exit |
|
||||
| next / previous page | swipe down / swipe up | on an answer |
|
||||
| new conversation | OS menu item | also available on the phone |
|
||||
| cancel request | OS menu item | duplicate path to double tap |
|
||||
|
||||
The product contract is the left-hand column. The gestures are one binding of it and are held
|
||||
in two small files (`device/events.ts`, the controller's event switch), so they can change
|
||||
after device testing without touching the state machine. A glasses-only path exists for every
|
||||
action except new conversation, which uses the OS menu (glasses) or the phone.
|
||||
|
||||
### 5. HUD layout and text constraints
|
||||
|
||||
| Finding | Status | Source |
|
||||
|---|---|---|
|
||||
| Canvas is 576 x 288 px per eye, origin top-left, 4-bit greyscale shown as green. | documented, simulator-tested (screenshots are 576 x 288) | docs:build/display |
|
||||
| One firmware font, not monospaced, no size or weight control. "Characters outside the font set are silently dropped." | documented | docs:build/display |
|
||||
| Line height is a fixed 27 px. | documented | skill:font-measurement |
|
||||
| Text limits: 1,000 characters for create and rebuild, 2,000 for `textContainerUpgrade`; byte-denominated elsewhere (999 / 1,999). | documented, units conflict | docs:build/display; docs:reference/changelog (simulator "999-byte text container limit") |
|
||||
| If content overflows a capturing text container "the firmware scrolls it". | documented | docs:build/display |
|
||||
| Even publishes `@evenrealities/pretext` for "pixel-accurate" wrapping measurement, and the text-heavy template paginates with it. | documented | templates:text-heavy |
|
||||
| `textContainerUpgrade` updates in place without flicker; `rebuildPageContainer` "flashes the full page". | documented | templates:text-heavy |
|
||||
| No numeric rate limit for text updates; guidance is to serialise all bridge calls and debounce. | documented as guidance only | skill:glasses-ui |
|
||||
| Emoji do not render. Full glyph coverage is not officially tabulated. | documented / **unknown** | docs:reference/faq |
|
||||
|
||||
What we did about it: two text containers tile the canvas, a 9-line body (which takes the
|
||||
gestures) and a 1-line status bar that always shows the state and, while recording, a
|
||||
`● REC m:ss / m:ss` indicator. Answers are paginated with `pretext` to at most 9 measured lines
|
||||
**and** at most 900 UTF-8 bytes per page, so a page never overflows and the firmware never
|
||||
scrolls it. Nothing is truncated: every page is reachable by swiping, and the phone shows the
|
||||
complete original. Markdown and HTML markup are removed for the HUD; the wording is not changed.
|
||||
|
||||
Simulator-tested: page 2 of a long answer fills exactly 9 lines with the status bar beneath
|
||||
(`docs/evidence/simulator/05-answer-page-2.png`), and swiping down then up returns a
|
||||
pixel-identical page 1. **Unknown until a device test:** whether `pretext` agrees with the real
|
||||
firmware for the text Dan actually reads, legibility at his fitted position, and behaviour for
|
||||
characters missing from the firmware font.
|
||||
|
||||
### 6. Networking
|
||||
|
||||
| Finding | Status | Source |
|
||||
|---|---|---|
|
||||
| The WebView can only reach origins listed in the `network` permission's `whitelist` in `app.json`. "Use the full origin... bare hostnames and wildcards aren't supported." | documented | docs:build/networking |
|
||||
| The whitelist "is not a CORS bypass"; the WebView enforces normal CORS. | documented | docs:build/networking |
|
||||
| The WebView's own origin is not specified. | **unknown** | docs say "the WebView origin if you can identify it" |
|
||||
| "HTTPS in production. Plain http:// is only useful for local dev against a LAN dev server." | documented | docs:build/networking |
|
||||
| `fetch` with a JSON body and with a binary body, with an `Authorization` header and a CORS preflight, works. | simulator-tested | this slice's simulator run |
|
||||
| WebSockets are allowed under the same whitelist; "Expect drops when the WebView backgrounds." | documented | docs:reference/faq |
|
||||
| SSE and streaming `fetch`. | **unknown** | not documented |
|
||||
| "WebView is suspended on background; in-flight requests stall." | documented | docs:reference/faq |
|
||||
| Whether the whitelist is enforced during QR sideloading. | **unknown** | not stated |
|
||||
|
||||
What we did about it: polling over plain `fetch` only, which is the fallback the specification
|
||||
allows. No SSE or WebSocket is used. Because the request is idempotent on the bridge and the
|
||||
client re-attaches by request id, a stalled or dropped request cannot run a turn twice.
|
||||
|
||||
Two consequences need Dan's attention:
|
||||
|
||||
- **The bridge origin is baked into each packaged build.** The repository contains no hostname:
|
||||
`app.json` is generated at build time from `HERMEVEN_BRIDGE_ORIGIN`. But a single store build
|
||||
cannot serve users with different bridges unless Even adds user-configurable origins or the
|
||||
product routes through one fixed relay origin. This is a distribution question, not an MVP
|
||||
blocker.
|
||||
- **The bridge's CORS allow-list needs the WebView's origin, which is not documented.** The
|
||||
phone page's diagnostics panel prints `location.origin` so it can be read on the device and
|
||||
put into `HERMEVEN_ALLOWED_ORIGINS`. Until that is done on a real phone, CORS configuration
|
||||
for a packaged build is unverified.
|
||||
|
||||
### 7. Storage
|
||||
|
||||
| Finding | Status | Source |
|
||||
|---|---|---|
|
||||
| `bridge.setLocalStorage` / `getLocalStorage` store strings and survive app restarts. | documented, simulator-tested within one run | sdk: README; skill:device-features |
|
||||
| Browser `localStorage` reliability: the docs FAQ says it survives; the skill says it does "NOT reliably persist". | **conflicting** | docs:reference/faq vs skill:device-features |
|
||||
| Storage is sandboxed per `package_id`. | documented | docs |
|
||||
| Any secure or encrypted storage. | **unsupported / not offered** | nothing in the SDK or docs is described as secure |
|
||||
|
||||
What we did about it: the device credential is kept in the Even app storage and the phone page
|
||||
says plainly that this is not an encrypted vault. The credential is scoped to one device and
|
||||
one configured profile, expires after 7 days (renewable up to a 90-day pairing lifetime), is
|
||||
revocable from the phone or the bridge host, and is stored on the bridge only as a hash. It
|
||||
cannot reach the Hermes API directly and cannot choose a profile or session.
|
||||
|
||||
### 8. Lock screen, suspension and background restore
|
||||
|
||||
| Finding | Status | Source |
|
||||
|---|---|---|
|
||||
| iOS: "The WebView keeps running." Android: "May be suspended under memory pressure... Treat Android suspend as 'the app starts cold.'" | documented | docs:build/background-lifecycle |
|
||||
| Microphone capture "Stops if the WebView is suspended... don't assume the stream is still live." | documented | docs:build/background-lifecycle |
|
||||
| QR-sideloaded apps do not survive the lock screen at all; private-testing builds "don't pass the 5-minute lock test"; beta builds do. | documented | docs:test/index |
|
||||
| Store review requires the app to stay alive with the phone locked for 5 minutes. | documented | docs:ship/app-submission |
|
||||
| The `background-state` skill describes a headless-WebView migration with `setBackgroundState` / `onBackgroundRestore` exported from the SDK. | **not present**: SDK 0.0.16 exports neither function and its bundle has no `__getStateSnapshot` string | skill:background-state vs sdk: `dist/index.d.ts` |
|
||||
| Whether a voice question can be captured and answered with the phone locked and pocketed. | **unknown** | no source addresses it; this is the first outcome |
|
||||
|
||||
Stated plainly, as the specification asks: **a state-persistence helper does not prove
|
||||
background microphone execution, and in SDK 0.0.16 even the helper is not there.** We did not
|
||||
invent it. Instead the app persists the one thing that matters, the id of a turn in flight, to
|
||||
app storage. A page that is killed and restarted re-attaches to that turn by polling and never
|
||||
resubmits it or reopens the microphone (covered by an automated test with fakes).
|
||||
|
||||
Whether capture works while locked can only be answered on the device, and it must be tested
|
||||
with a **beta-channel build**, since the docs say sideloaded builds die on lock.
|
||||
|
||||
### 9. Coexistence with native captions
|
||||
|
||||
| Finding | Status | Source |
|
||||
|---|---|---|
|
||||
| "Plugins are foreground-only on the glasses." | documented | docs:reference/faq |
|
||||
| "After exit, glasses can launch other apps and first-party apps (Conversate, Navigate)". | documented | docs:ship/app-submission |
|
||||
| Any API to read native captions or run beside them. | **unsupported** | none in the SDK |
|
||||
| What happens to a Hub app when a native feature or notification interrupts it. | **unknown** | not documented |
|
||||
|
||||
Conclusion: assume the user must switch between Hermeven and native captions. This is reported
|
||||
as a limitation, not hidden. It is on the device checklist to record exactly what the switch
|
||||
looks like.
|
||||
|
||||
### 10. Hermes API (the other half of feasibility)
|
||||
|
||||
| Finding | Status | Source |
|
||||
|---|---|---|
|
||||
| Bearer auth with `API_SERVER_KEY`; the server refuses to start without one. | documented, hermes-tested (401 without it) | hermes docs; `_check_auth` |
|
||||
| `POST /v1/runs` returns 202 with a `run_id`; `GET /v1/runs/{id}` is pollable; `POST /v1/runs/{id}/stop` interrupts. | documented, hermes-tested | hermes docs "Runs API" |
|
||||
| `Idempotency-Key` on `/v1/runs`: an identical retry returns the original `run_id` with `Idempotency-Replayed: true`; a different body returns 409 `idempotency_key_conflict`; durable, retained 24 hours. | documented, hermes-tested | hermes docs; `/v1/capabilities` reported `{"supported":true,"durable":true,"retention_seconds":86400}` |
|
||||
| A `session_id` in the run body continues that API-created session: Hermes loads its transcript. | documented, hermes-tested (the model received both user turns) | `_handle_runs` |
|
||||
| `/v1/responses` has no cancel endpoint; a turn is interrupted only by dropping a streaming connection. | source-verified | `_write_sse_responses` |
|
||||
| Run statuses include `waiting_for_approval`, `unknown` (owner restarted mid-turn) and `interrupted` (gateway shutdown). | documented; **not hermes-tested** (the stub model calls no tools) | hermes docs |
|
||||
| A run that stops short (iteration budget) reports `failed` with `completed: false` and usable `output`. | source-verified; **not hermes-tested** | `terminal_run_status` |
|
||||
| `instructions` is layered on the agent's prompt per request, without changing stored history. | documented, hermes-tested | hermes docs "System Prompt Handling" |
|
||||
|
||||
Decision recorded in `docs/decisions/0002-hermes-runs-api.md`: the adapter uses the Runs API,
|
||||
not `/v1/responses`. The specification said "normally `/v1/responses`" and also asked us to
|
||||
verify cancellation and idempotency; Responses cannot cancel or be polled in flight, and Runs
|
||||
can. No `conversation_id` field is sent to Hermes.
|
||||
|
||||
**Not verified:** Dan's actual target deployment. The specification mentions a Hermes
|
||||
reachable from "Pepper's environment"; we had no access to it. All Hermes evidence here is from
|
||||
the hermes-agent v0.23.1 installed on the development machine, run in a throwaway home
|
||||
directory with a stub model. The target's version, profile routing (`/p/<profile>/`), tool
|
||||
permissions and approval policy are unverified.
|
||||
|
||||
## Decisions needed from Dan
|
||||
|
||||
1. **Device access.** Nothing here is device-tested. The checklist is `docs/device-test-plan.md`.
|
||||
Lock-screen capture comes first because it can invalidate the product's first outcome.
|
||||
2. **STT provider.** Hosted (per-minute cost, audio leaves your network) or self-hosted Whisper
|
||||
(free, needs a machine). The adapter is the same either way.
|
||||
3. **Target Hermes.** Which deployment and profile the bridge should point at, and a safe
|
||||
read-only test profile for the first real run.
|
||||
4. **Distribution model**, given the per-build network whitelist: one build per deployment, or a
|
||||
relay origin. Not needed for the single-user slice.
|
||||
|
||||
## What was escalated rather than worked around
|
||||
|
||||
- No background-microphone guarantee was assumed.
|
||||
- No SDK function was invented; the two background helpers named by an official skill but
|
||||
absent from the published SDK are not called.
|
||||
- No native Android/iOS app was started. Nothing measured so far requires one, but item 8 could.
|
||||
@@ -0,0 +1,77 @@
|
||||
# Security and threat model
|
||||
|
||||
Scope: the single-user slice. One owner, one bridge, one Hermes profile, one or a few paired
|
||||
devices. Not reviewed by anyone but its author yet; see `docs/handoff/`.
|
||||
|
||||
## What is being protected
|
||||
|
||||
| Asset | Why it matters |
|
||||
|---|---|
|
||||
| The Hermes API key | It gives full use of the agent, "including terminal commands" per Hermes's docs. |
|
||||
| The ability to make the agent act | A forged or replayed turn could run tools. |
|
||||
| Voice recordings, questions, answers | Private by nature. |
|
||||
| The STT provider key | Billing and access. |
|
||||
|
||||
## Trust boundaries
|
||||
|
||||
1. **Phone WebView to bridge.** Untrusted network. The client holds only a device credential.
|
||||
2. **Bridge to Hermes and to STT.** The bridge holds the real secrets. Both must be HTTPS unless
|
||||
on loopback; the bridge refuses to start otherwise.
|
||||
3. **Bridge host.** Whoever can run the CLI or read the SQLite file is the owner.
|
||||
|
||||
## Controls in this slice
|
||||
|
||||
| Threat | Control | Tested |
|
||||
|---|---|---|
|
||||
| Hermes key or STT key leaks through the client | Neither is in the client code, bundle or any API response. The production bundle was searched for them. | yes |
|
||||
| Stolen device credential | Scoped to one device and one profile; cannot name a Hermes session; expires in 7 days; pairing ends at 90 days; revocable from the phone or the bridge host; stored on the bridge as SHA-256 only. | yes |
|
||||
| Guessing a pairing code | 10 characters from a 31-symbol alphabet (about 49 bits); valid 5 minutes; single use; a new code voids the old one; 5 wrong guesses burn every outstanding code; 5 attempts per minute per client address. | yes |
|
||||
| Client picks someone else's agent session or profile | Requests with unknown fields are rejected. The Hermes session id is generated by the bridge and never leaves it. A device is valid only for the profile it was paired under. | yes |
|
||||
| One device reads or cancels another's turn | Every lookup is scoped to the authenticated device; a foreign id answers 404, not 403. | yes |
|
||||
| Duplicate or replayed submit runs a tool twice | Client request id is the bridge's idempotency key; the bridge forwards a derived key to Hermes. | yes, including against real Hermes |
|
||||
| Blind replay after a timeout | A sent-but-unanswered request ends as `unknown`, never as retryable. | yes |
|
||||
| Oversized or malformed input | 32 kB JSON limit; audio capped at capture length + 1 s; schema validation; only one audio format accepted. | yes |
|
||||
| Request flooding | Per-device turn limit, per-address pairing limit, general per-device limit. | yes |
|
||||
| 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 |
|
||||
| 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 |
|
||||
| Administrative access over the network | There is none. Pairing codes and revocation are CLI-only. | by construction |
|
||||
| Accidental public exposure | Binds 127.0.0.1 by default; a non-loopback bind needs an explicit setting. | yes |
|
||||
|
||||
## Known gaps and accepted risks
|
||||
|
||||
Stated so they are not mistaken for protections.
|
||||
|
||||
1. **The device credential is not in secure storage.** Even's app storage is not described as
|
||||
encrypted, and the public SDK offers nothing better. The mitigation is that the credential is
|
||||
narrow, expiring and revocable, not that it is safe at rest. Anyone with the unlocked phone, or
|
||||
with developer access to the app's storage, can use it until it is revoked.
|
||||
2. **Renewal needs only the current token.** A thief who renews before the owner notices keeps
|
||||
access until revoked or until the 90-day pairing lifetime ends.
|
||||
3. **Audio leaves the device and, with a hosted STT provider, leaves your network.** A
|
||||
self-hosted Whisper endpoint avoids this. The provider's own retention is outside our control.
|
||||
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.
|
||||
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
|
||||
meaningful with `HERMEVEN_TRUST_PROXY=true` and a proxy that sets the forwarded address.
|
||||
7. **The 15-minute result cache holds question and answer text in SQLite in clear text**, as does
|
||||
the pending request body for the moment between sending and recording the run id.
|
||||
8. **The SQLite file and `.env` are protected only by file permissions** on the bridge host.
|
||||
9. **No audit trail** of pairings and revocations beyond the log stream.
|
||||
10. **The network whitelist puts the bridge origin into the packaged app**, where anyone with the
|
||||
package can read it. The origin is not a secret and must not be treated as one.
|
||||
11. **The agent's tool permissions are whatever the Hermes profile allows.** Hermeven does not
|
||||
narrow them. Use a read-only or test profile until approval handling is proven on a device.
|
||||
12. **Dependencies were not audited** beyond `npm install` reporting no known vulnerabilities on
|
||||
2026-11-18.
|
||||
|
||||
## Operational rules
|
||||
|
||||
- Keep `.env` out of git (it is ignored) and out of screenshots.
|
||||
- Never put a real key in a tutorial, a build-in-public post or an issue.
|
||||
- Revoke a lost device from the bridge host: `npm run bridge:cli -- revoke <device-id>`.
|
||||
+101
@@ -0,0 +1,101 @@
|
||||
# Setup
|
||||
|
||||
Requirements: Node.js 22.13 or later, a Hermes install with the API server enabled, and (for
|
||||
voice) an OpenAI-compatible transcription endpoint.
|
||||
|
||||
```sh
|
||||
npm ci
|
||||
cp .env.example .env # then edit: HERMES_API_KEY at minimum
|
||||
```
|
||||
|
||||
## 1. Hermes
|
||||
|
||||
Enable the API server for the profile you want to use (see Hermes's "API Server" docs):
|
||||
|
||||
```sh
|
||||
# in that profile's .env
|
||||
API_SERVER_ENABLED=true
|
||||
API_SERVER_KEY=<a long random value>
|
||||
```
|
||||
|
||||
Start the gateway, then put the same key in Hermeven's `.env` as `HERMES_API_KEY`. Use a
|
||||
read-only or test profile first.
|
||||
|
||||
## 2. Bridge
|
||||
|
||||
```sh
|
||||
npm run bridge # listens on 127.0.0.1:8787 by default
|
||||
curl http://127.0.0.1:8787/healthz
|
||||
```
|
||||
|
||||
The phone must reach the bridge over HTTPS. Two workable arrangements:
|
||||
|
||||
- a reverse proxy with a certificate in front of the loopback listener, or
|
||||
- a private network such as Tailscale with its HTTPS certificates.
|
||||
|
||||
Then set `HERMEVEN_ALLOWED_ORIGINS` to the origin of the page that calls the bridge. For a
|
||||
packaged app that value is not documented by Even: open the phone page, expand Diagnostics, read
|
||||
"Page origin", put that in `.env` and restart the bridge.
|
||||
|
||||
## 3. Try it without glasses
|
||||
|
||||
```sh
|
||||
npm run client:dev # http://localhost:5173
|
||||
```
|
||||
|
||||
Add `HERMEVEN_ALLOWED_ORIGINS=http://localhost:5173` to `.env`, restart the bridge, then:
|
||||
|
||||
```sh
|
||||
npm run bridge:cli -- pair # prints a one-time code
|
||||
```
|
||||
|
||||
Open the page, enter the bridge address and the code, and use "Typed question". This browser
|
||||
preview has no microphone and is not the glasses.
|
||||
|
||||
## 4. Simulator
|
||||
|
||||
```sh
|
||||
npm run client:dev
|
||||
npm run simulate -- http://localhost:5173
|
||||
```
|
||||
|
||||
`npm run simulate` calls the simulator package directly, because with npm 10.9 workspaces the
|
||||
`evenhub-simulator` command link was not created by `npm ci` on the development machine
|
||||
(`npm rebuild @evenrealities/evenhub-simulator` also restores it).
|
||||
|
||||
The simulator uses your computer's default audio input as the microphone. Add `--aid alsa:null`
|
||||
on Linux if you do not want it to open one.
|
||||
|
||||
## 5. On the glasses
|
||||
|
||||
The Even app only allows network requests to origins listed in the app's manifest, so the bridge
|
||||
origin is supplied when you build:
|
||||
|
||||
```sh
|
||||
export HERMEVEN_BRIDGE_ORIGIN=https://your-bridge.example
|
||||
npm run -w @hermeven/even-client pack # writes hermeven.ehpk
|
||||
```
|
||||
|
||||
For a first look, sideload the dev server instead: `npm run client:dev`, then
|
||||
`npx evenhub qr --url http://<your-lan-ip>:5173` and scan it from the Even app (developer mode).
|
||||
Even's docs say sideloaded apps stop when the phone locks, so lock-screen behaviour has to be
|
||||
tested with a beta-channel build (`evenhub create`, `evenhub promote --to beta`). Uploading
|
||||
anything to Even's portal is Dan's call.
|
||||
|
||||
Then follow `docs/device-test-plan.md`.
|
||||
|
||||
## Operating
|
||||
|
||||
```sh
|
||||
npm run bridge:cli -- devices # list
|
||||
npm run bridge:cli -- revoke <device-id> # revoke now
|
||||
```
|
||||
|
||||
## Tests
|
||||
|
||||
```sh
|
||||
npm run typecheck
|
||||
npm test # unit + integration, fakes only
|
||||
npm run test:simulator # needs a desktop session; opens the simulator window
|
||||
npm run test:real-hermes # needs the hermes CLI; uses a throwaway HERMES_HOME and a stub model
|
||||
```
|
||||
Reference in New Issue
Block a user