commit 5b07e9e16298c2b4f2093f07d10c946591da3325
parent 2aaa03c35202fc6a5fad51015fe00044a3ca1187
Author: I Mean I'm Just Saying <imeanimjustsaying@kiwifarms.st>
Date: Wed, 14 Oct 2026 06:34:35 -0400
plans: umtool redesign — P4a-1 as shipped (the piece page frame, the section → tab map, the Signal sweep); CHANGELOG
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Diffstat:
2 files changed, 150 insertions(+), 1 deletion(-)
diff --git a/editor/CHANGELOG.md b/editor/CHANGELOG.md
@@ -46,6 +46,10 @@
- **umtool's rail shows what is running, the editor's jobs too, and what it costs.** The foot of the rail lists umtool's own job and the editor's live ones (`GET /api/ops/jobs?active=1`): each with what it is, what it works on, how far it is, queued or running, and a report draft's spend so far; the label row says **Running N** and the day's Claude API spend. A row links to its article when it has one, else to the editor's `/jobs`. Queued syncs and the editor's lane runners fold into one line ("+ 140 queued · 3 lanes"). When the editor's jobs cannot be read the rail says why — **Editor unreachable**, **Editor's WORKER_TOKEN not set** (it answered 503) — and never just "nothing running". It asks every 8 s, and not while the tab is hidden.
- **umtool's Inbox has a card for drafts nobody has reviewed.** A report video whose fields a model drafted (narration, on-screen text, the teaser, the cut, flips, threads, the YouTube text) and that are not approved is one card under **Review** ("Narration draft · 5 fields · by qwen3:8b"); **Review drafts** opens the project's review page, and the card goes once they are approved. The decisions API carries them as `drafts-unreviewed` rows, one per field.
- **umtool waits at most 5 s for the editor.** A read from the editor's ops API is given 5 s (a write 30 s) and a read is kept 2 s, so the rail, a page and a poll asking at once ask once; an editor that does not answer is said to be unreachable rather than hanging the page.
+- **umtool: a report video's page is a piece page.** `/projects/<project>` has a head — the title, the lifecycle (**Active ▾**: Park, Mark done, Reactivate, with Undo), **⋯** (Delete project) and the stage stepper (Research → Article → Video → Deliver, the piece's own; an article's video says whose it is and links it) — then seven tabs: **Overview** (the **Next** card, the project's decisions, its stats, the article and its iterations, the README), **Cut** (the walk, takes, the timeline, corrections), **Media** (the drafts, the narration and review links, the YouTube text), **Build** (the final video, the build chain, on-screen), **Deliver** (deliver, exports), **Sources** and **History** (revisions, provenance, notes). The tab is the address (`?tab=build`); an old link lands where it did (`?all=1` on the Cut, a note's link on the tab its anchor is on). Song projects keep their page.
+- **The Next card is the piece's top call in the Inbox, with its one action.** `n` runs it; `1`–`7` open the tabs. A parked or done piece's Next is **Reactivate**.
+- **A project-wide decision links the tab that settles it.** A build out of date or never built opens **Build**, the deliverables' storage **Deliver**, an unpunctuated source **Sources**; a clip's or a claim's still opens its bench, and a bench's way back is the **Cut**.
+- **umtool: links on a project page are ink, not Signal.** The teal is kept for the lit line and the one primary action (the Next card's, **Walk the cut**); the drafts panel, the review and narration pages, the iterations and the new-article form follow.
- **Articles, iterations, report-video projects and takes can be deleted, and every delete shows its plan first.** `archilyzer reports delete <id>` prints what would go — each path with its size, what is kept and why, and anything that stops it — and deletes nothing until `--apply`; `--iteration <n>` deletes one iteration. Deleting an article removes its directory (report, video, history, notes, iterations), each iteration's video project under `settings.generation.projectsRoot` and its staged exports. A published article is refused unless `--force`, which unpublishes it first; an article with a running iteration is always refused. An iteration is refused while it is the current article or video, the one the article's report came from, running, or the parent or original of another iteration, and its number is never given out again. The usage ledger, the shared prepared-media cache and the corpus's git history are kept. The same deletes run over HTTP as `pnpm ops delete-article {id, force?, dryRun?}` and `pnpm ops delete-iteration {id, n, dryRun?}`, which answer a refusal as a 409 with the plan.
- **umtool: Delete article, `Delete i<n>`, Delete project and `Delete take <id>`.** Each button reads the plan, shows it (what goes with sizes, what is kept, what refuses) and deletes only on **Confirm delete**; **Keep it** closes it. **Delete article** is on an article's page (one in the making too) and returns to `/articles`, which says what went; `Delete i<n>` is on each iteration of the Iterations tab. **Delete project** on a report-video project removes its directory, and its `out/` or deliverables on the media drive when they are its own copy; it is refused while a job works in the project, for an article's current video, and — unless you tick **delete anyway** — for a project whose manifest names an article with a video attached. `Delete take <id>` removes `takes/<id>/`; the take whose manifest is the project's own needs **delete anyway**, and its verdict and notes are kept.
- **Reports and their revisions can be generated by the editor: `pnpm ops report-draft`.** `{"task": "sweep", "article", "question", "channels"}` drafts a new report of an article as its next iteration; `{"task": "revise-report" | "revise-video", "article", "iteration", "feedback"}` revises one; `{"task": "narrate", "article", "iteration"}` drafts the narration of an iteration's video cut; `"copyOf": N` runs iteration N again on another `"model"`. Each is a **Report draft** job on /jobs, on the Claude API (`draft:api`) or the local model (`draft:local`) by the model, and `pnpm ops job cancel` stops one. Every quote a model writes must be the transcript's words within 90 seconds of its link, or the finding is dropped; links cite the archive, never the platform. The answer names the job and the iteration; the job's log ends with the outcome. Needs a restart of the editor.
diff --git a/plans/umtool-redesign.md b/plans/umtool-redesign.md
@@ -353,7 +353,7 @@ P0 design ─► P1 foundation ─┬─► P3 inbox/work/tools/URLs ─┬─
| P2b jobs + drafts | `ux/p2b` | in progress |
| R2 research boards | `ux/r2` | in progress |
| P5 create + settings | — | after R2 (consumes the board API) |
-| P4a piece page | — | after P2b |
+| P4a piece page | `ux/p4a` | P4a-1 shipped on the branch (the frame); P4a-2, P4a-3 next |
| R3, P4b, P6 | — | after R2 / P4a / all |
### P2a, as shipped
@@ -1017,3 +1017,148 @@ group shows the drafts cards beside the iteration cards.
· 5 fields", the model under it): a decision may carry its card's `what` (`summarizeGroups` keeps it), else the
kind's `WHAT` label (`drafts-unreviewed`: "drafts to review"). Gates: tsc and typecheck clean; unit 814, 0 fail;
`running.spec` + `inbox.spec` + `inbox-engine.spec` 20/20 through the umtool e2e entry.
+
+### P4a-1, as shipped
+
+**What.** A report video's project page (`/projects/<path>`) is a piece page: a frame around one tab of the
+sections `ReportProject` drew top to bottom, moved unchanged. Song projects (`SongProject`, `CutPage`) and sweep
+reports keep their pages (P4a-3); the article-rooted merge is P4a-2.
+
+- **The frame** (`components/piece/PieceFrame.tsx`, kind-blind): the head through `AppShell` — the trail
+ (`projects / <project id>`), the piece's title as the `<h1>`, the lifecycle chip, **⋯**, the page's status line
+ (`4 clips · 2 other · 0:12 · not built`, still the head's last `.micro`) — and under it, in a new `below` row of
+ `AppHeader`/`AppShell`, the stage **Stepper** (P1's) and, for an article's video, "a video of <article>". Then
+ P1's link **Tabs**, then the tab's body, then the Inbox's `UndoBar`.
+- **Which piece** (`lib/pieces/frame.ts`): the project's piece from P2a's graph (`pieceOfProject`) — `p:<id>`, or
+ the article's `a:<site>/<report>` when an article claims it — so the stepper, the lifecycle and the Next call are
+ the article's for an article's video. The stepper's bucket is Work's (`stageOf`: an article's own stage; a
+ project's `deliver` when it looks done, else `video`); lit by `stepsOf` (`lib/pieces/tabs.mjs`, pure): before the
+ bucket done, it current, after it to do, all done once the piece is marked done.
+- **The lifecycle chip** (`components/piece/LifecycleChip.tsx`): **Active ▾** / **Parked ▾** / **Done ▾** opening
+ Park and Mark done (active), Reactivate and Mark done (parked), Reactivate (done) — P3's `LifecycleButton`, the
+ same POST and Undo bar. **⋯** holds the project id and **Delete project** (the delete plan, unchanged). Both are
+ one small menu (`components/piece/Menu.tsx`): trigger disabled until hydrated; Escape, a click away or a
+ lifecycle change closes it.
+- **The Next card** (`components/piece/NextCard.tsx`, on the Overview): `readNextCall` narrows `readInbox()` to the
+ piece, groups and ranks it the Inbox's way (`summarizeGroups`), skips Quiet, and takes the top card: its `what`
+ (the Inbox's words, now `lib/inbox/what.mjs`, which `app/page.tsx` imports instead of its own table), its `why`,
+ the count in Meter, "then N more calls", and its ONE action, filled Signal — a link, or Mark done for
+ `looks-done`. A parked or done piece's Next is **Reactivate** ("2 calls hidden while it is parked"). Nothing
+ waiting says so, with no button. It streams in under a `<Suspense>` (the Inbox is read whole), so the page never
+ waits on it; the fallback is `data-next-pending`.
+- **Tabs, `?tab=`** (`lib/pieces/tabs.mjs`, unit-tested): Overview · Cut · Media · Build · Deliver · Sources ·
+ History, counts in Meter (Cut: clips; Media: drafted fields; Sources: recordings). `?tab=` and not a segment: it is
+ the canvas's address (`…?tab=media`) and the article page's own key (`?tab=iterations`), so P4a-2's merged piece
+ keeps one spelling — and a project id is a path resolved longest-prefix, with the leftover segments a VIEW the
+ kind declares (`clip/<id>`, `takes`, `review` …), so `/projects/a/b/build` could be a project called `build`.
+ **Old addresses land:** no `tab` is the Overview; `?all=1` (the cut's "show every quote") opens the Cut;
+ `?note=<id>` opens the tab its anchor is drawn on (a row's `entry`/`edit` note → Cut, a timed `moment` → Build,
+ read from the project's `notes.json`); `/browse/<project>` rides P3's redirect. A bad `tab` is the Overview.
+ `projectHref(id, { tab })` builds them (the Overview never written). Only the tab on show is read: the Sources
+ tab's cue reads, History's snapshot diffs and Deliver's exports cost nothing on the Overview. The Tabs primitive no
+ longer prefetches (P3's finding: every page is dynamic, a prefetch is a full render — seven per piece page).
+- **Keys** (`components/piece/PieceKeys.tsx`): `1`–`7` open the tabs, `n` runs the Next card's visible action
+ (while React reveals a streamed boundary a hidden copy waits in a `<div hidden>`; the key and the spec skip it).
+ Bound after hydration (`data-piece-keys="ready"`); never while typing, on a focused `<video>` (`n` there is a
+ timed note), inside an open menu or dialog, with a modifier, or after another handler took the key.
+- **A project-wide decision links its tab** (`lib/projects/report.mjs` `decisionTab`): `stale-build`/`unbuilt` →
+ Build, the deliverables' storage → Deliver (`out`'s → Build), `no-punctuation` → Sources; a clip's or a claim's
+ still links its bench. The clip, claim and takes pages' way back is the Cut (`projectHref(id, { tab: "cut" })`).
+
+**Section → tab** (the 14 sections `ReportProject` drew, plus its title bar's pieces; `SECTION_TAB` names each for
+`e2e/urls.ts` `section(project, name)`):
+
+| Section (its attribute) | Tab |
+|---|---|
+| Title bar: title, subtitle, channel / generated / cited / enumerated | head (title) + Overview (**This video** stats) |
+| Title bar: **Walk the cut** (`data-walk-cut`, `data-walk-start`, `data-ready-count`) | Cut |
+| Title bar: **Narration — N** (`data-narration-link`), **Review drafts — N** (`data-review-link`) | Media |
+| Title bar: **Takes — N** (`data-takes-link`) | Cut |
+| Title bar: the final mp4, **open in mix** (`data-mix-deliverable`) | Build |
+| Title bar: **Delete project** | ⋯ menu (every tab) |
+| `GeneratedBanner` (`generated-banner`) | every tab, above the body |
+| 1. README (`data-readme`) | Overview |
+| 2. Decisions (`data-project`, `data-decision`) | Overview |
+| 3. Sources + availability + **Tag cited** (`data-sources`, `data-tag-cited`) | Sources |
+| 4. `ReportBuildChain` | Build |
+| 5. `DraftPanel` (release 28) | Media |
+| 6. `OnscreenSection` (2152 lines, parked whole until P4b) | Build |
+| 7. `DeliverSection` (`data-deliver`) | Deliver |
+| 8. The cut: `FetchUnfetchedButton`, `TimelineList` rows (`data-entry`), show every quote | Cut |
+| 9. Corrections for the next pass (`data-corrections`) | Cut |
+| 10. Revisions (`data-revisions`, `data-snapshot`) | History |
+| 11. `YoutubeSection` (release 28, `data-youtube`) | Media |
+| 12. Export + podcast (`data-exports`, `data-export-variant`) | Deliver |
+| 13. Provenance (`data-provenance`) | History |
+| 14. Notes: prose and sibling `.md` files (`data-notes`) | History |
+| new: the Next card, the article and its newest five iterations (article store) | Overview |
+
+The sections live in `components/projects/report/{Overview,Cut,Media,Build,Deliver,Sources,History}Tab.tsx`,
+moved verbatim in `f0f53642` (each tab does its own reads); `ReportProject.tsx` reads the manifest's detail once,
+picks the tab and renders the frame.
+
+**The Signal-as-link sweep** (P1's ruling, done in `52c72351`): on the piece page and r28's files beside it, a link
+that wore `text-[var(--color-sel)]` is `.ink-link` (the tabs' clip, bench, mix, quote, cite, takes, provenance URL
+links; `DraftPanel`, `DraftsReview`, `NarrationPage`, `IterationsTab`'s Compare, `ResearchSlot`, `StructureEditors`'
+"+ add a post", `OnscreenSection`'s post link and "at m:ss" jump), and a state that wore it is ink: a timeline row's
+id, `DeliverSection`'s section letter, `OnscreenSection`'s current row (semibold) and current-entry readout, the
+build chain's `cutting` chip, `ChainPanel`'s start step, `IterationsTab`'s current card edge (`--muted`),
+`NewArticleForm`'s picked channels (the `on` chip: `--muted` edge, `--panel-2`). **Walk the cut** is the Cut tab's
+one filled action (`go`). Left as Signal, by rule: `focus:border-[var(--color-sel)]` on inputs (focus), and
+`OnscreenSection`'s current-segment fill in the strip and the posts window (`:1814`, `:1852` — the play-head). Left
+as noted: `OnscreenSection.tsx:283` `bg-[#0d0f14]` (the neutral video frame) and `:1739` `#000` (a preview's
+default background), frame stand-ins. r28's literal `/browse/…` hrefs on these pages now go through `lib/hrefs`
+(`clipBenchHref`, `takesHref`, `narrationHref`, `reviewHref`, `projectHref`, `projectsHref`, `mixHref`).
+
+| sha | what |
+|---|---|
+| `f0f53642` | the frame (head, stepper, lifecycle chip, ⋯, Next card, tabs, keys), the seven tab components moved verbatim, `lib/pieces/{frame.ts,tabs.mjs}`, `lib/inbox/what.mjs`, `projectHref`'s `tab`, `e2e/urls.ts` `section()`, AppHeader/AppShell `below`, Tabs without prefetch |
+| `52c72351` | the Signal sweep, r28's hrefs through `lib/hrefs`, benches back to the Cut, `decisionTab` |
+| `2953c0d9` | 19 specs open their section's tab through `urls.section` (46 gotos); Delete project via **More** |
+| `18d667f0` | `e2e/piece.spec.ts` (8); `stepsOf` pure and unit-tested |
+| `ceb02eff` | the streamed twin: `n` takes the visible action, the fallback is `data-next-pending`; `onscreen.spec` reads the teaser's timeline row on the Cut |
+
+**Gates.**
+
+| Gate | Result |
+|---|---|
+| repo-wide `tsc --noEmit` | clean at `f0f53642`, `52c72351` and the tip (umtool typecheck clean at every commit) |
+| umtool unit (`node --test umtool/lib/*.test.mjs umtool/lib/*/*.test.mjs umtool/report-to-video/*.test.mjs`) | 819 tests, 817 pass, 2 skipped, 0 fail (new: `lib/pieces/tabs.test.mjs` 5; `hrefs.test.mjs` +3 assertions) |
+| `pnpm --filter umtool test` | 11/11 |
+| `pnpm run test:scripts` (reads the capped build) | 970 tests, 968 pass, 2 skipped, 0 fail |
+| capped umtool `next build` (corpus linked, `MemoryMax=5G`) | exit 0, compiled 10.4 s, 33 s wall, 1.45 GB max RSS; the link removed |
+| full umtool e2e, run 1 (`18d667f0`) | 398 tests: 390 passed, 2 failed, 6 skipped, 8.2 min. Reds: `onscreen.spec:253` (asserted a timeline row on the Build tab), `piece.spec:52` (strict mode met the streamed twin) — both fixed in `ceb02eff`; then `piece.spec` + `onscreen.spec` 16/16 |
+| full umtool e2e, run 2 (`ceb02eff`) | **398 tests: 392 passed, 0 failed, 6 skipped** (the song-data capability skips), 8.0 min; `piece.spec` 8/8 |
+
+**Spec churn:** 19 specs changed (46 `goto`s now `urls.section(project, name)`; 4 tests also hop to a second tab —
+`report-longform` sources→decisions, `draft-review` review→onscreen, `onscreen` onscreen→timeline, `timeline-edit`'s
+`open(page, "onscreen")` for the structure editors; `clip-bench`'s two walk-start hrefs are `urls.clipBenchHref`;
+`article-delete` opens **More** before **Delete project**). No `data-testid` renamed. New: `e2e/piece.spec.ts` (8):
+the frame (title, trail, status line, stepper at Video, seven tabs, the Overview alone), the Next card = the Inbox's
+top card for the piece and its action, the tab as the URL (`?tab=`, `?all=1`, a bad tab, `/browse/…`, a click), a
+note's link opening the Cut, the lifecycle chip Park → Parked + Undo + Reactivate in the Next card → Reactivate
+(through `/api/pieces`), the keys (`2`, `7`, a digit typed in a field left alone, `1`, `n`), an article's video
+(`a:articles/zeta`, its link, its iterations), 1366×768 with no horizontal scroll.
+
+**Screenshots** (job scratch `p4a-shots/final/`, 17): an article's report video (`gen-projects/msurf/i1`) on
+Overview, Build and Media, and `reports/report-fixture`'s Overview, at 1366×768 and 1440×900, dark and light, on the
+e2e build. Against the canvas's Piece · Overview: the head (title in Archivo, the chip and ⋯ on the right), the
+stepper with the current stage Signal-ringed, the tabs with Meter counts and the Signal underline, the Next card with
+its Signal edge and one filled action, the two-column Overview (decisions and iterations | stats and the article).
+Differences: the trail sits above the title where the canvas has a kind · site micro line; the status line is on the
+head's right; Media is release 28's panels as they were (the canvas's per-field review list is P4b's).
+**Keyboard-only** (production build, both themes): the rail's 11 stops, the trail, **Lifecycle: Active**, **More**,
+the seven tabs, the Next card's action — each with the 2 px Signal ring (`transition-colors` delays the colour
+~150 ms on the chip, ⋯ and the filled action); Enter opens the chip's menu, Tab reaches Park, Escape closes; `4`,
+`1`, `n` from the body. The frame has no motion of its own.
+
+**Found and left.**
+- A project an article claims is still drawn as a project page (the article's stepper, lifecycle and Next call, and
+ "a video of <article>" in the head); P4a-2 renders it as the article's piece with Article/Iterations tabs.
+- A standalone report video's stepper shows Research and Article done (Work's bucket rule: a project is at Video
+ until it looks done). An article in the making that already has a video project is at Research (P2a's rule).
+- The Next card reads the whole Inbox and narrows it; on the live reports that is P3's measured 0.1–2 s warm, streamed
+ so the page does not wait. A per-piece reader would be cheaper; not needed yet.
+- `DraftPanel`'s and `OnscreenSection`'s many **Draft with** / save buttons are P1's `primary` (a Signal outline,
+ "an action that is interaction-led but not THE action") — left; P4b's Media tab decides them.
+- Activity rows (a build job's link) still open the Overview; only decisions carry a tab.