commit 351127a25b1ed907f0746b1911eb3e7ee551dd6c
parent be774680b2e8ffe1a9ed2d096fffd19481f45ac4
Author: I Mean I'm Just Saying <imeanimjustsaying@kiwifarms.st>
Date: Wed, 14 Oct 2026 08:39:01 -0400
plans: umtool redesign — P4a-2 as shipped (the article-rooted piece); [Unreleased] bullets
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Diffstat:
2 files changed, 134 insertions(+), 1 deletion(-)
diff --git a/editor/CHANGELOG.md b/editor/CHANGELOG.md
@@ -54,6 +54,10 @@
- **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: an article and its video are one page.** `/articles/<id>` and `/sites/<site>/<report>` are the article's piece: the head (the title, **Active ▾**, **⋯** with **Delete article** and the video's **Delete project**, the stage stepper) and nine tabs — **Overview** (the **Next** card, the iterations, the video's decisions, the article's sections, the Cut on show and any other cut), **Article** (the reader with its notes, and its **source** and **evidence** views), **Iterations**, then the video project's **Cut**, **Media**, **Build**, **Deliver**, **Sources** and **History**. The video is the project the current video iteration made, else the article's Cut; one whose directory is outside the reports root says it is not reachable here, and `?project=<id>` opens another the article made. The tab is the address (`?tab=cut`); a link with `?note=` opens on the tab the note is on (the article's on **Article**, the video's where its anchor is), and the reader's `?rv=` and `?status=` open **Article**. `1`–`9` open the tabs and `n` runs the Next card. Needs a restart of umtool.
+- **A video project an article claims opens as the article's page.** `/projects/<project>` (and `/projects/at?path=`) answers a 307 to the article's page on the same tab — the Overview, the Cut, a note's tab — so every old link and every Inbox card lands there; the clip and claim benches, takes, narration and review stay at the project's address and lead back to the article.
+- **The article's stepper says what exists.** Research is done when the article has iterations or a research board seeded it, Article when it has a report, Video when it claims a video project, Deliver when it looks done (a final video and a share batch, or published with its video); the first one missing is lit. An article drafted from a board names the board in its head and on its Overview.
+- **The generation policy is a chip on the article's page.** Its preset, the API model and the day's spend against the daily cap, linking the generation settings page.
- **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.
diff --git a/plans/umtool-redesign.md b/plans/umtool-redesign.md
@@ -354,7 +354,7 @@ P0 design ─► P1 foundation ─┬─► P3 inbox/work/tools/URLs ─┬─
| R2 research boards | `ux/r2` → `main` `b8561669` | LIVE 2026-10-14 (editor N0OAYPyM…, umtool 9lPefuiS…) |
| P4a-1 piece frame | `ux/p4a` → `main` `a92251aa` | LIVE 2026-10-14 (umtool ErWqdPdg…) |
| P5 create + settings | `ux/p5` | in progress |
-| P4a-2 article-rooted merge | `ux/p4a2` | in progress |
+| P4a-2 article-rooted merge | `ux/p4a2` | shipped on the branch, awaiting review |
| P4a-3 song pieces | — | after P4a-2 |
| R3, P4b, P6 | — | after R2 / P4a / all |
@@ -1394,3 +1394,132 @@ built (40 s) and restarted (`scripts/p4a-umtool.sh`). A first rollout attempt la
the then-live code into `.next` and was stopped before its restart; the build was let finish (identical code) and the
real rollout followed. Live: `/projects/quartering-diet` and its `?tab=cut|build|media` 200, an article's video project
200, `/browse/<p>` 307, the Overview tab `aria-current`, decisions API 828 rows with notes' hrefs intact.
+
+### P4a-2, as shipped
+
+**What.** An article and the video project it claims are one page: the article's address (`/articles/<id>`,
+`/sites/<site>/<report>`, the MCP's and the notes' addresses, kept) is the piece frame around nine tabs, and a
+claimed project's own address lands there.
+
+- **The frame, generalised** (`components/piece/PieceFrame.tsx`): it takes the trail, the tabs with their addresses,
+ a `meta` line beside the title and a `head` slot after the stepper, instead of a project id; the rail's key is
+ `projects` or `articles` (Work lit as the place the piece is under, `aria-current="true"`, not as Work itself —
+ `shell.spec`'s `/articles/delta` row caught it). `ReportProject` passes `PIECE_TABS`' project addresses, unchanged.
+- **The article piece** (`components/articles/ArticlePage.tsx`, rewritten; `ArticleOverview.tsx`, new): the head —
+ the trail (`articles / <id>` or `articles / <site> / <id>`), the title as the `<h1>`, the meta line
+ (`[data-article-meta]`: home, status badge, dates, revisions — where the old page's first line had them),
+ **Active ▾**, **⋯** (the piece id, **Delete article** for a store article, the video's id and **Delete project**),
+ `N open notes`, the stepper, a board's "from the board <title>", the policy chip. Tabs (`lib/pieces/tabs.mjs`
+ `ARTICLE_PIECE_TABS`), counts in Meter (Iterations: a readdir; Cut, Media, Sources: the video's, as P4a-1):
+ - **Overview** (canvas "Piece · Overview"): the Next card; Iterations (P4a-1's `IterationsSummary`, newest five,
+ **All iterations →**, the question and scope of the current report's iteration) and the video's decisions
+ (P4a-1's section, now `ProjectDecisions`); Article · N sections (**Read →**); Cut · i<n> (final video built or
+ not, clips · runtime, the project id, **Open the cut →**), the other cuts the article made (each a `?project=`
+ link), not reachable here, or no video project yet; the research board; slug matches nobody linked ("Possible
+ videos").
+ - **Article**: the old page's views moved in — the reader with its notes (`ArticleReader`, unchanged), `?tab=source`
+ (workspace files, slide lint), the problems when `report.json` does not read, "No report yet" for one in the
+ making. Its first line is the views' switch (article · source · evidence) and the linked projects (now
+ `?project=` links into the piece) and the draft/generator line.
+ - **Iterations**: `IterationsView` as it was (r28's media drafts and Draft everything untouched; P4b absorbs them).
+ A site's report says it has none.
+ - **Cut · Media · Build · Deliver · Sources · History**: the claimed project's P4a-1 tabs, through
+ `components/projects/report/ReportTabBody.tsx` (extracted from `ReportProject`, shared by both pages; the
+ project's notes are the target under it). `ReportTabProps` gains an optional `tabHref`, so the Cut's
+ "show every quote" stays inside the article piece. No video: "No video project yet" with a way to the
+ Iterations; not reachable: "i<n>'s video project is not reachable here" and the directory; a manifest that does
+ not parse says so.
+- **Which project** (`lib/pieces/article.ts` `articleVideo`): only projects this piece OWNS (the graph's
+ `pieceOfProject`). The iteration `current.video` names; if its `projectDir` is outside `REPORTS_ROOT`, the video
+ tabs say "not reachable here" rather than show another; else the article's Cut (`links.mjs`: first linked —
+ iterations newest first, then a manifest naming it, then a unique slug). `?project=<id>` opens another the piece
+ owns, and is carried from tab to tab only when it is not the Cut. The fixture's `zeta` (i1 and i3, no
+ `current.json`) shows i3; `msurf` shows i2.
+- **A claimed project renders as the article's piece** (`claimedProjectRedirect`): `/projects/<path>` with no view
+ segment, and `/projects/at?path=`, answer `redirect()` — a 307 — to the article piece: the same `?tab=`; with no
+ tab, a `?note=`'s tab (its anchor in the project's `notes.json`, P4a-1's rule) or `?all=1`'s Cut; `?project=` when
+ it is not the Cut; `note` last (`withQuery`). The benches and kind views (`clip/<id>`, `claim/<id>`, `review`,
+ `narration`, `takes`) stay at the project's address; their way back is `pieceHrefOfProject` (the article piece's
+ Cut, Media or Overview). Decision and activity hrefs are unchanged — they ride the redirect, so the MCP still sees
+ `note=<id>` last on the project's href.
+- **`?note=` on an article piece**: a note in the article's `notes.json` opens the Article tab on it (as the old page
+ did); else a note in the shown project's opens where its anchor is drawn; `?rv=`, `?status=`, `?ws=`/`?rel=` open
+ the Article tab; the reader's slides switch keeps `?tab=article` beside `rv` (`readerPlaceUrl` keeps other keys).
+- **The stepper** (`articleSteps`, pure, unit-tested): Research done with iterations or a board that seeded it (else
+ `na`, "no iterations or research board" — a site's hand-written report); Article done with a report; Video done
+ with a claimed project (one not reachable here counts); Deliver done when it looks done (P2a's `looksDone`: a final
+ video and a share batch, or published with its video); the first not done is current. `data-piece-stage` is that
+ step.
+- **The board** (`boardOfArticle`, beside `boardOfProject`; `readCases` shared): the case whose `to: "article"`
+ hand-off names the article's page; shown in the head and on the Overview, as P4a-1 did for a video.
+- **The policy chip** (`components/piece/PolicyChip.tsx`): a Meter dot, "policy", the preset, the API model, today's
+ spend of the daily cap, linking `generationSettingsHref()` → `/settings/generation` (P5's page; a new builder —
+ `generationPolicyHref` still names the new-article form, for P5 to switch). Streamed under a `<Suspense>`; an editor
+ that does not answer says so. The brief's "remove the panel from the article page": `PolicyPanel` was never on it
+ (since release 27 S8 it lives only on `/articles/new`), so nothing was removed; the component is untouched.
+- **The Next card**: `readNextCall(a:<site>/<report>)` — decisions on the article and on its claimed projects already
+ carry the article's piece id, so it is the top Inbox call across both.
+- **Keys**: `1`–`9` open the nine tabs (PieceKeys takes the frame's hrefs); `n` runs the Next card on the Overview
+ and is the reader's "note" elsewhere (PieceKeys acts only when a Next action is on the page).
+
+| sha | what |
+|---|---|
+| `86ef12ab` | the article piece: `ArticlePage`/`ArticleOverview`, `PieceFrame` generalised, `ReportTabBody`, `lib/pieces/article.ts`, `articleSteps`/`articleTabOf`/`ARTICLE_PIECE_TABS`, `boardOfArticle`, `PolicyChip`, the redirect, the benches' way back, `articleHref`'s `tab`/`project`/`all`, unit tests |
+| `33da7f73` | specs: `piece.spec` (the article piece's frame, video tabs, redirect, note landing, 1366×768); the article specs through `urls.articleHref`; Delete article via **More** |
+| `1a301c42` | `piece.spec`: an article drafted from a board shows it |
+| `84b16df2` | a piece page lights Work as its parent place |
+| `5d2872fb` | the meta line drops the home link the trail already has |
+
+**Gates.**
+
+| Gate | Result |
+|---|---|
+| repo-wide `tsc --noEmit` | clean at every commit (umtool typecheck clean at every commit) |
+| umtool unit (`node --test umtool/lib/*.test.mjs umtool/lib/*/*.test.mjs umtool/report-to-video/*.test.mjs`) | 838 tests, 836 pass, 2 skipped, 0 fail (new: `tabs.test.mjs` +3 — the nine tabs and their sections, the address → tab rules, the stepper by what exists; `board.test.mjs` +1; `hrefs.test.mjs` +3 assertions) |
+| `pnpm --filter umtool test` | 16/16 |
+| `pnpm run test:scripts` (reads the capped build's traces) | 989 tests, 987 pass, 2 skipped, 0 fail |
+| capped umtool `next build` (corpus linked, `MemoryMax=5G`) | exit 0, compiled 13.4 s, 46 s wall, 1.44 GB max RSS; the link removed |
+| full umtool e2e, run 1 (`1a301c42`) | 411 tests: 404 passed, 1 failed, 6 skipped, 7.5 min. Red: `shell.spec` `/articles/delta has the rail, with work lit` — the frame lit Work as `page`; fixed in `84b16df2` |
+| `shell.spec` + `piece.spec` through the e2e entry (`84b16df2`) | 34/34 |
+| full umtool e2e, run 2 (`5d2872fb`) | **411 tests: 405 passed, 0 failed, 6 skipped** (the song-data capability skips), 7.4 min; `piece.spec` 14/14 |
+
+**Spec churn:** `piece.spec` +5 tests (14): the article piece's frame (nine tabs, the stepper, the policy chip's href and
+no panel, the Overview's iterations and Cut, keys `3` and `9`), the video tabs (the Cut, `?project=` and its carry, no
+video), the redirect (307 with the tab, the Overview, `?project=`, `?all=1`; a standalone project 200; `/browse/…`
+through both hops; takes and review 200; the clip bench's way back to the Cut, with `?project=` for the other cut),
+a video note landing on the Cut inside the piece (the 307's `note` last; the article's address finds it too), an
+article drafted from a board; the 1366×768 test covers both kinds of piece; the old "an article's video" test went
+(that page is now the redirect). The article specs (`article-delete`, `-evidence`, `-integration`, `-iterations`,
+`-notes`, `-slides`) open the tab they mean through `urls.articleHref` (the reader is `?tab=article`; the
+Iterations `?tab=iterations`); `article-iterations`' first test opens the piece on its Overview and clicks the
+Iterations tab; `article-slides`' URL checks accept `&rv=`; `article-delete` opens **More** before **Delete
+article**; `media-draft`/`media-surfaces` use the builder; `projects.spec`'s nested-folder gotos use
+`urls.projectHref`. No `data-testid` renamed; `[data-article-meta] [data-status]` kept (now in the head).
+
+**Screenshots** (job scratch `p4a2-shots/final/`): `/articles/msurf` (an article with two iterations, a current report
+made from i1, and two video projects) on Overview, Article, Iterations and Cut at 1366×768 and 1440×900, dark and
+light, plus `/sites/priv/polemic-alpha` (a site's report with a slug-linked video) and `/articles/zeta`. 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 nine tabs with Meter counts and the Signal underline, the Next card with its Signal edge and one
+filled action, the two columns (iterations table and question | the article's sections, Cut · i<n>). Differences:
+the trail sits above the title where the canvas has "Article · articles registry"; the policy chip sits in the
+stepper's row (the canvas puts the policy on Create); the Overview adds the video's decisions under the iterations.
+**Keyboard-only** (production build of `84b16df2`, both themes, `/articles/zeta`): the rail's 11 stops, the trail (and the
+meta line's home link, the same "articles" twice — dropped in `5d2872fb`), **Lifecycle:
+Active**, **More**, the policy chip, the nine tabs, the Next card's action, the Overview's links — each with the 2 px
+Signal ring; `2`, `3`, `4`, `1` open Article, Iterations, Cut, Overview; `n` runs the Next card's action.
+
+**Found and left.**
+- **Work's stage and the stepper can disagree** for an article in the making that already has a video: Work's bucket
+ (P2a's rule) says Research, the stepper (this brief's rule) lights Article with Video done. Left: Work's facet is
+ P2a's contract; worth one rule when P6 audits.
+- **Decision and activity hrefs still name `/projects/<id>`** for a claimed project's calls; they ride the 307 (one
+ hop), which keeps the MCP's `note=<id>`-last contract on the project's href. Building them as article hrefs would
+ mean the decisions engine knowing the piece's Cut; not needed.
+- **`generationPolicyHref()` still names `/articles/new`** (the rail's Settings page and ⌘K use it); the chip uses the
+ new `generationSettingsHref()`. P5 points both at `/settings/generation` when its page lands.
+- **The reader's first click can land before hydration** in dev mode (`article-slides`' "a section's open notes"
+ failed once in three dev runs, `note on Later` clicked before its handler); the start-mode suite passed it every
+ time. Not new to this slice.
+- **`ReportProject`'s "a video of <article>"** in the head is now reached only by a project the redirect cannot find
+ an article for at render time (a graph built a moment before); kept rather than removed.