Address Cody review round 8: CODY-014 start-up status; add acceptance contract

CODY-014 The page is no longer blank while it looks for the Even app. The
         static HTML carries an accessible status (#startup, role=status)
         visible from first paint; boot() keeps it until the real page is
         mounted, then removes it. Start-up moved from main.ts to boot.ts so
         the entry-point wiring can be exercised in a DOM. No eager browser
         fallback: the preview is chosen only after the host wait expires.

tests/integration/entryPoint.test.ts loads the real index.html and runs the
real boot() and the real Even Hub SDK in happy-dom: prompt status, preview
after timeout, real Even mode when a callable host appears during the wait
(SDK bridge initialised, HUD page created).

docs/contracts/: acceptance contract, written by the implementer on Dan's
instruction and tied to his quoted requests.
docs/evidence/device/2026-11-21.md: first run on a physical G2, as reported
by Dan plus the bridge log.

Not reviewed. This commit is not deployed.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This commit is contained in:
Dan
2026-11-21 12:50:45 -08:00
co-authored by Claude Fable 5.2
parent 09e21f6368
commit 7f055d490f
8 changed files with 605 additions and 64 deletions
@@ -0,0 +1,84 @@
# Acceptance contract: droplet deployment and first device run
**Provenance, stated plainly.** This contract was written by Claude, the implementer, on
2026-11-21. Cody's Round 6 and Round 8 reviews asked for a contract independent of the
implementer. Dan, the owner, was asked to supply one and replied, in conversation:
> "you supply the contract. why am I needed for this trivial nonsense?"
So it is supplied here on Dan's instruction. It is not independent of the implementer and does
not pretend to be. What makes it checkable is that every requirement below is tied to something
Dan asked for in his own words (quoted), or to a correction Cody required. Anything the
implementer added beyond those is marked as such.
## What Dan asked for
Quoted from the conversation of 2026-11-21, in order.
1. "that's easy - ip of the hermes droplet is: [the droplet]. Let's tackle that first. I think
you can ssh right in and see what's missing."
2. "pepper is default (also, i'd like to be able to summon other agents by name, but that's
another phase once MVP is done)"
3. On restarting the Hermes gateway to enable its API server: "approved".
4. On the unfinished browser-extension service occupying port 8642: "Can you deprecate that
process, use 8642 for the even bridge, and we'll defer the extension work and assign it a
different port at some point in the future?"
5. "I'm okay with the risk."
6. "we'll use hermeven.xylo.gg"
7. On where the bridge should live, after being told the Hermes server was the simpler choice
for now, no objection; and on capacity: "easier would be to just upgrade the droplet."
## Acceptance criteria
### A. Deployment (from requests 1 to 7)
| # | Criterion |
|---|---|
| A1 | The bridge runs on the Hermes droplet at the commit Cody marked SHIP (`f02715f`), as an unprivileged service, listening on loopback only. |
| A2 | The Hermes API server is enabled on `127.0.0.1:8642` for the `default` profile (Pepper), requires its key, and is not reachable from outside the droplet. |
| A3 | The unfinished extension service and its tunnel are stopped and disabled, not deleted. |
| A4 | The bridge is reachable at `https://hermeven.xylo.gg` with a valid certificate; plain HTTP redirects; ports 8787 and 8642 do not answer from outside. |
| A5 | A question sent through the bridge is answered by Pepper, and a follow-up shows the conversation was kept. |
| A6 | Other agents on the droplet and the n8n webhook are running after the change. |
| A7 | Secrets are not printed, committed or copied off the droplet; previous Hermes configuration is backed up before it is edited. |
### B. Documentation of the deployment (required by Cody, Rounds 6 and 8)
| # | Criterion |
|---|---|
| B1 | The deployment guide works end to end on a clean Ubuntu 24.04 host with no undocumented step. |
| B2 | Dependencies are installed and the client is built as the unprivileged user, only inside `app.new`; the final application tree is root-owned and not writable by the service; secrets, state and model paths are outside every recursive ownership change. |
| B3 | The static client is explicitly installed into `/opt/hermeven/www`, root-owned, directories 0755, files 0644, and is served with the intended security headers. |
| B4 | The README and the dated evidence say exactly which commit is deployed, what the static page was built from, and what remains unverified. |
### C. Page start-up (required by Cody, Round 8, CODY-014)
| # | Criterion |
|---|---|
| C1 | The page shows a meaningful, accessible status from the first paint, before any script runs. |
| C2 | In an ordinary browser the labelled browser preview appears only after the host wait has expired; there is no eager fallback. |
| C3 | A callable Even host appearing during the wait selects the real Even adapter, not the preview. |
| C4 | The start-up status is removed when the real page mounts. |
| C5 | A physical Even-app run shows SDK bridge initialisation and HUD creation for the build under review. |
### D. Standing constraints
| # | Criterion |
|---|---|
| D1 | CODY-001 to CODY-013 stay resolved. |
| D2 | No merge to `main` and no further change to the production host without Dan's explicit go-ahead for that change. |
| D3 | Nothing is claimed as deployed or device-verified unless it was, for that exact build. |
## Out of scope for this contract
Wake word ("Hey Pepper"), automatic end-of-speech detection, summoning other agents by name,
locked-phone operation, a beta-channel install, backups, monitoring and upgrades. Dan has raised
the first three as the next phase; they will get their own contract.
## Added by the implementer, not requested by Dan
- Rotating the Hermes API key (the old one was also in the retired extension's configuration).
- Serving the phone page from the bridge's own hostname.
- `deploy/install.sh` and `tests/deploy/runbook-proof.sh`.
- The precautionary host-detection wait (see `docs/handoff/2026-11-21-cody-round-7.md`: it was
introduced on a wrong diagnosis and kept only as a short precaution).
+65
View File
@@ -0,0 +1,65 @@
# First run on a physical G2, 2026-11-21
**Whose evidence this is.** The glasses and phone were in Dan's hands. The implementer (Claude)
saw nothing on the device: what the HUD showed is Dan's report, quoted. What the server recorded
is the implementer's reading of the bridge log (ids, states and timings; the log holds no
question or answer text).
## Conditions
| Item | Value |
|---|---|
| Glasses | Even G2 (Dan's). Firmware version not recorded. |
| Phone | Android (Dan's). Model, OS and Even app version not recorded. |
| How the app was loaded | QR sideload from inside the Even app's developer section (Even Hub tab), pointing at `https://hermeven.xylo.gg` |
| Phone state | Unlocked, Even app in the foreground |
| Static page build on the server | Built from `09e21f6368deed7917a9f5dcd2eadce5547eca04` (asset `index-84WTYY_U.js`, installed 20:31 UTC) |
| Bridge on the server | `f02715fb6487f4e2ff0adeccfaad2403e1724aa5` |
| Agent | Pepper (Hermes `default` profile), real model |
| Speech-to-text | Built-in `whisper-base` on the server |
## What Dan reported
| Time (UTC) | Dan's words | What it establishes |
|---|---|---|
| about 20:36 | "okay, page is open in the even app, need a code" | The Even app loaded the page from the server. |
| about 20:37 | "paired, runtime says even app host" | Inside the Even app the page found the SDK host (Diagnostics, Runtime), the pairing request reached the bridge, and the app's storage confirmed saving the credential (pairing refuses to complete otherwise). |
| about 20:40 | "Very cool. it worked, but we have a long way to go. When I exited, I just wanted to end the conversation, but it shut down the whole app." | Spoken questions were answered on the glasses. Exiting closed the whole app. |
Dan did not report the exact Runtime line (so the detection delay is unknown), the Diagnostics
"HUD page" value, transcription accuracy, legibility, or how he exited.
## What the server recorded
| Time (UTC) | Event | Transcription | Agent | Total |
|---|---|---|---|---|
| 20:37:30 | device paired | | | |
| 20:38:12 | conversation created | | | |
| 20:38:13 to 20:38:16 | audio turn, succeeded | 1.4 s | 2.2 s | 3.6 s |
| 20:38:26 to 20:38:30 | audio turn, succeeded | 1.1 s | 3.0 s | 4.1 s |
| 20:38:47 to 20:38:54 | audio turn, succeeded | 1.7 s | 4.9 s | 6.6 s |
| 20:39:14 to 20:39:24 | audio turn, succeeded | 1.7 s | 8.7 s | 10.5 s |
Four audio turns means the glasses' microphone was opened and closed by gestures four times and
real G2 audio was transcribed. Totals are measured on the server from accepting the upload to
having the answer; they exclude recording time, upload, polling and drawing on the glasses.
That HUD creation succeeded is inferred, not observed directly: the glasses microphone only
opens after the HUD page exists (Even's documentation), and Dan read answers on the glasses.
## Earlier the same day: a run that was NOT in the Even app
About 20:07 to 20:20 UTC the same page was opened by scanning the QR code with the phone's camera,
which opens it in Chrome. Pairing and a typed question worked (device "Flip", one text turn,
2.1 s). Diagnostics said "Browser preview: no glasses, no microphone". That run shows phone
browser to bridge to Pepper only. The implementer first misread it as an Even-app run; see
`docs/evidence/droplet/2026-11-21.md`.
## Not shown by this run
- Locked phone or backgrounded app. Even's documentation says sideloaded apps stop when the phone
locks; this was not tried.
- The ring, the left temple, the contextual menu, paging a long answer, cancel, the capture cap.
- Accuracy of transcription, legibility, battery, any latency as experienced on the glasses.
- A beta-channel install.
- Any build other than the one named above.