commit e9be2c3464b4a964aa2b9f586bc4585b90980e29
parent 367c409ee4430d30a142c2caadd8b49137f4a0a6
Author: I Mean I'm Just Saying <imeanimjustsaying@kiwifarms.st>
Date: Mon, 9 Nov 2026 20:35:50 -0500
transcribe-one: refuse only the audio download of a live video; Configure keeps an unchanged stored subLangs
Review of lane/editor-gaps. The live check ran before the captions route, so a
stale is_live/post_live record with English captions listed was refused though
a captions-only fetch is harmless (the managed path skips a real live stream);
it now runs only where the audio download comes next. And a subLangs value
saved before the check, submitted unchanged, is kept with a warning (server
log) instead of locking Configure: parseChannelForm takes the stored config.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Diffstat:
6 files changed, 68 insertions(+), 21 deletions(-)
diff --git a/editor/CHANGELOG.md b/editor/CHANGELOG.md
@@ -4,8 +4,8 @@
- **Deleting a channel takes it off every site.** On 9 Nov, deleting `mooler` left it in efapalyzer's `site.json`, and the site had to be fixed by hand. Danger → Delete and `pnpm ops delete-channel` now rewrite every site whose pool (`channels`) or cited scope (`citedChannels`) names the deleted channel, through the one site writer (`writeSite`), as a rename already re-points them. The ops answer names those sites in `sitesUpdated`. A site whose write is refused shows up as a `warnings` line, and the delete still stands. Sites that never named the channel are not written (`common/controller/siteMemberships.ts`).
- **`pnpm ops create-site` is the New site form, without a browser.** On 9 Nov an agent had to call `writeSite` from a tsx script to make `efapalyzer`. `create-site` takes `{"siteId", "siteTitle"}` and any of the form's fields: header title (default the title), description, tagline, wordmark lead, accent, public URL, Pages project, hub URL, audience, listed, publish policy, search, archives, duplicates, transcript downloads, PWA, archive cap, groups, default group, channels, cited channels, social links and related sites. It builds the FormData the form posts and saves it through the form's own action (`saveSiteAction` → `writeSite`), so you get the same validation and the same sentences. A new site is **private and unlisted** unless the body says `"audience": "public"` / `"listed": true`. An existing id is refused (409) unless `"update": true`, which is the site page's Save with only the given keys changed; every other key, and the published page list, is kept. Unknown channels, unknown keys and keys of the wrong type are refused before anything is written. It answers the saved site.
- **`pnpm ops channel-rank` places one channel in the order the lanes follow.** Before this, only /channels' "Add to top" moved a channel, and it also sets the tier to normal and turns the download lane on. `channel-rank` moves the rank alone: `{"slug"}` plus exactly one of `"rank": <n>` (or `null` to unrank), `"top": true`, `"bottom": true`, `"before": "<slug>"` or `"after": "<slug>"`. Every other channel keeps its order: if the rank is already taken, that channel and every one below it shift down one. It goes through the deck's one writer, so the four lane roots are recompiled in the same write. Refused before any write: an unknown channel or anchor, an anchor with no rank, a rank that is not a whole number ≥ 0, and a channel paused for every operation (its rank would not be kept). It answers the saved rank and the whole ranked order (`common/lib/channelPriority.ts` `placeChannelRank`).
-- **Configure's Caption languages field (`subLangs`) is checked when you save.** Before, any text was saved, and a value yt-dlp's `--sub-langs` cannot use failed every caption download on the channel at the moment it ran. Configure and `pnpm ops channel-config` (`patch.subLangs`) now refuse it, in the field's words, with what you typed kept. Refused: an empty entry (two commas, or one at an end), a space inside an entry, a bare `-`, an entry that is not a regular expression, or a value over 200 characters. Spaces around an entry are dropped (`en.* , es` saves as `en.*,es`). `all` and `-<lang>` exclusions are accepted as before (`common/lib/channelConfig.ts` `subLangsProblem`).
-- **Transcribe refuses a video that is live.** On 4 Nov a transcribe-one on a live YouTube video downloaded the stream at 1x and held `platform:youtube` for the stream's whole length. Now the video page's Transcribe and `pnpm ops transcribe-one` refuse a video whose `metadata.info.json` says it is live (`is_live`), scheduled (`is_upcoming`) or still processing its VOD (`post_live`), before anything is queued. The refusal names `pnpm ops record-live` for the stream (not for `post_live`), says to wait for the VOD otherwise, and names `refresh-metadata` to re-read the record once the stream has ended. The job checks again just before its download, in case the record was re-read while it waited. A video whose audio or container is already on disk still transcribes, since nothing is downloaded. A finished stream (`was_live`) downloads as before (`common/lib/liveNow.ts`).
+- **Configure's Caption languages field (`subLangs`) is checked when you save.** Before, any text was saved, and a value yt-dlp's `--sub-langs` cannot use failed every caption download on the channel at the moment it ran. Configure and `pnpm ops channel-config` (`patch.subLangs`) now refuse it, in the field's words, with what you typed kept. Refused: an empty entry (two commas, or one at an end), a space inside an entry, a bare `-`, an entry that is not a regular expression, or a value over 200 characters. Spaces around an entry are dropped (`en.* , es` saves as `en.*,es`). A value saved before this check and submitted unchanged is kept, with a warning in the server log, so Configure is never locked on it. `all` and `-<lang>` exclusions are accepted as before (`common/lib/channelConfig.ts` `subLangsProblem`).
+- **Transcribe refuses a video that is live.** On 4 Nov a transcribe-one on a live YouTube video downloaded the stream at 1x and held `platform:youtube` for the stream's whole length. Now the video page's Transcribe and `pnpm ops transcribe-one` refuse a video whose `metadata.info.json` says it is live (`is_live`), scheduled (`is_upcoming`) or still processing its VOD (`post_live`), before anything is queued. The refusal names `pnpm ops record-live` for the stream (not for `post_live`), says to wait for the VOD otherwise, and names `refresh-metadata` to re-read the record once the stream has ended. The job checks again just before its download, in case the record was re-read while it waited. Only the audio download is refused: a video whose audio or container is already on disk still transcribes, and a youtube-handling video with English captions listed still has its captions fetched instead. A finished stream (`was_live`) downloads as before (`common/lib/liveNow.ts`).
- **The X run console: several X channels' posts fetched as one job that stops when the cookies go stale.** On 8 and 9 Nov an agent ran X fetch-posts by hand, one channel after another, watching the cookie jar age and putting off the rest once it went stale. `/review`'s new **X run** section lists the X posts channels in priority order (focus, tier, rank; paused ones unticked), with a tick and up/down buttons for each, and **Start X run** queues ONE `x-run` job on X's queue. The job fetches each channel in turn (new posts only, at most 200 each), waits X's queue gap (`pacing.jobGapSeconds.twitter`) between two channels, and checks the cookie jar again before EACH one. Once the jar is past `social.x.maxCookieAgeMinutes`, or the X alert is up, the run stops and the rest are **deferred until the next refresh**. It never refreshes cookies itself. The console shows each channel's state (queued, running, done with its new posts, deferred, failed), "N done, M deferred until the next refresh", the jar's age counted down to the limit, and the wait before the next channel. **Resume** runs the deferred channels after the operator presses Refresh cookies on /settings. A Retry of the job, and "Re-run stopped jobs", do the same. A restart does not resume a run: an interrupted run ends deferred. `pnpm ops x-run {"channels": [...]}` / `{"resume": "<run id>"}` and `pnpm ops get x-run` do the same from a terminal.
- **Account activity on a posts channel's page: posts per day, with the long silences marked.** A compact bar strip shows posts per UTC day over the archive's range. Long silences are shaded and listed: a gap of at least 3× the account's median gap AND 48 h, each linked to the post before it and the post after. An open-ended silence since the last post is listed too, when the last fetch came that long after it. Only the account's own posts count (a with-replies timeline also archives the posts it answers). The silence is the archive's ("no archived post"), and a stretch no fetch reached looks the same. Mr Obvious's 5–8 Nov gap reads 4 Nov 10:54 → 8 Nov 19:00 UTC on ObviousRises-x.
- **umtool: each character has a voice, auditioned on a page, the same in every project.** The operator wanted to "pick different voices for different characters, and in UI alone be able to try rendering different ones to compare … and try to maintain consistent voices for different repeating characters" -- tonight TheQuartering's reads were re-voiced by hand after scoring five voices against his real one. `/projects/<p>/voices` (from the Cut tab's Reads and voices) lists every character a project's reads use, the voice each reads in now and where it comes from (the cast, the project, the narrator's, the default), its reads in another voice, and its real voice. **Audition** reads one line (its own words here, a stock line, or typed) in 2-6 stock voices -- a job: the editor's tts, then each one's closeness to the real voice (speakers.json, TitaNet, local) -- played side by side at one loudness beside the real voice, a reference never a target. **Use for this project** or **Use everywhere** (the cast, `<reports>/.umtool/cast.json`), then the items to re-read, queued. A recording of an item can be made a character's read: kept, cleaned, converted to its stock voice. Every read -- a single post's and each piece of a thread read -- asks the same order (the read's own, the project's map, the cast, the narrator's, the default), and a cast voice of another engine is synthesized by it. `umtool cast ls|add|set|rm|undo|project|audition|use|reread`, `posts narrate … --recording`, and `umtool lint` warns when a cast character is read in another voice.
diff --git a/editor/app/api/ops/transcribe-one/route.test.ts b/editor/app/api/ops/transcribe-one/route.test.ts
@@ -229,7 +229,7 @@ test("a live, scheduled or processing stream is refused before anything is queue
String(live.body.error).includes(`pnpm ops record-live --json '{"slug":"${SLUG}","id":"liveHHHHHHH"}'`),
String(live.body.error),
);
- // Without "asr" too: the live check comes before the captions route.
+ // Without "asr" and with no captions listed: the audio download is next, refused.
const plain = await callPost(POST, { slug: SLUG, id: "liveHHHHHHH" });
assert.equal(plain.status, 400);
assert.match(String(plain.body.error), /is live now/);
@@ -245,6 +245,19 @@ test("a live, scheduled or processing stream is refused before anything is queue
assert.match(String(post.body.error), /VOD is still being processed/);
assert.equal((await corpus.listJobIds()).length, before, "nothing was queued");
+ // A (possibly stale) live record with English captions listed: the captions
+ // fetch is no audio download, so it goes through; asr: true is refused.
+ const captions = { automatic_captions: { en: [{ ext: "vtt", url: "https://example.invalid/en.vtt" }] } };
+ await video("livecapsMMM", { live_status: "post_live", ...captions });
+ const caps = await callPost(POST, { slug: SLUG, id: "livecapsMMM" });
+ assert.equal(caps.status, 200, JSON.stringify(caps.body));
+ assert.equal(caps.body.instead, "captions");
+ await until("the live video's caption fetch", () => ended(String(caps.body.jobId)));
+ await video("livecapsNNN", { live_status: "is_live", ...captions });
+ const capsAsr = await callPost(POST, { slug: SLUG, id: "livecapsNNN", asr: true });
+ assert.equal(capsAsr.status, 400);
+ assert.match(String(capsAsr.body.error), /livecapsNNN is live now/);
+
// A finished stream (was_live) downloads as any video does.
await video("wasliveKKKK", { live_status: "was_live" });
const vod = await callPost(POST, { slug: SLUG, id: "wasliveKKKK", asr: true });
diff --git a/editor/app/channels/[slug]/videos/[id]/videoActions.ts b/editor/app/channels/[slug]/videos/[id]/videoActions.ts
@@ -734,16 +734,6 @@ export async function whisperVideoAction(
? null
: await transcriptionContainer({ paths, slug, videoDir, entries: firstEntries });
- // A STREAM IN PROGRESS IS NEVER DOWNLOADED FOR A TRANSCRIPTION (4 Nov): the
- // one-video download would read the HLS at 1x and hold the platform's queue
- // for the stream's length. Refused while its record says it is live,
- // scheduled or still processing — unless nothing has to be downloaded (the
- // audio, or a container, is already here). lib/liveNow.ts.
- if (!audioOnDisk && firstHeld?.kind !== "container") {
- const live = await liveDownloadRefusalFor(videoDir, { slug, videoId });
- if (live) return { ok: false, error: live };
- }
-
if (!audioOnDisk && asr !== true && r.config.handling === "youtube") {
const onDisk = englishVttsByPreference(firstEntries);
if (onDisk.length > 0) {
@@ -799,6 +789,18 @@ export async function whisperVideoAction(
});
}
+ // A STREAM IN PROGRESS IS NEVER DOWNLOADED FOR A TRANSCRIPTION (4 Nov): the
+ // one-video download would read the HLS at 1x and hold the platform's queue
+ // for the stream's length. Refused while its record says it is live,
+ // scheduled or still processing — only here, where the audio download is
+ // what comes next: audio or a container already here owes no download, and
+ // a captions-only fetch (above) is harmless, the managed path skipping a
+ // stream that really is live. lib/liveNow.ts.
+ if (!audioOnDisk) {
+ const live = await liveDownloadRefusalFor(videoDir, { slug, videoId });
+ if (live) return { ok: false, error: live };
+ }
+
const platformQueue = videoQueueKey(r.config, queueKey);
const slot = handOffSlot();
const res = await runManagedFunction({
diff --git a/editor/app/channels/actions.ts b/editor/app/channels/actions.ts
@@ -363,15 +363,18 @@ export async function updateChannelAction(
formData: FormData,
): Promise<ActionResult> {
const values = formValues(formData);
+ const paths = getPaths();
+ const existing = await readChannelConfig(paths, slug);
+ if (!existing) return { error: `Channel "${slug}" not found`, values };
let parsed;
try {
- parsed = parseChannelForm(formData);
+ parsed = parseChannelForm(formData, { stored: existing });
} catch (e) {
return { error: (e as Error).message, values };
}
- const paths = getPaths();
- const existing = await readChannelConfig(paths, slug);
- if (!existing) return { error: `Channel "${slug}" not found`, values };
+ // A stored value today's checks refuse, saved unchanged: the save stands.
+ // The form has no place for a warning, so the server log says it.
+ for (const w of parsed.warnings) console.warn(`Channel ${slug} saved with a warning: ${w}`);
// Plan the site-membership writes (Sites section) before touching anything,
// so bad input errors out with no partial write. Null = field absent
// (zero sites configured / legacy submit) → leave memberships alone.
diff --git a/editor/app/channels/components/parseChannelForm.test.ts b/editor/app/channels/components/parseChannelForm.test.ts
@@ -373,6 +373,14 @@ test("subLangs: a value --sub-langs cannot use is refused; spaces around entries
const fd = channelConfigToFormData({ handling: "youtube", name: "Example VODs" });
applyChannelFormPatch(fd, { subLangs: "en,(" });
assert.throws(() => parseChannelForm(fd), /Caption languages entry "\(" is not a valid regular expression/);
+ // A value saved before the check, submitted unchanged, does not lock the
+ // form: kept as stored, with a warning. Changed, it is refused.
+ const stored = { subLangs: "en us" };
+ const kept = parseChannelForm(form({ subLangs: "en us" }), { stored });
+ assert.equal(kept.config.subLangs, "en us");
+ assert.match(kept.warnings[0] ?? "", /Caption languages entry "en us" has a space in it .*\. Kept as stored, since it is unchanged/);
+ assert.throws(() => parseChannelForm(form({ subLangs: "en uk" }), { stored }), /has a space in it/);
+ assert.deepEqual(parseChannelForm(form({ subLangs: "en.*" }), { stored }).warnings, []);
});
// 2026-10-29: manual downloads (lib/manualDownloads.ts) are a Configure field
diff --git a/editor/app/channels/components/parseChannelForm.ts b/editor/app/channels/components/parseChannelForm.ts
@@ -61,6 +61,16 @@ export type ParsedChannelForm = {
name: string;
slug: string;
config: ChannelConfig;
+ // Saved, but said: a stored value the form's checks would refuse today,
+ // submitted unchanged (see `stored`).
+ warnings: string[];
+};
+
+// What a Configure save knows of the channel as stored. A check added after a
+// value was saved (caption languages, lane editor-gaps) must not lock the form
+// on it: the stored value, submitted unchanged, is kept with a warning.
+export type ParseChannelFormContext = {
+ stored?: Pick<ChannelConfig, "subLangs"> | null;
};
// ChannelConfig keys the form authoritatively controls. updateChannelAction
@@ -106,7 +116,11 @@ export const CHANNEL_FORM_FIELDS = [
// Maps FormData -> ChannelConfig. Throws on invalid input so the server
// action can render an error message.
-export function parseChannelForm(formData: FormData): ParsedChannelForm {
+export function parseChannelForm(
+ formData: FormData,
+ ctx: ParseChannelFormContext = {},
+): ParsedChannelForm {
+ const warnings: string[] = [];
const name = String(formData.get("name") ?? "").trim();
if (!name) throw new Error("Name is required");
@@ -294,11 +308,18 @@ export function parseChannelForm(formData: FormData): ParsedChannelForm {
// (`en.*,live_chat`), omitted; "with-download" is the default chat mode,
// omitted too, so choosing it clears a stored mode.
const subLangsRaw = stringOrUndef(formData, "subLangs");
+ let subLangs = subLangsRaw ? normalizeSubLangs(subLangsRaw) : undefined;
if (subLangsRaw) {
const problem = subLangsProblem(subLangsRaw);
- if (problem) throw new Error(`Caption languages ${problem}`);
+ const stored = ctx.stored?.subLangs?.trim();
+ if (problem && stored && normalizeSubLangs(stored) === subLangs) {
+ // Unchanged from what is stored: kept as stored, and said.
+ subLangs = stored;
+ warnings.push(`Caption languages ${problem}. Kept as stored, since it is unchanged; yt-dlp may refuse it.`);
+ } else if (problem) {
+ throw new Error(`Caption languages ${problem}`);
+ }
}
- const subLangs = subLangsRaw ? normalizeSubLangs(subLangsRaw) : undefined;
const chatRaw = String(formData.get("chat") ?? "").trim();
if (chatRaw && !isChatMode(chatRaw)) {
throw new Error(`Live chat must be one of: ${CHAT_MODES.join(", ")}`);
@@ -509,7 +530,7 @@ export function parseChannelForm(formData: FormData): ParsedChannelForm {
if (wayback) config.wayback = wayback;
if (xSearch) config.xSearch = xSearch;
- return { name, slug, config };
+ return { name, slug, config, warnings };
}
// The platform select's value for an X search channel: not a platform (the