commit 15d2e655700ce6ec212e0510bbc07ad8c799da58
parent 96a0849513e519d6ba18ee2898afb2460d39e2d7
Author: I Mean I'm Just Saying <imeanimjustsaying@kiwifarms.st>
Date: Mon, 19 Oct 2026 15:50:45 -0400
docs: the assistant's labels and Ask the assistant — report-video.md, notes.md, SETTINGS.md and settings.json.example regenerated, FACTS, CHANGELOG
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Diffstat:
6 files changed, 109 insertions(+), 2 deletions(-)
diff --git a/SETTINGS.md b/SETTINGS.md
@@ -1007,6 +1007,7 @@ Report and video generation (release 27): where each task runs (`code` = Claude
| `youtube` | `"local"` | A media draft: the YouTube title and description. |
| `social` | `"local"` | A media draft: the promotion posts for X and Bluesky (`publish.x`, `publish.bluesky`; text only, never posted), the link added by code. |
| `frames` | `"api"` | A frame scan's readings of a saved stream's frames (`frame-scan.<profile>.json` beside the video): `api` (`frames.apiModel`) or `local` (`frames.localModel`); `code` = none unless the job names a model. |
+| `clips-suggest` | `"local"` | The clip finder's optional AI pass on a reactions project (umtool's clip editor: Suggest, Ask the assistant): a label, a why and a rank for each proposal (`clip-suggestions.json` beside reactions.json; never a clip or the manifest), and an answer to a comment on a clip with at most one edit the operator applies. `code` = a Claude Code session answers the request (`/gen`). |
| `verdicts` | `"local"` | Verdict proposals for a fact-check's unruled claims (`verdicts.proposed.json` beside the article; the operator approves or rejects each). Runs only on a model in `verdicts.models`: the first of them on this route (`api` or `local`), or the one a job names; `code` = none unless named. |
#### `generation.models`
@@ -1112,7 +1113,8 @@ Default:
"youtube": "local",
"social": "local",
"verdicts": "local",
- "frames": "api"
+ "frames": "api",
+ "clips-suggest": "local"
},
"models": {
"api": "claude-sonnet-5-5",
diff --git a/editor/CHANGELOG.md b/editor/CHANGELOG.md
@@ -1,6 +1,8 @@
# Changelog
## [Unreleased]
+- **The clip editor can ask an assistant to label and rank the clip finder's proposals — optionally.** A **Suggest** button in the clip editor's side column asks the model your generation settings choose (the local model, the Claude API, or a Claude Code session through `/gen`) to name each proposal in at most six words, say in one line what makes it land, and rank them; the labels show on every clip and unused proposal, and **Sort by the assistant's rank** orders both lists by them. Labels made before the clips were proposed again are marked stale, not hidden. Nothing in the cut changes: the labels are suggestions. Without a model, or with no labels, the clip editor works as before. From a shell: `pnpm ops report-draft '{"task":"clips-suggest","project":"<dir>","dryRun":true}'` shows how many proposals and what it would cost first.
+- **Ask the assistant about a clip, and apply what it suggests with one click.** On a comment in the clip editor, **Ask the assistant** has the model read your comment, the clip's words and the clips around it, and reply in the thread (badged "agent"). When it suggests a concrete edit — new edges, a merge with the next clip, or leaving the clip out — the reply shows an **Apply** button; nothing changes until you click it, and Apply does exactly what the clip editor's own buttons do. The editor needs `UMTOOL_URL` set to post the reply.
- **Find clips: the clip finder from one button on the video page.** A video page's **Find clips** runs the whole chain umtool's clip finder needs, as one job: it saves the source video, transcribes the recording, makes its word timings (kept beside the transcript as `words.json`, so a second project from the same recording reuses them), fetches the stream's chat replay (YouTube), finds who speaks when, and then asks umtool to find the narrated-video segments and propose the clips. Each step whose output is already on disk is skipped, and the job's log says which ran and which were skipped. When it is done the panel links the umtool project and lists the segments it found, each with **Find clips in this part**. A target length can be given. When the workers are paused or the backfill lane is held, the step that needs them stops with a sentence saying so, and **Run while paused** runs this one video past them. The button is off, with a line saying why, when the editor has no `UMTOOL_URL`. The same from a terminal: `pnpm ops find-clips --json '{"slug","id"}'` (a `dryRun` lists what each step would do). Needs a restart of the editor.
- **Transcribe one video while the workers are paused.** With the transcription workers paused, the video page's Transcribe row offers **Transcribe now (workers paused)**: that one transcription runs on a worker the pause alone switched off, and the pause stays on — the worker is paused again when it finishes. A worker you drained, disabled by hand or that is marked degraded is never used, and the lanes stay held. `pnpm ops transcribe` and `transcribe-one` take `"whilePaused": true`.
- **Fetch a stream's chat replay on its own.** Media tools → **Fetch live chat** on a video page (`pnpm ops fetch-chat`) fetches the video's live chat and nothing else, paced like every YouTube request and on the platform's download queue, into the chat cues the index and the clip finder read. A video on another platform says there is no chat fetcher for it, as does a chat already fetched or a video that was never live.
diff --git a/plans/FACTS.md b/plans/FACTS.md
@@ -10942,3 +10942,51 @@ parsed to 0 cues, indexing the video textless) is CLOSED by `200a3105` (transcri
(disabled + `find-clips off` line without umtoolUrl), then the record's project link and `segments found` with
`Find clips in this part` each. The Transcribe row's `Transcribe now (workers paused)` shows while the pool is
paused. Media tools → `Fetch live chat`.
+
+## Release 36 lane D: the assistant's labels, Ask the assistant (verified 2026-10-19, branch `r36/clips-suggest`)
+
+- **`<project>/clip-suggestions.json`** `{model, at, proposedAt (reactions.json's at the pass), promptVersion
+ "clips-suggest-1", items: {<proposalId>: {label (≤ 6 words, ≤ 60 chars), why (one line, ≤ 200), rank (1 = best),
+ score (the model's 1–10), start, end (the span labelled)}}}`, items in rank order. ONE writer: `writeSuggestions`
+ (`yt-dlp-transcript-common/lib/clips/suggest.mjs`, tmp + rename, checked by `parseSuggestionsDoc`); readers
+ `readSuggestions` (`{doc, error}`) and `suggestionsState(doc, reactions)` → `{stale, why, passNewer, staleIds,
+ missing}`: stale when reactions.json's `proposedAt` is later than the file's (passNewer: every label), or per item
+ when its proposal is gone or its span moved > 0.05 s. Rank is CODE's: by score, then the finder's score, then time;
+ a pass merges over the old file's current items. Never a clip, the manifest, reactions.json or notes.json.
+- **The task**: `report-draft {task: "clips-suggest", project: <abs dir>, model?, maxUsd?, proposals?, note?, answers?,
+ dryRun?}` — `article` must be absent (the body's `article` is ""); `project` absolute, normalised, never under
+ `paths.transcriptsDir`, holding a reactions.json. Route `settings.generation.routes["clips-suggest"]` (presets: code
+ code, balanced local, api api, local local; an older file keeps its preset); model `modelFor` (routed to `code`
+ with no model: refused, unless `answers`). Cap: the NARRATION cap (`capOf`), plus the daily cap; ledger rows `task
+ "clips-suggest", article "", iteration 0`. Queue `draft:local` (GPU arbiter, ollama unloaded) or `draft:api` (also
+ a session's answers, model `claude-code`). Batches: 30 a call on the API, fitted to the 8k prompt cap locally.
+ Progress metric `entries`. Marker `@@report-draft {article: "", iteration: 0, task, project, status, summary, usd,
+ kind: "labels", suggestions {labelled, refused, failed, file}} | {kind: "ask", ask {note, clip, proposal,
+ dropped}}`. A batch whose answer is not `{items: […]}` is refused whole; a label over six words / a score outside
+ 1–10 / an id never asked is refused per item. No label at all → the job fails. The ops route's `dryRun: true`
+ answers `{ok, plan: {project, model, provider, promptVersion, wordsFrom, proposals, calls, estimate {inputTokens,
+ outputTokens, usd}, request {system, user, schema, ids}}}` (`planClipsSuggestJob`). Words: reactions
+ `source.words` (relative) else words.json, else the corpus cues spread (`wordsFromCues`).
+- **An Ask** (`note`): the note (open, anchored `entry`) from notes.json, the clip and its neighbours from the manifest
+ (`askClipsOf`: `next` only when the next timeline entry is a clip of the same recording), the words ±20 s with
+ times and roles → `{reply, proposal {kind none|trim|merge|cut, from, to}}`; kept proposals (`parseAskAnswer`): a
+ trim ≥ 0.5 s moving each edge ≤ 30 s and not a no-op; a merge only with a next clip; a cut. The reply is POSTed
+ to `<UMTOOL_URL>/api/notes?project=<dir>` with `Bearer WORKER_TOKEN` (stamped agent); without UMTOOL_URL or the
+ token the ask is refused at enqueue.
+- **A notes reply's `proposal`** (`umtool/lib/annotations/shape.mjs` `validateReplyProposal`): `{kind: "trim", clip,
+ from, to, basis?} | {kind: "merge", clip, with, basis?} | {kind: "cut", clip, basis?}` (basis `{cutStart,
+ cutEnd}`), accepted on `{op: "reply"}` from an AGENT only (an operator's is a NoteError, 400); kept by
+ `parseNotesDoc` (a malformed one makes the file unreadable). Applied only by the clip editor's **Apply** (trim →
+ `trim` op, merge → `merge`, cut → ruling `cut`), which then replies "Applied: …" as the operator; Apply is offered
+ while no operator reply follows the agent's.
+- **umtool**: `/api/report/clip-suggest` (GET `?project=` → `{suggestions, error, state, hasReactions, route {route,
+ model, why}, editorError, job}`; GET `&job=`; POST `{project, mode "labels", proposals?} | {project, mode "ask",
+ note}` → `{jobId, job}`, 409 while one runs; POST `?cancel=&project=`), via `askEditor`
+ (lib/articles/generation.ts) with the WORKER_TOKEN. The followed job is `<project>/.clip-suggest-job.json`
+ `{jobId, mode, note?, at}` (forgotten when seen ended, or unknown to the editor). Module
+ `umtool/lib/report/clipSuggest.mjs`; UI `components/projects/review/ClipSuggest.tsx` (`data-suggest-*`,
+ `data-note-action="ask"`, `data-reply-proposal`, `data-apply-proposal`). NoteThread gained `actions` and
+ `afterReply` props.
+- **MCP `generate`**: task `clips-suggest` with `project` (no article); routed to code with no model/via/answers, it
+ posts the plan (`dryRun`) and answers the request for the session to label; `answers` go straight to the editor (no
+ policy read). Test kit: `common/testing/clips/reactionProject.mjs`.
diff --git a/settings.json.example b/settings.json.example
@@ -256,7 +256,8 @@
"youtube": "local",
"social": "local",
"verdicts": "local",
- "frames": "api"
+ "frames": "api",
+ "clips-suggest": "local"
},
"models": {
"api": "claude-sonnet-5-5",
diff --git a/umtool/docs/notes.md b/umtool/docs/notes.md
@@ -91,6 +91,17 @@ it (`common/publish/composeReports.test.ts` holds that), so a note is never publ
"resolvedAt": "…", "resolvedBy": "agent" } ] }
```
+**A reply's proposal** (release 36, the clip editor's Ask the assistant): an
+AGENT's reply may carry ONE edit of one clip it suggests —
+`"proposal": {"kind": "trim", "clip": "r002", "from": 94.8, "to": 99, "basis":
+{"cutStart": 88, "cutEnd": 99}}`, `{"kind": "merge", "clip", "with": <the next
+clip>}` or `{"kind": "cut", "clip"}` (`basis`: the clip's cut when the agent read
+it). `{op: "reply", id, text, proposal}` takes it only from an agent (the page's
+own write with one is refused), checked by `validateReplyProposal`
+(`lib/annotations/shape.mjs`); a file whose proposal is not that shape does not
+parse. Nothing applies it but the operator's **Apply** in the clip editor, which
+answers the reply "Applied: …".
+
`source` is filled on the first write. For an article it comes from
`lib/articles/sources.mjs`: a draft whose `id` or file name is the report id (allowing
a `polemic-` prefix either way; the workspace whose generator names the site wins a
diff --git a/umtool/docs/report-video.md b/umtool/docs/report-video.md
@@ -1204,6 +1204,49 @@ back. The writers are `lib/report/manifest.mjs` (`updateClip`, `restoreClip`,
`splitClip`, `mergeClips`, `addClip`); the editor's operations are
`lib/report/clipEditor.mjs` behind `/api/report/clip-editor`.
+### The assistant's labels, and asking it about a clip (optional)
+
+Release 36: a model may help — never instead of you, and never by editing the
+cut. With no model, generation routed elsewhere, or no labels file, the clip
+editor is exactly as above.
+
+- **Suggest** (the side column's *The assistant*) starts the editor's
+ `report-draft` task `clips-suggest` on this project, routed by
+ `settings.generation.routes["clips-suggest"]` like any generation (the local
+ model through the GPU arbiter, or the Claude API under the narration cap and
+ the daily cap; routed to Claude Code, the button says to run `/gen` in a
+ session instead). Every proposal's words go in, each line marked HOST /
+ SUBJECT / OTHER by the turns, with what the finder heard (laugh, chat,
+ comment); back come a **label** (at most six words — a longer one is refused,
+ never cut down), a **why** (one line) and a score from 1 to 10, from which
+ code ranks them (1 = best). They land in `<project>/clip-suggestions.json`
+ `{model, at, proposedAt, promptVersion, items: {<proposalId>: {label, why,
+ rank, score, start, end}}}`, written whole by its one writer
+ (`yt-dlp-transcript-common/lib/clips/suggest.mjs`); a later pass keeps the
+ labels of proposals it did not ask about. The job's progress shows under the
+ button (and after a reload: `.clip-suggest-job.json`).
+- **The labels** show on each clip and each unused proposal (the why on hover,
+ and under the selected clip with its rank). **Sort by the assistant's rank**
+ orders both lists by it; off, the cut's order. A label made before the last
+ proposal pass, or for a proposal that has moved or gone, is marked **stale** —
+ shown, never hidden; Suggest again to refresh them.
+- **Ask the assistant** on a comment: the editor's job reads the comment (and
+ its thread), the clip's words with their times and speakers, ±20 s around it
+ and the clips either side, and replies in the thread as the agent (`POST
+ /api/notes` with the editor's `WORKER_TOKEN`; the editor needs `UMTOOL_URL`).
+ A reply may carry ONE proposal the clip editor can perform — a trim to new
+ edges (each moved at most 30 s), a merge with the next clip, or a cut — shown
+ under it with **Apply**. Nothing happens until you click it: Apply runs the
+ same trim / merge / Cut the buttons above do, and answers the reply
+ "Applied: …", so it is not offered twice.
+
+`/api/report/clip-suggest` is the page's route: GET the labels, their stale
+state, the route and the job being followed; POST `{project, mode: "labels",
+proposals?}` or `{project, mode: "ask", note}`. From a shell: `pnpm ops
+report-draft '{"task": "clips-suggest", "project": "<dir>", "dryRun": true}'`
+(the plan: proposals, calls, the cost estimate), then the same without
+`dryRun`.
+
## The look: captions, loudness, shorts (release 36)
Three render keys and one clip key, all opt-in (absent or `null` is off, and the