diff options
| author | Danilo M. <danix@danix.xyz> | 2026-11-17 11:51:08 +0100 |
|---|---|---|
| committer | Danilo M. <danix@danix.xyz> | 2026-11-17 11:51:08 +0100 |
| commit | 50c295794af5eed5d84c12f27cd894134951e486 (patch) | |
| tree | ff99868b2e0f6b3fc7079431b0c9f5a7ad82c4bb /docs/superpowers/specs | |
| parent | 6e2c7ad2d5e376b286e910f29a8b3ce4e3b9d4f4 (diff) | |
| download | desktop-assistant-50c295794af5eed5d84c12f27cd894134951e486.tar.gz desktop-assistant-50c295794af5eed5d84c12f27cd894134951e486.zip | |
docs: video spec, stop kills tools, 30 min guard
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'docs/superpowers/specs')
| -rw-r--r-- | docs/superpowers/specs/2026-11-17-video-transcript-design.md | 27 |
1 files changed, 22 insertions, 5 deletions
diff --git a/docs/superpowers/specs/2026-11-17-video-transcript-design.md b/docs/superpowers/specs/2026-11-17-video-transcript-design.md index 748d87f..ad1d268 100644 --- a/docs/superpowers/specs/2026-11-17-video-transcript-design.md +++ b/docs/superpowers/specs/2026-11-17-video-transcript-design.md @@ -53,7 +53,7 @@ refused, `ASSISTANT_DIR` reaching a tool, `out_dir` in `hello`. `~/.config/desktop-assistant/tools/`. ```toml -description = "Transcribe the speech in a video, a local file or a public URL (YouTube, social media, web pages). Writes the full transcript to a Markdown file and opens it. Returns the file's path and the start of the text only: you have NOT read the whole transcript, so to summarize or answer questions about it, ask the user to attach the file. Videos over 20 minutes are refused until the user agrees: tell them the length and that it takes a few minutes, then call again with long=1." +description = "Transcribe the speech in a video, a local file or a public URL (YouTube, social media, web pages). Writes the full transcript to a Markdown file and opens it. Returns the file's path and the start of the text only: you have NOT read the whole transcript, so to summarize or answer questions about it, ask the user to attach the file. Videos over 30 minutes are refused until the user agrees: tell them the length and that it takes a few minutes, then call again with long=1." command = ["video.sh", "{source}", "{long}"] cloud = ["hetzner"] timeout = 1800 @@ -64,7 +64,7 @@ description = "Absolute path of a local video, from its file block or the user's [params.long] type = "string" -description = "1 only after the user agreed to transcribe a video over 20 minutes; empty otherwise." +description = "1 only after the user agreed to transcribe a video over 30 minutes; empty otherwise." ``` ### Flow @@ -74,7 +74,7 @@ description = "1 only after the user agreed to transcribe a video over 20 minute yt-dlp as one argv element after `--`, never to a shell. 2. **Length and title.** Local: `ffprobe` duration, title is the file name. URL: `yt-dlp --print duration --print title --no-playlist`. - Over 20 minutes without `long=1`: print `long: <title>, <mm:ss>. + Over 30 minutes without `long=1`: print `long: <title>, <mm:ss>. Ask the user before transcribing.` and exit 0, nothing written. A source with no audio stream is an error. 3. **Subtitles first (URL only).** `yt-dlp --write-subs --sub-langs @@ -127,6 +127,21 @@ One line, nothing written: bad source, private or unavailable video unwritable output folder. Login-only videos are not supported: no cookies are passed. +### Daemon change: stop kills a running tool + +Today a stop drops a running tool's result but lets the process run +(a `ponytail:` ceiling); harmless for 10 s tools, not for a 7-minute +transcription. `run_tool` puts its `Popen` in `inflight["tool"]` while it +waits, the way `inflight["conn"]` holds the llama-server connection, and +clears it after. `interrupt()` sends `SIGKILL` to that process group +(`start_new_session` already gives each tool its own), so whisper, +ffmpeg and yt-dlp die with the script. `video.sh`'s `trap` cannot run on +`SIGKILL`: its temp dir lives under `$XDG_RUNTIME_DIR` and is named +`video-*`, and the script removes stale ones older than a day at start. +A half-written transcript cannot exist: the `.md` is written in one step +after whisper finishes. `--test`: a `sleep 30` tool, stopped, is gone +within a second and its child too. + ### Daemon change: video attachments `kind_of` returns `video` for `video/*` MIME types. `attach()` adds only @@ -139,7 +154,7 @@ image: the model gets the path for the tool, nothing else. Chip kind `video.sh --test`, like `test-clone.sh`: a generated 5 s clip (`ffmpeg -f lavfi` sine plus `flite` or a stored speech sample from outside the repo) as mp4 and mkv; a source with no audio; a relative path; the -20-minute refusal on a fake duration; slug collisions; the output +30-minute refusal on a fake duration; slug collisions; the output starting with the path line. URL steps against a `file://` source are not possible with yt-dlp's generic extractor rules, so they are covered by the live check only. @@ -150,16 +165,18 @@ Through a second daemon on a scratch socket, config and data dir, Gemma: - A local video, it and en, "trascrivi questo video" with the file attached and with the path typed. -- A YouTube video with uploader subtitles, one without, one over 20 +- A YouTube video with uploader subtitles, one without, one over 30 minutes (refused, asked, then done). - A public video from one social site. - Then attach the written file and ask for a summary. +- Stop mid-transcription: no whisper or yt-dlp left running, no `.md`. - Measure: wall time per minute of a real single-language video on the CPU (the 120 s measurement was a repeated it/en sample, whose last 30 s window came out garbled from the mixed languages). ## Not doing +- Subtitle languages other than it and en (user's choice). - Raising the 2000-character tool cap: the attach step covers it. Add a per-tool `limit` key if the two steps get tedious. - Auto-generated subtitles, cookies for login-only videos, playlists, |
