commit 742ea8d42ed8a8b762a1acc58467f4868978e34a
parent 193dd957806d7102d9eb5806225d37eb1b7d38eb
Author: I Mean I'm Just Saying <imeanimjustsaying@kiwifarms.st>
Date: Wed, 14 Oct 2026 11:24:14 -0400
plans: umtool redesign — P4a-3, as shipped (song pieces); [Unreleased] bullets
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Diffstat:
2 files changed, 126 insertions(+), 1 deletion(-)
diff --git a/editor/CHANGELOG.md b/editor/CHANGELOG.md
@@ -68,6 +68,9 @@
- **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 `/settings/generation`.
- **umtool: an article's "+ note", its citations and "+ whole article" wait until the page is ready.** A click before then did nothing; they are now disabled until it is.
- **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.
+- **umtool: a song's page is a piece page.** `/projects/<song>` has the head — the title, **Active ▾**, **⋯** and the stage stepper **Spec → Cuts → Done** (Spec with a `spec.json`, Cuts with one cut built, Done with all four, which is also when the song looks done) — then five tabs: **Overview** (the **Next** card, the song's decisions, its four cut slots, what it is, **copy this song**, the README, and links to the song piles, find, mix, sources and the hook trimmer, which stay in Tools), **Cuts** (the cut cards, their verdicts, notes and variants, and what matches no cut), **Spec** (the spec sheet and the plans), **Cover** (the cover bench) and **Notes** (the note on the song and every other note on it, each linking its tab). `1`–`5` open the tabs and `n` runs the Next card. A cut's page, `/projects/<song>/<cut>`, keeps its address and is drawn inside the song with **Cuts** current and the four cuts beside the title. `?tab=` picks the tab and `?note=<target>` opens the tab that note is written on; `/browse/<song>` lands on the Overview.
+- **A song's calls open where they are settled.** A spec problem or an unnamed plan opens **Spec**, a variant that matches no cut **Cuts**, an unaccepted cover **Cover**; a cut's calls still open the cut's page.
+- **Work files a song by its own stepper.** A song's row shows its three steps (spec, cuts, done) and the stage facet files it with the stage its step stands for: Spec with Article, Cuts with Video, Done with Deliver, the same rule its page lights.
- **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
@@ -355,7 +355,7 @@ P0 design ─► P1 foundation ─┬─► P3 inbox/work/tools/URLs ─┬─
| P4a-1 piece frame | `ux/p4a` → `main` `a92251aa` | LIVE 2026-10-14 (umtool ErWqdPdg…) |
| P5 create + settings | `ux/p5` → `main` `20ee628a` | LIVE 2026-10-14 (umtool ZfQXZuNF…) |
| P4a-2 article-rooted merge | `ux/p4a2` | shipped on the branch |
-| P4a-3 song pieces | — | after P4a-2 |
+| P4a-3 song pieces | `ux/p4a3` | shipped on the branch |
| R3 transparent runs | `ux/r3` → `main` `6362cf40` | LIVE 2026-10-14 (editor HqcZW4aJ…, umtool 85Ultdj2…) |
| P4b, P6 | — | after P4a / all |
@@ -1939,3 +1939,125 @@ the r28 session: editor built (53 s) and restarted (`scripts/r3-editor-{build,re
`UV_THREADPOOL_SIZE=16` ok, no ZodError, 0 queued before and after), umtool built (77 s) and restarted. Live:
`/research/runs`, `/research/runs/piratesoftware-ai-friends/1` (the real turns.jsonl fallback, the question as title),
`/research`, `/work`, `/` 200; editor 200.
+
+### P4a-3, as shipped
+
+**What.** A song's page (`/projects/<song>`) is a piece page: the P4a frame around one of five tabs, Overview · Cuts ·
+Spec · Cover · Notes, with the stepper **Spec → Cuts → Done**. A cut's page (`/projects/<song>/<cut>`) keeps its address
+and is drawn inside the song with Cuts current. The song deck and the `/tools/song/<mode>` piles stay in Tools; the
+Overview links them.
+
+- **The frame** (`components/projects/song/SongFrame.tsx`) hands P4a-1's kind-blind `PieceFrame` the trail (`projects /
+ <project id>`, the title as the `<h1>`), the five tabs with their `?tab=` addresses (`projectHref(project.id, { tab })`),
+ the counts in Meter (Cuts: cuts built; Cover: covers on offer; Notes: notes written), the status line
+ (`4/4 cuts · 3 variants`, the old header's) and **⋯** (the project id; a song had no Delete before and has none now).
+ The lifecycle chip, the Undo bar, `1`–`5` and `n` come with the frame unchanged.
+- **One stage rule, a song's flow** (`lib/pieces/song-tabs.mjs`, pure, unit-tested). The song kind declares its stepper
+ in the registry (`lib/projects/kinds.mjs` `piece: { flow: SONG_FLOW, reached: songReached }`, `kindPieceFlow`); the
+ pieces graph copies the flow onto the piece (`Piece.flow`: `article`, `project`, or a kind's) with the facts that light
+ it (`Reached` gains `spec`, `cuts`, `done`). **`pieceSteps` and `stageOfPiece` switch on it** (`lib/pieces/tabs.mjs`,
+ an additive kind switch: `songSteps`, `bucketOfSongStep(songStepOf)`), and `stepOfPiece` is the frame's
+ `data-piece-stage` (a song's `spec` / `cuts` / `done`; the four-stage pieces' unchanged). The rule is the one rule: the
+ furthest stage reached is current, a skipped one is to do with its reason ("no spec.json"), a piece marked done has done
+ them all. Spec is reached with a `spec.json`, Cuts with one cut built, Done with all four (the derived `shipped`, which
+ is also P2a's looks-done suggestion: Done is current, Signal-ringed, until the operator marks it done).
+- **Work agrees.** `stageOf` reads the piece's flow: a song's bucket is the one its current step stands for — **Spec →
+ article, Cuts → video, Done → deliver** (the spec is a song's written stage, as an article is a report video's) — and
+ `stageBar` (`lib/work/facets.mjs`) draws a song's own three steps on its row with the step's word (`cuts`, `done`)
+ where a project's state used to be. The four-stage rows are unchanged. Unit-tested: for every combination of facts the
+ stepper's current step, `stepOfPiece`, `stageOf`'s bucket, `stageOfPiece` and the bar agree.
+- **The page reads its own facts fresh**: `readPieceFrame(project, { reached })` takes the song's facts from the
+ `readSong` the page did anyway (one stat for `spec.json`), over the graph's 15 s memo, so a promote shows at once; a song
+ the graph has not listed yet still walks the song's stepper (`kindPieceFlow`).
+- **The Next card** is P4a-1's, kind-blind: the song's top Inbox card (an unnamed plan, an unjudged variant, a missing cut,
+ a stale recipe … or **Mark done** when looking done is all that is left).
+- **A song's calls open their tab** (`lib/decisions.ts`, by `songTabOfSection`): `spec-problem` and `no-plan` → Spec,
+ `unattributed` → Cuts, `thumb-unaccepted` → Cover (`/projects/<song>?tab=…`); a cut's calls (`missing-cut`,
+ `unjudged-variant` with its `?v=`, `stale-recipe`, `no-recipe`, `loudness`) keep the cut page's href.
+- **Addresses.** No `tab` is the Overview; a bad `tab` is the Overview; `?note=<target>` opens the tab that note is
+ written on (a song's notes are keyed by target, `lib/notes.ts`): `song` → Notes; `cut:`, `file:`, `moment:`,
+ `source:`, `clip:` → Cuts; `plan:` → Spec; `thumb:` → Cover. `/browse/<song>` rides P3's redirect to the Overview,
+ `/browse/<song>/<cut>` to the cut's page. The cut page's own keys (`?v=`, `?plan=`, `?notes=all`) are unchanged.
+
+**Section → tab** (SongProject's two columns and head row, CutPage's body; `SONG_SECTION_TAB` names each for
+`e2e/urls.ts` `songSection(song, name)`):
+
+| Section (its attribute) | Tab |
+|---|---|
+| Header: crumbs `songs / <id>`, note `N/4 cuts · N variants` | head (trail `projects / <id>`, the title, the same status line) |
+| Head row: the song's note (`NoteField target="song"`) | Notes |
+| Head row: **copy this song** (`CopyButton`, `/api/browse/context?song=`) | Overview (`data-song-copy`) |
+| Left: the four cut cards (`data-cut`, `data-present`, `data-variant`, `data-variant-tag`, `VerdictChip`, the slot's and the file's notes) | Cuts |
+| Left: matches no cut name (`data-unattributed`, new attribute) | Cuts |
+| Aside: `ThumbBench` (`data-judge-faces` …) | Cover (says "No cover generated" when the bench would draw nothing) |
+| Aside: `SpecSheet` (`data-op` …) | Spec |
+| Aside: README | Overview (`data-readme`) |
+| Aside: plans, their notes, clips.csv (`data-song-plans`, new) | Spec |
+| CutPage: `CutBench`, `LoudnessTable`, `ProvenancePanel` | Cuts (the cut's page, a view of it; `bare`, unpadded as before) |
+| CutPage: crumbs `songs / <id> / <cut>`, note duration · bytes | head: trail with the id linking the song, the four cuts beside the title (`data-song-cut-picker`), the same note |
+| new: the Next card, the song's decisions (P4a-1's `ProjectDecisions`), the four cut slots (`data-song-slot`), This song (cuts, variants, verdicts, plans, cover, looks done — `data-song-looks-done`), Song tools (`data-song-pile`, `data-song-trim`, song piles, find, mix, sources) | Overview |
+| new: every other note on the song, each linking its tab (`data-song-notes`, `data-song-note-target`) | Notes |
+
+The sections live in `components/projects/song/{SongFrame,OverviewTab,CutsTab,SpecTab,CoverTab,NotesTab}.tsx`;
+`SongProject.tsx` reads the song once, picks the tab and renders the frame; `CutPage.tsx` keeps its body and draws it
+through `SongFrame`. `ProjectView`'s song case hands both the project (it handed the basename). Only the tab on show is
+read: the Cuts tab's ffprobes and the spec's validation cost nothing on the Overview. A cut card's name is an ink link
+(it wore Signal on hover). `[data-nav-group=song]` and every `data-testid` are untouched.
+
+**Shared files, additive only.** `lib/pieces/tabs.mjs`: the import, the kind switch in `pieceSteps` and
+`stageOfPiece`, the new `stepOfPiece`. `PieceFrame`: no change. `lib/pieces/frame.ts`: `readPieceFrame`'s optional
+`reached`, the flow from the piece or the registry, `stepOfPiece` for `stage`. `lib/pieces.ts`: `Piece.flow`, `Reached`,
+a project piece's declared facts. `lib/work.ts`/`lib/work/facets.mjs`/`app/work/page.tsx`: the flow, `stageBar`, the
+row's `steps`. `lib/projects/kinds.mjs`: the song's `piece`, `kindPieceFlow`; `lib/projects/song.mjs`: `songReached`.
+`lib/decisions.ts`: the song-wide hrefs' tab. `e2e/urls.ts`: `songSection`.
+
+| sha | what |
+|---|---|
+| `aa8739d9` | the song piece: `lib/pieces/song-tabs.mjs` (+ unit tests), the flow switch in `pieceSteps`/`stageOfPiece`, `stepOfPiece`, the registry's `piece` and `songReached`, `Piece.flow`/`Reached`, `readPieceFrame`'s fresh facts, Work's `stageBar`, `components/projects/song/*`, `SongProject`/`CutPage` through `SongFrame`, the song-wide hrefs' tab |
+| `56a1fe72` | specs: `browse`/`faces`/`projects` through `urls.songSection`, `e2e/song-piece.spec.ts` (9); a cut card's name an ink link |
+
+**Gates** (at `56a1fe72`).
+
+| Gate | Result |
+|---|---|
+| repo-wide `tsc --noEmit` | clean at both commits (umtool typecheck clean) |
+| umtool unit (`node --test umtool/lib/*.test.mjs umtool/lib/*/*.test.mjs umtool/report-to-video/*.test.mjs`) | 850 tests, 848 pass, 2 skipped, 0 fail (new: `song-tabs.test.mjs` 4 — the tabs and sections, the address → tab rules and `?note=<target>`, the stepper by what exists, the stepper against Work's facet and bar) |
+| `pnpm --filter umtool test` | 24/24 |
+| `pnpm run test:scripts` (reads the capped build's traces) | 1001 tests, 999 pass, 2 skipped, 0 fail |
+| capped umtool `next build` (corpus linked, `MemoryMax=5G`) | exit 0, compiled 12.4 s, 39 s wall, 1.48 GB max RSS; the link removed |
+| song specs, dev mode (`E2E_MODE=dev`, the song specs' filter) | 102 tests: 96 passed, 1 failed, 5 skipped, 6.4 min; `song-piece.spec` 9/9. Red: `projects.spec:219` (the tool pages under `/browse`: a dev-mode `ERR_ABORTED` on first compile; green in both start-mode runs) |
+| full umtool e2e, run 1 (`56a1fe72`) | 446 tests: 437 passed, 3 failed, 6 skipped. Reds: `board.spec:102` (`e` did not focus the claim field) and the two after it that build on its sections (`:164`, `:186`) — the run started after 12 minutes waiting at the heavy slot for memory (a sibling dev server at 3.8 GB, 2.2–3.4 GB available); `board.spec` + `song-piece.spec` alone: 16/16 |
+| full umtool e2e, run 2 (`56a1fe72`) | **446 tests: 440 passed, 0 failed, 6 skipped** (the song-data capability skips), 10.9 min; `song-piece.spec` 9/9 |
+
+**Spec churn:** `browse.spec` (6 gotos through `urls.songSection`: the cut cards, verdicts and a hole on Cuts, the trim
+operation on Spec), `faces.spec` (the bench on Cover), `projects.spec` ("the song URLs that already existed": `/browse/alpha`
+is the Overview with the cut slots, the Cuts tab has the cards, `/browse/alpha/wide` is the cut's page with Cuts current,
+the canonical path is the Overview). No `data-testid` renamed. New `e2e/song-piece.spec.ts` (9): the frame (title, trail,
+status line, stepper at Done, five tabs, the Overview alone); a song with a hole at Cuts and Work's row (bucket, word,
+looks done) agreeing with both steppers; the Next card = the Inbox's top card for the song; a song's calls' hrefs; the
+tab as the URL (`?tab=`, a bad tab, `?note=song|plan:|cut:`, `/browse/alpha`); the cut's page (frame, picker, the
+loudness table, the trail back, a hop to `wide-short`); the keys (`2`, `5`, `1`, `n`); marked done (all done, the
+suggestion gone, the Next card's Reactivate); 1366×768 with no horizontal scroll on four addresses.
+
+**Screenshots** (job scratch `p4a3-shots/final/`, 17): `alpha` (all four cuts, at Done) on Overview, Cuts and Spec at
+1366×768 and 1440×900, dark and light; and, dark at 1366×768, the cut page `alpha/wide`, Cover, Notes, `beta`'s Overview
+(at Cuts, two holes) and Work filtered to songs — on the e2e start build over the fixture. Against the canvas's Piece ·
+Overview, in a song's words: the head (title in Archivo, the chip and ⋯ on the right, the status line), the three-step
+stepper with Done Signal-ringed, the five tabs with Meter counts and the Signal underline, the Next card with its Signal
+edge and one filled action ("Name the plan" → Spec), the two columns (decisions and the four cut slots | This song and
+the song tools), the README under them. Work's row for Mortal Kombat in the canvas reads step 2 "Cuts"; a song's row now
+reads its own three bars with `cuts` lit second, as drawn there.
+
+**Found and left.**
+- **On the real reports** (a read-only listing): all five songs have a `spec.json`; `mario-rpg`, `metal-slug`,
+ `mortal-kombat` and `yoshi` have three of the four cuts and stand at Cuts, `pokemon` has all four and stands at Done
+ with P2a's looks-done suggestion. The fixture's alpha has no `spec.json` until browse.spec writes one, so its Spec
+ reads to do ("no spec.json") on a fresh fixture.
+- **Spec → article** in Work's stage facet is a ruling to confirm: a song with a spec and no cut is filed under Article
+ (the written stage). The alternatives were Video (a song is a video piece) or Research; Article keeps the three steps
+ on three different buckets, so a song moves along the facet as it moves along its stepper.
+- **`urls.songSection`, not `urls.section`**: a song's section names overlap the report's (`notes`, `readme`,
+ `decisions`, `next`) on different tabs, so the song has its own table and builder rather than a fall-through.
+- The song bench's own controls (CutBench, ProvenancePanel, LoudnessTable, SpecSheet, ThumbBench, NoteField, VerdictChip)
+ keep P1's Signal-outline `primary` buttons and their Signal states; only the cut card's name link changed. They live
+ outside `components/projects/` and were moved, not restyled.