diff --git a/README.md b/README.md index db40d2c..f936fba 100644 --- a/README.md +++ b/README.md @@ -27,7 +27,7 @@ the implementer read from the server's log, and what Cody reproduced independent | Installed as an Even Hub private build ("Pepper", `xylo.hermeven` 0.1.0) | Runs from the Even app with no QR code: paired, and four spoken questions answered on the glasses, including hold-to-talk and one that had the agent send a Telegram message (Dan's report plus the bridge log, 2026-11-21). Needs `HERMEVEN_ALLOWED_ORIGINS=http://127.0.0.1:*` on the bridge. | | Ring, paging, contextual menu, cancel, relaunch with the pairing kept, the system exit dialog on the device | **Not run.** | | Locked phone | First success on 2026-11-21 with the beta build: launched by voice ("Hey Even, open Pepper") and a spoken question answered with the phone locked (Dan's report). The specification's ten-cycle acceptance run has **not** been done. | -| Leaving the glasses when idle (0.1.1) | Implemented and tested with fakes. **Not installed on the device.** | +| Leaving the glasses when idle | 0.1.1 on the device (2026-11-21, Dan's report): after one gesture the app left by itself and Telegram notifications returned to the lenses; after a voice launch with nothing touched it did **not** leave. 0.1.2 starts the countdown however the app was opened; tested with fakes and the simulator, **not installed on the device.** | | Real tools and approval flow | One tool use seen (a Telegram message, reported by Dan). The approval path has **not** been exercised against a real agent. | | Sustained load, backups, monitoring, upgrades on the server | **Not verified.** | | Clean-host install (`deploy/install.sh`) | Proven on a disposable Ubuntu 24.04 container with systemd (`tests/deploy/runbook-proof.sh`), not on a second real server. | diff --git a/apps/even-client/app.template.json b/apps/even-client/app.template.json index 97cea94..3ec05fc 100644 --- a/apps/even-client/app.template.json +++ b/apps/even-client/app.template.json @@ -2,7 +2,7 @@ "package_id": "xylo.hermeven", "edition": "202601", "name": "Pepper", - "version": "0.1.1", + "version": "0.1.2", "min_sdk_version": "0.0.16", "entrypoint": "index.html", "permissions": [ diff --git a/apps/even-client/src/core/controller.ts b/apps/even-client/src/core/controller.ts index 90b66ef..0767883 100644 --- a/apps/even-client/src/core/controller.ts +++ b/apps/even-client/src/core/controller.ts @@ -142,12 +142,11 @@ export class Controller { private readonly phoneGraceMs: number; private readonly conversationGapMs: number; private idleTimer: ReturnType | null = null; - /** - * Leaving by ourselves is only armed once the glasses are actually being used: a gesture has - * arrived, or the session was opened from the glasses. A page opened from the phone to set - * things up is never closed under the user's fingers. - */ - private idleArmed = false; + // Idle exit applies however the session was opened. It used to wait for a `glassesMenu` + // launch source or a first gesture; on a real G2 (2026-11-21, build 0.1.1) a voice launch + // delivered no such signal and the app stayed until the glasses were touched. Setting up on + // the phone is still protected: nothing leaves while unpaired, and a touch on the phone page + // holds the app open for the grace period. private phoneBusyUntil = 0; private launchSource: 'appMenu' | 'glassesMenu' | 'unknown' = 'unknown'; private readonly exitRetryMs: number; @@ -214,9 +213,7 @@ export class Controller { this.device.onLaunchSource?.((source) => { this.launchSource = source; this.note('lifecycle', `opened from ${source}`); - // Opened from the glasses (their menu, or by voice): the glasses are in use. - if (source === 'glassesMenu') this.idleArmed = true; - this.scheduleIdleExit(); + // Shown in Diagnostics only. It does not decide anything: see the note on idle exit. this.emit(); }) ?? (() => undefined), this.device.onConnection((connected) => { @@ -408,7 +405,7 @@ export class Controller { this.exitFailures = 0; this.activityEpoch += 1; } - if (this.stopped || this.exited || !this.idleExitMs || !this.idleArmed || !this.hudReady) return; + if (this.stopped || this.exited || !this.idleExitMs || !this.hudReady) return; const phase = this.state.phase; const wait = phase === 'answer' @@ -813,11 +810,8 @@ export class Controller { private onDeviceEvent(event: DeviceEvent): void { if (event.type !== 'audio') { - // Any gesture from the glasses means they are in use, and restarts the idle countdown - // even when it changes no state (paging past the last page, for example). - if (event.type !== 'foreground_enter' && event.type !== 'foreground_exit' && event.type !== 'system_exit' && event.type !== 'abnormal_exit') { - this.idleArmed = true; - } + // Any gesture or lifecycle event from the glasses restarts the idle countdown, even when + // it changes no state (paging past the last page, for example). this.scheduleIdleExit(); } switch (event.type) { diff --git a/apps/even-client/src/device/port.ts b/apps/even-client/src/device/port.ts index ec3dcd6..703e74c 100644 --- a/apps/even-client/src/device/port.ts +++ b/apps/even-client/src/device/port.ts @@ -27,7 +27,8 @@ export interface DevicePort { */ exitNow(): Promise; /** - * Optional: how this session was opened (`glassesMenu` covers the menu and voice launch). + * Optional, for Diagnostics: how this session was opened, when the host says. On a real G2 a + * voice launch was not reported as `glassesMenu`, so nothing may depend on it. * The host sends this once, early. An implementation must remember it and replay it to a * listener that subscribes later. */ diff --git a/docs/contracts/2026-11-21-droplet-deployment-and-first-device-run.md b/docs/contracts/2026-11-21-droplet-deployment-and-first-device-run.md index 0c0b80c..525f605 100644 --- a/docs/contracts/2026-11-21-droplet-deployment-and-first-device-run.md +++ b/docs/contracts/2026-11-21-droplet-deployment-and-first-device-run.md @@ -84,9 +84,10 @@ Quoted from the conversation of 2026-11-21, in order. Cody recorded after Round 9 that Dan's direct confirmation validates this contract. Section F was added afterwards, in the same way: Dan's words, quoted. -**Status of section F: not yet confirmed by Dan.** Cody's Round 11 verdict holds that the earlier -confirmation covers sections A to E only. F1 to F3 and F6 to F7 quote Dan; F4 and F5 are the -implementer's additions. Until Dan accepts or rejects F1 to F5, section F is a proposal. +**Status of section F.** Dan told Cody directly on 2026-11-21 that acceptance of behaviour +follows a device trial, not the other way round, and Cody issued SHIP FOR TRIAL for +`3e0468802f3ae23b30c39c48f36d489fa92f9658`. Dan then tried build 0.1.1 on the glasses. His +decisions, in his words, are in the table under "Decisions after the 0.1.1 trial" below. | # | Dan said | Criterion | |---|---|---| @@ -98,6 +99,19 @@ implementer's additions. Until Dan accepts or rejects F1 to F5, section F is a p | F6 | "yes, promote it to beta" | Build 0.1.0 is on the beta channel with Dan as tester. | | F7 | On 0.1.1: "send it to cody" | 0.1.1 is **not** uploaded to Even or installed until Dan says so. | +#### Decisions after the 0.1.1 trial (2026-11-21, Dan's words) + +| Item | Decision | Dan said | +|---|---|---| +| F1, F2 | Keep | After a swipe: "cool, she did exit that way." And: "yes, am getting tg notifications after her close." | +| F3 | Keep for now | "20s seems okay for now." The 30 s and 10 s waits were not commented on. | +| F4 | **Changed** | On a voice launch with nothing touched: "she's not leaving." Asked whether the countdown should start however the app was opened, at the cost of closing an untouched phone-opened session: "I also will almost never open her from the phone app. I'll use telegram when I'm going to look at my phone so the change is good in my \"eyes\"". | +| F5 | Not yet tried | No decision. | + +F4 as revised (build 0.1.2): the countdown runs however the app was opened. It still never +leaves while recording, transcribing, waiting for the agent or for an approval, or while +unpaired, and a touch on the phone page still holds it open for two minutes. + ## Out of scope for this contract Wake word ("Hey Pepper"), automatic end-of-speech detection, summoning other agents by name, diff --git a/docs/evidence/device/2026-11-21.md b/docs/evidence/device/2026-11-21.md index c2451cc..b13c645 100644 --- a/docs/evidence/device/2026-11-21.md +++ b/docs/evidence/device/2026-11-21.md @@ -184,3 +184,26 @@ consecutive cycles, locked and pocketed, with failures counted) has **not** been first success, not that test. Build 0.1.1 (idle exit) has not been installed on the device. + +## Fifth session, about 23:20 to 23:35 UTC: build 0.1.1, idle exit + +| Piece | Identity | +|---|---| +| Client | "Pepper" `xylo.hermeven` 0.1.1, beta channel. Package 99,946 bytes, SHA-256 `7dd36b4c7c83191ed830d325204175ca1423ceda6167a683b31655cab80c6eeb`, built from `3e0468802f3ae23b30c39c48f36d489fa92f9658` (Cody: SHIP FOR TRIAL), uploaded 23:09:58 UTC | +| Bridge | `d90cd89`, unchanged | + +Everything below is Dan's report. None of it is visible to the server: leaving the glasses +happens on the phone. + +| Dan reported | Establishes | +|---|---| +| "updated, pairing code not needed." | The pairing survived an update from 0.1.0 to 0.1.1 on the beta channel. | +| "pepper summoned. am waiting 30s now." then "she's not leaving." | After a voice launch with nothing touched, 0.1.1 did not leave. Under 0.1.1's rule that means no `glassesMenu` launch source reached the app. Whether the host sent nothing or sent `appMenu` was not determined. | +| (asked to swipe once and wait) "cool, she did exit that way." | After one gesture, the app left the glasses by itself. This is the first time `shutDownPageContainer(0)` is known to work on a real G2 through the Even app. How long after the swipe was not timed. | +| "yes, am getting tg notifications after her close." | With the app gone, Telegram notifications reach the lenses again. | +| "20s seems okay for now." | The wait after an answer is acceptable for now. | + +Not observed: an exit that the host refused, the retry path, exit from an error screen, the +ten-minute conversation rule, a question asked after a relaunch. + +Build 0.1.2 (countdown starts however the app was opened) has not been installed. diff --git a/docs/evidence/droplet/2026-11-21.md b/docs/evidence/droplet/2026-11-21.md index 12e2c2d..c6b35e9 100644 --- a/docs/evidence/droplet/2026-11-21.md +++ b/docs/evidence/droplet/2026-11-21.md @@ -246,3 +246,14 @@ tester, status "Invited". Dan subsequently installed and ran the beta build. Package `hermeven-0.1.1.ehpk` (99,493 bytes, SHA-256 `4a2c4ad8e27057df15aad81454fedde2296db3562ba28b29e0c5a4d87b9d23cf`, built from `cf2cf66`) exists on the development desktop only. It has **not** been uploaded. + +## 23:09 UTC: build 0.1.1 uploaded to the Even developer account + +Cody's Round 13 found no unresolved code finding on `3e0468802f3ae23b30c39c48f36d489fa92f9658` and +blocked only on owner pre-acceptance. Dan: "Dan says ship. :) Send it." Then `evenhub upload` +(version 0.1.1, id 155494) and `evenhub promote 0.1.1 --to beta`. Cody subsequently recorded +"Exact SHA 3e0468802f3ae23b30c39c48f36d489fa92f9658 is SHIP FOR TRIAL."; the upload preceded that +message by a few minutes, on the owner's instruction. `evenhub ls` at 23:21 UTC: beta channel at +0.1.1; 0.1.0 retained, on no channel. The server was not changed. + +Build 0.1.2 has **not** been uploaded. diff --git a/tests/integration/client-bridge.test.ts b/tests/integration/client-bridge.test.ts index 242d66a..ecf7879 100644 --- a/tests/integration/client-bridge.test.ts +++ b/tests/integration/client-bridge.test.ts @@ -833,17 +833,33 @@ describe('leaving the glasses when idle (the app blocks notifications while it i await until('left from the error screen', () => device.exits === 1, 1500); }); - it('opened from the phone with no gesture yet, it stays: setting up on the phone is not interrupted', async () => { + it('it leaves however it was opened: no launch source and no gesture at all (what a voice launch gave on a real G2)', async () => { + controllerExtras = { idleExit: FAST }; + await pairedController(); + expect(snapshot.launchSource).toBe('unknown'); + await until('left from Ready with nothing ever touched', () => device.exits === 1, 1500); + expect(device.exitAttempts).toBe(1); + }); + + it('opened from the phone app, it leaves too', async () => { controllerExtras = { idleExit: FAST }; await pairedController(); device.launchedFrom('appMenu'); controller.askText('typed on the phone'); await until('answer', () => phase() === 'answer'); - await quiet(500); - expect(device.exits).toBe(0); - // The first gesture on the glasses means they are in use: from then on it applies. + await until('left after the answer', () => device.exits === 1, 1500); + }); + + it('an unpaired app never leaves: pairing on the phone is not interrupted', async () => { + controllerExtras = { idleExit: FAST }; + device = new FakeDevice(); + controller = makeController(device); + await controller.start(); + device.launchedFrom('glassesMenu'); device.swipeDown(); - await until('left after the glasses were used', () => device.exits === 1, 1500); + await quiet(700); + expect(phase()).toBe('unpaired'); + expect(device.exitAttempts).toBe(0); }); it('touching the phone page holds it open for the grace period', async () => { diff --git a/tests/integration/idleExitHost.test.ts b/tests/integration/idleExitHost.test.ts index 7404038..22b592f 100644 --- a/tests/integration/idleExitHost.test.ts +++ b/tests/integration/idleExitHost.test.ts @@ -202,13 +202,14 @@ describe('the one-shot launch source is not lost during start-up', () => { expect(host.maxInFlight).toBe(1); }); - it('control: with no launch source and no gesture, the same start-up does not leave', async () => { + it('with no launch source and no gesture at all, the same start-up still leaves, once', async () => { await pairedHost(); controller = makeController(); await controller.start(); await until('ready', () => snapshot.state.phase === 'ready'); - await quiet(500); - expect(host.exitCalls).toEqual([]); + await until('left the glasses', () => logged('left the glasses') === 1, 2000); + await quiet(400); + expect(host.exitCalls).toEqual([0]); }); }); @@ -313,30 +314,65 @@ describe('default idle times with the production adapter (fake clock)', () => { await expectOneExitAtThirtySeconds(); }); - it('glassesMenu pushed AFTER the controller subscribed: one exit, 30 s later', async () => { + it('glassesMenu pushed AFTER the controller subscribed: still one exit, 30 s after Ready', async () => { await pairedHost(); fakeClock(); controller = defaults(); await controller.start(); - await vi.advanceTimersByTimeAsync(5 * 60_000); - expect(host.exitCalls).toEqual([]); // nothing has said the glasses are in use - host.pushLaunchSource('glassesMenu'); + await vi.advanceTimersByTimeAsync(10_000); + host.pushLaunchSource('glassesMenu'); // arrives late: it must not restart or double the countdown + await vi.advanceTimersByTimeAsync(19_900); + expect(host.exitCalls).toEqual([]); + await vi.advanceTimersByTimeAsync(200); + expect(host.exitCalls).toEqual([0]); + await vi.advanceTimersByTimeAsync(10 * 60_000); + expect(host.exitCalls).toEqual([0]); + }); + + it('NO launch source is ever pushed (seen on a real G2 voice launch): one exit, 30 s after Ready', async () => { + await pairedHost(); + fakeClock(); + controller = defaults(); + await controller.start(); + expect(snapshot.launchSource).toBe('unknown'); await expectOneExitAtThirtySeconds(); }); - it('appMenu pushed early does not arm it; the first glasses gesture does', async () => { + it('appMenu pushed early: opened from the phone app, it leaves the same way', async () => { await pairedHost(); fakeClock(); controller = defaults(); host.pushLaunchSource('appMenu'); await controller.start(); expect(snapshot.launchSource).toBe('appMenu'); - await vi.advanceTimersByTimeAsync(10 * 60_000); - expect(host.exitCalls).toEqual([]); - host.swipeDown(); await expectOneExitAtThirtySeconds(); }); + it('opened and then the phone page is touched: the full two-minute grace, then 30 s', async () => { + await pairedHost(); + fakeClock(); + controller = defaults(); + await controller.start(); + await vi.advanceTimersByTimeAsync(5_000); + controller.notePhoneActivity(); + await vi.advanceTimersByTimeAsync(149_500); + expect(host.exitCalls).toEqual([]); + await vi.advanceTimersByTimeAsync(1_000); + expect(host.exitCalls).toEqual([0]); + }); + + it('never paired: nothing leaves, however long it is left', async () => { + host = new FakeEvenHost(); + fakeClock(); + controller = defaults(); + host.pushLaunchSource('glassesMenu'); + await controller.start(); + expect(snapshot.state.phase).toBe('unpaired'); + host.swipeDown(); + await vi.advanceTimersByTimeAsync(30 * 60_000); + expect(host.exitCalls).toEqual([]); + }); + it('unsubscribing is preserved: a stopped controller no longer hears the launch source', async () => { await pairedHost(); fakeClock(); diff --git a/tests/simulator/simulator.test.ts b/tests/simulator/simulator.test.ts index c9f6d76..5aa6bd8 100644 --- a/tests/simulator/simulator.test.ts +++ b/tests/simulator/simulator.test.ts @@ -353,11 +353,7 @@ describe('Even Hub simulator 0.9.5', () => { await launchSimulator('fast', h.bridge.devices.createPairingCode().code); await waitConsole('hud: HUD page created', 30_000, from); await waitConsole('-> ready', 20_000, from); - await new Promise((r) => setTimeout(r, 6_500)); - await pumpConsole(); - // Opened by URL, no gesture yet: not armed, so it must still be there. - expect(consoleLines.slice(from).some((l) => l.includes('leaving the glasses'))).toBe(false); - await input('down'); // a glasses gesture arms it + // No gesture and no launch source: it leaves from Ready after the (shortened) wait. await waitConsole('leaving the glasses: idle on ready', 15_000, from); await new Promise((r) => setTimeout(r, 1_500)); await pumpConsole();