Words on the glasses while recording, and "Heard:" for spoken questions (0.4.0)

While a recording is being made the app sends the recording so far to a
new bridge route, POST /v1/transcribe, about every half second of new
audio and one request at a time, and draws the words under "... is
listening…", newest words kept in view. No new service: it is the Whisper
already in the bridge. A preview is only ever drawn. The question is
transcribed again by its own turn, so a preview can never be what the
agent receives.

After sending, the last preview stays under "Transcribing…", then "Heard:"
shows the transcript the bridge gave the agent, now for every spoken
question (it was hands free only). The reducer tracks `spoken` explicitly
and treats an accepted, not yet transcribed recording as transcribing.

Bridge: /v1/transcribe needs a device credential, shares the audio checks
with /v1/wake, runs one at a time per device within
HERMEVEN_PREVIEWS_PER_MINUTE (60), creates nothing and logs no text.
An older bridge answers 404 and the client stops asking.

Simulator: a scenario that launches the app as shipped (menu, hands free)
as Round 18 required. A diagnostics note marks when listening for a name
starts and stops.

Also records the 0.3.0 deployment, upload and Dan's device report
(docs/evidence/device/2026-11-28.md), and decision 0005.

Not reviewed, not deployed, not uploaded, not device-tested.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This commit is contained in:
Dan
2026-11-28 11:44:36 -08:00
co-authored by Claude Fable 5.2
parent 44ea1148c3
commit f9946a027a
19 changed files with 531 additions and 32 deletions
+67 -2
View File
@@ -149,14 +149,15 @@ function litInBand(shot: { rows: Buffer[]; width: number }, fromY: number, toY:
let pageOriginForRelaunch = '';
/** Start a simulator on the page. `idleExit` is the development-only switch read by main.ts. */
async function launchSimulator(idleExit: 'off' | 'fast', code: string): Promise<void> {
async function launchSimulator(idleExit: 'off' | 'fast', code: string, legacy = true): Promise<void> {
const pageOrigin = pageOriginForRelaunch;
const automationPort = await freePort();
automation = `http://127.0.0.1:${automationPort}`;
const bin = require.resolve('@evenrealities/sim-linux-x64/bin/evenhub-simulator');
// idleExit=off: this suite drives the app for longer than the idle timeout between steps.
// wake=off, menu=off: this suite covers the tap path and idle exit from Ready, as before the menu.
const url = `${pageOrigin}/?idleExit=${idleExit}&wake=off&menu=off&bridge=${encodeURIComponent(h.url)}&pair=${encodeURIComponent(code)}`;
// `legacy = false` launches the app as it ships: opening menu, hands free and live preview on.
const url = `${pageOrigin}/?idleExit=${idleExit}${legacy ? '&wake=off&menu=off&preview=off' : ''}&bridge=${encodeURIComponent(h.url)}&pair=${encodeURIComponent(code)}`;
// alsa:null yields silence: the simulator never opens a real microphone in this test.
sim = spawn(bin, [url, '--automation-port', String(automationPort), '--no-glow', '--aid', 'alsa:null'], {
stdio: ['ignore', 'pipe', 'pipe'],
@@ -373,4 +374,68 @@ describe('Even Hub simulator 0.9.5', () => {
const problems = after.filter((l) => /\[uncaught\]|\[unhandledrejection\]/.test(l));
expect(problems).toEqual([]);
}, 120_000);
it('as shipped: opens on the menu; a tap starts hands free with the microphone open; double tap returns to the menu and closes it; Agents does not listen', async () => {
// A third simulator, with nothing switched off. The microphone is alsa:null (silence), so
// this shows the menu, the gestures and the microphone opening and closing through the
// real SDK bridge. It shows nothing about hearing a name: no speech exists here.
sim.kill('SIGTERM');
await new Promise((r) => setTimeout(r, 500));
if (sim.exitCode === null) sim.kill('SIGKILL');
await pumpConsole().catch(() => undefined);
const from = consoleLines.length;
lastConsoleId = 0;
const sttBefore = h.stt.calls;
const runsBefore = h.hermes.executions;
await launchSimulator('off', h.bridge.devices.createPairingCode().code, false);
await waitConsole('hud: HUD page created', 30_000, from);
await waitConsole('-> menu', 20_000, from);
await new Promise((r) => setTimeout(r, 800));
const menu = await screenshot('10-menu');
expect(litInBand(menu, 0, 120)).toBeGreaterThan(200);
expect(litInBand(menu, 251, 288)).toBeGreaterThan(100);
// Nothing listens on the menu.
expect(consoleLines.slice(from).some((l) => l.includes('wake: listening for a name'))).toBe(false);
// Swiping moves the marker: the picture changes, and changes back.
await input('down');
await new Promise((r) => setTimeout(r, 600));
const second = await screenshot('11-menu-agents-selected');
expect(second.png.equals(menu.png)).toBe(false);
await input('up');
await new Promise((r) => setTimeout(r, 600));
expect((await screenshot('12-menu-again')).png.equals(menu.png)).toBe(true);
// First entry: hands free.
await input('click');
await waitConsole('state: menu -> ready', 10_000, from);
await waitConsole('wake: listening for a name', 10_000, from);
await new Promise((r) => setTimeout(r, 1500));
const handsFree = await screenshot('13-hands-free');
expect(litInBand(handsFree, 251, 288)).toBeGreaterThan(100);
await pumpConsole();
// Silence is never sent anywhere.
expect(h.stt.calls).toBe(sttBefore);
// Back to the menu: the microphone closes.
let mark = consoleLines.length;
await input('double_click');
await waitConsole('state: ready -> menu', 10_000, mark);
await waitConsole('wake: stopped listening', 10_000, mark);
// Second entry: Agents. No listening.
mark = consoleLines.length;
await input('down');
await input('click');
await waitConsole('state: menu -> ready', 10_000, mark);
await new Promise((r) => setTimeout(r, 1500));
await pumpConsole();
expect(consoleLines.slice(mark).some((l) => l.includes('wake: listening for a name'))).toBe(false);
await screenshot('14-agents-ready');
expect(h.stt.calls).toBe(sttBefore);
expect(h.hermes.executions).toBe(runsBefore);
const problems = consoleLines.slice(from).filter((l) => /\[uncaught\]|\[unhandledrejection\]|\[fetch\]/.test(l));
expect(problems).toEqual([]);
}, 120_000);
});