# Unattended batch / overnight queue in a local desktop app Use when briefing a queue for slow local generation (TTS, image, video) that the user leaves running. ## Requirements to put in the PM brief (product level, not design) - Which job types can be queued; per-item settings captured at enqueue time; item cap (e.g. 50). - Sequential processing; one failing item does not stop the queue, its reason stays next to it. Exception worth asking about: pause after N consecutive systemic errors (network/disk), otherwise a dropped connection burns every item in minutes. - Prevent idle system sleep only while the queue runs; allow the display to sleep. Release the assertion when done. - Persist the queue to disk; after app close/reboot show it again but never auto-start. - Morning view: per-item status, output file name/location, total time; descriptive file names, one folder per run, optional summary text file. - Show an estimate up front and recompute remaining time from the measured speed after the first item; never promise "done by morning" without a measurement on the target hardware. - Long text in queue items: split at sentence boundaries (respect abbreviations like "Dr.", "vb." and decimals), generate parts with identical settings, join into one file without clicks; resume from the last finished part; block random/unspecified voice for multi-part items (each part would sound like a different speaker). - Bulk import (TXT/CSV): preview with accepted count and per-row rejection reasons, nothing enqueued without confirmation; Turkish Excel CSVs are often `;`-separated Windows-1254, so accept UTF-8 (with/without BOM), Windows-1254, `,` and `;`, TR/EN headers; provide a sample template. - Everything stays local; queued text is not written to logs or error reports. Require that every new path that sends text to the model (queue worker, resumed items from a previous session, batch parts) calls the SAME privacy hook as manual generation (SesVer: `hata_raporu.remember_private(text, ref_text)` before the model call, not only in the error handler), with a test where the model prints the text to stderr and the log file still lacks it. A queue built on a branch older than the privacy fix silently bypasses it; the security review rates that medium and blocks release. ## Platform sleep facts (cite to the user, from Microsoft/Apple docs) - Windows: `PowerSetRequest` (fallback `SetThreadExecutionState(ES_CONTINUOUS|ES_SYSTEM_REQUIRED)`). Lid close, power button and Start > Sleep still sleep. On Modern Standby laptops on battery the request ends ~5 min after the sleep timeout, so warn "plug in, keep the lid open". Windows Update reboots cannot be blocked; persistence covers it. Verify on a real machine with `powercfg /requests` (CI cannot test it). - macOS: `NSProcessInfo beginActivityWithOptions` (also stops App Nap) or `caffeinate -i -w `; lid close still sleeps. Verify with `pmset -g assertions` showing `PreventUserIdleSystemSleep` with the app's reason while running and gone after. Use an ASCII reason string: powerd shows non-ASCII reasons as empty. ## Phase acceptance (what to require from the worker) 1. Core (not wired to UI): tests for states, close/reopen persistence, no auto-start, systemic pause, resume mid long item; sleep-assertion evidence on and off. 2. Drafts: same sample data in every draft (mixed done/running/waiting/failed, a multi-part item, import entry); PNGs at real width; inspect them yourself before sending to the user. 3. UI wiring: real-model run with a few short items (one deliberately failing) and one multi-part item; output folder listing and summary file verbatim; measured seconds per character on this machine. ## Measured on a 16 GB Apple Silicon dev machine (SesVer, VoxCPM2, MPS) - Unloaded: ~0.31 s/character on a 500-char part (~2.5 min per part); first item adds ~90 s model load. - The app process reaches 13-14 GB during long items; with other heavy apps open (Android emulator, Gradle) the same part ran 8-14x slower from swapping. Tell users the overnight run needs other heavy apps closed, and never quote a speed measured under memory pressure as the product's speed. - Before a real-model run, check for ANY Python process holding the model, not just the app's file names: experiment scripts (`scratch/.../uret.py`) slip past a `desktop.py|app.py|voxcpm` grep. Use `ps aux | grep -i python` and look at RSS; two loaded models do not fit in 16 GB.