Record round 6 proofs and the Round 7 handoff (documentation only)

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This commit is contained in:
Dan
2026-11-21 12:31:15 -08:00
co-authored by Claude Fable 5.2
parent 65260911ae
commit 09e21f6368
3 changed files with 224 additions and 0 deletions
+125
View File
@@ -65,3 +65,128 @@ turns in Pepper's history, in their own session.
- Backups of `/var/lib/hermeven`, log rotation, monitoring, and an upgrade procedure. - Backups of `/var/lib/hermeven`, log rotation, monitoring, and an upgrade procedure.
- The service was started with these hardening options and loaded the model, but no option was - The service was started with these hardening options and loaded the model, but no option was
tested by trying to violate it. tested by trying to violate it.
## Later the same day
### The static phone page was replaced twice
The bridge on the server is still commit `f02715f`. Only the static page in `/opt/hermeven/www`
changed, and it was built from client code that Cody has not reviewed:
| When (UTC) | Page built from | Why |
|---|---|---|
| 19:5x | `f02715f` | First deployment |
| 20:1x | `e5559dc` | A host-detection change made on a wrong diagnosis (below) |
| after this record | the commit that adds this section | Shorter detection wait; corrected comments |
### What happened on the phone, and a correction
Dan opened `https://hermeven.xylo.gg` on his Android phone, paired with a code from the server,
and typed a question; Pepper answered (bridge log: device paired, one text turn, `succeeded`,
2.1 s in the agent). **The page had been opened by scanning the QR code with the phone's camera,
so it was running in Chrome, not in the Even app.** Its Diagnostics said "Browser preview: no
glasses, no microphone", and the browser line had no WebView marker.
Before that was understood, the implementer (Claude) wrongly concluded that the Even app provides
its connection late, told Dan that the Even app had loaded the page, allowed its network calls
and confirmed storage writes, and shipped a change to wait for the connection. None of those
three statements was supported: nothing has yet run inside the Even app. They were retracted
the same day. What the phone run does show is phone browser -> HTTPS -> bridge -> Pepper.
### Loading the page in a desktop browser
Chrome on the development desktop, `https://hermeven.xylo.gg/`: the page rendered the pairing
form with the bridge address preset to `https://hermeven.xylo.gg`, and Diagnostics reported
`Page origin: https://hermeven.xylo.gg`. `HERMEVEN_ALLOWED_ORIGINS` on the server is empty: the
page and the API share one origin, so no cross-origin allowance exists or is needed.
Through the server's Caddy 2.6.2, from outside:
| Request | Result |
|---|---|
| `GET /` | 200 `text/html` |
| `GET /assets/index-<hash>.js` | 200 `text/javascript`, 296,329 bytes |
| Headers on both | `strict-transport-security: max-age=31536000`, `x-content-type-options: nosniff`, `referrer-policy: no-referrer`, no `server` header |
| `GET /v1/device` with `Origin: https://evil.example` | no `access-control-allow-origin` header |
| `OPTIONS /v1/turns` preflight from that origin | 404, no `access-control-allow-origin` header |
## Clean-host proof of the written guide (not this server)
The guide's server-side steps were run from an empty `/opt/hermeven` on a disposable Ubuntu 24.04
host: a privileged Docker container with systemd as PID 1, on the development desktop
(`tests/deploy/runbook-proof.sh`). Hermes is not present there, and the hostname is `localhost`
with a certificate from Caddy's local CA, so this proves the install sequence, ownership, the
unit and the Caddy configuration. It does not prove a public certificate or a second real server.
The first attempt failed at `npm ci`: a clean Ubuntu has no compiler, and the SQLite library
builds from source there. The guide and `install.sh` now require `build-essential` and `python3`.
(The real server already had them, which is why the first deployment did not show this.)
Output of the passing run:
```
### host image
Ubuntu 24.04.5 LTS
/opt/hermeven does not exist
id: 'hermeven': no such user
### step 2: packages (Caddy, git, Node.js with checksum)
node-v22.23.5-linux-x64.tar.xz: OK
v22.23.5
2.6.2
### step 3: get the release onto the server (git clone of 65260911ae907846ea7febd933e8c0e37c471c22)
65260911ae907846ea7febd933e8c0e37c471c22
### step 4: deploy/install.sh
==> 1/7 user and directories
==> 2/7 copy the release to /opt/hermeven/app.new
==> 3/7 npm ci as the unprivileged user
==> 4/7 build the phone page for https://localhost
==> 5/7 hand the tree back to root
==> 6/7 install the phone page into /opt/hermeven/www
==> 7/7 activate the new tree and install the unit
Installed 65260911ae907846ea7febd933e8c0e37c471c22 to /opt/hermeven/app
Phone page installed to /opt/hermeven/www
Not started. Next: configuration, speech model, then 'systemctl enable --now hermeven-bridge'
### ownership and permissions after install
DEPLOYED_SHA: 65260911ae907846ea7febd933e8c0e37c471c22
app tree owner: root:root 755
not root-owned in app: 0 group/other-writable in app: 0
node_modules present: yes
hermeven cannot write the app tree
hermeven cannot create files in the source
www: root:root 755 index root 644 files=3
hermeven cannot write www
caddy can read www
state dir: hermeven:hermeven 700
secrets dir entries: 0 (install.sh wrote none)
models dir: not created by install.sh
### steps 5, 6: configuration and speech model
hermeven:hermeven 600 /etc/hermeven/bridge.env
Verified 7 file(s); downloaded 7.
Verified 7 file(s).
models owner: root:root
### step 8: start the bridge under systemd
systemd-analyze verify: ok
unit: active (running as hermeven, MainPID uid hermeven)
"msg":"Server listening at http://127.0.0.1:8787" "msg":"stt.loading" "msg":"stt.ready"
healthz (direct): {"status":"ok","schema_version":1}
state files: 700 hermeven 600 /var/lib/hermeven/hermeven.sqlite;hermeven 600 /var/lib/hermeven/hermeven.sqlite-shm;hermeven 600 /var/lib/hermeven/hermeven.sqlite-wal;
### step 9: HTTPS through Caddy (hostname replaced by localhost; certificate from Caddy's local CA)
caddy fmt --diff on the example: exit 0, 0 changed line(s)
Valid configuration
caddy: active
GET / -> 200 text/html; charset=utf-8
GET /assets/index-DqyTqNG5.js -> 200 text/javascript; charset=utf-8 296323 bytes
GET /healthz -> {"status":"ok","schema_version":1}
GET /v1/device -> 401 (no credential)
headers on /:
referrer-policy: no-referrer
strict-transport-security: max-age=31536000
x-content-type-options: nosniff
headers on the asset:
referrer-policy: no-referrer
strict-transport-security: max-age=31536000
x-content-type-options: nosniff
bridge address built into the page: 1 occurrence(s) of https://localhost
CORS for a foreign origin: 0 allow-origin header(s)
### done: 65260911ae907846ea7febd933e8c0e37c471c22
```
+71
View File
@@ -0,0 +1,71 @@
# Handoff for Cody, Round 7
From: Claude (implementation). Date: 2026-11-21.
**Not reviewed.** Cody's Round 6 result (REVIEW BLOCKED) applies to `98c7b03` only.
| Item | Value |
|---|---|
| Repository | `git@git.xylo.gg:Xylo-Digital/hermeven.git` |
| Branch | `cody/droplet-deploy` |
| `main` | `f02715fb6487f4e2ff0adeccfaad2403e1724aa5` (Cody: SHIP; unchanged) |
| Reviewed in Round 6 | `98c7b03aa78b3570592c17a1412a071e3499fce9` |
| New head | the tip of `cody/droplet-deploy` after this push; exact SHA in the push report |
## The acceptance contract
**Not supplied.** Round 6 asks for a trusted, independent issue or task contract. The implementer
cannot write an independent contract for its own work, so none is included. Dan has been asked to
provide one (a Gitea issue or equivalent). Until he does, this round can only be judged against
Round 6's own required corrections, listed below.
For context, not as a contract: the work on this branch came from three requests by Dan in
conversation on 2026-11-21. (1) Inspect the Hermes droplet and deploy the bridge there. (2) Retire
the unfinished browser-extension service and use port 8642 for the Hermes API. (3) Serve the
bridge at `hermeven.xylo.gg`.
## Scope of this branch beyond `main`
| Commit | Kind | Content |
|---|---|---|
| `98c7b03` | docs, deploy examples | Deployment record; unit and Caddyfile aligned with what ran |
| `e5559dc` | **client code** | Host detection waits for the Even app connection; Diagnostics shows the browser |
| next | docs, deploy script, tests, small client change | Round 6 corrections; wait shortened to 2.5 s; a wrong diagnosis corrected |
So this is no longer documentation only: `apps/even-client/src/device/hostDetect.ts`,
`src/main.ts` and `src/ui/phone.ts` changed. No bridge code changed.
## Round 6 corrections
| Finding | What was done | Proof |
|---|---|---|
| CODY-011 | `deploy/install.sh`: copy the release to `app.new`, `chown` only that directory to `hermeven`, `npm ci` as `hermeven`, then `chown -R root:root` and `chmod -R go-w` on it before it becomes `/opt/hermeven/app`. It does not touch `/etc/hermeven`, `/var/lib/hermeven` contents or `/opt/hermeven/models`. The guide gives exact commands and names the toolchain a clean host needs. | `tests/deploy/runbook-proof.sh`: from an empty `/opt/hermeven` on a disposable Ubuntu 24.04 host with systemd. Unprivileged `npm ci` succeeds; 0 files in the app tree not owned by root; 0 group/other-writable; `hermeven` cannot write the tree or create a file in the source; the unit is `active`, running as `hermeven`. |
| CODY-012 | `install.sh` builds the client with the bridge address preset and installs it into `/opt/hermeven/www` as root (directories 0755, files 0644). The guide has a section on the web build versus the `.ehpk` and when each is needed. | Same run, Caddy 2.6.2: `GET /` 200, hashed asset 200, the three security headers on both, `/healthz` proxied, no CORS header for a foreign origin. On the live server: the same requests, and the page loaded in Chrome with Diagnostics reporting `Page origin: https://hermeven.xylo.gg`. |
| CODY-013 | README states that `f02715f` was deployed with only the bounded server-side checks, and lists phone/glasses, locked-phone capture, tools/approvals, sustained load, backups, monitoring and upgrades as unverified. | Read the diff. |
One thing the README says that Round 6 did not anticipate: the static page on the server has since
been rebuilt from this branch's unreviewed client commits. `98c7b03` itself was never deployed;
the bridge on the server is still `f02715f`.
## Checks
`npm ci`, `npm run typecheck`, `npm test` (205), `npm run client:build`, `npm run test:real-stt`
(11), `npm run test:real-hermes` (9), `npm run test:simulator` (6), `git diff --check`: all pass.
`caddy validate` and `caddy fmt --diff` with 2.6.2, and `systemd-analyze verify`: pass on the
disposable host. Nothing omitted. Details: `docs/test-evidence.md`, "Round 7".
## Things the author got wrong, and is unsure about
- **A wrong diagnosis reached a commit message.** `e5559dc` says the Even app's WebView provided
its connection late on a real phone. That was not observed: the page was open in Chrome. The
code comments are corrected in the next commit; the commit message of `e5559dc` is left as it is
(already pushed) and is wrong.
- Whether the precautionary wait is worth having at all. It delays the browser preview by 2.5 s
and addresses nothing that has been seen.
- The clean-host proof uses a container, `localhost` and Caddy's local CA, not a second server.
- `install.sh` builds the client on the server as the service user, so build tooling runs there.
- Nothing has run inside the Even app.
## Not claimed
No evidence from the Even app, the glasses, or a locked phone. Nothing merged to `main`.
+28
View File
@@ -417,3 +417,31 @@ parent-is-a-file refusal.
Three ways of removing the ownership check were tried against the suite; all three were caught Three ways of removing the ownership check were tried against the suite; all three were caught
(2 to 4 failing tests each). (2 to 4 failing tests each).
## Round 7: after Cody's Round 6 review of the deployment documents (2026-11-21)
Cody reviewed `98c7b03` (deployment record and examples): REVIEW BLOCKED, with CODY-011
(install sequence not executable on a clean host), CODY-012 (static client never installed) and
CODY-013 (README contradicted the deployment evidence). The block also requires an independent
acceptance contract, which only Dan can supply; none is included here.
```
$ npm ci exit 0
$ npm run typecheck exit 0
$ npm test Tests 205 passed (205)
$ npm run client:build built
$ npm run test:real-stt Tests 11 passed (11)
$ npm run test:real-hermes Tests 9 passed (9)
$ npm run test:simulator Tests 6 passed (6)
$ git diff --check clean
$ tests/deploy/runbook-proof.sh exit 0 (on a disposable Ubuntu 24.04 host with systemd)
caddy 2.6.2: validate "Valid configuration"; fmt --diff 0 changed lines
systemd-analyze verify: ok (run on the disposable host, where /opt/node exists)
```
`systemd-analyze verify` on the development desktop reports only that `/opt/node/bin/node` does
not exist there, which is expected. No check was omitted.
The proof output, the live-server header and CORS checks and the page load are in
`docs/evidence/droplet/2026-11-21.md`. The 7 tests added since Round 5 are for host detection
(`tests/integration/hostDetect.test.ts`).