Live preview is for Agents only; CODY-023; simulator screenshots wait for the draw

Dan, after the Round 19 review: "I'd only invoke the live transcription
when in agent sub-app." The preview now runs only in Agents mode. In
hands free a recording, whether started by a name or by a tap, is never
previewed; the only audio sent for transcription there is the wake check
and the question itself. "Heard:" is unchanged in both modes. He also
ruled out sending the hands-free listener's audio to a paid service;
decision 0005 records both.

CODY-023: the README status table now states one SHA or version per
surface (server 44ea114, beta client 0.3.0, repository client 0.4.0
candidate), nine simulator scenarios and what the ninth does and does not
cover, and the evidence level of 0.3.0 and 0.4.0.

Simulator suite: the answer and page-turn screenshots poll until the
display shows the expected change instead of sleeping a fixed 800-900 ms.
One of five runs had failed there (the answer page was not yet drawn).

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 12:06:46 -08:00
co-authored by Claude Fable 5.2
parent 31ae4efb13
commit 2a63b7796a
5 changed files with 58 additions and 22 deletions
+17 -7
View File
@@ -654,19 +654,29 @@ describe('glasses: words shown while recording', () => {
await until('answer', () => phase() === 'answer');
});
it('works in hands free too, for the question that follows a name', async () => {
// One preview only, so the scripted recogniser's replies line up.
extras = { livePreview: { firstMs: 300, stepMs: 60_000, pauseMs: 200 } };
it('is for Agents only: in hands free no recording is previewed, by name or by tap', async () => {
extras = { livePreview: { firstMs: 300, stepMs: 300, pauseMs: 200 } };
await paired();
await listening();
h.stt.next({ text: 'Wendy' }, { text: 'are you' }, { text: 'are you there' });
h.stt.next({ text: 'Wendy' }, { text: 'are you there' }, { text: 'a tapped one' });
say(0.5);
await until('recording for Wendy', () => phase() === 'listening');
device.speak(0.6);
await until('words', () => device.frame.body === 'Wendy is listening…\n\nare you');
device.speak(1.2);
await pause(80);
expect(device.frame.body).toBe('Wendy is listening…\n\nAsk your question. It is sent when you stop speaking.');
device.silence(1.4);
await until('answer', () => phase() === 'answer');
expect(h.hermes.executedBy).toEqual(['wendy']);
expect(snapshot.lastTurn?.input_text).toBe('are you there');
await listening();
device.tap();
await until('recording', () => phase() === 'listening');
device.speak(1.2);
await pause(80);
device.tap();
await until('second answer', () => phase() === 'answer' && h.hermes.executions === 2);
expect(snapshot.lastTurn?.input_text).toBe('a tapped one');
expect(posts('/v1/transcribe')).toBe(0);
// What was sent is still shown while the agent works: that is the turn's own transcript.
expect(h.stt.calls).toBe(3);
});
});
+20 -6
View File
@@ -139,6 +139,20 @@ async function screenshot(name: string) {
return { png, ...decodePng(png) };
}
/**
* Take screenshots until one satisfies `ready`, and return it (or the last one, for the
* assertion to fail on). The simulator draws some time after the app asks, and how long varies
* with how many updates are queued, so a fixed wait before a single screenshot is a guess.
*/
async function screenshotWhen(name: string, ready: (shot: Awaited<ReturnType<typeof screenshot>>) => boolean, timeoutMs = 8000) {
const deadline = Date.now() + timeoutMs;
for (;;) {
const shot = await screenshot(name);
if (ready(shot) || Date.now() > deadline) return shot;
await new Promise((r) => setTimeout(r, 250));
}
}
/** Lit pixels inside a horizontal band of the canvas. */
function litInBand(shot: { rows: Buffer[]; width: number }, fromY: number, toY: number): number {
let lit = 0;
@@ -264,21 +278,21 @@ describe('Even Hub simulator 0.9.5', () => {
expect(h.hermes.lastRun()!.input).toBe('simulated question');
expect(h.hermes.executions).toBe(1);
await new Promise((r) => setTimeout(r, 800));
const page1 = await screenshot('03-answer-page-1');
const page1 = await screenshotWhen('03-answer-page-1', (shot) => litInBand(shot, 0, 251) > 2000);
expect(litInBand(page1, 0, 251)).toBeGreaterThan(2000);
// Let the drawing settle, so the next scenario compares against a finished page.
await new Promise((r) => setTimeout(r, 800));
expect(consoleLines.slice(mark).some((l) => /answer laid out on [2-9] page/.test(l))).toBe(true);
});
it('swipe down turns the page, swipe up returns, and the page fits without firmware scrolling', async () => {
const page1 = await screenshot('04-before-swipe');
await input('down');
await new Promise((r) => setTimeout(r, 900));
const page2 = await screenshot('05-answer-page-2');
const page2 = await screenshotWhen('05-answer-page-2', (shot) => !shot.png.equals(page1.png));
expect(page2.png.equals(page1.png)).toBe(false);
await new Promise((r) => setTimeout(r, 600));
await input('up');
await new Promise((r) => setTimeout(r, 900));
const back = await screenshot('06-answer-page-1-again');
const back = await screenshotWhen('06-answer-page-1-again', (shot) => shot.png.equals(page1.png));
expect(back.png.equals(page1.png)).toBe(true);
});