Archilyzer · Source

archilyzer

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

commit 05fcb29c41f4c256e7ce83fdbdd1e5eb89fbf3ed
parent 2d240cd92262ebfa2f4affeacd7a7c6c254bf79a
Author: I Mean I'm Just Saying <imeanimjustsaying@kiwifarms.st>
Date:   Wed, 14 Oct 2026 15:46:36 -0400

docs: umtool's sheets for the redesign — inbox, research, work, piece, tools, settings, refresh, recurring; AGENTS, FACTS, OPERATING and REPORT on the new addresses

- umtool/docs: dashboard, browse, decisions, sites and projects are gone into
  inbox.md (the page, groups, lifecycle and mutes, every decision kind, the
  API, the Running list), work.md (Work's facets, the projects grid, a site's
  page), piece.md (ids and addresses, the frame and stepper, each kind's tabs,
  Media, the benches, iterations, reading and noting, evidence, kinds and
  routing), tools.md and settings.md; refresh.md and recurring.md are new.
  README: the places, Create's lines, the old-address table. The other sheets'
  /browse, /mix, /articles/new and "project page" references name the address
  and the tab. notes.md says where each kind of note is written.
- AGENTS.md: where notes are written (the Article tab, Cut-tab rows).
- FACTS: the redesign's facts (places, piece ids, the .umtool state files, the
  one stage rule, the decisions API, the redirect table, a claimed project's
  redirect, a song's address, colour roles); /sites, /articles/new and /bench
  lines corrected.
- OPERATING.md: Create's article form, the Iterations tab's buttons, the Media
  tab's drafts and the review bench, /settings/generation, the ⋯ deletes.
- REPORT.md: /articles/new is an address.

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

Diffstat:
MAGENTS.md | 5+++--
MOPERATING.md | 37++++++++++++++++++++-----------------
MREPORT.md | 2+-
Mplans/FACTS.md | 60+++++++++++++++++++++++++++++++++++++++++++++++++++++++-----
Mumtool/docs/README.md | 146+++++++++++++++++++++++++++++++++++++++++++++++++------------------------------
Mumtool/docs/authoring.md | 14+++++++-------
Dumtool/docs/browse.md | 88-------------------------------------------------------------------------------
Mumtool/docs/build.md | 2+-
Mumtool/docs/claim-bench.md | 4++--
Mumtool/docs/cli.md | 13+++++++++----
Mumtool/docs/clip-bench.md | 14+++++++-------
Dumtool/docs/dashboard.md | 36------------------------------------
Dumtool/docs/decisions.md | 107-------------------------------------------------------------------------------
Mumtool/docs/e2e.md | 2+-
Mumtool/docs/folders.md | 2+-
Aumtool/docs/inbox.md | 145+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Mumtool/docs/index.md | 2+-
Mumtool/docs/mix-from-a-project.md | 8++++----
Mumtool/docs/notes.md | 16+++++++++++-----
Aumtool/docs/piece.md | 233+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Dumtool/docs/projects.md | 129-------------------------------------------------------------------------------
Aumtool/docs/recurring.md | 71+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Aumtool/docs/refresh.md | 81+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Mumtool/docs/report-video.md | 62++++++++++++++++++++++++++++++++------------------------------
Aumtool/docs/research.md | 109+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Aumtool/docs/settings.md | 55+++++++++++++++++++++++++++++++++++++++++++++++++++++++
Dumtool/docs/sites.md | 132-------------------------------------------------------------------------------
Aumtool/docs/tools.md | 27+++++++++++++++++++++++++++
Aumtool/docs/work.md | 84+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
29 files changed, 1050 insertions(+), 636 deletions(-)

