Address Cody review round 3: CODY-003 and CODY-006

CODY-003 Request identity is durable before submission. Storage results are
         explicit at the DevicePort boundary (storageSet resolves true only
         on the host's own timely confirmation; storageGet distinguishes
         unknown from empty). A request is not sent until the phone has
         confirmed storing its id; a timeout or refusal holds it back,
         unsent and retryable under the same id. Unreadable storage at
         start is not treated as unpaired; an unsaveable pairing is revoked.
CODY-006 The state directory is set to 0700 on every open, including when
         it already existed, and the bridge refuses to start with an
         operator-facing error if it cannot be. Deployment guide creates
         it with install -d -m 0700.

Checks: typecheck clean; npm test 194 passed; client build ok;
test:real-stt 11 passed; test:real-hermes 9 passed; test:simulator 6
passed; git diff --check clean.

Not reviewed. No physical-device, droplet or production evidence.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This commit is contained in:
Dan
2026-11-18 20:29:05 -08:00
co-authored by Claude Fable 5.2
parent e1c02d5266
commit 1507cea077
19 changed files with 759 additions and 45 deletions
+10 -4
View File
@@ -1,6 +1,6 @@
import type { HudFrame } from '../../apps/even-client/src/core/hud.ts';
import type { DeviceEvent } from '../../apps/even-client/src/device/events.ts';
import type { DevicePort } from '../../apps/even-client/src/device/port.ts';
import type { DevicePort, StorageRead } from '../../apps/even-client/src/device/port.ts';
/**
* TEST FAKE. Not glasses, not the simulator.
@@ -51,11 +51,17 @@ export class FakeDevice implements DevicePort {
async requestExit(): Promise<void> {
this.exitRequests += 1;
}
async storageGet(key: string): Promise<string> {
return this.storage.get(key) ?? '';
/** Set to make storage writes report "not confirmed" without writing. */
storageWritesFail = false;
storageReadsFail = false;
async storageGet(key: string): Promise<StorageRead> {
if (this.storageReadsFail) return { ok: false };
return { ok: true, value: this.storage.get(key) ?? '' };
}
async storageSet(key: string, value: string): Promise<void> {
async storageSet(key: string, value: string): Promise<boolean> {
if (this.storageWritesFail) return false;
this.storage.set(key, value);
return true;
}
// ---- test controls