Archilyzer · Source

archilyzer

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

commit 873569b08432da857ca86a5822817a3884db907b
parent 79b44546f71628edc2cf723be39ba9c609371732
Author: I Mean I'm Just Saying <imeanimjustsaying@kiwifarms.st>
Date:   Wed, 14 Oct 2026 05:40:50 -0400

plans: umtool redesign — R2, as shipped (research boards; the sweep's seed)

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

Diffstat:
Mplans/umtool-redesign.md | 139++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-
1 file changed, 138 insertions(+), 1 deletion(-)

diff --git a/plans/umtool-redesign.md b/plans/umtool-redesign.md @@ -351,7 +351,7 @@ P0 design ─► P1 foundation ─┬─► P3 inbox/work/tools/URLs ─┬─ | R1 research | `ux/r1` → `main` `01120bfe` | LIVE 2026-10-14 | | P3 inbox/work/tools/URLs | `ux/p3` → `main` `01120bfe` | LIVE 2026-10-14 (umtool BUILD_ID q7e29Em…) | | P2b jobs + drafts | `ux/p2b` | in progress | -| R2 research boards | `ux/r2` | in progress | +| R2 research boards | `ux/r2` | gates green, not merged (record below) | | P5 create + settings | — | after R2 (consumes the board API) | | P4a piece page | — | after P2b | | R3, P4b, P6 | — | after R2 / P4a / all | @@ -901,3 +901,140 @@ the article-new memo miss — both fixed in `b7c49fb5`), 6 skipped; **at `b7c49f - The MCP `notes` tool lists the 14 open notes. - No `.umtool/` state written yet. - **Inbox on the real reports:** 51 calls waiting, against the old 518 "blocking". + +### R2, as shipped + +**What.** Research boards: a case is a question being researched — its scope, the quotes pinned from Research as +snapshots, their sections and order, our claim line and note on each — at `/research/<case>`, with re-verify, a +cited-markdown export, and two hand-offs behind plans. Umtool-side state; read-only on the corpus. + +- **The store** (`umtool/lib/research/cases.mjs`, plain ESM, unit-tested): `REPORTS_ROOT/.umtool/research/<case>/case.json`, + `{format: "umtool-research-case", version: 1, id, title, scope, search, sessions, sections, quotes, notes, handoffs, + counters, createdAt, updatedAt}`. The lifecycle store's discipline (one writer, serialised, temp + rename, an unreadable + file never overwritten — 409, listed with its error). A case id is a piece segment; `sessions`, `census`, `archive`, + `runs`, `cases`, `new` are reserved (the reading logs and the census live beside the cases; the pages under + `/research`). The piece id is `c:<case>`; a created case takes the title's slug, `-2`, `-3` … when taken. +- **A quote is a snapshot** (`lib/shortlist.ts` `Pick`'s reasoning): the words at the cite, read by the SERVER at pin + time through the MCP engine (`findVideo`/`findPost`, the cue nearest the cited second, `until` for several cues), and + the cite — source handle, channel slug and key, recording id (and the editor's directory id when a Rumble URL slug + differs), title, date, first cue start and last cue end, clock, track (and the alternate track id), the moment link, + the house-format citation, local-only. The same cite twice answers the quote already there (`duplicate`). A pin + carrying its search (`session`, counts) makes that search the case's: `search` and `sessions` — "searched N", + and "read N of M" from that session's reading log, which R1's page keeps writing (the log becomes the case's by + reference, not by copy). +- **Re-verify** (`lib/research/boards.ts` `verifyQuote`): R1's `windowOf` (±30 s) on the quote's own track; the words + found (case, punctuation, spacing aside; whole words) → `ok` (with where they start now when they moved ≥ 1 s); else + `drifted` with the words over the quote's seconds now; a recording gone → `missing`; a source not offered → `unreadable`. + Where the record has both `en` and an `en-orig` and their words differ over the cite, `enOrig {text, quoted, other}`. + Nothing changes a quote's words but the operator's `useCurrentWords` (a drifted quote only; the old words kept in + `history`). +- **The export** (`lib/research/board.mjs` `exportMarkdown`): `# title`, the notes as the summary and a line saying what + the board is, a `##` per section (`Unsorted` when there are sections, `Findings` when there are none) with one finding + per quote — `- <claim>: "<quote>" — [<title> @ m:ss](<link>)` (a post `[post by <author>, <date>](<link>)`), our note, + speaker-not-checked, drifted and en-orig as a `Note:` line under it — and `## Coverage` (scope, searched, read, pinned, + drifted, unchecked). It converts as a /sweep report (`boards.test.ts` runs common's `sweepToReport` on it: one + citation per quote, verbatim, no problems). +- **Hand-offs, plan then confirm** (`lib/research/handoff.ts`): + - **Article.** Neither form the plan named existed: report-draft's sweep took a question and channels, nothing seeded, + and no task took a markdown input. The smallest additive change in common: report-draft's **`seed`** (a new sweep's, + ≤ 200,000 characters, on a Claude model) is kept as the iteration's `seed.md` (`ITERATION_FILES` + `seed.md`); the + sweep agent's report file starts as the seed and its first message says to verify every quote, heed and drop the + `Note:` lines, and extend it (`SEED_NOTE`). A local model is refused: the pipeline writes its report from scratch. + So the hand-off is "a report-draft sweep seeded with the board", whose seed is "the exported markdown" — both + readings in one. umtool asks the editor (`askEditor` → `POST /api/ops/report-draft`; it writes nothing of the article + store) with `task: "sweep"`, the case id as the article, the scope's query (else the title) as the question, the + scope's channels (else the quoted ones), dates, the source handle, the policy's API model (a seeded sweep runs the API + agent whatever the sweep route; the plan says so) and the seed. The plan shows the article (new or a new iteration), + question, channels, seed size, model and the cap it may spend; the confirm answers `{href, jobId, iteration}`. + - **Video.** `scaffoldReportVideo` (`lib/projects/scaffold.mjs`) takes a board's `timeline` (additive; refused with + `--from`/`--seed`, every entry checked): one clip per video quote in board order, its window the quote's cue span + (start, end, cite, quote, date, the claim as `note`, the alternate track; `siteVideo`/`siteChannel` when the editor's + directory id differs), `provenance.siteOrigin` when every link shares one viewer origin, and a README listing the + windows to review. No title or chapter cards (the operator's evidence-first rule). The plan shows the folder, title, + clips, origin and what it writes; a taken folder is refused. + - **Research rules.** A board with a local-only quote (`rules.mjs`, Candace's channels) is refused an article (the + article store publishes); its video plan warns it must stay local. The export itself is local and allowed. The X + archive is on no site, so no R1 source can reach it and a board cannot hold it. +- **The API** (documented in `app/api/research/cases/route.ts`; shapes in `lib/research/case-types.ts`, for P5): + `GET/POST /api/research/cases`; `GET/PATCH …/<id>` (title, notes, scope; `sections` as the whole ordered list, + `order` as every quote with its section); `POST …/<id>/quotes` (pin); `PATCH/DELETE …/quotes/<qid>`; + `POST …/<id>/verify`; `GET …/<id>/export.md[?download=1]`; `POST …/<id>/handoff {to, confirm?}` → `{plan}` / + `{href}`. JSON, `no-store`, errors in words (400, 404, 409, 502). Mutations answer the `CaseView`. +- **`/research/<case>`** (`components/research/BoardView.tsx`, `QuoteSlip.tsx`, `HandoffDialog.tsx`; canvas "Research + board"): the header (Research · case, the title, quotes · sections · from "query" · source, Re-verify quotes, + Copy as cited markdown, Download .md); ONE lit list of section heads and quotes — each quote a slip on the reader + surface (the words in the reader serif, the cite in mono, linked), the claim line and the note edited in place on the + desk, the flags (**Speaker not checked** until checked, **Drifted** with the words there now and **Use the current + words**, **Missing**, **en-orig differs** with en-orig's words); the lit quote's section menu, speaker toggle, Remove; + the side panel (Hand off, Scope, Searched, Read N of M, Stored, Piece, Search and pin more, + Section, Notes, what was + made from it). Keys: `j`/`k`, `alt+j`/`alt+k` (a quote, across sections; or a section), `e` claim, `n` note, `s` + speaker, `m` section, `a` add section, `r` rename (the lit section, else the case), `x` remove (confirm), `v` + re-verify, `c` copy, `/` search more; a quote drags by its grip onto a quote or a section head. +- **`/research`**: a **Board** chooser beside Search (in the URL as `case=`, remembered in this browser); `p` or the + reader's **Pin to board** (now the reader's one filled action; Copy citation an outline) pins the lit hit's cited cue — + to the chosen case, or the dialog asks (an open case, or a new one named for the query). The reader says "Pinned to … + · N quotes · Open board" or "Already on … (q2)". A hit in a description or tags (no moment) is refused. Before a search + the page lists the **Cases** (a lit list: title, quotes · sections · drifted, updated). +- **⌘K** lists every case as `c:<case>` (its board), through `/api/jump` (the palette is P2b's; not touched). + +**Commits** (`ux/r2`, from `main` `8f08fc0b`): + +| sha | what | +|---|---| +| `77b03246` | common: report-draft's `seed` (a new sweep's starting report, kept as `seed.md`; the agent starts from it; refused on a local model), its tests, the ops help and COMMANDS.md | +| `2582dbe7` | the case store, pin as a snapshot, re-verify, the export, the hand-offs, the API (seven routes), scaffold's `timeline`, the fixture's `en` track and board, unit tests | +| `c9d716b3` | `/research/<case>` (the board), pinning from Research's results and reader, the Board chooser and the Cases list | +| `7c3f5c3d` | `e2e/board.spec.ts`; the claim and note save once | +| `3400db75` | `[Unreleased]` bullets | +| `99430f38` | ⌘K lists the cases (`/api/jump`) | +| `2a51bbb5` | a quote's claim and note are in the Tab order on the lit quote only | + +**Gates.** + +| Gate | Result | +|---|---| +| repo-wide `tsc --noEmit` | clean (umtool's at every commit; repo-wide at `77b03246`, `3400db75` and the tip `2a51bbb5`) | +| `pnpm --filter umtool typecheck` | clean | +| umtool unit, `node --test umtool/lib/*.test.mjs umtool/lib/*/*.test.mjs umtool/report-to-video/*.test.mjs` | 817 tests, 815 pass, 2 skipped, 0 fail (new: cases 7, board 6) | +| `pnpm --filter umtool test` | 16/16 (new: `boards.test.ts` 5 — the pin, re-verify on the fixture's drifted and `en` quotes, the export through common's `sweepToReport`, both hand-offs planned and confirmed against a stand-in editor) | +| `pnpm run test:scripts` (reads the capped build's traces) | 968 tests, 966 pass, 2 skipped, 0 fail | +| common `pnpm --filter yt-dlp-transcript-common test` | 4096 tests, 4094 pass, 2 fail — both `controller/autoRunner.test.ts` (`computeLeafPending…`, `a channel with a move marker…`), which read the repo's `settings.json`: a worktree has none. With `SETTINGS_FILE` at the primary's (read only) the file passes 24/24; on `main` in the primary it passes 24/24. Not this lane's | +| editor unit `pnpm --filter editor test` | 297/297 (2 new in `_reportDraft.test.ts`: the seed's body rules; a seeded sweep refused on a local model, and on the API kept as `seed.md` with the agent told to start from it) | +| mcp `pnpm --filter yt-dlp-transcript-mcp test` | 363/363 | +| `pnpm archilyzer docs cli --check` | clean (COMMANDS.md regenerated for the `seed` sentence) | +| capped umtool `next build` (corpus linked, `MemoryMax=5G`, heavy slot) | exit 0; compiled 11.2 s, 34 s wall, 1.40 GB max RSS. The new routes' traces: 873–952 files, none from `transcripts/`, `export/public`, `.e2e-song`, `.next-e2e` or `.env*` | +| full umtool e2e (`pnpm --filter umtool run e2e`, detached, queued) at `7c3f5c3d` | 394 tests: **388 passed, 0 failed, 6 skipped** (the song-data skips), 7.9 min. `board.spec` 7/7 | +| `board.spec` + `research.spec` + `shell.spec` at the tip `2a51bbb5` (after ⌘K and the Tab change) | 39 passed, 0 failed | + +**Screenshots and keys.** Job scratch `r2-shots/`: `/research/<case>` and `/research` with cases at 1366×768 and +1440×900, dark and light, on the REAL local corpus (the primary's `export/public`, Rekietalyzer, read only; every write +— the case, the reading log — in a scratch REPORTS_DIR): a "Contempt of court" board of five pins from the 70-recording +search, two sections, a claim and note, re-verified; plus Research after a pin ("Already on …"), and both hand-off +plans. Against the canvas: the same columns (the board, the 300 px side panel), the slip on the reader surface with +the cite in mono, Claim / note / flags on the desk, the section heads in small caps with Meter counts, the lit quote's +Signal edge, the side panel's Hand off (the filled one is Draft an article), Scope / Searched / Read (Meter) / Stored. +Differences: an **Unsorted** group above the sections (where a new pin lands), the lit quote's action row (section, +speaker, Remove), the key legend at the foot, Notes and Piece in the side panel. Keyboard only (reduced motion): the +rail's 11 stops, the header's three, the board ONE stop (the lit line, dashed 1 px), the section heads' actions, the +side panel's; a quote's claim and note only on the lit quote (`e`/`n` reach them, Escape returns to the line); `j`/`k`, +`alt+j`/`alt+k`, `a` (the dialog focuses its field) all work; the head moves in 0 s under reduced motion. + +**Found and left.** +- **A seeded sweep needs an API model.** A policy that routes sweeps to Claude Code or the local model still gets the + API agent for a board (the plan says so); the local pipeline would need a seed step of its own. +- **The seed's links stay on the board's origin;** the agent is told to cite on its own. A case on a hub keeps + `<site>:<slug>` keys in its scope; the sweep gets the slugs. +- **A pin is one cue** from the UI (the cited cue); the API takes `until` for several, and the reader has no + range-select yet. Cue ends are where a caption wrapped, so a video clip's window can stop mid-thought (the README + says so; the bench is where it is cut). +- **The case's reading log is the search's session, by reference.** A second search pinned into the same case becomes + `search`; earlier sessions stay listed in `sessions`, and "read N of M" is the latest's. +- **No case delete yet** (not asked for); a case is a directory under `.umtool/research/`. P5/P6 can add it, plan + then confirm. +- **Not on Work or the Inbox.** `c:<case>` is in ⌘K only; P5 (Create's "Research a question" opens a case) and P4a (a + case as a piece's Research stage) consume the API. +- **The header buttons' focus ring** (`buttonVariants`) computes to the text colour rather than Signal on this page as + elsewhere — P1/P3's global ring, not changed here. +- Not touched (P2b's): `lib/activity.ts`, `components/shell/**` (the board renders `AppRail` and `AppHeader` as they + are), `e2e/fixtures/editor-stub.mjs`, `lib/articles/generation.ts` (its `askEditor` and `readPolicy` are called, not + edited), `lib/inbox*`, `lib/projects/report.mjs`.