diff --git a/AGENTS.md b/AGENTS.md @@ -185,8 +185,9 @@ This tooling is on `main` as of 2026-08-20. umtool notes --all --open # from the checkout: node umtool/bin/umtool.mjs notes --all --open ``` -The operator leaves notes in umtool on articles (`/sites/<site>/<report>`) and on -report-video projects (rows, takes, moments in a cut). They live in a `notes.json` +The operator leaves notes in umtool on articles (`/sites/<site>/<report>`, the store's +`/articles/<id>`; the piece's Article tab) and on report-video projects (Cut-tab rows, +takes, moments in a cut). They live in a `notes.json` beside the report's `report.json` (never published) or beside the project's `video.manifest.json`. `umtool notes <site>/<report>` prints each open note with its anchor resolved and the **source** file to edit — a draft, not the generated diff --git a/OPERATING.md b/OPERATING.md @@ -161,11 +161,12 @@ pnpm archilyzer reports iterations example-article umtool chain example-article 3 ``` -- In umtool: `/articles/new` starts an article with a sweep or with research (question, channels, dates, model, - cap; research takes an autonomy, defaulted from the settings, and needs no channel); the article's **Iterations** - tab (`/articles/<id>?tab=iterations`) lists its iterations and runs the rest (**New iteration**, **Copy with - model**, **Narrate**, **Draft**, **Draft everything**, **Cancel**, **Make the video**, **Use this iteration**); `/articles/<id>/compare?a=&b=` - puts two side by side. The pages: [umtool/docs/sites.md](umtool/docs/sites.md). +- In umtool: Create's **Article from a question** (`/create?make=article`) starts an article with a sweep or with + research (question, channels, dates, model, cap; research takes an autonomy, defaulted from the settings, and needs + no channel); the article piece's **Iterations** tab (`/articles/<id>?tab=iterations`) lists its iterations and runs + the rest (**New iteration**, **Copy with model**, **Cancel**, **Make the video**, **Use this iteration**, + **Refresh…**, **Media drafts →** to the cut's Media tab); `/articles/<id>/compare?a=&b=` puts two side by side. + The pages: [umtool/docs/piece.md](umtool/docs/piece.md). - Each generation is an **iteration** of the article, `i1`, `i2`, … in `transcripts/reports/<id>/iterations/<n>/`, never published ([REPORT.md](REPORT.md), "Iterations"). The article's `report.json` changes only when you choose **Use this iteration**. An article with iterations and no `report.json` is in the making: not listed, not a @@ -192,8 +193,8 @@ umtool chain example-article 3 --draft-all --model qwen3:8b | Task | Field | Limits (code's) | Review | | --- | --- | --- | --- | -| `cut` | the timeline's order (`drafted.timeline`) | ids from the report's citations only, 3 to `generation.cut.maxClips` (20); windows untouched | the project page's **Review drafts** | -| `onscreen` | each clip's `onscreen.{title, subtitle}` | title ≤ 60, subtitle ≤ 90, one line; a subtitle quotes the clip's own words only | the On-screen table, **Review drafts** | +| `cut` | the timeline's order (`drafted.timeline`) | ids from the report's citations only, 3 to `generation.cut.maxClips` (20); windows untouched | the Media tab, **Review drafts** | +| `onscreen` | each clip's `onscreen.{title, subtitle}` | title ≤ 60, subtitle ≤ 90, one line; a subtitle quotes the clip's own words only | the Media tab's On-screen table, **Review drafts** | | `teaser` | a teaser's `lines` (a cut with none gets one) | 3 to 5 lines ≤ 70, no quote read out | the teaser editor, **Review drafts** | | `flips` | `render.chrome.flips` | pairs over the cut's clips of two dates, THEN the earlier; needs the deck | **Review drafts** | | `threads` | `render.chrome.threads` and each clip's `thread` | 2 to 4 threads; needs the deck; not with flips | **Review drafts** | @@ -203,15 +204,17 @@ umtool chain example-article 3 --draft-all --model qwen3:8b - Every drafted field carries `drafted {task, model, at, iteration, attempt}`. A field you wrote or edited is never replaced: the draft is kept in `<task>-draft.json` as an alternative, taken with **Use this**. `force` re-drafts only a field a model drafted. `entries` limits a per-entry task to those entries. -- In umtool: the project page's **draft** section has **Draft with** a model per task (force, the entries, the job's - progress, the last run's written, skipped and refused); the Iterations tab has the six beside **Narrate**. A - project not made from an iteration (`<projectsRoot>/<id>/i<n>/`) offers none. -- **Draft everything** (the Iterations tab, or `umtool chain <id> <n> --draft-all [--model M]`) is the chain with +- In umtool: the piece's **Media** tab lists every drafted field with its provenance, **Approve draft** and + **Reject**, and heads each section with **Draft with <model>** (force, the entries, the job's progress, the last + run's written, skipped and refused). A project not made from an iteration (`<projectsRoot>/<id>/i<n>/`) offers + none ("Drafting is off: no article iteration made this project."). +- **Draft everything** (the Media tab, or `umtool chain <id> <n> --draft-all [--model M]`) is the chain with its drafts: current → windows → prepare → posts → manifest → cut → on-screen → teaser → flips → threads → narration → voices → the fast build → podcast → YouTube (its chapters re-muxed so `out/youtube.txt` is written). No attach, no dedupe. A draft refused or failed is recorded failed and the chain goes on; one with nothing to draft, or flips and threads with no deck (or the other panel on), is skipped. A resume passes a draft that ran. -- **The review gate:** approve or reject each drafted field (with a note) on `/browse/<project>/review`. A preview or +- **The review gate:** approve or reject each drafted field (with a note) on the Media tab or the review bench, + `/projects/<project>/review` (**Review drafts — N**). A preview or fast build warns of an unreviewed draft; a `final` build refuses one, and refuses a rejected one whatever the flags; `--drafts-unreviewed` builds it anyway. A video revision that reorders the cut makes the order its draft. @@ -227,8 +230,8 @@ pnpm ops get generation-usage ``` - The presets: `code` (everything in Claude Code), `balanced` (sweeps in Claude Code, report revisions and research - on the API, video revisions and narration local), `api`, `local`. Choosing one writes its routes; the panel on - `/articles/new` writes the same settings. + on the API, video revisions and narration local), `api`, `local`. Choosing one writes its routes; umtool's + `/settings/generation` writes the same settings. - `gen run` exits 3 and runs nothing for a task routed to `code`. In Claude Code, `/gen` and the MCP's `generate` run a routed task through the editor and review what it made; `generation_policy` reads the policy and moves it when you ask. `/sweep` follows the policy too. @@ -305,9 +308,9 @@ pnpm ops delete-iteration --json '{"id":"example-article","n":3}' ``` - Every delete is a **plan** first: each path that would go with its size, what is kept and why, what refuses. In - umtool the buttons are **Delete article** (the article's page), `Delete i<n>` (its Iterations tab), **Delete - project** (a report-video project's page) and `Delete take <id>` (its takes page); each shows the plan and acts - only on **Confirm delete**. + umtool the buttons are **Delete article** (the article piece's **⋯** menu), `Delete i<n>` (its Iterations tab), + **Delete project** (a report video's **⋯** menu) and `Delete take <id>` (its takes page); each shows the plan and + acts only on **Confirm delete**. - **An article** takes its directory (report, video, history, notes, iterations), its iterations' video projects under the projects root and its staged exports. Refused while published or named by a site page with no report of its own (force unpublishes and drops the page), and while any iteration runs. diff --git a/REPORT.md b/REPORT.md @@ -6,7 +6,7 @@ One cited report, format `"archilyzer-report"`, version 1, persisted as `report. A report lives in one of two stores: -- **An article** — `transcripts/reports/<reportId>/report.json`, published by the project homepage. `transcripts/reports/index.json` — `{"published": [ids]}` — is the published, ordered list; an article directory it does not name is a draft. An article's `audience` (below) says which homepage build carries it: the public one only `"public"` articles, the private one every published article. An article may cite any channel of the corpus. An article may not be called `new` (umtool's `/articles/new` is a page). +- **An article** — `transcripts/reports/<reportId>/report.json`, published by the project homepage. `transcripts/reports/index.json` — `{"published": [ids]}` — is the published, ordered list; an article directory it does not name is a draft. An article's `audience` (below) says which homepage build carries it: the public one only `"public"` articles, the private one every published article. An article may cite any channel of the corpus. An article may not be called `new` (umtool's `/articles/new` is an address: it opens Create's article form). - **A site's page** — `transcripts/sites/<siteId>/reports/<reportId>/report.json`, published by its site at `/pages/<reportId>/`: the site's `pages` list in `site.json` is the published, ordered list — see [SITE.md](SITE.md). A page cites the site's `channels` and `citedChannels`. `index.json` and an article's `audience` are written ONLY through `common/lib/report/registry.ts` (`configureArticle`, `setPublished`, `setArticlesOrder`, `patchArticle`, `writeArticle`: locked, validated, atomic) and `pnpm ops articles-config` (`{"id", "audience"?, "published"?, "position"?}`), never by hand. Only a sound article (no problem below) is published; a patch may not add a problem to an article. diff --git a/plans/FACTS.md b/plans/FACTS.md @@ -9114,8 +9114,9 @@ The record is [`landed-2026-10.md`](landed-2026-10.md). Every anchor below was r `kindTakesNotes` / `kindLinksArticles` (`:192`, `:195`) — `umtool/lib/annotations/targets.mjs:80`, `:164`; `umtool/lib/articles/links.mjs:47` — and an e2e spec fails on a kind id written as a literal outside `lib/projects/` and `components/projects/`. -- **/sites** lists every site's articles (`umtool/lib/articles/sites.ts`): published ids unioned with draft - report dirs, each with its open notes, its source and its linked video. An article row's `kind` is the REPORT's +- **Every site's articles** (`umtool/lib/articles/sites.ts`; Work's site facet `/work?by=site`, which `/sites` + redirects to, and `/sites/<site>`): published ids unioned with draft report dirs, each with its open notes, its + source and its linked video. An article row's `kind` is the REPORT's kind (`factcheck|sweep`), not a project kind. ## The caption-track rule (verified 2026-10-10, release 20 D3, against `585be292`) @@ -9160,8 +9161,8 @@ parsed to 0 cues, indexing the video textless) is CLOSED by `200a3105` (transcri / `deleteIteration`; `archilyzer reports delete`, `pnpm ops delete-article|delete-iteration`, umtool's Delete buttons): a plan first, then the store's writes and one rename (`.deleting-…`) under the lock, the bulk after it. An iteration's number is never reused (`current.json` `highest`). -- **An article may not be called `new`** (`RESERVED_ARTICLE_IDS`, `assertArticleId`): umtool's `/articles/new` is a - page. +- **An article may not be called `new`** (`RESERVED_ARTICLE_IDS`, `assertArticleId`): umtool's `/articles/new` is an + address (a redirect to Create's article form, `/create?make=article`). - **Generation jobs** are job kind `report-draft` on the queues `draft:api` and `draft:local` (`DRAFT_API_QUEUE`, `DRAFT_LOCAL_QUEUE`, `common/lib/queueKeys.ts`), enqueued by `enqueueReportDraft` (`common/controller/reportDraft.ts`). A `sweep` body with `iteration` CONTINUES a research run; a copy is `copyOf` with no `iteration`. @@ -9282,7 +9283,7 @@ parsed to 0 cues, indexing the video textless) is CLOSED by `200a3105` (transcri `article: ""`, `iteration: 0`. The cues are the local corpus's (`diskCuesOf`), not a build's. `archilyzer reports bench-verdicts` is `--dry` (read only), through the editor (default), or `--here` (API models only). - **`settings.generation.verdicts` = `{bar: {agreement, contradictedRecall, notFoundRecall}, models: string[]}`**: - fractions 0..1 (all 0 = no bar), and the passing models the operator ticked on umtool's `/bench` (never set + fractions 0..1 (all 0 = no bar), and the passing models the operator ticked on umtool's `/tools/bench` (never set automatically). umtool writes the whole block through the editor's settings action (a nested object replaces). `passesBar(score, bar)` (`bench/score.ts`) is the one pass rule: strict agreement and the two recalls; a recall with nothing ruled that way is not a miss. @@ -9407,3 +9408,52 @@ parsed to 0 cues, indexing the video textless) is CLOSED by `200a3105` (transcri fired by `approveResearch` when the run is left `ready`). - **build-video run by hand needs the editor's `WORKER_TOKEN`** for narration (source `editor/.env`; the chain sets it). + +## The umtool redesign: pieces, places, addresses (verified 2026-10-14, P6a, branch `ux/p6a` from `main` `165a4ee2`) + +- **The places** (`umtool/components/AppNav.tsx`, `components/shell/AppRail.tsx`): Inbox `/`, Research `/research`, + Work `/work`, Tools `/tools`, Settings `/settings` (`/settings/generation`, `/settings/system`), and **+ Create** + `/create` (a link, not a place). ⌘K / Ctrl+K opens the jump palette from any page (`components/shell/JumpPalette.tsx`). + A page passes `active`; old keys (`browse`, `articles`, `home`, a tool's own) map to a place (`placeOf`), and an + unknown key lights Work. +- **Piece ids are namespaced** (`umtool/lib/pieces/ids.mjs:10-13`): `a:<site>/<report>` (site `articles` = the + store), `p:<project id>`, `c:<case>`, `s:<series>`. A bare `x/y` never parses (`parsePieceId`), so a two-segment + id is never ambiguous. A project an article claims (an iteration's `projectDir`, then the manifest's `article` + key, then a unique slug — `lib/articles/links.mjs`) is that article's piece, not its own. +- **umtool's own state lives under `REPORTS_ROOT/.umtool/`**, never in the corpus, every file one writer, temp + + rename, an unreadable file never overwritten (409): `lifecycle.json` (`{state: active|parked|done, at, by?}` per + piece id; `lib/lifecycle.mjs:40`), `mutes.json` (piece → decision kind → `{at}`; `lib/mutes.mjs:38`), + `research/<case>/case.json` (a board; `lib/research/cases.mjs:7`; `sessions`, `census`, `archive`, `runs`, + `cases`, `new` are reserved ids, `:39`), `research/sessions/<16 hex>.json` (a reading log; `log.mjs:41`), + `research/census/<sha1>.json` (the track census per source build), `refresh-check.json` (R4's daily check; + `lib/inbox/refresh.ts:52`). A recurring report's schedule is the article store's, written by the editor only: + `transcripts/reports/<article>/schedule.json` (living) or `transcripts/reports/.series/<id>/series.json` + (`common/lib/report/schedule/store.ts:36-38`). +- **One stage rule** (`umtool/lib/pieces/tabs.mjs` `pieceSteps` `:60`, `stageOfPiece` `:93`, `stepOfPiece` + `:105`): the current step is the FURTHEST stage reached (Research → Article → Video → Deliver; a song's flow + Spec → Cuts → Done), a skipped stage before it is to do with its reason, a stage that cannot apply is `na`, a + piece marked done has done every stage that applies. The stepper, `data-piece-stage` and Work's stage facet all + read it, so they cannot disagree. +- **The decisions API contract** (`app/api/browse/decisions/route.ts`): `items[]` is ONE ROW PER DECISION, never + grouped or dropped (the MCP reads `open-note` rows, `project` as the notes target, and `href` ending + `note=<id>`; `lib/hrefs.ts` keeps `?note=` last). Each row's `piece`, `category`, `group`, `action {label, href}`, + `lifecycle`, `muted`, `hidden`, `hiddenBy` are additive; `groups` (cards: Your call, Review, Blocking, Notes, + Open, Ready to finish, Quiet — `lib/inbox/groups.mjs:24`), `hidden` and `muted` are counts beside them. + A song's decision keeps its BASENAME as `project` and links its full path (`lib/decisions.ts`, + `songProjectId` in `lib/browse.ts`). +- **Redirects are ONE table**, `umtool/redirects.mjs`, read by `next.config.ts`'s `redirects()` (checked before the + filesystem, the query passed through, the request's query FIRST) and by `e2e/redirects.spec.ts`. 16 rows, all + 307 (`permanent: false`) until P6b flips them to 308: `/` with `?from=` → `/create`; `/articles/new` and + `/drafts` → `/create?make=article`; `/browse` → `/work`; `/browse/decisions` → `/`; + `/browse/{find,faces,sources}`, `/browse/trim/:set` → `/tools/…`; `/browse/at` → `/projects/at`; + `/browse/:path*` → `/projects/:path*` (after the reserved rows); `/articles` → + `/work?kind=article&site=articles`; `/sites` → `/work?by=site`; `/mix` → `/tools/mix`; + `/:mode(sort|salvage|verify|keeps)` → `/tools/song/:mode`; `/bench` → `/tools/bench`. +- **A claimed project's address lands on its article** (`claimedProjectRedirect`, `lib/pieces/article.ts`): a + `redirect()` (307) from `/projects/<path>` with no view segment; the benches and kind views (`clip/<id>`, + `claim/<id>`, `review`, `narration`, `takes`) stay at the project's address. +- **A song's canonical address is its full path** (`/projects/<REPORTS_ROOT-relative path>`, `/…/<cut>`); the + basename resolves only when unique (`resolveProjectPath`, `lib/projects.ts`). +- **Colour is a role, and verdict colours are judgements only** (`umtool/app/globals.css`): Signal is focus, the lit + line and ONE filled action per view (`buttonVariants` `go`); every other action is an `outline`; a state that is + not a judgement wears `badgeVariants` `state` (a dashed ink edge); Meter is measurement. diff --git a/umtool/docs/README.md b/umtool/docs/README.md @@ -1,35 +1,74 @@ # umtool docs -umtool judges and drives the things this repo makes videos out of. There are two -kinds of work in it today and the tool treats them the same way: as **projects** -in a folder tree, each with a state, a set of open decisions, and a build. +## The places -These sheets live in the repo because they describe code and have to move with it. -Notes about *one particular video* belong beside that video, in its own `README.md` -— which the project page now renders at the top, with any other `*.md` beside it -under **Notes**. +Every page has the rail: **Inbox · Research · Work · Tools · Settings**, **+ Create**, **Jump to…** (⌘K / Ctrl+K from +anywhere), Pinned, the **Running** list with today's API spend, and the theme (**Auto** / **Light** / **Dark**). -`/` is the [dashboard](dashboard.md): what is running, what is waiting on you, -where every project stands, which sources nobody has checked, what is built, and -whether this machine can build. The song piles are one nav entry, `song ▸`. +| Place | Addresses | Sheet | +|---|---|---| +| Inbox | `/` (`?hidden=1`, `?muted=1`) | [inbox.md](inbox.md) | +| Research | `/research`, `/research/<case>`, `/research/runs`, `/research/runs/<article>/<n>`, `/research/archive` | [research.md](research.md) | +| Work | `/work`, `/projects`, `/sites/<site>` | [work.md](work.md) | +| A piece | `/articles/<id>`, `/sites/<site>/<report>`, `/projects/<path>`, `/series/<id>` | [piece.md](piece.md) | +| Tools | `/tools`, `/tools/{find,mix,faces,sources,bench}`, `/tools/song[/<mode>]`, `/tools/trim/<set>` | [tools.md](tools.md) | +| Settings | `/settings`, `/settings/generation`, `/settings/system` | [settings.md](settings.md) | +| Create | `/create` (`?make=`, `?from=`, `?case=`, `?article=`) | below | + +**Create** is one list, "What are you making?" — j/k move the lit line, Enter opens its form, Escape closes it; the +open form is the address (`?make=`): + +| Group | Line | Button | `?make=` | +|---|---|---|---| +| Research | Research a question | **Open a case** | `research` | +| Article | From a question | **Start sweep** | `article` | +| Article | From a board | **Draft article** | `article-board` | +| Article | A recurring report ([recurring.md](recurring.md)) | **Set a schedule** | `recurring` | +| Video | From an article | **Choose article** | `video-article` | +| Video | From a board | **Choose board** | `video-board` | +| Video | From a recording | **Choose recording** | `video-recording` | +| Video | From a sweep report | **Choose report** | `video-report` | +| Song | A song cut | **New song** | `song` | + +The editor's "Open in umtool" (`/?from=<channel>/<id>`) lands on `/create?from=…` with **From a recording** open and +prefilled. + +## Old addresses + +`umtool/redirects.mjs` is the one table (307 today; P6b makes them 308). The query string is kept. + +| Old | Now | +|---|---| +| `/?from=<channel>/<id>` | `/create?from=…` | +| `/articles/new`, `/drafts` | `/create?make=article` | +| `/browse` | `/work` | +| `/browse/decisions` | `/` | +| `/browse/find`, `/browse/faces`, `/browse/sources`, `/browse/trim/<set>` | `/tools/…` | +| `/browse/at` | `/projects/at` | +| `/browse/<path>[/…]` | `/projects/<path>[/…]` | +| `/articles` | `/work?kind=article&site=articles` | +| `/sites` | `/work?by=site` | +| `/mix` | `/tools/mix` | +| `/sort`, `/salvage`, `/verify`, `/keeps` | `/tools/song/<mode>` | +| `/bench` | `/tools/bench` | ## You have been asked for an umtool video -Work out which kind you are making first — the rest follows from it. - | What you were handed | Kind | Start here | |---|---|---| | A cited sweep report (`*sweep-report.md`) and "make this a video" | `report-video` | [report-video.md](report-video.md), then [authoring.md](authoring.md) | -| One archived recording and "make a video from this" | `report-video` | `umtool new <slug> --from <channel>/<id> [--seed chapters]`, or the editor's "Open in umtool" | +| One archived recording and "make a video from this" | `report-video` | Create → **From a recording**, or `umtool new <slug> --from <channel>/<id> [--seed chapters]` | +| A board of pinned quotes | `report-video` | the board's **Start a video from this board** ([research.md](research.md)) | +| An article with a done iteration | `report-video` | Create → **From an article**, or the Iterations tab's **Make the video** | | A song's clips and "judge these" | `song` (template `um-song`) | `~/reports/quartering-uh-song/specs/` | | A report with no manifest yet | `sweep-report` | [authoring.md](authoring.md) | The short path from a cited report to a built video: ```sh -# 0. scaffold it (writes an EMPTY timeline and a citation checklist), from a -# report, a viewer share URL, or a bare <channel>/<videoId>. `--seed chapters` -# writes one clip per digest chapter -- the digest's boundaries, not guesses. +# 0. scaffold it (an EMPTY timeline and a citation checklist), from a report, a +# viewer share URL, or <channel>/<videoId>. `--seed chapters` writes one clip +# per digest chapter -- the digest's boundaries, not guesses. umtool new <slug> --from <sweep-report.md> umtool new <slug> --from the-quartering/MpZuPjnF_O8 --site-origin https://jeralyzer.pages.dev --seed chapters umtool doctor # can this machine build at all? @@ -43,71 +82,66 @@ umtool check <slug> node umtool/report-to-video/resolve-windows.mjs ~/reports/<slug>/video.manifest.json node umtool/report-to-video/resolve-windows.mjs ~/reports/<slug>/video.manifest.json --write -# 4. bench any clip whose edges you are unsure of -# /browse/<slug>/clip/<id> +# 4. bench any clip whose edges you are unsure of: the Cut tab's Walk the cut, +# or /projects/<slug>/clip/<id> -# 4b. if the manifest has a ledger, rule on every claim in it. `umtool check` -# BLOCKS until it is empty, because both totals lie on an unadjudicated one. -# /browse/<slug>/claim/<id> +# 4b. a manifest with a ledger: rule on every claim. `umtool check` BLOCKS +# until none is unadjudicated. /projects/<slug>/claim/<id> -# 5. build: a fast pass to watch, then the real one. -# The BUTTON on the project page runs it -- cancellation, the per-step -# timeouts and the process-group kill live in the server's job runner. -# `umtool build` prints the same chain if you would rather paste it. +# 5. build: a fast pass to watch, then the real one -- the Build tab runs it +# (cancellation, per-step timeouts, the process-group kill live in the +# server's job runner). `umtool build` prints the same chain. umtool build <slug> --preset fast # 6. before revising: keep the manifest that made the deliverable umtool snapshot <slug> --label v1 -# …edit… umtool diff <slug> revisions/<stamp>-v1.manifest.json -# 7. post it: the TOC / description / chapters, derived from the build's offsets +# 7. post it: the TOC / description / chapters, from the build's offsets umtool export <slug> --format toc-bbcode ``` -**A manifest may describe more than one cut.** `build-video.mjs --variant -sourced|full` selects between them; `sourced` is the default and still writes -`out/<slug>.mp4`, so the button and `umtool build` are unchanged. The working -files moved under `out/<variant>/` while `clips-raw` and `availability.json` -stayed at the root. See -[report-video.md](report-video.md#one-manifest-two-cuts). +**A manifest may describe more than one cut.** `build-video.mjs --variant sourced|full`; `sourced` is the default and +writes `out/<slug>.mp4`. The working files are under `out/<variant>/`; `clips-raw` and `availability.json` stay at the +root. See [report-video.md](report-video.md#one-manifest-two-cuts). -**Run step 2 before step 5, always.** It is a few seconds and it catches the two -defects that have already shipped in real videos: a manifest with no `siteOrigin` -(19 QR codes encoding `undefined/?v=…`) and one pointing at `http://localhost:3000` -(QR codes that resolve to nothing on anybody's phone). +**Run step 2 before step 5, always.** It catches the two defects that have shipped in real videos: a manifest with no +`siteOrigin` (QR codes encoding `undefined/?v=…`) and one pointing at `http://localhost:3000`. ## The sheets | Sheet | What it covers | |---|---| -| [dashboard.md](dashboard.md) | The front door: what each panel reads, `/api/jobs`, `umtool doctor` | -| [projects.md](projects.md) | Kinds vs templates, marker files, ids, how to add a kind | -| [folders.md](folders.md) | The walk, `REPORTS_ROOT`, read roots vs write roots | -| [browse.md](browse.md) | The project index, the four filters, cards per kind | +| [inbox.md](inbox.md) | The Inbox: groups, cards, Park / Mark done / Mute; every decision kind and its severity; the Running list; `/api/browse/decisions` | +| [research.md](research.md) | Search, the reader, the reading log, boards, hand-offs, agent runs, the archive inventory | +| [work.md](work.md) | Work's facets, the projects grid, a site's page | +| [piece.md](piece.md) | The piece page: head, stepper, Next card, tabs per kind; iterations, the reader and notes, evidence; projects: kinds, ids, routing, delete | +| [refresh.md](refresh.md) | Refresh: fetch what is new, check it, update; the daily check | +| [recurring.md](recurring.md) | Recurring reports: living reports and series, the schedule, the series page | +| [tools.md](tools.md) | The song piles, find, mix, faces, sources, trims, the verdict bench | +| [settings.md](settings.md) | The generation policy and spend; the system page; `umtool doctor` | | [report-video.md](report-video.md) | The manifest as an EDL, the three-stage window model, `lock` | | [clip-bench.md](clip-bench.md) | Editing a clip's window against the waveform and the cues | | [claim-bench.md](claim-bench.md) | Ruling on a `ledger[]` claim against ±90 s of context | | [build.md](build.md) | The four-step chain, presets, cancellation, overwrite | -| [decisions.md](decisions.md) | What earns a severity, and how a kind contributes | -| [mix-from-a-project.md](mix-from-a-project.md) | Deep-linking a clip into `/mix` | +| [mix-from-a-project.md](mix-from-a-project.md) | Deep-linking a clip into the mix bench | +| [folders.md](folders.md) | The walk, `REPORTS_ROOT`, read roots vs write roots | | [index.md](index.md) | The LMDB index, and why the filesystem stays the model | -| [cli.md](cli.md) | `umtool ls / show / check / build / window / …` | +| [cli.md](cli.md) | `umtool ls / show / check / build / inbox / refresh / schedule / …` | | [notes.md](notes.md) | Operator notes on articles and videos; `umtool notes`, the agent loop | -| [sites.md](sites.md) | `/sites`: every site's articles, their media, workspaces and notes | -| [authoring.md](authoring.md) | Writing a manifest from a sweep report | +| [authoring.md](authoring.md) | Writing a manifest from a sweep report; generating one | | [e2e.md](e2e.md) | The fixture, the stubs, the global queue | | [quirks.md](quirks.md) | Everything that cost time to find out | ## The rules that outrank convenience -1. **The filesystem is the model.** An index may cache what the tree says; if a - value exists *only* in the index, that is a bug. See [index.md](index.md). -2. **The index must not shell out.** Listing projects never probes, never runs - ffprobe, never runs yt-dlp. Measuring is what a project page and a job do. -3. **Judgements travel with the tree.** `verdicts.json`, `notes.json` and - `video.manifest.json` live *inside* the project directory, so copying the - directory copies the decisions. -4. **Never guess at something you cannot read.** A directory whose name does not - route, a project two kinds match, a citation with no cue file — each is - *reported*, never silently dropped or resolved by picking one. +1. **The filesystem is the model.** An index may cache what the tree says; a value that exists only in the index is a + bug ([index.md](index.md)). +2. **The index must not shell out.** Listing never probes, never runs ffprobe or yt-dlp. A piece page and a job measure. +3. **Judgements travel with the tree.** `verdicts.json`, `notes.json` and `video.manifest.json` live inside the + project directory. umtool's own state (lifecycle, mutes, boards, reading logs) is under `REPORTS_ROOT/.umtool/`, + never in the corpus. +4. **Never guess at something you cannot read.** A name that does not route, a project two kinds match, a citation with + no cue file — each is reported, never dropped or resolved by picking one. +5. **These sheets describe code and move with it.** Notes about one video belong beside it, in its own `README.md` + (its Overview tab renders it; other `*.md` beside it are under History). diff --git a/umtool/docs/authoring.md b/umtool/docs/authoring.md @@ -88,7 +88,7 @@ a human-chosen window usually *is* the truth. ## 5. Bench each clip -`/browse/<slug>/clip/<id>`. Look at the waveform and the cue rail, and act on +The Cut tab's **Walk the cut**, or `/projects/<slug>/clip/<id>`. Look at the waveform and the cue rail, and act on what it says: run a clip to the end of its sentence, or set `lockEnd` to acknowledge that you meant to cut there. One 14-clip cut shipped with 8 clips ending mid-thought. @@ -109,8 +109,8 @@ technically correct and editorially wrong. ## Generating with a model A model can make the report and the cut in place of steps 0–2: in umtool, -`/articles/new` and then the article's Iterations tab ([sites.md](sites.md)), -or from a shell. When the archive may lack the material, start with research +Create's **From a question** (`/create?make=article`) and then the article's +Iterations tab ([piece.md](piece.md#iterations)), or from a shell. When the archive may lack the material, start with research instead of a sweep: its queue proposes what to fetch, and **Continue into a sweep** makes the report once it is in (OPERATING.md, "Research runs"). @@ -140,8 +140,8 @@ pnpm ops report-draft --json '{"task":"narrate","article":"<id>","iteration":<n> `narration-draft.json`. - **The media drafts** (cut, on-screen, teaser, flips, threads, narration, YouTube) each draft fields of the iteration's cut, marked as drafts: the - project page's **draft** section (**Draft with** a model per task), the - Iterations tab, or `pnpm ops report-draft` with `iteration`. A field you + piece's **Media** tab (**Draft with <model>** per section, **Draft + everything**), or `pnpm ops report-draft` with `iteration`. A field you wrote or edited is never replaced; the draft waits in `<task>-draft.json` as an alternative (**Use this**). `force` re-drafts a model's field only. The limits per task are OPERATING.md's table ("Generate and iterate"). @@ -150,8 +150,8 @@ pnpm ops report-draft --json '{"task":"narrate","article":"<id>","iteration":<n> the podcast, then drafts the YouTube text and writes `out/youtube.txt`. A failed draft does not stop it; flips and threads need the deck, and one panel only. -- **Review every draft before a final build:** `/browse/<project>/review`, - approve or reject with a note. A fast build warns; `--preset final` +- **Review every draft before a final build:** the Media tab, or the review + bench `/projects/<project>/review`: **Approve draft**, or **Reject** with a note. A fast build warns; `--preset final` refuses an unapproved or rejected draft (`--drafts-unreviewed` overrides the unapproved). - **Then review it as a hand-made cut:** `umtool check`, steps 4–6, and a fast diff --git a/umtool/docs/browse.md b/umtool/docs/browse.md @@ -1,88 +0,0 @@ -# /browse — the project index - -Every project, of every kind, in one list. **Zero client JavaScript**: the filters -are links that change `searchParams`, and `?q=` is a plain GET form. Nothing here -hydrates, and `pnpm build` still reports the page as server-rendered. - -## The four filters - -| filter | param | values | -|---|---|---| -| kind / template | `?kind=`, `?template=` | registry ids | -| state | `?state=` | `draft` `windows` `fetched` `built` `shipped` `stale` | -| open decisions | `?open=blocking` \| `?open=1` | from the decision counts | -| text / recency | `?q=`, `?sort=name\|recent` | substring over the haystack | - -**Counts come from the unfiltered set.** A chip whose number changes when you -click a different chip moves under the cursor, and the whole point of a filter row -is to say how much is behind each one. An e2e spec asserts the chip's number -equals the number of cards rendered. - -`?q=` is a `<form method="get">` carrying the other filters as hidden inputs — the -`/browse/find` idiom — so searching does not throw away the filters you set, and -any filtered view is one pasteable URL. - -## The state vocabulary - -One vocabulary across every kind, not per-kind words, because the point of the -filter is to ask "what is half-done" without first asking "half-done at what". A -kind maps its own situation onto these; it does not invent a seventh. - -## The cards - -`components/projects/ProjectGrid.tsx` **contains no kind ids and no per-kind -branches**, and that is the design working rather than an omission: a kind's -summariser has already rendered its own facts (`19 clips · 4m46s · 17 sources`, -`3/4 cuts · 2 variants`) and its own flags. The grid lays out strings. - -A kind can attach `data-*` attributes to its card through `attrs`, which is how a -song keeps `data-missing` as an assertion surface without the grid knowing what a -cut is. - -The poster falls back: the deliverable → a built **segment** (which already -carries the chrome, so the card looks like the video mid-build) → a raw clip → -nothing. Served by `/api/browse/poster?project=…`, which takes **no -client-supplied `rel`** — the frame is the one the summariser chose. - -## Routing - -`app/browse/[...path]` resolves the **longest** path prefix that is a project and -hands the rest to that kind's view. `a/b` being a project must not stop `a/b/c` -from being one. - -- `[]` → the project page -- `["wide"]` on a song → the cut page, unchanged -- `["clip","c04"]` on a report video → the clip bench -- anything else → 404, rather than a page that silently drops half its URL - -The static tool pages (`/browse/decisions`, `find`, `sources`, `faces`, `trim`, -`at`) still win their routes, and a spec asserts each is 200. - -## Cost - -Listing never probes and never shells out — the rule `listSongs()` already -followed, extended to every kind. A summary is memoised against a signature of -mtimes and sizes, so it survives for as long as the project has not changed and is -discarded the moment it has. - -The `open` filter needs decision counts for every project, which means running -each kind's reducer. That is memoised the same way; the expensive input is cue -files, and their *derived* answers are cached against the file's own mtime. - -## Discovered by getting it wrong once - -**Tailwind's source detection is turned OFF, and the three real directories are -named in `app/globals.css`.** It has to be. Auto-detection honours `.gitignore` -but scans everything else, so a scratch `NEXT_DIST_DIR` got read, its binary -turbopack cache yielded a garbage class candidate, and every page 500d on a CSS -parse error with nothing wrong in the CSS. - -Then it happened a second time from **this file**: an earlier draft quoted the -corrupt candidate to explain the first failure, Tailwind scanned the markdown, -and the trap re-created itself. Hence `source(none)` plus explicit `@source` — -a doc, a fixture, a test artefact or a stray dist dir can no longer poison the -stylesheet at all. If you add a directory that holds class names, name it there. - -**`lmdb` must be in `serverExternalPackages`.** Bundled, Turbopack tries to -resolve its optional `moduleRequire('cbor-x')` and fails the whole module graph — -so every page importing `lib/projects` 500s naming a package nothing here uses. diff --git a/umtool/docs/build.md b/umtool/docs/build.md @@ -1,6 +1,6 @@ # Building -From the project page, or `umtool build <project>` to see the chain. +From the piece's **Build** tab (a preset, **show the command**, **run**, **cancel**), or `umtool build <project>` to see the chain. ## Four steps diff --git a/umtool/docs/claim-bench.md b/umtool/docs/claim-bench.md @@ -1,6 +1,6 @@ # The claim bench -`/browse/<project>/claim/<id>`. +`/projects/<project>/claim/<id>` — a claim's Inbox card (**Adjudicate claim**) links it. The clip bench asks *"where exactly does this cut?"*. This one asks *"what did he mean by that?"* — and the two want opposite things. A clip wants sample-accurate @@ -113,7 +113,7 @@ but 20 of 50 needed the **Rumble site-id → URL-slug** remap first (see ## Sign-off is "the inbox is empty" `claim-unadjudicated` is **blocking** and is emitted one row per entry. Work it to -empty; see [decisions.md](decisions.md). +empty; see [inbox.md](inbox.md#decisions). Never auto-apply an adjudication. Every ruling carries its `scopeBasis` precisely so the next person can check it against the audio in one click. diff --git a/umtool/docs/cli.md b/umtool/docs/cli.md @@ -9,8 +9,8 @@ The audience is an AI assistant working in this repo, which is why every command takes `--json` and why `check` exits non-zero. It reads the **same** `lib/projects/*.mjs` the app does, so `umtool ls` and -`/browse` cannot disagree about what a project is, and `umtool check` and the -decisions inbox cannot disagree about what is wrong with one. +`/projects` cannot disagree about what a project is, and `umtool check` and the +Inbox cannot disagree about what is wrong with one. ## Commands @@ -34,6 +34,11 @@ decisions inbox cannot disagree about what is wrong with one. | `diff <project> <snapshot>` | added / removed / moved / window / retyped, by entry id | | `export <project> --format toc-bbcode\|toc-markdown\|description\|chapters [--variant V]` | the posting artifacts, from the build's chapter offsets | | `check-sources [<project>…]` | **prints** the re-check chain; with no args, the never-checked and >30 d projects | +| `corrections <project>` | what the report got wrong (the clip bench's sixth field) and the walk's coverage, as markdown for the next pass | +| `chain <article> <n> [--from <step>] [--dry] [--final] [--draft-all [--model M]]` | an iteration to a video: the Iterations tab's **Make the video** (`--draft-all`: Draft everything) | +| `refresh <article> [--iteration N] [--no-fetch] [--yes] [--json]` · `refresh --check [<article>] [--force]` | the refresh's plan, `--yes` starts it; the daily check now ([refresh.md](refresh.md)) | +| `schedule list \| show <id> [--json]` | the recurring reports, read-only ([recurring.md](recurring.md)) | +| `notes …` | operator notes: list, read, reply, resolve ([notes.md](notes.md)) | A project argument is an exact id, a directory, or a **unique** basename. Two projects answering to one name is reported, never resolved by picking one. @@ -82,12 +87,12 @@ front of a twenty-minute build, and it exits non-zero so a script can gate on it **`build` prints, it does not run.** Cancellation, per-step timeouts and the process-group kill live in the server's job runner; a second runner here would be -a second, worse set of those. Use the button on the project page, or paste the +a second, worse set of those. Use **run** on the piece's Build tab, or paste the printed commands. **`check` cannot compute the song reducer.** Nine decision kinds are TypeScript beside `readSong()`, the loudness cache and the accepted cover set. It reports how -many projects it only checked the routing of, and points at `/browse/decisions`. +many projects it only checked the routing of; `umtool inbox` and the Inbox have the rest. ## `window` goes through the same writer the bench does diff --git a/umtool/docs/clip-bench.md b/umtool/docs/clip-bench.md @@ -1,6 +1,6 @@ # The clip bench -`/browse/<project>/clip/<id>`. +`/projects/<project>/clip/<id>` — reached from the Cut tab's **Walk the cut** or a row's **bench →**. "How much context does this clip need" used to be a loop of hand-editing JSON, re-running two CLIs and watching an mp4. This is that loop in one place. @@ -77,7 +77,7 @@ was. See [report-video.md](report-video.md#where-the-bytes-come-from-the-editor- machine with no editor to ask. Same file naming, same format pin, same Rumble HLS retry, same NDJSON events. -**"Fetch N unfetched clips via the editor"**, above the cut on the project page, +**"Fetch N unfetched clips via the editor"**, above the rows on the Cut tab, closes the whole `ready N of M` gap in one press — the clips that need judgement with nothing cached holding them, one at a time, awaiting each before starting the next. Stop abandons rather than kills: the in-flight fetch is already paid @@ -203,7 +203,7 @@ anything is saved. The sixth field in that panel is not about this video at all. It records what the **report** got wrong about this clip — wrong speaker, wrong addressee, wrong date -— and nothing renders it. The project page collects every one under *corrections +— and nothing renders it. The Cut tab collects every one under *corrections for the next pass*, and `umtool corrections <project>` prints the same list as markdown with each clip's own moment link, ready to paste into the next sweep. @@ -231,8 +231,8 @@ before the edit. `p` and `n` (and the links in the header line) move to the previous and next clip **on the walk**, computed server-side. Reviewing a cut is watching nineteen -clips in a row, and going back to the project page between each one is nineteen -round trips to re-find your place. The project page starts the walk: one +clips in a row, and going back to the Cut tab between each one is nineteen +round trips to re-find your place. The Cut tab starts the walk: one **"Walk the cut → start at `<first clip on it>`"** button above the rows, because the per-row links are the right control for "go to that one" and the wrong one for "start". @@ -254,7 +254,7 @@ timeline order — so `p`, `n`, both header links, the start button and the jump A **URL still opens any clip**, judged or unfetched — the bench renders it, says *"nothing fetched for this clip yet"* and carries a **not fetched yet** pill, and its two links point at the fetched, unjudged neighbours either side. The -per-row link on the project page is that URL, so "go to that one" is unchanged. +per-row link on the Cut tab is that URL, so "go to that one" is unchanged. Both pages read **`ready N of M needing judgement`**: `M` is the clips with no verdict, `N` the ones among them that can be judged today. The gap between the @@ -383,7 +383,7 @@ somebody's judgement. ## Deliver — the half that starts when the walk ends The bench answers one question per clip. What a report owes its readers after -that is a different list, and it lives on the **project page** as `Deliver` +that is a different list, and it lives on the piece's **Deliver** tab (`components/projects/DeliverSection.tsx`, `/api/report/deliver`): | | | diff --git a/umtool/docs/dashboard.md b/umtool/docs/dashboard.md @@ -1,36 +0,0 @@ -# The dashboard (`/`) - -The front door. It used to be a doorway that put you back in the song pile you -last judged; it is a page now, and the song piles are one nav entry (`song ▸`) -at the URLs they always had. - -**Nothing on it shells out.** Every panel reads the index, the two in-memory -job registries, or a cache. The one probe on the page is behind a button. - -| panel | what it reads | where it goes | -|---|---|---| -| **now** | `runningActivity()` — whichever of the two job registries (`lib/jobs.ts` chain jobs, `lib/mix.ts` renders) is busy, merged in `lib/activity.ts`; step `n/of` and per-entry state from the build's NDJSON events. A client poll of `/api/jobs` every 2 s **only while something runs**. Under it, the newest finished jobs. | the project page, or `/mix` | -| **needs a decision** | `openDecisions()` — the same reducer as `/browse/decisions`; totals and the worst eight | `/browse/decisions` | -| **projects** | `listProjects()` + `decisionCounts()`; one row per kind, the six states as proportional segments. The header string comes from `lib/dashboard.ts`, shared with `/browse`, so the two cannot disagree. One meaningful colour: `stale` is `--color-dirty`; every other state is neutral. | `/browse?kind=&state=` | -| **sources** | each report project's summary attrs (`sources-checked-at`, `sources-dead`, `sources-missing`, `cue-gaps`), written by `lib/projects/report.mjs`: never checked / older than 30 d / with dead or missing sources. "Re-check" starts one `check-sources` job. | the project page | -| **deliverables** | `attrs["final-bytes"]` (a report's `out/<slug>.mp4` + `-full.mp4`; a song's shipped cuts) — built count, bytes, newest, stale | `/browse?state=built` | -| **tools & disk** | the doctor **cache** (`lib/doctor.ts`, ten minutes) or "not checked"; free bytes under `REPORTS_ROOT` via `statfs`; index health. The button `POST`s `/api/doctor`, which is the only place the app probes. Red only when the report pipeline needs a tool and it is absent. | — | -| **recent** | the six newest projects by `newestMtimeMs`, as the same cards `/browse` draws | the project page | -| **resume** | the last URL the recorder wrote (`components/LastPage.tsx`), HEAD-probed down to `/browse`, offered as a chip rather than navigated to | wherever you were | - -`?from=<channel>/<id>` opens the new-project menu prefilled — the editor's -"Open in umtool" link (`UMTOOL_URL`) lands here. - -## `/api/jobs` - -`GET` → `{ running, jobs }`, one shape over both registries, `no-store`. The -registries stay separate: their one-at-a-time rules differ (a chain is -process-wide exclusive; a render is one ffmpeg call). - -## `umtool doctor` - -The CLI form of the tools panel: `umtool doctor [--json]`, exit 1 if the -report pipeline is missing a tool it cannot run without (ffmpeg, ffprobe, -yt-dlp, qrencode). ImageMagick is probed as `magick` — every call in the -pipeline is IM7's `magick`, and a machine with only `convert` cannot build a -card, which the report says. diff --git a/umtool/docs/decisions.md b/umtool/docs/decisions.md @@ -1,107 +0,0 @@ -# Decisions - -One worklist, every project, every kind: `/browse/decisions`, or -`umtool decisions`. - -## Severity is EARNED - -| | | -|---|---| -| `blocking` | something downstream would **lie or die** if you acted on it | -| `open` | a real decision nobody has made | -| `info` | a true fact that is not a decision | - -An inbox that marks four missing cuts per song as blocking is an inbox nobody -opens twice. A song that never had a vertical is not waiting on you. - -## It is a REDUCER, and it must never measure - -Every call it makes is one a project page already makes. An inbox that shells out -to ffmpeg once per rendition, or to yt-dlp once per source, is an inbox that takes -a minute to open — which is the one thing it cannot afford to be. - -So loudness is read from the **cache**, and availability is read from whatever the -preflight last **wrote** (`out/availability.json`), never measured here. "Nobody -has ever run one" is itself something it can say. - -## The kinds - -Each registry entry owns its own vocabulary (`decisionKinds`), and the union is -assembled rather than hand-written — a closed union in one shared file would mean -every future kind editing it to say a word only it uses. - -**report-video** - -| kind | severity | trigger | -|---|---|---| -| `manifest-invalid` | blocking | missing or `localhost` `siteOrigin`, missing `channelSlug`, duplicate ids, `section` out of range | -| `clip-no-cues` | blocking | no `transcript.cues.json` — the build dies there | -| `clip-unfetchable` | blocking | the last preflight says the source is gone | -| `clip-mid-sentence` | open | the cut lands inside a cue that does not close a sentence, and `lockEnd` is unset | -| `window-overlap` | open/info | two clips from one source overlap | -| `no-punctuation` | info | a source's ASR has no terminators — one row per project | -| `clip-cue-gap` | open | the source's cue file **ends before a clip does** (`cues end 880 s · c03 needs 897 s`); one row per source, naming the clip that reaches furthest. The build does not die — it cuts from audio — but the tail has no words behind it; recover the transcript or shorten the window | -| `claim-unadjudicated` | blocking | a `ledger[]` entry missing any of the six adjudication fields | -| `claim-incoherent` | open | a fired coherence predicate, in plain words | -| `stale-build` | open | the output is older than the manifest | -| `unbuilt` | info | never built. A normal state, not a decision | - -`claim-unadjudicated` **earns** blocking: both the stated and the implied total -lie if you act on an unadjudicated ledger, and they lie quietly, in a chart, with -somebody's name on it. It is also the one kind that is deliberately **one row per -entry** rather than collapsed — fifty unpunctuated sources are the same true -thing said fifty times, but fifty unadjudicated claims are fifty *different* -decisions, and the inbox being empty is the sign-off. - -`claim-incoherent` is `open` rather than blocking because the decision is -**editorial**: is the flag right, and does it belong on screen? Neither answer -stops a build. - -Both come from `ledger-totals.mjs` in `report-to-video`, which is pure arithmetic -over JSON already parsed into memory — so the reducer stays a reducer. Audio is -fetched only when a claim page is opened, one claim at a time. - -**song** — the nine the existing reducer emits: `unjudged-variant`, -`missing-cut`, `no-recipe`, `stale-recipe`, `spec-problem`, `no-plan`, -`unattributed`, `thumb-unaccepted`, `loudness`. - -**routing**, kind-independent — `shadowed-name` (blocking), `unroutable-name` -(info), `ambiguous-project` (blocking). - -## Adding one - -Extend the kind's `decisionKinds` and emit it from its `decisions(ctx, summary)`. -Nothing outside `lib/projects/` needs to change. - -## What the CLI can and cannot do - -`umtool check` computes every report-video decision and every routing one, and -exits 1 on anything blocking — which is what makes it usable as a gate before a -build. It **cannot** compute the song reducer: that is TypeScript beside -`readSong()`, the loudness cache and the accepted cover set, and a second -implementation is the thing this design exists to avoid having two of. It says -how many projects it only checked the routing of. - -## Discovered by getting it wrong once - -**Forty true rows are worse than one.** The first real run emitted a -`no-punctuation` row per *source* — forty-odd across six projects, all correct, -burying two blocking rows off the top of the list. One per project now. - -**A reducer that says the opposite of the card next to it.** The first -adjudicated build shipped a rail tally reading "Spans everything **18**" directly -beside a card reading "He never said eighteen". The adjudication had set -`valueKind: "derived"` and nothing downstream was reading it: the tally still took -the latest value of any kind, and the ledger's `label` still said "the only -explicit sum in the corpus". A field that changes what something *means* has to be -chased through every renderer that prints it, and the only way this surfaced was -looking at a frame. - -**Do not assume where a project reads its cues from.** The first run confidently -reported three sources of `quartering-flagging-takedowns` as having no cue file. -They cite deleted YouTube uploads, are cut from live Rumble mirrors, and build -against a **shadow `CHANNELS_DIR`** the project's own `make-shadow-channels.sh` -writes. A project now says which directory it reads — `provenance.channelsDir`, or -the `.shadow-channels` convention that already existed — and neither is a guess: -both are things the project wrote down. When the builder is present but unrun, the -decision says to run it rather than declaring the sources gone. diff --git a/umtool/docs/e2e.md b/umtool/docs/e2e.md @@ -40,7 +40,7 @@ rendered over a deliverable would be indistinguishable from a person doing it. | `takes-fixture` | takes **write** `takes/verdicts.json` — two groups, a take with no preview, one skipped take.json, a work dir that is not a take | | `delete-fixture` | `article-delete.spec.ts` **deletes** a take of it, then the project (`e2e/fixtures/delete-fixture.mjs`, with the article `psi`; the spec writes its draft `omega` itself, since `articles.spec.ts` counts the store's rows) | | `bike-fixture` | the third kind | -| `find/` | shadowed by a tool page | +| `find/` | a project named like a tool (`find` was a static page under `/browse`; since P3 it is an ordinary project name, and `/projects/at?path=` stays the escape hatch) | | `deep/nested/solo-fixture` | a pass-through chain, for the collapse | **Three copies of one manifest is not duplication.** Sharing one project between diff --git a/umtool/docs/folders.md b/umtool/docs/folders.md @@ -114,7 +114,7 @@ Measured on the real tree: **12 projects in 25 ms**, and the 3.1 GB never touche A folder with no projects and exactly one child collapses **for display**: `quartering-uh-song / videos` is one heading. -**The URL is never collapsed.** `/browse/quartering-uh-song/videos/yoshi` stays +**The URL is never collapsed.** `/projects/quartering-uh-song/videos/yoshi` stays the one true address. A URL has to mean the same thing in six weeks, and a display convenience does not get to decide what a link is. diff --git a/umtool/docs/inbox.md b/umtool/docs/inbox.md @@ -0,0 +1,145 @@ +# The Inbox (`/`) + +## The page + +- **One card per piece and kind**: 483 unadjudicated claims on one video are ONE call. `umtool inbox [--all] [--json]` + prints the same list. +- **The big number** — the cards in Your call, Review, Blocking, Notes and Open on active pieces, plus the machine's + own calls ("N calls waiting on you"). Under it: rows · pieces ready to finish · quiet · hidden (`lib/inbox/headline.mjs`, + which the rail's count and the CLI also read). +- **One lit list** of the groups below. A card: piece · what, its why, the count in Meter, ONE action (an outline at + rest, filled Signal on the lit line), **Park**, **Mute** (**Not yet** on a looks-done card). j/k move the light. +- **Park** / **Mark done** / **Reactivate** write the piece's lifecycle; **Mute** / **Unmute** this kind of call on this + piece. Each shows "<Parked|Marked done|Reactivated|Muted|Unmuted> <title>" with **Undo** for 8 s. +- **Show hidden N** (`/?hidden=1`) lists the calls on parked and done pieces as a Hidden group, each with + **Reactivate**. **Muted N** (`/?muted=1`) lists the muted ones, each with **Unmute**. Hidden rows are never dropped: + every count but the cards still has them. +- **resume <url> →** offers the last page you were on (after its redirect), never navigates by itself. + +| Group | What lands there | Note on the page | +|---|---|---| +| **Your call** | research proposals, failed runs, a tick that failed or was held, a refresh held by the cap — money or work waiting on a yes | spend or failed runs | +| **Review** | an iteration ready, drafts to review, an edition ready, new recordings since the current report | | +| **Blocking** | a blocking decision on an active piece; a `notes.json` that does not read; the machine's calls (a required tool absent, under 5 GB free under the reports root → **Check tools** / **Open system**, `/settings/system`) | active pieces only | +| **Notes** | open operator notes | | +| **Open** | an open decision the groups above do not take (a variant with no verdict, a video to link) | | +| **Ready to finish** | a piece that looks done (**Mark done**) | suggested, never automatic | +| **Quiet** | every `info` decision — facts, not calls; folded | N cards, facts rather than calls | + +A piece's page shows the same top card as its **Next** card ([piece.md](piece.md)). + +## Lifecycle and mutes + +| State | File | Effect | +|---|---|---| +| `active` / `parked` / `done` | `REPORTS_ROOT/.umtool/lifecycle.json`, keyed by piece id (`POST /api/pieces/lifecycle`) | a parked or done piece's calls are hidden (`hiddenBy: parked \| done`); Work's lifecycle facet; the piece's chip | +| muted (piece × decision kind) | `REPORTS_ROOT/.umtool/mutes.json` (`POST /api/pieces/mute`) | those rows are hidden (`hiddenBy: muted`); a parked or done piece's reason wins | + +Both files: one writer, temp + rename, an unreadable file never overwritten (409). "Looks done" only ever suggests: a +song with every cut, a final video plus a `share-*` batch, or a published article with its video. + +## Decisions + +Severity is EARNED: + +| | | +|---|---| +| `blocking` | something downstream would **lie or die** if you acted on it | +| `open` | a real decision nobody has made | +| `info` | a true fact that is not a decision (always Quiet) | + +**It is a reducer, and it must never measure.** Every call it makes is one a piece page already makes: loudness from the +cache, availability from what the preflight last wrote (`out/availability.json`). "Nobody has ever run one" is +itself something it can say. + +Each kind's card action names its result (`lib/inbox/groups.mjs`), and a project-wide call links the tab it is settled +on (`decisionTab`, `songTabOfSection`). + +**report-video** + +| kind | severity | trigger | action | +|---|---|---|---| +| `manifest-invalid` | blocking | missing or `localhost` `siteOrigin`, missing `channelSlug`, duplicate ids, `section` out of range | Fix the manifest | +| `clip-no-cues` | blocking | no `transcript.cues.json` — the build dies there | Fix the cue source | +| `clip-unfetchable` | blocking | the last preflight says the source is gone | Replace the source | +| `clip-mid-sentence` | open | the cut lands inside a cue that does not close a sentence, and `lockEnd` is unset | Trim to the sentence | +| `window-overlap` | open/info | two clips from one source overlap | Fix the windows | +| `no-punctuation` | info | a source's ASR has no terminators — one row per project | Check the windows | +| `clip-cue-gap` | open | the cue file ends before a clip does (`cues end 880 s · c03 needs 897 s`), one row per source | Fix the window | +| `claim-unadjudicated` | blocking | a `ledger[]` entry missing any of the six adjudication fields — one row per entry | Adjudicate claim | +| `claim-incoherent` | open | a fired coherence predicate, in plain words | Rule on the flag | +| `stale-build` | open | the output is older than the manifest (→ Build) | Rebuild the video | +| `unbuilt` | info | never built | Build the video | +| `storage-unreachable` | blocking | an `out/` or deliverables link whose drive is not there | Reconnect the media drive | +| `storage-mismatch` | open | a storage move that was cut, with the command that finishes it | Settle the storage | +| `clip-cut-outside` | blocking | a `cutStart`/`cutEnd` without its pair, under half a second, or outside its window | Fix the cut | + +**song** — `unjudged-variant` (Judge variant), `missing-cut` (Ship the cut), `no-recipe` / `stale-recipe` (Record the +recipe), `spec-problem` (Fix the spec), `no-plan` (Name the plan), `unattributed` (Attribute variant), +`thumb-unaccepted` (Accept a cover), `loudness` (Re-render at the target). A song-wide call opens its tab (Spec, Cuts, +Cover); a cut's opens the cut's page, at the song's full path. + +**articles, runs and schedules** (from disk, beside the reducers — `lib/inbox.ts`) + +| kind | group | action | +|---|---|---| +| `research-proposal` — a research run's acquisition waiting (`proposals.json`, status `proposed`) | Your call | Approve acquisition | +| `iteration-failed` — a failed run not superseded by a later live one; spend from its `usage` | Your call | Retry run | +| `tick-failed`, `tick-held` ([recurring.md](recurring.md)) | Your call | Tick now / Raise cap | +| `refresh-held` ([refresh.md](refresh.md)) | Your call | Refresh | +| `iteration-ready` — done, not current, newer than current | Review | Make i<n> current | +| `drafts-unreviewed` — drafted fields awaiting review (unreviewed, or edited since approved) | Review | Review drafts | +| `edition-ready` | Review | Review edition | +| `refresh-available` | Review | Refresh | +| `open-note` — an operator note (its href ends `note=<id>`) | Notes | Answer note | +| `unreadable-notes` | Blocking | Repair notes.json | +| `link-ambiguous` — a slug match no iteration or manifest settles | Open | Link the video | +| `looks-done` | Ready to finish | Mark done | + +**routing**, any kind — `shadowed-name` (blocking), `unroutable-name` (info), `ambiguous-project` (blocking) +([piece.md](piece.md#projects-kinds-ids-routing)). + +`claim-unadjudicated` earns blocking: both the stated and the implied total lie on an unadjudicated ledger, quietly, in +a chart, with somebody's name on it — and fifty unadjudicated claims are fifty different decisions, so the empty Inbox +is the sign-off. `claim-incoherent` is open: whether the flag is right, and belongs on screen, is editorial. + +**Adding a kind:** extend the project kind's `decisionKinds` and emit it from its `decisions(ctx, summary)`; nothing +outside `lib/projects/` changes. Give it a card action in `lib/inbox/groups.mjs` and its words in `lib/inbox/what.mjs`. + +## The API, `GET /api/browse/decisions` + +`items[]` is ONE ROW PER DECISION, never grouped and never dropped: the MCP reads it (`open-note` rows, `project` as the +notes target, `href` ending `note=<id>`; `lib/hrefs.ts` keeps `?note=` last). Each row carries `piece`, `category`, +`group`, `action {label, href}`, `lifecycle`, `muted`, `hidden`, `hiddenBy` — additive. Beside it: `counts` (by +severity), `groups` (the cards), `hidden`, `muted`. `?project=<song>` narrows to one song's reducer. `no-store`. + +`umtool decisions [--json]` prints the reducer's rows; `umtool check` computes every report-video and routing decision +and exits 1 on anything blocking (it cannot run the song reducer and says how many it only routed). + +## The Running list (the rail's foot) + +- umtool's own jobs (a chain, a render, an index rebuild, a storage move) and the editor's `GET /api/ops/jobs?active=1`: + generation first, then a research run's acquisitions and clip windows umtool asked for, then the rest; at most 5 + rows, the rest folded ("+ 2 running · 140 queued · 3 lanes"). The lane runners are never rows. +- A row: the kind in words, the target, queued ("queued · 1 ahead") or running, progress, a generation job's spend in + Meter. A sweep's row links its run page; another placed draft its article's Iterations tab; anything else the editor's + `/jobs`. The label says the day's API spend from the ledger ("$0.42 today"). +- Three sentences, never one: **Editor unreachable**, **Editor's WORKER_TOKEN not set**, **Nothing running** (and + **WORKER_TOKEN not set here**, **WORKER_TOKEN does not match the editor's**). +- Polled every 8 s while the tab is visible; a page never waits on the editor ("Asking the editor…"). + +## Discovered by getting it wrong once + +**Forty true rows are worse than one.** The first real run emitted a `no-punctuation` row per source — forty-odd, all +correct, burying two blocking rows. One per project now. + +**518 "blocking" was mostly one finished video.** 483 of them were `claim-unadjudicated` on `quartering-diet`. One card +per piece and kind, and a lifecycle that hides a done piece's calls, made the number mean something. + +**A reducer that says the opposite of the card next to it.** An adjudicated build shipped a rail tally reading "Spans +everything **18**" beside a card reading "He never said eighteen": `valueKind: "derived"` was set and nothing +downstream read it. A field that changes what something means has to be chased through every renderer that prints it. + +**Do not assume where a project reads its cues from.** A project says which directory it reads — +`provenance.channelsDir`, or the `.shadow-channels` convention — and when the builder is present but unrun, the +decision says to run it rather than declaring the sources gone. diff --git a/umtool/docs/index.md b/umtool/docs/index.md @@ -51,7 +51,7 @@ without the native module all take that path, and everything still works. It is deliberately almost invisible, so its health has to be surfaced on purpose: -- the footer note on `/browse` — `index: 9/11 fresh` +- the footer note on `/projects` — `index: 9/11 fresh`; Settings · system's Index panel - the `x-index` header on `/api/browse/projects` - `umtool index` — records, schema, when it was built - `umtool index --rebuild` / `--prune` / `--since <ms>` diff --git a/umtool/docs/mix-from-a-project.md b/umtool/docs/mix-from-a-project.md @@ -1,4 +1,4 @@ -# Reaching /mix from a project +# Reaching the mix bench from a project Six of seven projects used to resolve to `null` in the mix bench: `MEDIA_ROOTS` was the um-song subtree, so no report video's media was openable at all. @@ -6,7 +6,7 @@ was the um-song subtree, so no report video's media was openable at all. ## The link ``` -/mix?body=<absolute>&start=<s>&end=<s>&from=<projectId>&clip=<clipId> +/tools/mix?body=<absolute>&start=<s>&end=<s>&from=<projectId>&clip=<clipId> ``` - **`body` is absolute**, like the picker's own `<option value>`. That is what @@ -17,7 +17,7 @@ was the um-song subtree, so no report video's media was openable at all. resolver for what the first one already did. - A deliverable link carries no window: the whole thing is the point. -Resolved **server-side** in `app/mix/page.tsx`, which is why this needs no +Resolved **server-side** in `app/tools/mix/page.tsx`, which is why this needs no `useSearchParams` and no Suspense boundary — that page already ran on the server, it simply never read its own `searchParams`. @@ -52,7 +52,7 @@ fade, gain, duck — *are* adopted, because those are things learned about that pair. Arriving via a link does **not** write a session. A session is saved only on a -real render, so drive-by navigation cannot change what the next bare `/mix` visit +real render, so drive-by navigation cannot change what the next bare `/tools/mix` visit opens. ## Refuse, never clamp diff --git a/umtool/docs/notes.md b/umtool/docs/notes.md @@ -1,10 +1,16 @@ # Notes: the operator writes them in umtool, an agent acts on them -A note is a sentence or two the operator leaves on an **article** (one of the -homepage's, `/articles/<id>`, or a site's own page, `/sites/<site>/<report>`) or on -a **report-video project** (a timeline row, a -take, a moment in a rendered cut). It is saved where the agent that made the thing -can read it back, act on the right SOURCE file, and reply or resolve. +## Where they are written + +| On | Where in umtool | +|---|---| +| an article (the store's `/articles/<id>`, or a site's `/sites/<site>/<report>`) | the piece's **Article** tab: a passage, a section, a citation, the whole article ([piece.md](piece.md#reading-and-noting-the-article-tab)); a timed note on its video | +| a report-video project | the **Cut** tab's rows and the clip bench (`entry`), the takes bench (`take`), the **Build** tab's final video and a take's preview (`moment`), an edit to a generated manifest (`edit`) | +| a song | the song piece's **Notes** tab and the notes beside each cut and file (a song's own `notes.json`, not this store) | + +A note is saved where the agent that made the thing can read it back, act on the right SOURCE file, and reply or +resolve. Open notes are the Inbox's **Notes** group (`open-note`, **Answer note**; its link ends `note=<id>` and opens +the tab the note is drawn on). ```sh umtool notes --all --open # every notes file with an open note diff --git a/umtool/docs/piece.md b/umtool/docs/piece.md @@ -0,0 +1,233 @@ +# A piece + +## Ids and addresses + +An article plus the video project(s) made from it is ONE piece with one page; a project no article claims is a piece +too. Ids are namespaced (`lib/pieces/ids.mjs`); a bare `x/y` never parses. + +| Piece | Id | Page | +|---|---|---| +| a store article | `a:articles/<id>` | `/articles/<id>` | +| a site's report | `a:<site>/<report>` | `/sites/<site>/<report>` (the MCP's and the notes' address) | +| a project no article claims | `p:<project id>` | `/projects/<path>` | +| a research case | `c:<case>` | `/research/<case>` ([research.md](research.md)) | +| a recurring report's series | `s:<series>` | `/series/<id>` ([recurring.md](recurring.md)) | + +**Which article claims a project**, in order: an iteration's `projectDir` (with `current.video` choosing the Cut tab's +project), the manifest's `article` key, then a unique slug match in the article's workspace (only this raises +`link-ambiguous`). A `projectDir` outside `REPORTS_ROOT` is "not reachable here". **A claimed project's own address +lands on its article** (a 307: `/projects/<path>` with no view segment → the article's address, the same `?tab=`, a +`?note=`'s tab, `?project=` when it is not the Cut). The benches stay at the project's address. + +## The frame + +- **The head**: the trail, the title, the meta line (an article's status — **in the making**, **published**, **draft** — + dates, revisions), **Active ▾** / **Parked ▾** / **Done ▾** (Park, Mark done, Reactivate, with **Undo**), **⋯** (the + piece id and the kind's actions), the status line (`4 clips · 2 other · 0:12 · not built`). +- **Under it**: the stage stepper; "from the board <title>", "a video of <article>" or "an edition of <series>" when so; + a living report's cadence chip with **Pause schedule** / **Resume schedule** and **Tick now**; an article's **policy** + chip (preset, model, today's spend of the daily cap → `/settings/generation`). +- **The Next card** (Overview): the piece's top Inbox call — what, why, "then N more calls", and its ONE action, filled. + A parked or done piece's Next is **Reactivate**. "Nothing waiting on you" when nothing is. +- **Tabs** are `?tab=` (no tab is the Overview; a bad one is the Overview); counts in Meter. Only the tab on show is + read. +- **Keys** (not while typing, nor on a focused video, nor in a menu): `1`–`9` open the tabs, `n` runs the Next card's + action. + +### The stepper + +ONE rule (`lib/pieces/tabs.mjs` `pieceSteps`), read by the stepper, `data-piece-stage` and Work's stage facet alike: +the current step is the **furthest stage reached**; a skipped stage before it is to do with its reason ("no report +yet"); a stage that cannot apply is dimmed with its reason (a project no article claims has no Article stage); a piece +marked done has done every stage that applies. + +| Flow | Reached when | +|---|---| +| Research → Article → Video → Deliver | Research: iterations, or a board that seeded it · Article: a report · Video: a claimed project (or one not reachable here) · Deliver: looks done (a final video and a `share-*` batch, or published with its video) | +| Spec → Cuts → Done (a song) | Spec: a `spec.json` · Cuts: one cut built · Done: all four (the derived `shipped`) | + +## A report video (`/projects/<path>`, and an article's video tabs) + +| Tab | Holds | +|---|---| +| **Overview** | the Next card, the project's decisions, "This video" (cut, final video, channel, cited, enumerated), the article and its newest iterations, the research board, the README | +| **Cut** | **Walk the cut** (the filled action) → the clip bench; **Takes — N**; the timeline rows (drag or alt+↑/↓; each row's ⋯), **Fetch N unfetched clips via the editor**, show every quote (`?all=1`), corrections for the next pass | +| **Media** | every drafted field, below | +| **Build** | the build chain: a preset (preview, fast, final), **show the command**, **run**, **cancel** ([build.md](build.md)); the final video and **open in mix** | +| **Deliver** | cuts and share batches, the export formats, the podcast | +| **Sources** | every cited recording: cues, coverage, availability, **Re-check availability**; tag the cited videos (a tag, a scope, **tag N videos** / **untag N videos**) | +| **History** | revisions (snapshot, diff), provenance, notes (prose and sibling `.md`) | + +**⋯**: **Delete project**. `?note=<id>` opens the tab its anchor is drawn on (a row's or an edit's → Cut, a timed note +→ Build). A project-wide call links its tab (`stale-build` → Build, `no-punctuation` → Sources). + +### Media + +- ONE lit list of every drafted field, grouped by section (Cut, On-screen, Teaser, Flips, Threads, Narration, + YouTube; chips narrow it), each line its words, its **provenance** (the draft file, when, the model, "attempt 2 of 2 + chosen", refused attempts' rules, "repaired"), **Approve draft** / **Reject** with a note, the alternatives with + **Use this**. +- Each section's head: what it writes and **Draft with <model>** (force, entries, the job, the last run) — only on a + project an article iteration made ("Drafting is off: no article iteration made this project."; a running iteration: + "Drafting waits for <article> i<n>, which is <status>."). +- Above: the counts, **Review drafts — N** (the review bench), the Draft everything model and **Draft everything**, + **Approve all N**, the final gate's line. Then the On-screen panel and the YouTube text. +- Keys in the list: j/k light a field, `a` approves it, `r` rejects it (the cursor to its note first). +- "Awaiting review" is ONE count (`awaitingReview`): a field a model drafted whose verdict is not given on its current + value. The Inbox card, the tab's count, **Approve all** and the review bench read it. Verdicts are + `<project>/drafts.review.json`; a final build refuses an unapproved or rejected draft. + +### The benches + +One shell (`components/projects/bench/BenchShell.tsx`): a top bar (home, **← the piece**, the kind, **N of M**, ‹ prev / +next ›, the keys), the work, the **verdict bar** (the question, its consequence in bold, the actions; the first is the +filled one), the reader on the right. + +| Bench | Address | Keys | The bar | +|---|---|---|---| +| Clip ([clip-bench.md](clip-bench.md)) | `/projects/<p>/clip/<id>` | `y` confirm, `x` note, `[ ] , .` nudge, space play, `p` `n` walk | "Extend c04 to the end of the sentence?" → **Extend to m:ss** (or **Fetch to m:ss**), **Keep the cut here**; else "Is c04 what the report says it is?" — **Yes, confirmed**, **No, note what is wrong** | +| Claim ([claim-bench.md](claim-bench.md)) | `/projects/<p>/claim/<id>` | j/k cue | "Save the ruling on k01?" → **Save ruling**, **Next claim** | +| Narration | `/projects/<p>/narration` | j/k card, `a`, `r` | "Approve the narration of t1?" → **Approve**, **Reject with a note** | +| Takes | `/projects/<p>/takes` | `n` `p` listen, `l` `m` `x` | "Is <take> the take for <group>?" → **Like**, **Maybe**, **No** | +| Drafts review | `/projects/<p>/review` | j/k field, `a`, `r` | "Approve the drafted on-screen text of m01?" → **Approve draft**, **Reject with a note** | + +**Extend to …** saves at once; **Reset** (`R`) puts the window it replaced back. + +## An article (`/articles/<id>`, `/sites/<site>/<report>`) + +| Tab | Holds | +|---|---| +| **Overview** | the Next card; Iterations (newest five, **All iterations →**, the current report's question and scope) and the video's decisions; Article · N sections (**Read →**); Cut · i<n> (**Open the cut →**), other cuts, "Possible videos"; the board; the last **Refresh** ([refresh.md](refresh.md)) | +| **Article** | the reader with its notes (below); its switch **article** · **source** (`?tab=source`: workspace files, the slide lint) · **evidence**; the linked projects; "No report yet" for one in the making | +| **Iterations** | every iteration, below (a site's report has none) | +| **Cut** · **Media** · **Build** · **Deliver** · **Sources** · **History** | the claimed project's tabs, as above; "No video project yet" when there is none | + +**⋯**: **Refresh…**, **Delete article** (a store article; a published one offers **delete anyway**, which unpublishes +it first), and the video's **Delete project**; a living report's Edit cadence and Delete schedule. Addresses: +`?note=<id>` opens the Article tab on an article note (else the video's tab where it is drawn); `?rv=`, `?status=`, +`?ws=&rel=` open the Article tab; `?project=<id>` another cut the piece owns; `?refresh=1` the refresh plan. + +### Iterations + +An article made by a model is a series of **iterations** (`i1`, `i2`, …: common's `lib/report/iterations.ts`). +umtool **starts** them and never writes one: each is a `report-draft` job the EDITOR runs, asked over its ops API with +the shared `WORKER_TOKEN` (`lib/articles/generation.ts`). + +| On an iteration | What happens | +|---|---| +| **Use this iteration** | the article's `report.json` becomes its report (common's `makeCurrent`: locked, validated; the audience and the attached video kept) | +| **New iteration** → **Start iteration** | a `revise-report` or `revise-video` of it, from feedback, on a model | +| **Copy with model** | the same kind, base, question or feedback, on another model (an API sweep: its extractor too) | +| **Media drafts →** | the iteration's cut's Media tab | +| **Make the video** | the chain (`lib/report/chain.mjs`) as a umtool job: its steps, each one's status, **Run the chain** (resume, or from a step), **Cancel the chain** | +| **Cancel i<n>** | `job cancel` on its editor job | +| **Run** | the run page of a sweep ([research.md](research.md#agent-runs-researchruns-and-researchrunsarticlen)) | +| compare | tick two, then **Compare iN and iM** (`/articles/<id>/compare?a=&b=`: sections and findings side by side, ops applied and refused, failed checks, both cuts) | +| **Delete iN** | the plan, then **Confirm delete** (common's `deleteIteration` under the registry's lock). Refused: the current article or video, the iteration the report came from, a running one, one another revises or copies | +| **Refresh…** (the tab's head) | [refresh.md](refresh.md) | + +A `research` iteration carries its research queue: each acquisition with **Yes** / **No**, and **Continue into a sweep** +once nothing is pending (OPERATING.md, "Research runs"). The tab's head: the count, which is the article and the +video, the article's spend and the day's against the daily cap. + +### Reading and noting (the Article tab) + +The article in a ~70ch column, its notes in a rail (a drawer below 1100px); its video under the title takes timed notes +(`n` with the video focused, or **Mark**). + +| To note | Do | +|---|---| +| a passage | select it → **Note** (or `n`) | +| a section | **+ note** on its heading | +| a citation | click it → the evidence panel → **+ note on this citation** | +| the article | **+ whole article** | + +A passage note keeps its quote and 32 characters either side and is found again in the text as it is now (exact, then +normalised, then by its surviving context); one whose quote is gone is **orphaned**. Keys: j/k move, `r` resolves, `e` +edits, `n` notes, Escape closes. `?status=` and `?note=` open the rail on a filter or a note. **Copy agent brief** +copies `/api/notes/context` (the `umtool notes` digest; [notes.md](notes.md)). Open notes are `open-note` calls in the +Inbox. + +### Evidence + +A citation's panel: its quote, speaker, date, label and link; ±6 cues of its record, the cited ones marked (click to +seek); media, best first — the site's prepared clip, a clip window the editor fetched, a saved video or audio file, +else the `fetch_clip` line (umtool never runs yt-dlp for it). A post shows its text and capture. The walk +(`…/evidence?c=<id>`) is the same panel one citation at a time: j/k (or ←/→), space plays, `n` notes. + +**Add to video** (with a linked project) puts the cited span at the end of its timeline as a clip; the manifest is +snapshotted first, so the Cut tab's **Undo** takes it back, and a generated manifest gets an `edit` note. + +## A song (`/projects/<path>`) + +| Tab | Holds | +|---|---| +| **Overview** | the Next card, the song's decisions, the four cut slots (**All cuts →**), This song (cuts, variants, verdicts, plans, cover, looks done; **copy this song**), Song tools, the README | +| **Cuts** | the four cut cards (poster, verdicts, the slot's and the file's notes, variants), what matches no cut name | +| **Spec** | the spec sheet, the plans and their notes, `clips.csv` | +| **Cover** | the cover bench ("No cover generated for <id> yet" when none) | +| **Notes** | the note on the song; every other note, each linking the tab it is on | + +A cut's page, `/projects/<path>/<cut>`, is the Cuts tab's view of one cut (the four cuts beside the title; the cut +bench, loudness, provenance). **The canonical address is the full path**; a bare basename resolves when unique. +`?note=<target>` opens the tab it is written on: `song` → Notes; `cut:` `file:` `moment:` `source:` `clip:` → Cuts; +`plan:` → Spec; `thumb:` → Cover. The cut page keeps `?v=`, `?plan=`, `?notes=all`. + +## Projects: kinds, ids, routing + +A **project** is a directory under `REPORTS_ROOT` holding one piece of work; umtool finds them by walking the tree +([folders.md](folders.md)). A **kind** is what it is; a **template** is which configuration of that kind. + +| kind | template | marker | what it is | +|---|---|---|---| +| `report-video` | `cited-timeline` | `video.manifest.json` | a sweep report said in the sources' own voices | +| `song` | `um-song` | `spec.json`, `verdicts.json`, or any cut | filler sounds playing a game tune | +| `sweep-report` | `sweep` | a `*sweep*.md` and no manifest | a report that is not yet a video | + +- **Detection**: `project.json` (`{kind, template}`) wins; otherwise every kind's `detect()` runs on the entry NAMES. + Two matches is an `ambiguous-project` decision, never a guess. +- **An id is a PATH** relative to `REPORTS_ROOT` (`ferret-rescue`, `quartering-uh-song/videos/yoshi`), never the + basename. A bare basename resolves only when unique; two projects sharing it get a page listing both canonical paths. +- **`shadowed`** — the first segment is `at` (`RESERVED_BROWSE`, held equal to `app/projects/`'s static pages by an e2e + spec): listed with a blocking decision, opened at `/projects/at?path=…`. **`unroutable`** — the name fails + `isSegment()`: an info decision, opened the same way. +- **Delete project** (⋯; `POST /api/projects/delete`, `lib/report/delete.mjs`): the plan (the directory with its size + and biggest parts, and a media copy `umtool storage` linked), then **Confirm delete** or **Keep it**. Refused: a + link or a path through one, one a umtool job works in, an article's current video or a running iteration's project; a + manifest naming an article with a video attached needs **delete anyway**. Nothing outside `REPORTS_ROOT` and + `MEDIA_ROOT` is touched. + +**Adding a kind** — a registry entry and one view, nothing else: + +1. `lib/projects/kinds.mjs`: `id`, `template`, `label`, `badge`, `detect(names)`, `stages`, `decisionKinds`, and + optionally `summarise`, `signature`, `decisions`, `views`, `piece` (its stepper flow). +2. A component in `components/projects/` and a case in `ProjectView.tsx`. + +`e2e/projects.spec.ts` fails when a kind id is written outside `lib/projects/` and `components/projects/`, when +`RESERVED_BROWSE` drifts from the real static pages, and when a kind injected through `E2E_UMTOOL_EXTRA_KINDS` does not +reach the index, the chips and the CLI with no code edit. + +| File | What | +|---|---| +| `lib/projects/kinds.mjs` | the registry (plain ESM, server-only) | +| `lib/projects/walk.mjs` | the folder walk, routing, collapsing | +| `lib/projects/{report,song,sweep}.mjs` | per-kind reading | +| `lib/projects.ts` | the app's façade: caching, dispatch, the index, `resolveProjectPath` | +| `lib/pieces.ts`, `lib/pieces/*` | the piece graph, ids, the frame, the tabs and the stepper | +| `lib/project-types.ts` | types only, no `node:` import ever | + +## Discovered by getting it wrong once + +**`lib/projects/kinds.mjs` is server-only**, despite being plain ESM: it imports the per-kind modules and those read +the disk, so a client component importing it drags `node:fs` into the browser bundle. It passed `tsc` and 500'd every +page. A client component takes `lib/project-types.ts`. `pnpm build`, not typecheck, catches it. + +**Watch the import cycle.** `songIds()` lives in `lib/projects/song-ids.mjs` because in `song.mjs` it closes `song → +walk → kinds → song`; Turbopack then evaluates `kinds.mjs` mid-initialisation and every song page 500s with "Cannot +access 'CUT_NAMES' before initialization". Nothing prerenders, so a build does not see it; a page render does. + +**Do not write a root path out by hand.** The song-decision dispatch had the production path hard-coded, so under the +e2e fixture no song decisions were produced at all and the Inbox looked clean because it was empty. + +**Caches live on `globalThis`.** A module-level cache is one copy per Next bundle, so an API route's invalidation never +reached the page rendered next (a new project 404'd; a deleted piece stayed on Work for 15 s). diff --git a/umtool/docs/projects.md b/umtool/docs/projects.md @@ -1,129 +0,0 @@ -# Projects - -A **project** is a directory under `REPORTS_ROOT` that holds one piece of work. -umtool finds them by walking the tree; nothing registers itself and nothing had -to move on disk for this to exist. - -## Kind vs template - -A **kind** is what a thing *is*. A **template** is which configuration of that -kind it is. `um-song` is not a kind — it is the one template of the `song` kind -that exists so far, and the distinction is the whole point: the next thing this -tool has to hold (a supercut, a cover set, a vertical short) will be a new -template of an existing kind at least as often as a new kind. - -Three kinds ship: - -| kind | template | marker | what it is | -|---|---|---|---| -| `report-video` | `cited-timeline` | `video.manifest.json` | a sweep report said in the sources' own voices | -| `song` | `um-song` | `spec.json`, `verdicts.json`, or any cut | filler sounds playing a game tune | -| `sweep-report` | `sweep` | a `*sweep*.md` **and no manifest** | a report that is not yet a video | - -`sweep-report` earns its place on day one because `~/reports/hasan-bike` is one, -and because a kind with no decisions, no build and no rich read is the cheapest -possible proof that the registry is extensible. - -## Detection - -`project.json` (`{kind, template}`) wins outright, so a directory can always -declare itself. Otherwise every kind's `detect()` runs against the directory's -entry NAMES — no reads, no stats. - -**Two matches is an error, never a guess.** A directory that is two kinds is a -bug, and picking one would hide it; it gets an `ambiguous-project` decision -instead. - -## Identity: an id is a PATH - -A project's id is its POSIX path relative to `REPORTS_ROOT` — -`ferret-rescue`, or `quartering-uh-song/videos/yoshi`. Not the basename: bare -names collide across folders (a second `pokemon` is a matter of time) and the -path is what makes a link stable. - -A **bare basename still works as a URL**, because `/browse/yoshi` and -`/browse/yoshi/wide` are the addresses that exist in every decision href, every -spec, and whatever anybody has open. It resolves **only when unique** — two -projects sharing a name is precisely why an id is a path, so that case reports -the collision and offers both canonical URLs rather than picking one. - -## Two ways a project cannot be opened - -Both used to fail **silently**, which is worse than either. - -**`shadowed`** — the first path segment is a static page under `app/browse/` -(`decisions`, `faces`, `find`, `sources`, `trim`, `at`). A static segment beats a -dynamic one, so `/browse/find` renders the phrase console no matter what is on -disk. The project is still listed, with a `blocking` decision, and its link goes -to `/browse/at?path=…`. - -**`unroutable`** — the name fails `isSegment()` (a space is enough). It has no -address of its own; it is listed with an `info` decision and reached the same way. - -`RESERVED_BROWSE` is asserted by an e2e spec to equal the real directory listing -of `app/browse/`, so a tenth tool page cannot quietly make a project unreachable. - -## Deleting a project - -**Delete project** on a report-video project's page (`POST /api/projects/delete`, -`lib/report/delete.mjs`) is the "new project" door's other half. It shows the -plan first — the directory with its size and its biggest parts, and, for an -`out/`, `clips/` or `share-*` that `umtool storage` linked to the media root, -that media copy — and removes it on **Confirm delete**. Refused: a project that -is a link or is reached through one, one a umtool job is working in, an -article's current video (an iteration project `current.json` names) or a running -iteration's project. A project whose manifest names an article with a video -attached needs **delete anyway** (the article keeps its attached copy). Any -other link is removed as a link; its target is kept and named. Nothing outside -`REPORTS_ROOT` and `MEDIA_ROOT` is touched, and neither root itself. - - -**A registry entry and one view. Nothing else.** - -1. Add an entry to `lib/projects/kinds.mjs`: `id`, `template`, `label`, `badge`, - `detect(names)`, `stages`, `decisionKinds`, and optionally `summarise`, - `signature`, `decisions`, `views`. -2. Add a component to `components/projects/` and a case in `ProjectView.tsx`. - -`e2e/projects.spec.ts` enforces this three ways, and they are the assertions that -fail when somebody special-cases a kind in a page — which no page test can see: - -- **no kind id is special-cased outside `lib/projects/` and - `components/projects/`** — a grep for lines carrying both a kind id and the - word `kind`; -- **`RESERVED_BROWSE` equals the real static pages**; -- **a kind injected through `E2E_UMTOOL_EXTRA_KINDS` reaches the index, the chips and - the CLI with no code edit at all**. - -## Where the code is - -| file | what | -|---|---| -| `lib/projects/kinds.mjs` | the registry. Plain ESM, no TypeScript | -| `lib/projects/walk.mjs` | the folder walk, routing, collapsing | -| `lib/projects/{report,song,sweep}.mjs` | per-kind reading | -| `lib/projects/core.mjs` | the CLI's assembled view | -| `lib/projects.ts` | the app's façade: caching, dispatch, the index | -| `lib/report/delete.mjs` | deleting a project or a take: the plan, then the delete | -| `lib/project-types.ts` | types only, **no `node:` import ever** | - -## Discovered by getting it wrong once - -**`lib/projects/kinds.mjs` is server-only**, despite being plain ESM. It imports -the per-kind modules and those read the disk, so importing it from a client -component drags `node:fs` into the browser bundle — which this repo has already -been bitten by: it passed `tsc --noEmit` and then 500'd every page. A client -component takes `lib/project-types.ts` and gets the rest as props. **`pnpm build`, -not typecheck, is what catches a regression here.** - -**Watch the import cycle.** `songIds()` lives in its own module -(`lib/projects/song-ids.mjs`) because putting it in `song.mjs` closes -`song → walk → kinds → song`. Plain node survives that; Turbopack evaluates -`kinds.mjs` while `song.mjs` is still initialising and every song page 500s with -"Cannot access 'CUT_NAMES' before initialization". `pnpm build` does not see it -either — nothing prerenders. A page render does. - -**Do not write a root path out by hand.** The song-decision dispatch had the -production path hard-coded, so under the e2e fixture — whose songs live elsewhere -— *no song decisions were produced at all* and the inbox looked clean because it -was empty. diff --git a/umtool/docs/recurring.md b/umtool/docs/recurring.md @@ -0,0 +1,71 @@ +# Recurring reports + +## Two shapes + +The same topic, updated at an interval. The EDITOR keeps the schedule and runs the ticks (its `report-schedule` lane, +armed at boot unless `ARCHILYZER_IDLE_BOOT`); umtool shows and edits a schedule and never runs a timer. + +| Shape | What each tick does | +|---|---| +| **Living report** | One article kept current: a [refresh](refresh.md) (its own fetch, then what changed, then the update). The result is an iteration-ready card; "Make each update current without review" makes it current (default off). The first tick, with no report yet, is the article's first sweep. | +| **Series** | A new dated **edition** over whole days since the last: the day after the previous edition's end through the day before the tick (weekly on Mon 06:00 covers Mon … Sun before it). Fetch over the window's channels and dates, then a sweep with from/to. A window nothing matches is a quiet edition: recorded, no article, $0. A tick with nothing to cover yet makes no edition. | + +## Make one + +**+ Create** → **A recurring report** (`/create?make=recurring`), or ⌘K "New recurring report": + +1. **Living report** or **Series**; topic; question; scope — channels, or a board's (its channels, its date floor, its + query as the window check); cadence (**Daily**, **Weekly** on a day, **Every N days** at HH:MM, in the editor's + zone); a series' window check, or a living report's "Make each update current without review". +2. **Plan the schedule** — the editor's dry run: the first tick, the model, the per-tick cap, the daily cap, a series' + first window and title, what is worth knowing. **Change it** goes back to the form. +3. **Start the schedule** — writes it and opens the series page or the article. + +```sh +pnpm ops report-schedule --json '{"action":"create","shape":"series","topic":"Co-host updates","channels":["<slug>"],"cadence":"weekly mon 06:00","dryRun":true}' +pnpm ops report-schedule --json '{"action":"list"}' +pnpm ops report-schedule --json '{"action":"tick-now","id":"<id>"}' --wait +umtool schedule list | show <id> [--json] # read-only +``` + +## The series page, `/series/<id>` (piece `s:<id>`) + +- The cadence chip ("weekly · next Mon 06:00", "· paused"), **Pause schedule** / **Resume schedule**, **Tick now**, + **Edit cadence** (→ **Save cadence**), **Delete schedule** (the plan, then **Confirm delete** or **Keep it**; the + editions stay as articles). +- The tick in flight, as a job. +- The editions, newest first: a done one links its article; a quiet one is dimmed, with its window and why. +- The tick log: when, how (schedule or Tick now), status, edition, spend, why. +- What it asks: question, channels, board, window check, cadence and zone, model and cap. + +A living report's `/series/<article>` redirects to its article, whose head carries the same chip with Pause / Resume and +Tick now, and Edit cadence and Delete schedule in its **⋯** menu. An edition's head says "an edition of <series>". + +## Where it shows + +- **Work**: the **Recurring** facet (`/work?recurring=1`), the Series kind, the chip under a row's id. An edition is + not a Work row; its series is. +- **Inbox**: `tick-failed` (Your call, **Tick now**), `tick-held` (Your call, **Raise cap** → `/settings/generation`, + "up to $x a tick"), `edition-ready` (Review, **Review edition** → the edition's iterations). An edition raises no + iteration card of its own. +- **Running**: a `report-tick` is a generation row with its spend, linking the schedule. + +## Rules + +- **The lane's pause** is `settings.reportSchedule.held` (`pnpm ops lane {"lane":"report-schedule","held":true}`, or the + editor's pause): it stops new ticks; one in flight finishes. **Tick now** is the operator's word: not held by the + lane, still within the caps. +- **One tick at a time** machine-wide (queue `report-tick`), never two of one schedule. A missed window is ONE catch-up + tick (`missed` counts the rest). A resume or a new cadence re-plans from now. +- **No day is read twice.** A held or refused edition leaves no line; the next tick covers its window. +- A step refused or skipped in the fetch (a held or cooling platform, a channel no build holds) is a warning on the + tick, never its failure; a build that ran and failed fails it. + +## Where it is stored + +Written by the editor only, through `controller/reportSchedule.ts`: + +| Shape | File | +|---|---| +| Living | `transcripts/reports/<article>/schedule.json`, beside the article | +| Series | `transcripts/reports/.series/<id>/series.json`, its editions listed in it; each edition the store article `<series>-<YYYY-MM-DD>` | diff --git a/umtool/docs/refresh.md b/umtool/docs/refresh.md @@ -0,0 +1,81 @@ +# Refresh: fetch what is new, check it, update + +## What it is + +A **refresh** is an iteration of an article (kind `refresh`, its parent the iteration refreshed). It is ONE editor job, +`report-draft {"task":"refresh"}` on the queue `draft:refresh`. umtool plans it, confirms it, shows what it found and +suggests it; the editor runs it. + +```sh +umtool refresh <article> [--iteration N] [--no-fetch] [--yes] [--json] # the plan; --yes starts it +umtool refresh --check [<article>] [--force] # the daily check, now +pnpm ops report-draft --json '{"task":"refresh","article":"<id>","dryRun":true}' +pnpm ops report-draft --json '{"task":"refresh","article":"<id>"}' --wait +``` + +## Where + +| Surface | What | +|---|---| +| the article piece's **⋯** → **Refresh…** | opens the plan | +| the Iterations tab's **Refresh…** | the same plan | +| `?refresh=1` on the article's address | the same plan; the Next card's and the Inbox card's **Refresh** link here | +| the Overview's **Refresh · i<n>** card | the last refresh: its state, line, new recordings, changed quotes, sources gone, fetches and build, spend; **Review in Iterations →** once it has a report | +| the Iterations tab | a refresh's line on its card | + +## The plan, then Refresh + +The dialog says, before anything runs: + +- **Refreshes** — the iteration (i<n>, kind, made, the question). +- **Searched again** — the queries, the match set then, the quotes read again. +- **Fetch** — each channel's actions (`sync`, `refresh-report`, `transcribe-bucket`, `fetch-posts`), or "skipped — <why>" + (a platform held or cooling down). +- **Build** — the site whose build holds the channels: "locally, if anything changed — never deployed". +- **Update** — model, extractor, "spends up to $X", the rate, today's spend. +- Refusals and warnings (an older parent: "changed recordings are not tracked before <date>"). + +**Refresh** starts it ("Refresh i<n> is running (job …)"); **Cancel** closes it with nothing written. + +## The three stages + +1. **Fetch (no model).** The report's scope plus every channel its citations touch: the editor's own paced `sync` per + video channel, `refresh-report` and `transcribe-bucket` for ONLY what landed, `fetch-posts` per posts channel, then + a local `publish build` of the site holding them (through the publish lock; never a deploy). Each step is waited + for, up to 6 h, then read as it is. +2. **What changed (no model).** The original enumeration again with the iteration's recorded terms and scope: **new** + recordings (ids not matched before, late transcripts included), **changed** ones (matching lines moved), and every + cited quote re-read on today's transcript (moved, drifted, missing; deleted or private on the platform; `en` vs + `en-orig`). Written as the iteration's `refresh.json`. **Nothing changed → the iteration ends "no change", $0.** +3. **Update (model).** Runs on its own when stage 2 found anything, within the caps: a sweep restricted to the new and + changed ids (the sweep's `ids` restriction), then a revision of the parent with those findings and the drift fixes. + A cap refusal ends `held-by-cap` with the estimate. The result is an **iteration-ready** card; making it current + stays yours (**Use this iteration**). + +`refresh.json` `status`: `running`, `no-change`, `updated`, `held-by-cap`, `failed`, `cancelled`. The iteration ends +`done` whatever the refresh's status; only a failed revision or a cancel fails it. + +## The daily check and its cards + +Once a UTC day per active store article with a current report (parked, done and muted skipped), umtool re-runs +stage 2's enumeration alone — no fetch, no model, at most 12 queries — over the build the iteration read when it is on +this machine and holds every channel of the scope, else Research's local corpus when that does. Neither: the entry is +`unchecked` with the reason, never "0 new". Kept in `REPORTS_ROOT/.umtool/refresh-check.json`; checked in the +background in the app's server only (`UMTOOL_REFRESH_CHECK=0` turns it off; the e2e server does). + +| Card | Group | Action | +|---|---|---| +| `refresh-available` — "3 new recordings mention this since <date>" | Review | **Refresh** | +| `refresh-held` — the newest refresh held by the cap | Your call | **Refresh** | + +A card goes when a refresh made after the check exists or one is running. + +## Code + +| Module | What | +|---|---| +| `common/lib/report/draft/refresh/` | `refresh.json` (`types.ts`), the basis (`basis.ts`), the delta (`delta.ts`), stage 1 (`fetch.ts`), the task (`task.ts`) | +| `common/controller/reportRefresh.ts` | the editor's side: the target iteration, the plan, the enqueue, `fetchScope` (stage 1 for any scope; R5's ticks call it) | +| `umtool/lib/articles/refresh.ts` | plan, start, read; `GET/POST /api/articles/refresh` | +| `umtool/lib/inbox/refresh.ts` | the daily check and the two cards; `POST /api/articles/refresh/check` | +| `umtool/components/articles/Refresh{Dialog,Summary,Watch}.tsx` | the dialog, the Overview's card, its 4 s re-read while running | diff --git a/umtool/docs/report-video.md b/umtool/docs/report-video.md @@ -119,7 +119,7 @@ Destiny, on a call. It is deliberately not a decision in the inbox: the fix belongs to the next sweep, not to this manifest, and nothing here can close it. `correctionsOf()` is -the one definition; the project page lists it and `umtool corrections <project>` +the one definition; the Cut tab lists it and `umtool corrections <project>` prints the same list as markdown with the QR's own moment link per bullet, ready to paste into the next prompt. @@ -181,7 +181,7 @@ is somebody checking that claim against the audio. **The note is not always a complaint.** On a confirmed clip `correction` says why a good clip's window moved, or something a reader should know; on an incorrect one it says what the report got wrong. `umtool corrections` and the -project page split on the *verdict*, not on "has text", so the next pass is +Cut tab split on the *verdict*, not on "has text", so the next pass is never sent to fix a clip nobody complained about. **An incorrect verdict with no note is a complaint nobody can act on**, so the @@ -204,7 +204,7 @@ the explicit value, so those entries can still be cleared — a rule that refuse to let somebody undo a note they wrote before the rule existed would be a trap. `reviewOf()` is the one definition of coverage — the bench header's -`N reviewed`, the project page's "Walk the cut" button and `umtool corrections +`N reviewed`, the Cut tab's **Walk the cut** and `umtool corrections <project>` all read it, and `walkReadiness()` reads the same verdict rule to decide what the walk VISITS (unjudged and fetched — see [clip-bench.md](clip-bench.md#what-the-walk-skips)), and the last opens with @@ -573,7 +573,7 @@ predicate: a large rise or fall between claims — fluctuation is usually the A seventh **optional** field, `roles`, records who he named when he enumerated rather than counted. It is not part of the gate — see [claim-bench.md](claim-bench.md). -Rule on them at [`/browse/<project>/claim/<id>`](claim-bench.md). +Rule on them at [`/projects/<project>/claim/<id>`](claim-bench.md). ## One manifest, two cuts @@ -666,8 +666,8 @@ end against the latest clip end, so a clip past the transcript's end reads as availability from `out/availability.json` with its age, or "never checked"; and the cite target — derived `${siteOrigin}/?v=…` or the per-clip `citeUrl` override, marked as such when it differs (every clip in one real manifest -carries a `citeUrl`; only the Rumble ones point elsewhere). The project page, -`umtool show` and the dashboard's Sources panel all read this one function. +carries a `citeUrl`; only the Rumble ones point elsewhere). The Sources tab, +`umtool show` and Settings · system's Sources panel all read this one function. Nothing in it probes. ## Revisions, instead of `.bak` @@ -685,7 +685,7 @@ labelled `built-<file>`, so the file and its description stay paired. ## Notes have a home -`README.md` renders at the top of the project page. Provenance splits by +`README.md` renders on the Overview tab. Provenance (the History tab) splits by shape: scalars and URLs stay in the table; any string over ~120 characters or containing a newline (`coverage`, `transcriptGapNote`, `qrNote`, `revisionNote`, `asrCaveat`, …) reads as a titled paragraph under **Notes**. Other `*.md` files @@ -694,7 +694,8 @@ there too. No field is moved or rewritten. ## Takes: alternative renders, judged side by side -`/browse/<project>/takes`, linked from the project page when `takes/` exists. +`/projects/<project>/takes` (a bench: [piece.md](piece.md#the-benches)), linked from the Cut tab as **Takes — N** +when `takes/` exists. Something else renders the takes; umtool reads them and records the verdicts. ``` @@ -727,10 +728,10 @@ gone shows as missing. Notes on a project live in `<project>/notes.json` (shape and CLI: [notes.md](notes.md)): **row notes** on a timeline entry (`entry` anchor, an open -count per row on the project page and in the clip bench), **take notes**, **timed +count per row on the Cut tab and in the clip bench), **take notes**, **timed notes** and **edit notes**. -**Timed notes.** On the built cut (On-screen → the built video), on every take +**Timed notes.** On the built cut (the Build tab's final video), on every take preview and on an article's report video: `n` with the video focused, or Mark, writes a note at the playhead, and the tick strip under the player seeks. On a project the second is resolved against the build's `schedule.json` (the @@ -743,8 +744,8 @@ a mark is exact when the lengths match within 0.25 s and `approx` when they differ, when the schedule is estimated, or when the second is a held frame past the clip's source. `lib/report/moments.mjs`, `GET /api/report/moment`. -**Generated manifests.** A manifest with `generatedBy` shows one line on the -project page, the clip bench and the On-screen section: "Generated by +**Generated manifests.** A manifest with `generatedBy` shows one line on every +tab of its piece, the clip bench and the On-screen section: "Generated by `<generatedBy>`; a rebuild of manifests overwrites edits made here." Edits are still allowed. Every manifest writer ROUTE goes through `withEditNotes` (`lib/report/guard.ts`), which diffs the manifest before and after and records @@ -756,12 +757,12 @@ tool and is not wrapped. ## Structural edits -The project page's timeline re-orders by drag or alt+↑/↓; each row's ⋯ menu +The Cut tab's timeline re-orders by drag or alt+↑/↓; each row's ⋯ menu duplicates it, removes it, or inserts a clip after it -(`<channel>/<video>@<start>-<end>`). The On-screen section edits a teaser's lines, +(`<channel>/<video>@<start>-<end>`). The On-screen section (the Media tab) edits a teaser's lines, beat, tail, tail wait and dip; the posts (add, edit, remove); and each verdict's label and colour and the stamp seconds. An article's citation can be added to the -end of a linked project's timeline ("Add to video", [sites.md](sites.md)). +end of a linked project's timeline ("Add to video", [piece.md](piece.md#evidence)). All of it is `POST /api/report/timeline` (`move`, `remove`, `duplicate`, `insert`, `teaser`, `post`, `post-remove`, `factcheck`, `undo`; `GET` gives the token), with @@ -782,7 +783,7 @@ byte-identical. ## Exports `umtool export <project> --format toc-bbcode|toc-markdown|description|chapters` -and the Export row on the project page (one copy button per format, per +and the Deliver tab's export row (one copy button per format, per variant with anything on disk). All derived from the manifest plus the build's offsets — `out/<variant>/chapters.ffmeta` when present, else `segmentOffsets()` over the segments, else a refusal with the reason. `toc-bbcode` reproduces the @@ -809,23 +810,24 @@ and `WORKER_TOKEN` as a clip fetch, from the server's environment) and keeps eac sound in `out/narration/`. The README's "Narration" section has the shape, the rules and the validator. -**The narration review** — `/browse/<project>/narration`, linked from the -project page as **Narration — N** — is the script card by card before synthesis: -the words beside what the card shows, who drafted them, Approve / Reject (a note -required) / Save words / Play. `GET|POST /api/report/narration`, +**The narration review** — `/projects/<project>/narration`, a bench linked from the +Media tab's narration section — is the script card by card before synthesis: +the words beside what the card shows, who drafted them, **Approve** / **Reject with a +note** (`a` / `r`, the verdict bar on the card in hand) / **Save words** / **play**. `GET|POST /api/report/narration`, `POST /api/report/narration/play` (a job: `narrate-via-editor.mjs --only`), `GET /api/report/narration/audio`. Once a narration verdict exists, a build refuses any hand-written narrated card not approved on its current words (`--narration-unreviewed` builds unreviewed and edited ones; a rejected one never). -**The drafts review** (release 28) — `/browse/<project>/review`, linked as -**Review drafts — N** when a draft task wrote a field — lists every drafted -field (on-screen text, a narration, a teaser's lines, the cut's order, the -flips, the threads, the YouTube text): who drafted it, its value, Approve / -Reject (a note required), and the alternatives a task kept for a field that is -the operator's, each with **Use this**. The same badge sits beside the field in -the On-screen table, the teaser editor and on the narration page. Verdicts — +**The drafts review** (release 28; P4b made it the Media tab and a bench) — the +Media tab lists every drafted field (on-screen text, a narration, a teaser's lines, +the cut's order, the flips, the threads, the YouTube text): its provenance, its +value, **Approve draft** / **Reject** (a note required), and the alternatives a +task kept for a field that is the operator's, each with **Use this**; +`/projects/<project>/review` (**Review drafts — N**) walks the same fields one at a +time ([piece.md](piece.md#media)). The same badge sits beside the field in the +On-screen table, the teaser editor and on the narration bench. Verdicts — the narration's included — live in `drafts.review.json` beside the manifest (release 25's `narration.review.json` is still read); `GET|POST /api/report/drafts`. A final build refuses a drafted field not approved on its @@ -837,6 +839,6 @@ the operator's: its mark goes. The README's "The drafts review" has the rules. `check-sources` is one `check-availability.mjs --allow-missing` step per selected project — the driver's step 1, reused — through `startJob`, so it -serialises with builds and is cancellable. The dashboard's Sources panel starts -it over the never-checked and older-than-30-day projects; the project page over -one; `umtool check-sources` prints the chain. +serialises with builds and is cancellable. Settings · system's Sources panel starts +it over the never-checked and older-than-30-day projects; a project's Sources tab +over one; `umtool check-sources` prints the chain. diff --git a/umtool/docs/research.md b/umtool/docs/research.md @@ -0,0 +1,109 @@ +# 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 `<repo>/export/public` (whichever site was composed last) | +| `remote:<site>` | 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/<case>` (piece `c:<case>`) + +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 — `- <claim>: "<quote>" — + [<title> @ 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. + +## 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**. +- 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]]`, `/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). diff --git a/umtool/docs/settings.md b/umtool/docs/settings.md @@ -0,0 +1,55 @@ +# Settings + +`/settings` lists the two pages. The rail's Settings opens `/settings/system`. + +## Generation, `/settings/generation` + +The generation policy (`settings.generation`), read from and written through the EDITOR's settings action; an editor +that does not answer is said ("The editor did not answer …, so the policy is unknown. Start it, then reload."). + +- **policy**: the presets (`code`, `balanced`, `api`, `local`; the chosen one pressed — choosing one writes its routes; + a route set by hand makes it `custom`); **routes** (where each task runs: `code` = Claude Code, `api` = the Claude API, + `local` = the local model); **models** (the API model, the local model, the extractor an API sweep reads its batches + with); **caps** (USD per task, the daily cap, **Save caps** — the editor refuses a cap it will not take); **API key**: + the key FILE's path and whether it is there — never the key. +- **Spend today**: the editor's usage ledger for the UTC day, job by job (time, task, the article's iteration, the + models, USD), against the daily cap; **Last 7 days** on a Meter bar. + +The head says the policy in one line ("Generation: balanced · Claude Code: sweeps · API: report revisions, research · +local: video revisions, drafts"); Create's chip, an article's **policy** chip and a `tick-held` card's **Raise cap** link +here. OPERATING.md, "Generate and iterate", has the presets, caps and key rules. + +## System, `/settings/system` + +The machine and the collection at a glance, read from the index, the job registries and a few stats; nothing here +probes but **Check**. What is a call (a required tool absent, under 5 GB free) is an Inbox card linking here. + +| Panel | Says | Acts | +|---|---|---| +| **Tools & disk** | free space under the reports root; each tool's version or "absent" (red only when the report pipeline needs it), from the doctor's cache | **Check** / **Check again** (`POST /api/doctor`) | +| **Roots** | reports, media (or "= reports · UMTOOL_MEDIA_DIR unset"), the cache and whether an index exists, an old cache "not read; safe to delete" | — | +| **Index** | "N records · rebuilt <ago>" (and how many are for projects that are gone), or "No index — every read walks the disk." | **Rebuild…** (`umtool index --rebuild`, as a job in Running), **Prune…** (drops the stale records) | +| **Activity** | umtool's own running job (live) and the newest that ended | — | +| **Projects** | per kind, the six states as proportional segments (`stale` the one coloured state); the same header line as `/projects` | **Every project →**, a segment opens `/projects?kind=&state=` | +| **Deliverables** | built count and bytes, the newest, how many are stale | **Built →** | +| **Sources** | report projects never checked, older than 30 d, with dead or missing sources | **Re-check N projects** (one `check-sources` job) | +| **Storage** | every project's `out/` (here, on media, DRIVE MISSING, none) and its deliverables switch | **Move every out/ to the media root…**, **Move every out/ back…**, per project **Move out…**, **Move back…**, **Deliverables to media…** / **Deliverables home…** | + +**Plan, then confirm** (`components/system/ActionPlan.tsx`): every action that changes or moves anything asks for its +plan first (`POST /api/system/{index,storage} {…, dryRun: true}`: what it touches with sizes, what refuses, what is worth +knowing). The plan takes the focus; only its confirm (named for the result: "Drop 2 records", "Rebuild the index", +"Move out") acts, and it re-reads the plan and refuses (409) if it now refuses. **Keep it** or Escape closes it with +nothing written. A project is named by id, never a path; a busy one is refused alone, skipped in an "all". The moves run +`umtool storage …` as umtool jobs, the same CLI a terminal runs. + +## `umtool doctor` + +`umtool doctor [--json]`: the roots, then every tool with its version, exit 1 if the report pipeline is missing a tool +it cannot run without (ffmpeg, ffprobe, yt-dlp, qrencode). ImageMagick is probed as `magick` (IM7); a machine with only +`convert` cannot build a card, and the report says so. The app's cache of it is `lib/doctor.ts` (ten minutes). + +## `/api/jobs` + +`GET` → `{ running, jobs }`, one shape over umtool's two registries (`lib/jobs.ts` chain jobs, `lib/mix.ts` renders), +`no-store`. Their one-at-a-time rules differ (a chain is process-wide exclusive; a render is one ffmpeg call). The rail's +Running list adds the editor's jobs ([inbox.md](inbox.md#the-running-list-the-rails-foot)). diff --git a/umtool/docs/sites.md b/umtool/docs/sites.md @@ -1,132 +0,0 @@ -# /sites — every site's articles - -Every report on every site under `transcripts/sites/` — published and drafts — -read in place: no private site built, no port served. umtool **reads** the sites; -the one file it writes there is a report's `notes.json` (docs/notes.md). - -| page | what | -|---|---| -| `/sites` | every site (private first), every article: status, updated, citations, open notes, poster, video project, source draft. Filters are links: `?site=`, `?status=published\|draft`, `?notes=open` | -| `/sites/<site>` | its articles, its report videos (playable), the umtool projects they were cut in (takes, like/maybe/no), the workspace files they were written from (`?ws=&rel=` opens one) | -| `/sites/<site>/<report>` | the article with its notes (below) | -| `/sites/<site>/<report>?tab=source` | the article's workspace files, its own draft opened | -| `/sites/<site>/<report>/evidence` | every citation, one per screen (`?c=<id>`) | -| `/articles` | the homepage's article store (`transcripts/reports/`), the same columns; above it, the articles **in the making** (iterations, no `report.json` yet) | -| `/articles/new` | a new article: question, channels (the editor's), dates, the sweep (agent on Claude, pipeline on the local model), model, cap; and the **generation policy** | -| `/articles/<id>?tab=iterations` | the article's iterations (below) | -| `/articles/<id>/compare?a=<n>&b=<n>` | two iterations side by side: sections and findings (what the other lacks marked), ops applied and refused, failed checks, both cuts | -| `/drafts` | redirects to `/articles/new` | - -## Where an article comes from - -- **Site and reports**: common's `listSites`/`getSite` (site.json, the editor's - defaults), `listReportDirs` (the enumerator the editor's Reports tab uses), each - `report.json` through the report validator. **Published** = named in site.json - `pages`, in that order; every other report directory is a **draft**. -- **Source** (`lib/articles/sources.mjs`): the draft under - `~/reports/<ws>/polemics/drafts/` whose `id` or file name is the report id, - `polemic-` allowed on either side, preferring a workspace whose generator names - the site; the generator is the `*.py`/`*.mts` under `<ws>/polemics` or - `<ws>/site` that names the site or the report. Shown with its reason; written - into `notes.json` `source` on the first note. **Edit the draft, not - report.json** — the generator overwrites report.json. -- **Video project** (`lib/articles/links.mjs`): a report-video manifest with a - top-level `"article": "<site>/<report>"` is linked to that article and nothing - else (build-video.mjs ignores the key). Otherwise a manifest `slug` equal to the - report id (± `polemic-`) in the draft's workspace, when exactly one matches; - several are listed as "possible". - -## Generated articles: iterations (release 27) - -An article made by a model is a series of **iterations** (`i1`, `i2`, …: common's -`lib/report/iterations.ts`). umtool **starts** them and never writes one: each is -a `report-draft` job the EDITOR runs, asked over its ops API with the shared -`WORKER_TOKEN` (`lib/articles/generation.ts`). The token stays on the server. - -| on an iteration | what happens | -|---|---| -| **Use this iteration** | the article's `report.json` becomes its report — common's `makeCurrent`, the registry's writer (locked, validated; the audience and the attached video kept) | -| **New iteration** | a `revise-report` or `revise-video` of it, from feedback, on a model | -| **Copy with model** | the same kind, base, question or feedback, on another model | -| **Narrate** | a narration step over its cut, on a model | -| **Cancel** | `job cancel` on its editor job; the log's last lines are polled every 2.5 s while it runs | -| **Make the video** | the chain (`lib/report/chain.mjs`) as a umtool job: its ten steps, each one's status, resume or **from** a step, cancel | -| **compare** | tick two, then **Compare iN and iM** | -| **Delete iN** | the plan (its directory and its project, with sizes; what refuses), then **Confirm delete** — common's `deleteIteration` under the registry's lock. Refused: the current article or video, the iteration the article's report came from, a running one, one another revises or copies | - -**Delete article** (on any article of the store, in the making too) shows the -plan — the article's directory, its iterations' projects, its staged exports, -what is kept — and deletes on **Confirm delete** (common's `deleteArticle`; a -chain of it running here refuses). A published article offers **delete anyway**, -which unpublishes it first. `/articles?deleted=<id>` says what went. - -The list shows each one's kind, model, parent, copy, status, cost per model, -minutes, ops applied and refused, and checks; which is the article and which the -video; the article's spend and the day's API spend against the daily cap (the -editor's usage ledger). A `research` iteration carries its research queue -(`ResearchSlot`). - -**The policy** (`/articles/new`) is `settings.generation`: the presets (`code`, -`balanced`, `api`, `local` — each writes its routes), a route per task, the -models, the caps. It is written through the editor's settings action. The API -key is never shown or taken: only its file's path and whether the file exists. - -## Reading and noting - -The article renders in a ~70ch column with its notes in a rail (a drawer below -1100px). Its video sits under the title (`components/articles/ArticleVideo.tsx`) -and takes timed notes: `n` with the video focused, or **Mark**, notes the -playhead as a `moment` anchor on the article's notes ([report-video.md](report-video.md)). - -| to note | do | -|---|---| -| a passage | select it → **Note** (or `n`) | -| a section | **+ note** on its heading | -| a citation | click it → the evidence panel → **+ note on this citation** | -| the article | **+ whole article** | - -A passage note keeps its quote and 32 characters either side; it is found again -in the text as it is now (`lib/annotations/anchor.mjs`: exact, then -whitespace/quote/case-normalised, then by its surviving context) and marked. -One whose quote is gone is listed **orphaned**. Keys, when not typing: `j`/`k` -move, `r` resolves, `e` edits, `n` notes, `Esc` closes. `?status=` and `?note=` -open the rail on a filter or a note (the decisions inbox links to the note). -**Copy agent brief** copies `/api/notes/context` — the `umtool notes` digest. - -Open notes are `open-note` rows in `/browse/decisions` and on the dashboard. - -## Evidence - -A citation's panel: its quote, speaker, date, label and original link; ±6 cues -of its record's `transcript.cues.json`, the cited ones marked (click one to seek); -and media, best first: - -1. the site's **prepared** clip (`.export-index/sites/<site>/report-media/`); -2. a clip **window** the editor fetched (`data/<id>/clips/`); -3. a **saved** video or audio file in `data/<id>/` (through its media-tier link); -4. otherwise the `fetch_clip` MCP line to fetch it through the editor. umtool - never runs yt-dlp, and its own fetch client needs a project manifest. - -A post shows its text and its capture screenshot. The walk -(`/evidence`) is the same panel one citation at a time: `j`/`k` (or ←/→), -`space` plays, `n` notes. - -**Add to video** (in the panel, when the article has a linked video project) -puts the cited span at the end of that project's timeline as a clip -(`/api/report/timeline` insert): the manifest is snapshotted first, so the -project page's **Undo** takes it back, and on a generated manifest an `edit` note -tells the agent to port it into the generator's inputs. - -## Routes (read-only) - -| route | serves | -|---|---| -| `/api/sites/media?site&report&file` | a file in the report dir (video.mp4, poster.jpg, stills/…), byte ranges | -| `/api/sites/media?site&moment` | the prepared clip of a moment, via report-media/index.json | -| `/api/sites/media?corpus=<abs>` | a media file lexically under CHANNELS_DIR | -| `/api/sites/evidence?site&report&cite` | one citation's evidence (JSON) | -| `/api/sites/workspace?ws&rel` | a listed workspace file; HTML under a CSP sandbox | - -`SITES_DIR` (else `TRANSCRIPTS_DIR/sites`, else the checkout's -`transcripts/sites`) is where all of it is read; the e2e suite points it at its -fixture (`e2e/fixtures/sites-fixture.mjs`). diff --git a/umtool/docs/tools.md b/umtool/docs/tools.md @@ -0,0 +1,27 @@ +# Tools + +## `/tools` + +Two lists. **Song**: song piles, find, mix, faces, sources, a trim set. **Articles**: the verdict bench. While you are in +a tool the rail opens Tools into its tools: find · mix · **song ▸** (the four piles) · faces · sources · bench. + +| Tool | Address | What it is | +|---|---|---| +| Song piles | `/tools/song`, `/tools/song/<mode>` | the clip-judging deck, one pile at a time: `sort` (candidate clips never judged), `salvage` (clips parked as unclean, offered again), `verify` (accepted clips the risk check flagged, riskiest first), `keeps` (clips kept on purpose for a stray word, to side). `?limit=`, `?only=<ids>` | +| Find | `/tools/find` | every occurrence of a word across the song corpus: a GET form (`?q=`, `?page=`, `?list=<shortlist>`), filters as links, so a view is one pasteable URL | +| Mix | `/tools/mix` | the mix bench: set the handover and the end point, hear it, render it. A clip deep-links in with `?body=&start=&end=&from=&clip=` ([mix-from-a-project.md](mix-from-a-project.md)) | +| Faces | `/tools/faces` | every cover corner on record, deduped by episode and moment, the ones that ship first: judge the crop (`face-verdicts.json`, which `make-thumb.mjs` reads). `?cover=` / `?key=` open one | +| Sources | `/tools/sources` | where the song palette comes from: placements and clips per episode, the top episode, the top five, how many cover half | +| Trim | `/tools/trim/<set>` | a hook set's trims against the waveform, then **run the chain** (apply-hook-trims → pick-take → mix-hooks) | +| Verdict bench | `/tools/bench` | could a model propose a fact-check verdict well enough to review: runs of `archilyzer reports bench-verdicts`, each model's agreement and recalls against the bar (**passes the bar** / **fails the bar**), confusion matrices, the items; the bar is set here (`settings.generation.verdicts`) | + +A song's own page links its piles, find, mix and sources (its Overview's Song tools; [piece.md](piece.md#a-song-projectspath)). +The old addresses (`/sort`, `/salvage`, `/verify`, `/keeps`, `/mix`, `/bench`, `/browse/find`, `/browse/faces`, +`/browse/sources`, `/browse/trim/<set>`) redirect here. + +## The deck (`/tools/song/<mode>`) + +A clip at a time, its verdict and reason codes by key. Some of the keys: space play, `[` / `]` +1 s left / right, `,` +/ `.` un-expand a side, `A` play the whole window, `E` hear the expansion (shift+E applies it), `R` undo the +auto-expand, `M` another sound in this window, `W` the word, the digits a reason, Escape keep it. The deck's own legend +lists every key for the pile. diff --git a/umtool/docs/work.md b/umtool/docs/work.md @@ -0,0 +1,84 @@ +# Work + +## `/work` — every piece + +One lit list: every article (with the video projects it claims), every project no article claims, every series. An +edition of a series is not a row; its series is. A row: the title and id (and a schedule's chip), the stage on a step +bar, the kind ("article + report video" …), the lifecycle ("· looks done" when it does), open calls in Meter, and on the +lit line **Park** / **Mark done** (or **Reactivate**). **+ Create** in the head. + +The facets are links (any view is one pasteable URL), each chip with the count it would show; `/` focuses **Find a +piece** (a GET search, `q`). + +| Facet | Key | Values | +|---|---|---| +| Stage | `stage` | `research`, `article`, `video`, `deliver` — the one stage rule ([piece.md](piece.md#the-stepper)); a song files Spec → article, Cuts → video, Done → deliver | +| Kind | `kind` | `article`, `series`, a project kind id (`report-video`, `song`, `sweep-report`); a project kind also finds the article whose video it is | +| Lifecycle | `life` | `active` (the default), `parked`, `done`, `all` | +| Site | `site` | a site id (`articles` = the store); **site page →** opens `/sites/<site>` | +| Recurring | `recurring=1` | series and living reports | +| View | `by=site`, `sort=name` | **By site** groups by site; **By name** sorts | +| Also | `template`, `state`, `open`, `status`, `notes`, `audience` | the old lists' keys; each shows as a chip that takes itself off | + +`/browse`, `/articles` and `/sites` redirect here with their keys kept (`/articles` → `?kind=article&site=articles`, the +store's; `/sites` → `?by=site`). After a delete, `?deleted=<id>` (and `freed`) says what went. + +## `/projects` — every project, by folder + +The project grid the old `/browse` was: one card per project, by folder. **+ new project** (or `?new=1`) opens the +scaffold form; **copy the whole picture** copies every project as markdown. Server-rendered, no client JavaScript. + +| Filter | Key | Values | +|---|---|---| +| Kind / template | `kind`, `template` | registry ids | +| State | `state` | `draft` `windows` `fetched` `built` `shipped` `stale` | +| Decisions | `open` | `blocking`, `1` (any waiting) | +| Text / order | `q`, `sort` | substring over the haystack; `name` or `recent` | + +- **Counts come from the unfiltered set**, so a chip's number does not move under the cursor; an e2e spec holds the + number to the cards drawn. +- **One state vocabulary across every kind**, so "what is half-done" needs no "at what". A kind maps onto it; it does + not invent a seventh. +- **The cards carry no kind ids** (`components/projects/ProjectGrid.tsx`): a kind's summariser renders its own facts + (`19 clips · 4m46s · 17 sources`, `3/4 cuts · 2 variants`) and flags, and attaches `data-*` through `attrs`. +- **The poster** falls back: the deliverable → a built segment → a raw clip → nothing, served by + `/api/browse/poster?project=…`, which takes no client-supplied `rel`. +- **Listing never probes.** A summary is memoised against a signature of mtimes and sizes; `open` needs every kind's + reducer, memoised the same way. The footer says the index's health ("index: 9/11 fresh"). +- `/projects/<folder>` is the same grid under a folder. A bare name two projects share lists both canonical paths. + +## `/sites/<site>` — a site's page + +Its articles (status, updated, citations, open notes, the linked video and source draft), its report videos (playable), +the video projects they were cut in (their takes and like / maybe / no), and the workspace files they were written from +(`?ws=&rel=` opens one). Its articles open as pieces at `/sites/<site>/<report>` ([piece.md](piece.md)). + +- **Site and reports**: common's `listSites`/`getSite`, `listReportDirs`, each `report.json` through the report + validator. **Published** = named in `site.json` `pages`, in that order; every other report directory is a draft. +- **Source** (`lib/articles/sources.mjs`): the draft under `~/reports/<ws>/polemics/drafts/` whose `id` or file name is + the report id (`polemic-` allowed on either side), preferring a workspace whose generator names the site. **Edit the + draft, not `report.json`** — the generator overwrites `report.json`. +- `SITES_DIR` (else `TRANSCRIPTS_DIR/sites`, else the checkout's `transcripts/sites`) is where it is read; the e2e + suite points it at `e2e/fixtures/sites-fixture.mjs`'s fixture. + +| Route (read-only) | Serves | +|---|---| +| `/api/sites/media?site&report&file` | a file in the report dir (video.mp4, poster.jpg, stills/…), byte ranges | +| `/api/sites/media?site&moment` | the prepared clip of a moment | +| `/api/sites/media?corpus=<abs>` | a media file lexically under `CHANNELS_DIR` | +| `/api/sites/evidence?site&report&cite` | one citation's evidence (JSON) | +| `/api/sites/workspace?ws&rel` | a listed workspace file; HTML under a CSP sandbox | + +## Discovered by getting it wrong once + +**Tailwind's source detection is OFF, and the scanned directories are named in `app/globals.css`** +(`source(none)` plus `@source "../app"`, `"../components"`, `"../lib"`, common's report components). Auto-detection read +a scratch `NEXT_DIST_DIR`'s binary cache, took a garbage class candidate, and every page 500'd on a CSS parse error — +then it happened again from a doc that quoted the candidate. A doc, a fixture or a stray dist dir can no longer poison +the stylesheet. If you add a directory that holds class names, name it there. + +**`lmdb` must be in `serverExternalPackages`.** Bundled, Turbopack resolves its optional `moduleRequire('cbor-x')` and +fails the whole module graph — every page importing `lib/projects` 500s naming a package nothing here uses. + +**Every page is dynamic, so a `<Link>` prefetch is a full render.** The rail, the Inbox, Work and the tool lists do not +prefetch; a piece's tabs do not either.