commit 738989c61935ebe086e83fa4b9034edf72a44067
parent 0ddc1eec5536454647662df1d3cbf79629979fa7
Author: I Mean I'm Just Saying <imeanimjustsaying@kiwifarms.st>
Date: Sun, 11 Oct 2026 01:44:35 -0400
plans: release 25 — T2 and T3, as shipped: narrated cards, the podcast; changelog
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Diffstat:
2 files changed, 93 insertions(+), 0 deletions(-)
diff --git a/editor/CHANGELOG.md b/editor/CHANGELOG.md
@@ -145,6 +145,8 @@
- **Different e2e suites run side by side, and `pnpm e2e:all` runs them all with one summary.** Each package's suite now waits only for another run of the SAME suite (`e2e-editor`, `e2e-export`, `e2e-homepage`, `e2e-umtool`), so the editor, export, homepage and umtool suites can run at once. `pnpm e2e:all` starts one per package, writes each suite's output to `test-results-e2e-all/`, and ends with one table — passed, failed, flaky and skipped per suite, how long each waited, every failed test by file and line — and the wall time against the sum of the suites' own.
- **The heavy slot admits jobs by memory, one build at a time.** An e2e suite (1.5 GB) or a capped `next build` (its 5 GB cap) now starts beside other heavy work while the memory left after what the running jobs were promised stays above the 6000 MB floor; two `next build`s still never run at once. A job that declares no estimate — a render, a hand `pnpm heavy -- …`, a publish stage's build — runs alone, as before. A waiter is told what it waits for (`waiting for memory — … MB promised to 2 running jobs`, `waiting for the build slot`).
- **The editor suite can run on several workers, each with servers of its own.** `E2E_WORKERS=2` (or `auto`, from memory, up to 3) gives every worker its own editor, export server and Ollama stub over its own data directory; specs that write into the checkout's build outputs or time a wall clock run afterwards on one worker. One worker stays the default until the parallel runs are measured.
+- **A report video's cards can be narrated by a stock synthetic voice.** A card may carry `narration: {text, voice?, engine?}` — the author's words, never derived from the card — and `seconds: "auto"`, its words' length plus a lead and a tail; `render.narration` sets the engine and voice (Kokoro, `af_heart`, by default), speed, level (−17.7 LUFS, with the clips) and the quiet around the words. The voice is synthesized by the editor (`pnpm ops tts`), never by umtool: the build chain's new step, `narrate-via-editor.mjs`, asks for every narration not yet kept and keeps each in the project's `out/narration/`, and the build plays it under its card. A number of seconds shorter than the words need is a lint error. A narrated cut says "Narration: synthetic voice (Kokoro-82M · af_heart)" — the editor's own line — in its file's metadata and at the end of its description and chapters exports. Stock voices only; a manifest without narration builds exactly as before.
+- **A report video can be exported as a podcast.** The project page's export row has a **podcast** button per cut (`build-podcast.mjs <manifest>` on the command line): the built cut as sound only — the clips, the narrated cards and the teasers' hits, each silent card left out (`render.podcast.skipSilentCards`) — levelled to −16 LUFS, as `out/<variant>/podcast.m4a` and `podcast.mp3` with the video's chapter titles at the podcast's own times, and `show-notes.md`: the chapters, every cited source's link and, for a narrated cut, the disclosure line. It is made from the segments of the last build, so build the cut first.
## [0.11.0] - 2026-09-30
- **Transcripts that arrived after a video was first seen are counted.** The stats behind the homepage, the hub and every site's charts were cached per video and refreshed only when the video's metadata changed, so a transcript that came later — a Whisper run days after the download, or a video downloaded after the last index build — never reached them, and a video with YouTube captions alone had no transcription date. Counts and charts were low; the homepage could show a site with 0 transcripts, 0 channels and 0 hours while it served its videos. A stat is now also redone whenever the index re-reads the video, every transcript has a date, and a captioned video is dated by when its captions arrived rather than by a later Normalize run, so its place on "Transcribed over time" can move. **After updating, rebuild and restart the editor before anything else:** until then, **Build stats dataset** runs the old code and would undo the new stats, while a site, hub or homepage build already runs the new code — and the first stats build of any kind re-reads every video once (about 10–30 minutes on a large archive; it can be stopped and picks up where it stopped). Then build the index, the stats, the homepage, the hub, and the sites.
diff --git a/plans/release-25.md b/plans/release-25.md
@@ -129,3 +129,94 @@ Not done here: the four `next build`s and `pnpm e2e:all` (the orchestrator's); n
runs a real synthesis in-process). Found and left: a job's `done` settles when its log stream is ended, not flushed
(`runManagedFunction`), so a near-instant job (a cache hit) can settle before its log is on disk — `pnpm ops --wait`
polls over HTTP and does not see it; the unit tests poll for the marker.
+
+### T2, as shipped — report-video narration (`r25/tts-video`)
+
+A card may carry words spoken by a stock synthetic voice. Opt-in and explicit: the words are the author's, never
+derived from the card, and a manifest without narration builds byte-for-byte as before.
+
+- **Manifest.** A `card`'s `narration: {text, voice?, engine?}` and `seconds: "auto"`; `render.narration {engine
+ (kokoro), voice (af_heart), speed (1, 0.5–2), lufs (−17.7, −30 to −10), lead (0.8), tail (0.8)}`. Engine
+ `kokoro | orpheus | espeak-ng` (the editor refuses `orpheus` until T1b); the engine and voice are always sent, so a
+ change of the editor's default never changes a cut that did not ask for it.
+- **`validateNarration`** (`report-to-video/narration.mjs`, pure; the build before a single fetch, and the lint):
+ narration on cards only; text non-empty and at most 300 words, the tags not counted; the only `<…>` are the
+ expressive tags, lowercase and exact (the editor's rule; a case slip gets "did you mean <sigh>?"; a test holds the
+ list equal to `TTS_EXPRESSIVE_TAGS`); a stock voice's id, never a path; each setting in range; `lead`/`tail` at least
+ the crossfade; `seconds: "auto"` only beside a narration.
+- **`narrate-via-editor.mjs`** asks `POST /api/ops/tts` `{text, engine, voice, speed}` once per distinct narration (a
+ key over words, engine, voice, speed), as one batch, follows each job on `GET /api/ops/job/<id>` (its queue place
+ said as it moves), reads the last `@@tts-result` line of its tail (re-read briefly when a done job's line is not on
+ disk yet), and COPIES the WAV into `out/narration/<key>.wav` beside `<key>.json`: the words, engine, voice, speed,
+ measured seconds and LUFS, the copy's sha256, the editor job, and the editor's `disclosure`, verbatim. `out` is
+ never sent. A narration kept is never asked again. The driver runs it as a step before the build when the manifest
+ carries narration (`options.narrate`, set by the build route); `busy.mjs` sees it. A build that finds one missing
+ asks itself; `--skip-fetch` refuses, naming the card.
+- **The card's sound**: the WAV in place of `anullsrc` (`narratedCardEncodeArgs`, `narrationAudioFilter`): resampled
+ to `audioRate`/`audioChannels`, levelled from its measured loudness to `lufs` (±24 dB), limited at −1 dBFS, delayed
+ by `lead`, padded and trimmed to exactly the card's seconds. `cardEncodeArgs` is the un-narrated encode, argument for
+ argument as before.
+- **`seconds: "auto"`** = lead + words + tail, up to the tenth, on the run's copy of the timeline. An authored number
+ shorter than that is a lint ERROR (`narrationLengthErrors`): the build refuses before it renders; `--lint` judges the
+ narrations already kept. The deck's estimate reckons 2.7 words a second (`estimatedDuration`); `verify-build`'s
+ length floor takes no number from "auto".
+- **Rebuilt only on change**: `segments/<id>.narration.json` holds the key (the card as resolved, the render block,
+ the nodes, the framing, the narration's sha256, the sound's filter, the encode); a match leaves the segment, a
+ change writes a new file through a rename (a take's linked segment is never written through).
+ `SEGMENT_FILE_SUFFIXES` gains `.narration.json`.
+- **Disclosure**: the editor's own lines from the kept records ("Narration: synthetic voice (Kokoro-82M · af_heart)"),
+ each once — in the cut's `comment` metadata (muxed with the chapters), and at the end of the `description` and
+ `chapters` exports (`readCutDisclosure`). A narration not kept says the line in the editor's form.
+- README "Narration" (with "Writing narration": for the ear, the drama never outrunning the sources); docs
+ `report-video.md` "Narrated cards"; "Not done yet" now says narration is on cards only.
+
+| commit | what |
+|---|---|
+| `96bab418` | narrated cards: validator, narrate-via-editor, the store, the card encode, "auto", the record, driver step, disclosure, e2e stub + spec |
+| `219f9967` | T1 as shipped: the editor's disclosure verbatim, exact tags (+ the `TTS_EXPRESSIVE_TAGS` test), a late result line re-read |
+
+### T3, as shipped — the podcast (`r25/tts-video`)
+
+`build-podcast.mjs <manifest> [--out] [--variant] [--progress ndjson]` renders the cut as sound only, **from its built
+segments**, so it plays exactly what the video plays. Takes the heavy slot.
+
+- **The plan** (`podcastPlan`, pure): heard — each clip (its `muteFrom` honoured, `muteSegmentSeconds` as the join
+ does), each narrated card, each teaser with hits; left out — every entry with no sound of its own, or
+ `render.podcast.silence` seconds of quiet each with `skipSilentCards: false`. Holds, moves, dips and the end fade are
+ picture and are not in it.
+- **The sound**: joined end to end with 10 ms edges, levelled in two `loudnorm` passes (linear) to −16 LUFS / −1.5
+ dBTP; `podcast.m4a` (AAC 160k, faststart) and `podcast.mp3` (128k, ID3v2.3 chapters), each with the chapters — the
+ video's `chapters.ffmeta` titles at the podcast's own offsets — the title, and the disclosure as `comment`.
+- **`show-notes.md`**: title, subtitle, length, the chapters with times, every cited source's link once (a heard
+ clip's by the QR's rule, a still's `citeUrl`, a post's `url`), the disclosure. **`podcast.json`**: the plan, each
+ item's seconds, what was left out, the measured loudness, the files.
+- **Refusals**, naming each: a segment not built ("build the cut first — a fast build is enough"); a narrated card's
+ segment made from other words than the manifest's (its `.narration.json` key). `validatePodcast` (`render.podcast`:
+ `skipSilentCards, silence, lufs, truePeak, bitrate, mp3, mp3Bitrate`) runs in the render and the lint.
+- **umtool**: the build route's `options.podcast` runs it alone (no preflight, no verify, no overwrite guard; job
+ `podcast <project>`); `GET /api/report/podcast?project&variant&file=m4a|mp3|notes` serves the three by name
+ (`podcastFor`, `PODCAST_FILES`); the project page's export row has a **podcast** button per cut
+ (`PodcastExport.tsx`), then links to the three files.
+
+| commit | what |
+|---|---|
+| `094b64fb` | build-podcast, validatePodcast, the route option, the file route, the export-row button, driver/busy, docs |
+| `1f48aa9c` | a post's label without a nested template literal (`next-build-trace.test.mjs` misread it as running to the file's end) |
+
+#### Gates (T2 + T3)
+
+| gate | result |
+|---|---|
+| tsc (`pnpm -r … exec tsc --noEmit`) | clean at every commit |
+| umtool unit (`report-to-video/*.test.mjs`, `lib/*.test.mjs`, `lib/report/*.test.mjs`) | 655: 653 pass, 2 skip (new: `narration.test.mjs` 12, `narrate.test.mjs` 6 — a fake editor, three real builds, `build-podcast.test.mjs` 6 — a real render, `export-narration.test.mjs` 1, `driver.test.mjs` +2, `deliverables.test.mjs` +2 asserts) |
+| `pnpm run test:scripts` (after the T1 merge) | 825: 822 pass, 3 skip |
+| un-narrated byte-identity | the same manifest (two cards, a still, hard cuts, chapters) built by `9d805472`'s and this branch's `build-video.mjs`: every segment and the final mp4 md5-identical |
+| umtool e2e `report-narration.spec.ts` (new; start mode, at `219f9967`) | 3 passed (14.9 s): the chain's narration step, a fixture build voiced by the e2e editor stub's tone (one ask, the words, engine and voice on the wire; the card audible, "auto" 3.7 s; the plain card −91 dB; the exports' disclosure), the export row's podcast (files, 2 chapters, `left: ["k02"]`, served by name, a traversal name a 400) |
+| umtool e2e `build.spec.ts onscreen.spec.ts` | 14 passed (35.9 s) |
+| umtool capped `next build`, corpus linked (`pnpm heavy`, 5 GB cap) | compiled in 7.1 s, TypeScript 15.0 s; link removed |
+| counts-only privacy greps over `9d805472..` (home paths, the operator's names and email, session links and trailers) | 0 each |
+
+Not done here: no real Kokoro synthesis through the live editor (the fake editor and the e2e stub stand in; T1's
+gate ran one through the route), the editor/export/homepage builds and `pnpm e2e:all` (the orchestrator's).
+**Found and left.** A podcast is made from the last build's segments: a clip re-cut since is heard as it was built
+(only a narrated card's words are checked). Narration under clips, and a podcast's RSS enclosure (T4), are not built.