From 1aeebac6f29f464ccfb268893b33577fad0036f8 Mon Sep 17 00:00:00 2001 From: teahubxyz Date: Wed, 21 Oct 2026 06:01:48 +0000 Subject: [PATCH] harness: a resume mode (autoplay blocked); docs for the state machine and hooks tools/harness.sh resume seeds IndexedDB with a station and one rendered track, resumes it with no user gesture and expects the TAP TO PLAY wait. IndexedDB needs http, so the page is served from a temp folder; headless Chrome's virtual time doesn't wait for IndexedDB, so this mode is driven in real time over the DevTools protocol (tools/harness-cdp.py, stdlib only). The loop harness now prints state.phase too. ARCHITECTURE.md describes the machine as implemented; HANDOFF.md lists what was found and left alone; STORAGE.md gains db.get and the tapes store (the code already had both); README points at the new files. Co-Authored-By: Claude Fable 5.1 Claude-Session: https://claude.ai/code/session_01K6897PWcUEwHiqZMcVnNF6 --- ARCHITECTURE.md | 95 +++++++++++++++++++++++++++++---------- HANDOFF.md | 38 +++++++++++++--- README.md | 6 ++- STORAGE.md | 24 ++++++++-- tools/harness-cdp.py | 90 +++++++++++++++++++++++++++++++++++++ tools/harness-resume.html | 40 +++++++++++++++++ tools/harness.html | 8 ++-- tools/harness.sh | 51 +++++++++++++++++---- 8 files changed, 304 insertions(+), 48 deletions(-) create mode 100644 tools/harness-cdp.py create mode 100644 tools/harness-resume.html diff --git a/ARCHITECTURE.md b/ARCHITECTURE.md index 36feddf..3fccbf6 100644 --- a/ARCHITECTURE.md +++ b/ARCHITECTURE.md @@ -9,44 +9,82 @@ the invariants that the playback code relies on. Keep it current when you change |---|---|---| | Seed screen | the seed box, the stations row, LIBRARY / TASTE / LIGHT / RELOAD | `#seed`, `listStations`, `openStation` | | Station | seed, name, taste {like, avoid, notes}, history (last 8 sheets), look, palette, DJ name + voice, `welcomed` | `openStation`, `saveStation`, `stationSheet`; IndexedDB `stations` | -| DJ | writes a sheet (JSON, `DJ_SCHEMA`) from seed + taste + recent tracks + the brain's taste text | `djPrompt` (base) + brain.js override, `askDJ`; breaks: `askBreak`; mashups: `askMash` | +| DJ | writes a sheet (JSON, `DJ_SCHEMA`) from seed + taste + recent tracks + the brain's taste text | `djPrompt` (base) + `hooks.djPrompt` (brain.js), `askDJ`; breaks: `askBreak`; mashups: `askMash` | | Renderer | audio from a sheet | `renderTrack` → worker `/v1/render` (Runware; seed, bpm, key, meter, reference audio) or Venice queue/poll with a personal key; spoken breaks → `speak` → `/v1/speech` | -| Player | one `