Address Cody review round 6: executable runbook, static client install, README

CODY-011 deploy/install.sh performs the ownership-sensitive sequence: the
         release is copied to app.new, that one directory is given to the
         hermeven user, npm ci runs unprivileged, and the finished tree is
         handed back to root:root with group/other write removed. Secrets,
         state and model directories are never touched. The guide now gives
         exact commands, including the C/C++ toolchain a clean host needs
         (found by running it on one).
CODY-012 install.sh builds the phone page with the bridge address preset
         and installs it root-owned into /opt/hermeven/www for Caddy. The
         guide explains the web build versus the .ehpk package and when
         each is needed.
CODY-013 README states which commit was deployed, what was checked, and
         what remains unverified.

Also corrects a wrong diagnosis recorded in the previous commit: the phone
page that showed "Browser preview" had been opened in Chrome, not in the
Even app. Host detection keeps a short precautionary wait (2.5 s) and its
comments no longer claim an observed Even-app delay.

tests/deploy/runbook-proof.sh proves the guide on a disposable Ubuntu 24.04
host with systemd.

Not reviewed.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This commit is contained in:
Dan
2026-11-21 12:28:07 -08:00
co-authored by Claude Fable 5.2
parent e5559dc5e7
commit 65260911ae
8 changed files with 333 additions and 52 deletions
+3 -3
View File
@@ -2,8 +2,8 @@ import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';
import { HOST_WAIT_MS, PLATFORM_READY_EVENT, waitForEvenHost, watchForLateHost, type HostWindow } from '../../apps/even-client/src/device/hostDetect.ts';
/**
* Found on the first real-phone run (2026-11-21): the Even app's connection was not yet on
* `window` when the page's script started, and the page wrongly chose browser-preview mode.
* Host detection waits briefly for the Even app's connection instead of deciding on the first
* instant. This is a precaution: no real phone has yet been observed providing it late.
*/
function fakeWindow() {
const listeners = new Map<string, Set<() => void>>();
@@ -28,7 +28,7 @@ describe('detecting the Even app host', () => {
expect(win.listenerCount()).toBe(0);
});
it('appears shortly after the page starts (the real phone): found, not mistaken for a browser', async () => {
it('appears shortly after the page starts: found, not mistaken for a browser', async () => {
const win = fakeWindow();
const detecting = waitForEvenHost(win);
await vi.advanceTimersByTimeAsync(800);