# Research ## The sources Read-only on the corpus, over the MCP's own engine (`createCorpusTools`, `yt-dlp-transcript-mcp/research`), with its caps. The **Source** chip offers: | Source | From | |---|---| | local | `TRANSCRIPT_LOCAL_DIR`, else `EXPORT_PUBLIC_DIR`, else `/export/public` (whichever site was composed last) | | `remote:` | every `transcripts/sites/*/site.json` with a `siteUrl` | | the hub | `TRANSCRIPT_HUB_URL`, else `settings.json` `homepageUrl` | Held counts (what the archive has on disk) are the editor's `GET /api/ops/coverage`; without `WORKER_TOKEN`, an editor that does not answer, a 503 or a 401 each say which, and the local corpus falls back to reading `CHANNELS_DIR`. ## Search, `/research` - **The ask bar** (`/` focuses it): a phrase, `/regex/`, or `a near:8 b` (a regex within one caption line — there is no `near` in the engine). **Search** ↵. **Board:** chooses where **Pin to board** goes (`?case=`; "ask on pin", an open case, or **New case…**). - **Scope chips**: Source, channels, dates, platform state, Videos and streams / Videos only / Streams only, **+ Posts**. Before anything runs the holds line says what the scope holds: "holds 3 channels · 2,140 videos · 2019–2026 · transcripts 81% · captions 19%". Transcripts vs captions is known only for channels a search has read whole ("counted by the first full search" until then); the count is kept per source build under `.umtool/research/census/`. - **One search reads the whole scope once** (`enumerate_matches`) and never pages. The header is honest: "412 recordings · full coverage", or "Partial — not reached: X, Y"; lines, pages, mirrors folded, aliases, "showing n of N", **read x of N**. **Show 200 more** draws more of what was found; it never searches again. - **Results**: ONE lit list grouped by recording — timecode, the match marked, the read state, the cite thread on the lit line. **Facets** (year histogram with zeros, channel, transcript/captions, state, reading) narrow what is drawn. - **The reader** (right): the window with the cited cue lit and centred, **−** / **+** span, **Pin to board** (the one filled action), **Copy citation** (the house format: `"quote" [title @ m:ss](url)`), **Play from m:ss** when a local file covers it, else **Fetch clip** (the editor's fetch-window route, as the MCP's `fetch_clip`; "The editor is fetching it (job …)"). - **Keys**: j/k line, `r` read, `s` skip (both move to the next recording), `u` unread, `c` copy citation, `p` pin, `/` ask. The query and scope are the URL; a `?q=` link runs on arrival. - **The reading log** — read, skipped or unread per hit — is `REPORTS_ROOT/.umtool/research/sessions/<16 hex>.json`, keyed by query + scope. - **Cases**: before a search the page lists every case (title, quotes · sections · drifted, updated). Header links: **Agent runs**, **Archive inventory**. - A Candace hit (`candace-owens`, `realcandaceo`) is marked local only; a board holding one is refused an article. ## A board, `/research/` (piece `c:`) A case is a question being researched: its scope, the quotes pinned as **snapshots**, their sections and order, a claim line and note on each. - **A pin is a snapshot**: the words at the cite, read by the server at pin time, and the cite (source, channel, recording, title, date, cue span, track, the moment link, the house citation, local-only). The same cite twice answers the quote already there. - **The page**: **Re-verify quotes** (`v`), **Copy as cited markdown** (`c`), **Download .md**; ONE lit list of section heads and quote slips (the words on the reader surface; **Claim** and **note:** edited in place; flags **Speaker not checked**, **Drifted** with the words there now and **Use the current words**, **Missing**, **en-orig differs**, **by agent**); on the lit quote its section select, **Mark speaker checked**, **Remove**. A quote drags by its grip. - **Side panel**: **Hand off** (below), Scope, Searched, Read N of M, Stored, Piece, From run, **Search and pin more** (`/`), **+ Section** (`a`), Notes, Made from it. - **Keys**: j/k, alt+j / alt+k move the lit quote (or section), `e` claim, `n` note, `s` speaker, `m` section, `a` add section, `r` rename (the lit section, else the case), `x` remove (asks), `v` re-verify, `c` copy, `/` search more. Moves pressed while one is saving queue in order. - **Re-verify**: the quote's own track ±30 s → `ok` (and where it starts now), `drifted` (the words there now), `missing` (the recording is gone), `unreadable` (the source is not offered), and `en` vs `en-orig` where they differ. Nothing changes a quote's words but **Use the current words** (the old words kept in its history). - **The export**: `# title`, the notes, a `##` per section with one finding per quote — `- : "" — [ @ m:ss](<link>)` — and `## Coverage`. It converts as a `/sweep` report. - **Stored** at `REPORTS_ROOT/.umtool/research/<case>/case.json` (one writer, temp + rename, 409 on an unreadable file). `sessions`, `census`, `archive`, `runs`, `cases`, `new` are not case ids. ### Hand-offs (plan, then confirm) | Button | What it plans | Confirm | |---|---|---| | **Draft an article from this board** | a `report-draft` sweep seeded with the exported board (`seed.md`): the article (new, or a new iteration), the question (the query, else the title), the channels, the seed size, the API model and its cap. Refused on a local model, and for a board with a local-only quote | **Start the sweep (up to $X)** | | **Start a video from this board** | `scaffoldReportVideo` with the board's timeline: one clip per quote in board order, its window the quote's cue span, the claim as its note; the folder, title, origin; a taken folder is refused | **Create the project** | | **Run a sweep on this scope** | the same sweep without the seed, on the policy's sweep route (a route to Claude Code runs the API agent, and says so) | **Start the sweep …** | Create's **From a board** lines open the same plans. ## A case's pipeline, `/research/<case>/pipeline` (release 38) Beside the board (its side panel's **Open the case pipeline**): the research a Claude Code session did on a case, as stages, each with its manual path and its buttons. The stages are common's (`controller/casePipelineRun.ts`), so `archilyzer case <verb> <case>` (COMMANDS.md) runs the same ones from a shell, and `stages.json` shows either's run to the other. The files sit beside `case.json`, never in it (`common/lib/research/caseTypes.ts` `CASE_FILES`). - **Define** — `pipeline.json`: subjects (and their own channels), scope (channels, `<site>:<group>` groups, sites), eras with term families (regex, flags `iu`; `strictFamilies` for a subject's own late material), reader groups (a list of slugs, `"subject"` or `"coverage"`; an era), reader prompts, key dates. Edited as JSON, checked whole. - **Private names** — typed into a password field, hashed in the browser, and only the sha256 is posted and stored (`privateNames.sha256`). The page shows a count. Once a name is in, it is withheld (`[name withheld]`) from the candidates and batches the case stores, so no file of the case holds it. - **1 Coverage** — per channel × year: listed, held, transcribed, untranscribed audio; key years (an era touches them) marked. Each channel's gap buttons ask the editor's own ops, plan first: **Download missing** (`download-missing`), **Transcribe** (`transcribe-bucket`), **Persist the key period** (`persist-videos`, its plan the dryRun), and **Focus the case** (`channel-priority` focus: the case's first site, else its channels). - **2 Candidates** — the scope's held recordings dated in an era, read through the caption-track rule (en-orig before en), each era's families matched, ±W s windows merged, title hits, the noise filters (a coverage window must name a subject; strict families on a subject's own channel), counted per family, year, channel and group before any read. - **3 Batches** — per reader group under a character budget, written as wrapped text (no line over 200). A batch a reader has begun is kept; new windows make the next round. **Read the text** shows one. - **4 Read** — lane B's deck and `case-read` readers come next; until then the reader prompts (the naming rule always in them) and a box for finding rows as JSON lines. - **5 Merge** — the same recording within 20 s is one finding (higher relevance, then later round); sections by group; relevance 2 and up; the quarantined in their own section. The **Summary** is a person's (or a model's, marked a draft). - **6 Privacy gate** — every write of findings, the summary, the export and a hand-off is checked against the hashes; a hit blocks it and names the rows, never the name. The board's own export and hand-offs are gated by the same names. - **Export and hand-off** — `REPORT.md` (the house format) and `REPORT.html`; **Hand off to the board** pins the merged findings to the board, one section per reader group, and the board's hand-offs take it from there. - **9 Date checks** — the subject's uploads around each key date and the latest after it, captioned or not, and the sentence ("no response found in captioned uploads through <date>", or the findings that are one). ### 7 Verify, 8 Leads, 10 Evidence (release 38 lane C) Three more panels of the pipeline page (`#stage-verify`, `#stage-leads`, `#stage-evidence`, in its **Stages** list). They write `findings.jsonl` (through the store's lock and the privacy gate), `leads.json` and `evidence.json`; no model is needed for any of them; every fetch, capture, transcription and channel is the editor's (its ops door), paced by it. - **7 Verify**: the findings (`findings.jsonl`) with their status and a **forum** tag for one first seen on a forum. A finding's window in every caption track it has **side by side** (`en-orig` first, then `en`, then a transcription; a post's text for a post), the quote's words lit where they land and "holds the quote" or "N of M words" per track. **Audio check**: the held media (or a clip fetched through the editor) transcribed by the editor's `transcribe` on a local worker — **Run even while transcription is paused** sends `whilePaused` — then "Heard N of M words" and the word diff (missing struck through, extra in brackets), kept on the finding (`verify.audio`). **Status**: Unverified, Verified, Corrected, Disputed, Quarantined (**Save status**, with a note). **Correct by hand** (quote, speaker) saves as Corrected and keeps the reader's words once in `verify.original` ("The reader wrote: …"). A hand-written quote, speaker or note that holds one of the case's private names is refused by the privacy gate (the row id and a count, never the name). - **8 Leads** (`?leads=<slug>` picks the channel on the first frame): over a posts or forum channel (the scope's first by default), the accounts and pages its posts link most, **counted by post** (the forum's own links left out); a lead whose name is a private name is counted as withheld, never listed. **Context** shows the posts that link it (private names withheld). Each lead: a **Role** note and a **Disposition** — **Never archive** adds the lead's name to the case's private names as its sha256 (the Private names box's writer, so it is withheld from the stored candidates and batches too) and keeps the lead only as that hash (`[name withheld]`, no URL, in `leads.json`); **Archive** creates the channel through `create-channel` **on no site** (X never on a site; a site is the operator's) and starts its first fetch, then **Older walk** is `fetch-posts {older}`; **Watch** starts nothing. - **10 Evidence** (`evidence.json`): **Wayback captures at chosen dates** for a list of pages — **Look up** is `wayback-lookup` (a 403 is the row **excluded from the Wayback Machine (cause unknown)**), **Capture** is `import-page {slug, url, at}` into a Wayback pages channel (picked, or a new one on no site); **A forum post's attachments and screenshot** through `capture-posts`, labelled **forum attachment, post #N, unverified** on the row, its thumbnails, the finding it is attached to and the export. A queued row is asked again every 1.5 s. **Attach to a finding** records it on both sides (`FindingRow.evidence`). - **The export** (`REPORT.md`, `REPORT.html`) lists `evidence.json` in an **Evidence** section before Coverage (`common/lib/research/caseEvidence.ts`), and a finding's own line names its forum attachment the same way. ## Agent runs, `/research/runs` and `/research/runs/<article>/<n>` `/research/runs` lists every sweep iteration of the article store, newest first. A run page shows what a sweep did, step by step — live while it runs (re-read every 2.5 s), a replay when done: - **The head**: the question (two lines; the full text on hover), `<article> · i<n>` in the trail, sweep · model · extractor · channels · dates · corpus · when · minutes · spend · kept / dropped · checks · status. **Run 1 2 3** (`?run=k`) when it ran more than once, **Replay** (`r`), **Open as a board** / **Update the board** (`b`). - **Steps**, one lit list: scope, each turn (`t0`…, a repair's `r0`…) or a pipeline's enumerations and batches, findings, quote checks, the end — each with the running spend. The lit step's detail: the enumeration's ids and what was not reached, a batch's extractor lines (on the reader), findings with quotes, the checks grouped **Dropped** / **Refused by a strict check** / **Kept**, each with why; **Spend by step, cumulative**. - **The record** is the iteration's `trace.jsonl` (written by the editor); a run from before it is projected from `turns.jsonl`, with a gap step where the checks were not recorded. - **Open as a board** makes the case `<article>-run<n>` from the report's quoted citations (`by: "agent"`, the report's sections, the finding as the claim); a second press adds what is new and never touches your claims, notes, sections or order. The board's side panel links **From run**. - A sweep a triage escalated ([triage.md](triage.md)) starts with a **triage first** step: the tiers, the flagged ids, a link to the triage run. - The Iterations tab's **Run** link and a sweep's Running row open it. ## The archive inventory, `/research/archive` Channels × years: what the archive can and cannot answer. **Videos held** / **Videos published**, **Heatmap** / **Table**, the source chips. A cell's number on the Meter ramp; a gap over 60 days marked under its year; "—" for none. Hover or focus a cell for held, published, missing states, transcripts vs captions; the arrow keys walk the grid. Held counts are kept 5 minutes per channel ("Held counts from 3 min ago (kept 5 min)"); **Refresh** asks again. ## Routes `/api/research/{sources,scope,search,window,coverage,log,media,fetch}`, `/api/research/cases[/<id>[/quotes[/<qid>] |/verify|/export.md|/handoff|/pipeline[/<op>]|/stages/{verify[/captions|/audio],leads[/context|/older],evidence}]]` (the pipeline's ops are listed in its route), `/api/research/runs/<article>/<n>[/board]` — JSON, `no-store`, errors in words (400 bad input, 404 nothing there, 409 an unreadable file, 502 a source that cannot be read).