Archilyzer · Source

archilyzer

Archilyzer
git clone https://archilyzer.pages.dev/source/archilyzer.git
Log | Files | Refs | README | LICENSE

commit a082ad43c93fb09cd2a2a2708852dc154c2dd161
parent 15d2e655700ce6ec212e0510bbc07ad8c799da58
Author: I Mean I'm Just Saying <imeanimjustsaying@kiwifarms.st>
Date:   Mon, 19 Oct 2026 15:52:28 -0400

plans: release 36 lane D — the assistant's labels and Ask the assistant, as shipped (record)

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

Diffstat:
Aplans/release-36/clips-suggest.md | 99+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 99 insertions(+), 0 deletions(-)

diff --git a/plans/release-36/clips-suggest.md b/plans/release-36/clips-suggest.md @@ -0,0 +1,99 @@ +# Release 36 lane D — `r36/clips-suggest`: the assistant's labels, Ask the assistant (as shipped) + +The plan of record is [clip-finder-2.md](clip-finder-2.md), lane D: the clip finder's OPTIONAL AI pass. Lane B's +analysis ([clip-analysis-2.md](clip-analysis-2.md)) and lanes A and C were merged into this branch before its gates. +Rulings followed: the UI works with no model (with no labels file, generation off or no model the clip editor is as it +was; every edit a proposal names is a button the operator already had); the only model calls are through +`settings.generation`'s routing (a `report-draft` job in the editor); nothing a model returns edits a clip — the +operator's **Apply** does; comments are notes; synthetic fixtures only; the live projects read only. + +## What + +1. **The `clips-suggest` generation task** — `GENERATION_TASKS` + every preset (code code, balanced local, api api, + local local; an older settings file keeps its preset), dispatched in `common/controller/reportDraft.ts` beside + verdicts into its own controller `common/controller/clipsSuggest.ts`. A body names `project` (the reactions + project's absolute directory; never inside the corpus) instead of `article`. Per proposal the prompt carries its + words, each line HOST / SUBJECT / OTHER by the turns, and what the finder heard (laugh / chat / comment); the model + answers `{items: [{id, label, why, score 1–10}]}` and CODE ranks (so batches rank globally): 30 proposals a call on + the API, at most 20 and within the 8k prompt cap locally. A malformed answer is refused whole; a label over six + words, a score outside 1–10 or an id never asked is refused per item, never trimmed to fit. Output + `<project>/clip-suggestions.json` `{model, at, proposedAt, promptVersion, items: {<id>: {label, why, rank, score, + start, end}}}` through its one writer (`common/lib/clips/suggest.mjs`), merged over the old file's still-current + labels. Cap: the narration cap (`capOf`) and the daily cap; usage rows `task "clips-suggest"`. Lanes: `draft:local` + through the GPU arbiter (ollama unloaded) or `draft:api`. The `code` route: the ops route's `dryRun: true` answers + the plan (proposals, calls, the estimate, the request); the MCP's `generate` hands that request to the session + and takes its `answers` back, read and written exactly as a model's (`model: "claude-code"`). SETTINGS.md and + settings.json.example regenerated; `/gen` names the task. +2. **The clip editor** — `umtool/components/projects/review/ClipSuggest.tsx` (+ small additive hooks in + `ClipEditor.tsx`): a label on each clip and unused proposal (the why on hover, and under the selected clip with its + rank), **Sort by the assistant's rank** for both lists, **Suggest** (one editor job via + `/api/report/clip-suggest`, which asks the editor with the WORKER_TOKEN through `askEditor` — the TS client + `lib/articles/generation.ts`, not chain-run's private `editorCall`) with its progress (remembered in + `<project>/.clip-suggest-job.json` across a reload), Stop; a stale file (a later proposal pass) or item (its + proposal moved or went) is marked stale, never hidden. Routed to Claude Code, Suggest is disabled with the `/gen` + line. +3. **Ask the assistant** on a comment: the editor job reads the note (and its thread), the clip's words with times and + speakers ±20 s, and the clips either side; replies through umtool's `POST /api/notes` as the agent + (`UMTOOL_URL` — lane A's `umtoolUrl` — and WORKER_TOKEN; refused at the ask without them), with at most one + proposal in the reply's new `proposal` field (`{kind: "trim", clip, from, to} | {kind: "merge", clip, with} | + {kind: "cut", clip}`, `basis` the cut it read). notes.json takes a proposal only from an agent + (`validateReplyProposal`). The thread shows it with **Apply**, which runs the clip editor's own trim / merge / + Cut ruling and answers "Applied: …" (so it is not offered twice). The job never applies anything. +4. **Tests + docs** — below; `umtool/docs/report-video.md` ("The assistant's labels, and asking it about a clip"), + `umtool/docs/notes.md` (a reply's proposal), FACTS ("Release 36 lane D"), CHANGELOG. + +## Interfaces (exported) + +common `lib/clips/suggest.mjs` (+ `.d.mts`, package export): `SUGGESTIONS_FILE`, `readSuggestions`, +`writeSuggestions`, `parseSuggestionsDoc`, `suggestionsState`, `suggestItems`, `roleLines`, `suggestPrompt`, +`SUGGEST_ANSWER_SCHEMA`, `parseSuggestAnswer`, `suggestionsDocOf`, `askNoteOf`, `askClipsOf`, `askPrompt`, +`ASK_ANSWER_SCHEMA`, `parseAskAnswer`, `wordsOfFile`, `wordsFor`, constants. `lib/report/draft/tasks/clipsSuggest.ts`: +`CLIPS_SUGGEST_TASK`, `CODE_MODEL`, `LOCAL_BATCH_MAX`, `loadClipsProject`, `batchesOf`, `planClipsSuggest`, +`runClipsSuggest`, `loadAsk`, `runClipsAsk`, `ClipsSuggestRefusal`. `controller/clipsSuggest.ts`: +`enqueueClipsSuggest`, `planClipsSuggestJob`, `projectDirOf`, `postReplyToUmtool`, `umtoolOrigin`. reportDraft body +keys `project`, `proposals`, `note`, `answers` (and `dryRun` for this task). Test kit +`common/testing/clips/reactionProject.mjs` (`reactionProject`, `writeReactionProject`, `labelAnswer`). umtool +`lib/report/clipSuggest.mjs` (`suggestionsView`, `parseSuggestRequest`, `draftBodyOf`, `readSuggestJob`, +`writeSuggestJob`, `clearSuggestJob`, `suggestJobView`, `suggestRouteOf`), `lib/annotations/shape.mjs` +`validateReplyProposal` / `REPLY_PROPOSAL_KINDS`, types `ReplyProposal`, `NoteReply.proposal`; NoteThread props +`actions`, `afterReply`. MCP `generate` takes `project`, `proposals`, `answers`. + +## Commits + +| sha | what | +|---|---| +| `b1aa9162` | clips: the clips-suggest generation task (common, editor ops route, MCP, settings, test kit, unit tests) | +| `912d9e6a` | umtool: the assistant in the clip editor — labels, sort, Suggest, Ask, Apply; the reply's proposal | +| `c41c9f8b` | umtool e2e: clips-suggest.spec.ts (fixture, the editor stub's clips-suggest job) | +| `17429bf7` | merge main (lanes A and C) | +| `2cc98b85` | clips: local batches at most 20; the Ask uses lane A's umtoolUrl | +| `39c70272` | docs: report-video.md, notes.md, SETTINGS.md + settings.json.example regenerated, FACTS, CHANGELOG | +| (this) | plans: this record | + +## Gates (through the shared lock, from the worktree root, after the merge of main) + +- `pnpm -r --no-bail --workspace-concurrency=1 exec tsc --noEmit` — clean (at 2cc98b85's tree and before each commit). +- common `pnpm --filter yt-dlp-transcript-common test` — 4694 tests, 4690 pass, 2 skipped; the 2 that failed were + `settings.json.example` / `SETTINGS.md is what the schema generates`, fixed by `archilyzer settings example` and + green on the re-run (`lib/settingsSchema*.test.ts` + the new batching test: 25 / 25). New in common: 7 + (`lib/clips/suggest.test.ts` 5, `generationSettings.test.ts` +1, `tasks/clipsSuggest.test.ts` 1). +- editor `pnpm --filter editor test` — 353 / 353 (new: `app/api/ops/_clipsSuggest.test.ts` 7 — the body, API + labels + plan + ledger, a malformed answer refused, the cap and the daily cap, local through the arbiter with a + six-word refusal and the unload, the code route's answers, Ask posting a trim and applying nothing). +- mcp `pnpm --filter yt-dlp-transcript-mcp test` — 379 / 379 (+1 clips-suggest; one preset expectation gained the + route). +- `pnpm run test:scripts` — 1294 tests, 1290 pass, 4 skipped (new: `umtool/lib/report/clipSuggest.test.mjs` 4). +- umtool `pnpm --filter umtool test` — 45 / 45. +- `archilyzer docs env --check`, `docs files --check`, `docs cli --check`, `settings example --check` — clean. +- e2e (umtool, `E2E_MODE=dev`, one run): `clips-suggest.spec.ts` + `clip-editor.spec.ts` — **2 passed, 0 failed, + 1.0 min** (14.7 s + 33.7 s). +- Read-only plan on the live `~/reports/nik-drop-clips` (no model, nothing written): 112 proposals, words from + words.json; ~13.7k input / ~6.7k output tokens — Sonnet 5.5 4 calls ≈ $0.09, Haiku 4.5 ≈ $0.05; the local model + (before the 20-a-call cap) 2 calls, now 6. + +## Found and left + +- The editor stub in umtool's e2e cannot reach umtool, so the spec posts the agent's reply itself (as clip-editor.spec + does); the reply's POST from the job is covered by the editor unit test's `postReply` and `postReplyToUmtool`'s shape. +- An Ask needs `UMTOOL_URL` on the editor (lane A's Find clips needs it too); the live unit does not set it yet. +- `~/reports/nik-drop-highlights` holds no reactions.json: the second-half project Find clips makes is the one to label.