commit adb1761a515484548bf8a492a6e416fc86844373
parent f996d99cbd7aca16b4df66a36aea2abf55c243c4
Author: I Mean I'm Just Saying <imeanimjustsaying@kiwifarms.st>
Date: Wed, 14 Oct 2026 00:52:21 -0400
plans: release 28 M9, as shipped (lane G); FACTS: the surfaces of the media drafts; CHANGELOG
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Diffstat:
4 files changed, 158 insertions(+), 3 deletions(-)
diff --git a/common/publish/siteDelete.ts b/common/publish/siteDelete.ts
@@ -1,7 +1,7 @@
// DELETE A SITE — a plan, then the delete (release 28 H5; `pnpm ops
-// delete-site`). The editor's Danger → Delete (`deleteSiteAction` →
-// lib/site.ts `deleteSite`) removes `sites/<id>/` and nothing else; this is
-// the scripted path, and it says first what goes, what stays and what refuses.
+// delete-site`, and since M9 the editor's Danger → Delete on /sites:
+// `planSiteDeleteAction`, then `deleteSiteAction`). It says first what goes,
+// what stays and what refuses.
//
// WHAT A SITE IS ON DISK (the survey, 2026-10-13):
// sites/<id>/ site.json (the pool: `channels`,
diff --git a/editor/CHANGELOG.md b/editor/CHANGELOG.md
@@ -1,6 +1,13 @@
# Changelog
## [Unreleased]
+- **umtool drafts each section of a report video with a model you pick.** A video project made from an article's iteration has a **draft** section: for the cut, the on-screen titles, the teaser, the flips, the threads, the narration and the YouTube text, **Draft with** and a model (the generation policy's models, the task's route chosen first), **force** (re-drafts only what a model drafted; what you wrote or edited is never replaced), and for a per-entry task the entries to draft. The job's progress shows while it runs; when it ends the page shows what it wrote, skipped and had refused by a check, the **drafted by** badge with **Approve** and **Reject**, and any draft kept aside with **Use this**. A project not made from an iteration says so and offers none. The article's Iterations tab gains the same drafts beside **Narrate**. Needs a restart of umtool.
+- **Draft everything.** One button on the Iterations tab (or `umtool chain <article> <n> --draft-all [--model M]`) runs the chain with every media draft in it, on the model you choose: the cut, on-screen, teaser, flips, threads and narration after the manifest, then the voices, a fast build and the podcast, then the YouTube text, whose chapters are re-muxed so `out/youtube.txt` is written. A draft the editor refuses or that fails is marked failed and the chain carries on; one with nothing to draft, or flips and threads with no on-screen deck (or with the other panel on), is skipped. It does not attach the video to the article: review the drafts first. Started again, it resumes after the last draft that ran. Needs a restart of umtool.
+- **A site's Delete shows its plan before anything goes.** On `/sites`, **Delete** lists what would be removed (the site, its publish state and last bundle, its staging), how much, what is kept and what refuses; **Confirm delete** removes it. A site with a deploy target, a recorded deploy or reports of its own is refused unless you tick the box and press **Delete with force**; a site whose directory is a link, or a publish stage running, is refused outright. The delete is `pnpm ops delete-site`'s, so it now removes the build state too.
+- **Use this on a threads draft sets each clip's thread too.** Taking a threads alternative writes the clips' assignments with the list, so no clip is left naming a thread that is gone.
+- **A video revision that reorders the cut makes the order a draft.** The order then has a review row, and the cut task redrafts it only with force. A revision that leaves the order alone keeps the mark it had.
+- **An on-screen title in Title Case is no longer refused as naming people.** Its capitals are not read as names: an ordinary word passes, and a name the clip's evidence lacks is still refused.
+- **Claude Code's `generate` and `/gen` know the media drafts.** `/gen` maps "draft the on-screen titles", "make a teaser", "YouTube description" and the like to the media tasks; `generate` checks that a media draft names its iteration, and its answer for a done draft says what to check for that task and that the approval is yours in umtool's review page. `archilyzer gen run` takes a media task with `--iteration` and `--entries`.
- **The editor drafts a report video's cut, on-screen text and teaser.** `pnpm ops report-draft --json '{"task": "cut" | "onscreen" | "teaser", "article", "iteration", "model"?, "entries"?, "force"?}'` runs on a done iteration's video project, as a step on it, like narration. **Cut** picks which of the report's citations the video shows and in what order, grouped under the report's sections; the code builds the timeline from the entries the cut already had (windows, quotes and on-screen text untouched), keeps a chapter card only while its section has a clip, keeps the title card and the teaser where they are, never drops a clip a post or a flip needs, and refuses an order the build would refuse. At most `settings.generation.cut.maxClips` entries (new, default 20), at least 3. **On-screen** writes each clip's title (at most 60 characters, no quotation marks) and subtitle (at most 90; it may quote only the clip's own words, exactly), several clips to a request. **Teaser** writes 3 to 5 lines that fit the teaser card, quoting nobody; a cut with no teaser gets one after its last clip. Every name and number must be in the report. Each drafted field carries its `drafted` mark and goes through the drafts review; a field you wrote or edited is never replaced (with `force` its draft is kept aside as an alternative). Each media draft has its own route in the generation policy (narration's, in every preset), and its job shows the entries done. Needs a restart of the editor and umtool.
- **A starter cut's order is marked as the converter's.** `archilyzer reports to-manifest` marks the timeline it writes as drafted by code (`drafted.timeline`, model `code`), so the cut task may redraft it without `force`; a cut converted before this release counts the same while its clips are still in the converter's order. A code-made order needs no review and shows no badge. Reordering it in umtool makes it yours.
- **New settings key `generation.cut.maxClips`** (SETTINGS.md): the most entries a drafted cut keeps (default 20).
diff --git a/plans/FACTS.md b/plans/FACTS.md
@@ -9350,3 +9350,44 @@ parsed to 0 cues, indexing the video textless) is CLOSED by `200a3105` (transcri
without chapters) when the manifest has a `publish.youtube` title. `muxChapters` returns `{chapters: [{start, end,
title}], total}`. The composition is `report-to-video/youtube.mjs` (`composeYoutubeText`, `youtubeChapters`,
`youtubeSources`, `momentLinkOf`, `youtubePreview`, `youtubeTextName`), exported as `umtool-report-to-video/youtube`.
+
+## Release 28 M9: the surfaces of the media drafts (verified 2026-10-14, branch `r28/surfaces`)
+
+- **Draft everything is a chain mode.** `umtool/lib/report/chain.mjs` `CHAIN_STEPS` carries every step with its
+ `modes` (`"video"`, `"draft-all"`); `chainStepsOf(mode)` is a chain's list. The generation steps are
+ `draft-<task>` (`optional: true`, `draft: <task>`), in the draft-all chain only: current → windows → prepare →
+ posts → manifest → draft-cut → draft-onscreen → draft-teaser → draft-flips → draft-threads → draft-narrate →
+ voices → video → podcast → draft-youtube. No attach, no dedupe. `CHAIN_STEP_NAMES` is still the default chain's
+ ten. The draft-all build never takes `--final`; `model` rides on the draft steps' argv (`--model`) only.
+- **A draft step is one `report-draft` job through the editor** (`chain-run.mjs` `draftStep`: POST
+ `/api/ops/report-draft`, GET `/api/ops/job/<id>` every `CHAIN_DRAFT_POLL_MS` (2 s), a chain cancel cancels the
+ job). It records `chain:draft-<task>` as `done` (the job's summary), `skipped` (`draftPrecheck`: flips and
+ threads with no `render.chrome` or with the other panel on, never asked; or `draftOutcome`: every unit of
+ `<task>-draft.json` skipped) or `failed` (refused at the ask, or the job failed) — and an optional step exits 0
+ either way, so the chain goes on. `doneSteps` counts an optional step `done`, `skipped` or `failed` as finished
+ (a resume passes it); a code step only `done`. The pure part is `chain-draft.mjs` (plain node).
+- **draft-youtube re-muxes a built cut's chapters** (`build-video --chapters-only --no-xfade --skip-fetch`) so
+ `out/youtube.txt` is written; with no `out/<slug>.mp4` the next build writes it.
+- **umtool's chain jobs are two kinds:** `chain <article> i<n>` and `draft-all <article> i<n>` (`chainKind(…,
+ mode)`); one umtool job runs at a time either way. `/api/articles/chain` takes `{draftAll, model}` and `?mode=`.
+- **A project names its iteration by its path:** `projectIteration(dir)` (`umtool/lib/articles/projectDraft.ts`)
+ is `<projectsRoot>/<article>/i<n>/` whose iteration exists and names that directory as its project (or none).
+ Any other project has no "Draft with". `draftRunSummary` reads a task's last run from `<task>-draft.json`;
+ `/api/articles/draft?project=` answers both.
+- **A threads alternative is `{list, clips}`** (`clips`: clip id → thread id); the task applies `{list}`.
+ `writeDraftedField` writes the list and sets each clip's `thread` from `clips` (removed from a clip in none),
+ refusing a clip the cut lacks and anything `validateThreadEntries` refuses. An alternative without `clips` writes
+ the list alone, as before.
+- **A revise-video whose ops change the timeline's order** (its ids, `fieldSignature`) sets `drafted.timeline =
+ {task: "revise-video", model, iteration, attempt: 1}`; one that does not keeps the parent's mark.
+- **onscreen checks a Title Case title in its sentence case** (`isTitleCase`, `titleAsSentence`): past the first
+ word a small word, an ordinary headline word (`TITLE_ORDINARY`) or a word the evidence has (by stem) is
+ lowercased; anything else keeps its capital and is a name's candidate. The first word is never checked as a
+ name (the grounding's rule, unchanged).
+- **The editor's site Delete is plan-first:** `planSiteDeleteAction` / `deleteSiteAction(siteId, {force})`
+ (`editor/app/sites/actions.ts`) over `publish/siteDelete.ts`; `lib/site.ts` `deleteSite` has no caller in the
+ editor now (lane C's "still removes `sites/<id>/` alone" above no longer holds).
+- **The umtool e2e stub drafts every media task:** the kit's article `mdraft` runs the real task (lane D's
+ `runMediaStep.ts`); the surfaces' article `msurf` is canned (`startCannedDraft`, through `applyDraft`, with a
+ draft file in the scaffold's shape and `entries` progress).
+
diff --git a/plans/release-28.md b/plans/release-28.md
@@ -839,6 +839,113 @@ Found and left:
- **The Iterations tab does not follow a step it did not start.** A media draft asked through the API shows on reload.
M9's buttons start their own.
+### M9, as shipped (2026-10-14, lane G, `r28/surfaces`)
+
+The surfaces of the media drafts: "Draft with <model>" per section, Draft everything, the MCP and `/gen`, the two
+leftovers, and the two rulings added to the lane.
+- **Draft with <model>** is a **draft** section on a report-video project page (`DraftPanel.tsx`), one row per task:
+ the cut, on-screen titles, the teaser, flips, threads, narration, the YouTube text. A row has **Draft with** and the
+ model (the policy's API and local models, the task's route preselected), **force** (re-drafts only what a model
+ drafted; the UI says a field the operator wrote or edited is never replaced) and, for a per-entry task (on-screen,
+ teaser, narration), the entries to draft. It posts `report-draft {task, article, iteration, model, entries?,
+ force?}` through `/api/articles/generate` and follows the job (status, the queue, F3's progress, the last log line,
+ Cancel). When the job ends the page re-reads the manifest, the drafts and the server sections, and the row shows the
+ task's last run from its `<task>-draft.json`: written, kept as an alternative, refused by a check (with the reason),
+ skipped, the failing checks. The cut, flips, threads and YouTube rows carry M0's badge and alternatives with **Use
+ this**; per-entry fields keep theirs in the sections and on the review page. Flips and threads on a cut with no
+ deck say why and offer no button.
+- **Which iteration:** a project `<projectsRoot>/<article>/i<n>/` whose iteration exists and names that directory
+ (or none) (`projectIteration`). Any other project shows one line why and no control; an iteration not done says so.
+- **The Iterations tab** gains the six media drafts beside **Narrate** (a task select, a model, force, **Draft**) and
+ **Draft everything** (a model and the button, which opens and starts a chain panel in its own mode).
+- **Draft everything** (`chain.mjs`): `CHAIN_STEPS` carries each step's `modes`; the draft-all chain is current →
+ windows → prepare → posts → manifest → draft-cut → draft-onscreen → draft-teaser → draft-flips → draft-threads →
+ draft-narrate → voices → video → podcast → draft-youtube.
+ - Ruled here: the drafts sit after `manifest`, because a media task drafts the project's manifest, and the windows
+ are fetched from the report's citations before prepare, not from the cut. The brief's "cut → windows" cannot hold.
+ YouTube sits after the podcast as the brief says, and its step re-muxes a built cut's chapters
+ (`--chapters-only`), so `out/youtube.txt` is written then.
+ - No attach and no dedupe: a cut whose drafts nobody reviewed is not made the article's video.
+ - The build is the existing `video` step without `--final` (fast: `--no-xfade`). The default chain is unchanged,
+ its ten steps and labels as they were.
+ - A draft step is one `report-draft` job through the editor, followed every 2 s, cancelled with the chain. It is
+ recorded done, skipped or failed, and exits 0 either way: a missing draft never blocks a build.
+ - Skipped: flips with threads on, or threads with flips on (the pre-check; the second of the pair is never asked
+ once the first applied a panel), either with no deck, or a draft file whose every unit was skipped.
+ - Failed: refused at the ask, or the job failed.
+ - A resume passes an optional step that ran (done, skipped or failed); `--from` names one.
+ - `umtool chain <article> <n> --draft-all [--model M]`; `--final` with it is refused. The umtool job kind is
+ `draft-all <article> i<n>`.
+- **MCP and `/gen`:**
+ - `generate` refuses a media draft with no iteration, a `copyOf`, a question, feedback, channels or dates, and
+ `entries` on a task that is not a media draft. The tools' texts name the media tasks.
+ - A done media draft's answer is `mediaReviewGuidance(task, projectDir)`: read `<task>-draft.json`, read the
+ drafted fields and check what that task needs (`MEDIA_REVIEW`), say what to approve; the operator approves or
+ rejects in umtool's review page, never by writing `drafts.review.json`; the final gate; force's rule.
+ - `.claude/commands/gen.md` maps phrasings to each media task and says Draft everything is umtool's.
+ - `archilyzer gen run <media task> --iteration <n> [--entries a,b] [--force]` takes no words; COMMANDS.md
+ regenerated.
+- **Leftovers:**
+ - The editor's site **Delete** on `/sites` is plan-first through H5's `publish/siteDelete.ts`
+ (`planSiteDeleteAction`, `deleteSiteAction(id, {force})`). The plan shows the paths, files and size removed,
+ what is kept and the refusals; then **Confirm delete**. A plan refused only for forceable reasons offers
+ **Delete with force** behind an "I understand" box; any other refusal offers nothing. It now also removes the
+ site's build state and staging.
+ - **Use this on a threads alternative** writes the clips' assignments too. The threads task's alternative is
+ `{list, clips}` and the task applies `{list}`. `writeDraftedField` sets each clip's `thread`, removes it from a
+ clip in none, and refuses a clip the cut lacks or what `validateThreadEntries` refuses. An alternative without
+ `clips` writes the list alone, as before.
+- **The two rulings added to the lane:**
+ - **A revise-video that reorders the cut** (its timeline's ids, `fieldSignature`) sets `drafted.timeline =
+ {task: "revise-video", model, iteration, attempt: 1}`. The reorder is then a model's draft: it has the cut's
+ review row, and the cut task needs `force` to redraft it. A revision that keeps the order keeps the parent's mark
+ (or none).
+ - **A Title Case on-screen title** (every word but the small ones capitalised, two at least) is checked in its
+ sentence case (`titleAsSentence`): past the first word, a small word, an ordinary headline word
+ (`TITLE_ORDINARY`) or a word the clip's evidence has (by stem) is lowercased; any other keeps its capital and
+ is looked for as a name. So "She Refuses To Sell To A Chain" passes, "The Bakery Stays, Says Marco" still fails
+ on Marco. The first word is never a name's candidate (the grounding's rule, unchanged).
+
+| Commit | What |
+| --- | --- |
+| `f6de9a9e` | umtool: the chain's optional generation steps (`chain.mjs` modes, `chain-run.mjs` `draftStep`, `chain-draft.mjs`), `umtool chain --draft-all [--model]`; `chain-draft.test.mjs` (6), `chain.test.mjs` (+2) |
+| `18e2542e` | umtool: `DraftPanel.tsx` on the project page, the Iterations tab's drafts and Draft everything, `ChainPanel` modes, `/api/articles/draft`, the chain route's `draftAll`/`model`, `entries` in report-draft bodies, job progress in umtool's job view |
+| `ea232bbc` | merge of `r28/integration` (lane D) |
+| `81da836d` | common: revise-video's order mark; onscreen's Title Case check; MCP `draftTasks.test.ts` (+1), `onscreen.test.ts` (+1) |
+| `d1dda928` | threads' alternative `{list, clips}`; `writeDraftedField` sets the clips' threads; `panelTasks.test.ts` (+1), `drafted-writer.test.mjs` (+1) |
+| `82fd4ab8` | MCP `generate` checks and `mediaReviewGuidance`; `/gen`; `archilyzer gen run` media tasks; COMMANDS.md; `generation.test.ts` (+1), `instructions.test.ts` (+1), `gen.test.ts` (+1) |
+| `e3b6af2e` | editor: the site Delete plan-first; e2e `site-delete.spec.ts` (2), `sites-crud.spec.ts` follows the plan |
+| `189bc376` | umtool e2e `media-surfaces.spec.ts` (2), `fixtures/media-surfaces-fixture.mjs` (msurf), the stub's canned drafts for every media task |
+| `c4235bb5` | OPERATING.md "Generate and iterate" (the media tasks' table, Draft everything, the gate), `umtool/docs/authoring.md` |
+| `2d257fbe` | the stub's narration makes its card auto-length; msurf's clips inside the cached window |
+| (this commit) | this record, FACTS "Release 28 M9", CHANGELOG; `publish/siteDelete.ts`'s header names the editor's path |
+
+Gates (from the worktree root; counts at the branch's start `f7b8dae9`, after the merge of lane D `ea232bbc`, and at
+the tip):
+- tsc (all packages) clean before every commit.
+- common 4076 → 4089 after the merge → 4092/4092 (+3).
+- mcp 349 → 349 → 352/352 (+3).
+- editor unit 295 → 295 → 295/295 (none added).
+- `test:scripts` 880 + 3 skipped → 881 + 3 skipped after the merge → 890 + 3 skipped, 0 failed (+9).
+- `docs cli|files|env --check`, `settings example --check`: clean (COMMANDS.md regenerated in `82fd4ab8`).
+- umtool e2e, single specs in the foreground (the prebuild's capped `next build`: 396 s, most of it waiting for
+ memory beside the integration suite):
+ - `media-surfaces.spec.ts`: 1 passed, 1 failed twice (the chain's fast build: a stub narration longer than its
+ card, then a clip outside the cached window — fixture fixes in `2d257fbe`), then 2/2 in 48.8 s.
+ - `article-iterations.spec.ts` + `projects.spec.ts` 27/27 (52.0 s); `media-draft.spec.ts` + `draft-review.spec.ts`
+ 6/6 (28.8 s); `media-draft-e.spec.ts` + `onscreen.spec.ts` 9/9 (42.3 s).
+- Editor e2e `site-delete.spec.ts` + `sites-crud.spec.ts` 22/22 (34.9 s; its prebuild's capped `next build`, 76 s).
+- umtool capped build with the corpus linked, through the heavy slot (5 GB): ok, 301 s wall (most of it waiting for
+ the slot); the link removed.
+
+Found and left:
+- `draft-youtube`'s re-mux passes `--no-xfade`, Draft everything's build. A cut built final before it would be
+ re-muxed with hard-cut offsets; Draft everything never builds final.
+- The iteration's draft steps (`onscreen`, …) and the chain's (`chain:draft-onscreen`) are two records of one run;
+ the Iterations tab shows the first beside the step list.
+- `generate`'s summary of a media draft still lists the iteration's directory files (sweep.md, report.json) above
+ the video project; harmless, not trimmed.
+
## Not in this release
Comment and thread generation for social posts (X/Bluesky promotion); auto-publishing to YouTube (r28 writes the text