Sound check on the phone page (probe for issue #1); timing logs for name checks and previews; 0.4.1

- apps/even-client: a collapsed "Sound check" on the phone page. Finds out whether the page
  may play sound in the Even app, without a touch, in the background, and which outputs it can
  see. Plays only on a button press; sends nothing to the bridge.
- services/bridge: wake.checked (every name check) and preview.done log the clip length and the
  duration, never the words.
- tests: hands free after a recording in Agents with menu, wake and preview all on; the log
  lines carry only the fields above.
- docs: 0.4.0 rollout and Dan's device report; security 3c, 3e, 3f; 0005 records that the
  Round 20 reading of "agent sub-app" was wrong (not changed here).

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This commit is contained in:
Dan
2026-11-29 11:24:16 -08:00
co-authored by Claude Fable 5.2
parent e4c102a539
commit b57505406b
9 changed files with 365 additions and 5 deletions
+62
View File
@@ -68,6 +68,14 @@ describe('bridge: POST /v1/wake', () => {
const logs = h.logs.join('\n');
for (const fragment of ['card number', 'four one one', 'wendi', 'Wendi']) expect(logs).not.toContain(fragment);
expect(logs).toContain('wake.matched');
// Every check leaves its length and duration, and nothing else.
const checks = h.logs.filter((l) => l.includes('wake.checked')).map((l) => JSON.parse(l));
expect(checks.map((c) => [c.matched, c.near_miss])).toEqual([[false, false], [false, false], [false, true], [true, false]]);
for (const c of checks) {
expect(typeof c.audio_ms).toBe('number');
expect(typeof c.check_ms).toBe('number');
expect(Object.keys(c).filter((k) => !['level', 'time', 'pid', 'hostname', 'reqId', 'msg', 'device_id', 'audio_ms', 'check_ms', 'matched', 'near_miss'].includes(k))).toEqual([]);
}
});
it('needs a device credential and a well-formed request', async () => {
@@ -680,3 +688,57 @@ describe('glasses: words shown while recording', () => {
expect(h.stt.calls).toBe(3);
});
});
describe('glasses: hands free after using Agents (as shipped: menu, wake and live preview together)', () => {
beforeEach(async () => {
sent = [];
wakeRoute = 'real';
extras = { menu: true, idleExit: null, livePreview: { firstMs: 300, stepMs: 300, pauseMs: 200 } };
await harness();
});
afterEach(async () => {
await controller?.stop();
});
it('a recording in Agents, then back to the menu and into Hands free: a name is still heard', async () => {
device = new FakeDevice();
controller = makeController(device);
await controller.start();
await controller.pair(h.url, h.bridge.devices.createPairingCode().code, 'fake-g2');
expect(phase()).toBe('menu');
device.swipeDown();
device.tap(); // Agents
expect(phase()).toBe('ready');
h.stt.next({ text: 'a tapped' }, { text: 'A tapped question.' });
device.tap();
await until('recording', () => phase() === 'listening' && device.micOpen);
device.speak(0.5);
await until('preview', () => device.frame.body.includes('a tapped'));
device.tap();
await until('answer', () => phase() === 'answer');
await until('microphone closed', () => !device.micOpen);
device.doubleTap(); // answer -> Ready
device.doubleTap(); // Ready -> menu
expect(phase()).toBe('menu');
device.swipeUp();
device.tap(); // Hands free
expect(phase()).toBe('ready');
await listening();
h.stt.next({ text: 'Wendy, hello' });
say();
await until('answer', () => phase() === 'answer');
expect(h.hermes.executedBy).toEqual([null, 'wendy']);
});
it('straight into Hands free: a name is heard', async () => {
device = new FakeDevice();
controller = makeController(device);
await controller.start();
await controller.pair(h.url, h.bridge.devices.createPairingCode().code, 'fake-g2');
device.tap();
await listening();
h.stt.next({ text: 'Pepper, hello' });
say();
await until('answer', () => phase() === 'answer');
});
});