@aicopycoders/exodus 2026.11.1200-beta.12 → 2026.11.1200-beta.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1654,8 +1654,9 @@ under it:
1654
1654
  made again with `retry-clip`, or kept as it is with `exodus video keep
1655
1655
  <runId> --scene <n>` or on the video's page (the link it prints). Keeping
1656
1656
  the last one starts the cut.
1657
- A One-take take held for its words, or for a product label that came out
1658
- backwards and could not be fixed, is named under `Held:` with its own
1657
+ A One-take take held for its words, for a picture that came out turned on
1658
+ its side or upside down, or for a product label that came out backwards and
1659
+ could not be fixed, is named under `Held:` with its own
1659
1660
  sentence, every reason it was held for (`stop.heldTakes` in `--json`). It
1660
1661
  cannot be made again on its own, so no `retry-clip` is offered. Show the user the sentence
1661
1662
  and ask them to watch the take. With their yes, `exodus video keep <runId>
@@ -83,6 +83,9 @@ export class FirstCutError extends Error {
83
83
  readonly code: 1 | 2;
84
84
  }
85
85
 
86
+ /** Why a finished cut is refused for its loudness (LoudnessRefusal's message), or null when its true peak is at or under -1 dBTP. */
87
+ export function truePeakRefusal(measured: { i: number; tp: number } | null): string | null;
88
+
86
89
  /** The finished cut's true peak is over -1 dBTP, or could not be measured, after the loudness pass. */
87
90
  export class LoudnessRefusal extends FirstCutError {
88
91
  constructor(message: string, measured: { i: number; tp: number } | null);
@@ -269,8 +272,11 @@ export interface CutPace {
269
272
  /** COP-300: the finished cut was checked against its own sound (cutSync). */
270
273
  captionCheck?: true;
271
274
  };
272
- /** `limited`: limitPeaks' limiter ran after the loudness pass. */
273
- loudness?: { lufs: number; truePeak: number; passes: 1 | 2; limited?: true };
275
+ /**
276
+ * `limited`: limitPeaks' limiter ran after the loudness pass. #4573: `limitedAgain` times it ran again lower, from
277
+ * the same mix, because the finished file was over -1 dBTP; `limit` is the ceiling the kept cut was made at.
278
+ */
279
+ loudness?: { lufs: number; truePeak: number; passes: 1 | 2; limited?: true; limitedAgain?: number; limit?: number };
274
280
  /** Present only with cutChecks. */
275
281
  checks?: CutChecks;
276
282
  /** COP-300: present when a sped-up cut burned its captions: the caption file is on the finished cut's clock. */
@@ -199,11 +199,32 @@ export const FINISH_LRA = 11;
199
199
  export const TRUE_PEAK_MAX_DB = -1;
200
200
  /**
201
201
  * limitPeaks: after the loudness pass, the sound oversampled 4x through a
202
- * limiter at 0.8 (about -1.9 dB), so a peak between two samples is caught too.
202
+ * limiter at PEAK_LIMIT (about -1.9 dB), so a peak between two samples is caught too.
203
203
  * The cut is still measured after and refused over TRUE_PEAK_MAX_DB. Its
204
204
  * resample is pinned to stereo, as every one after loudnorm is (loudnessApplyArgs).
205
205
  */
206
- export const PEAK_LIMITER = "aresample=192000,aformat=channel_layouts=stereo,alimiter=limit=0.8:level=false:attack=2:release=60";
206
+ export const PEAK_LIMIT = 0.8;
207
+ /** The limiter at `limit`, a linear level alimiter takes from 0.0625 to 1. */
208
+ export function peakLimiter(limit = PEAK_LIMIT) {
209
+ return `aresample=192000,aformat=channel_layouts=stereo,alimiter=limit=${limit}:level=false:attack=2:release=60`;
210
+ }
211
+ export const PEAK_LIMITER = peakLimiter();
212
+ /**
213
+ * #4573: the AAC encode after the limiter can put a peak back over
214
+ * TRUE_PEAK_MAX_DB, by a different amount on each cut of the same takes (the
215
+ * room tone is fresh noise every time). A limited cut that lands over is
216
+ * limited again from the same mix, this many times at most, each time lower by
217
+ * what the last one landed over FINISH_TRUE_PEAK; still over, it is refused.
218
+ */
219
+ export const LIMIT_AGAIN_MAX = 2;
220
+ /** The lowest ceiling a limit again goes to (about -6 dB): a cut that needs lower is refused, not squashed. */
221
+ const PEAK_LIMIT_MIN = 0.5;
222
+
223
+ /** The next ceiling down after a limited pass measured `tp` dBTP. */
224
+ export function lowerPeakLimit(limit, tp) {
225
+ const lower = limit * 10 ** (-(tp - FINISH_TRUE_PEAK) / 20);
226
+ return Math.max(PEAK_LIMIT_MIN, Math.round(lower * 10_000) / 10_000);
227
+ }
207
228
  /**
208
229
  * jumpCut: inside a talking clip, a pause over maxGap between two heard words
209
230
  * is cut down, keeping keepAfter after the earlier word and keepBefore before
@@ -609,12 +630,21 @@ function spokenWords(word) {
609
630
  return spokenForms(word).flatMap((t) => SPOKEN_FORMS.get(t) ?? [t]).map((t) => SAME_WORD_SPELLINGS.get(t) ?? t);
610
631
  }
611
632
 
633
+ /**
634
+ * COP-311: a scribe writes two words it heard as one with a slash ("probiotic/an" for "probiotic and"): the
635
+ * aligners read them as the words they are, as scout scribe.ts slashParts. A number ("1/2", "24/7") stays whole.
636
+ */
637
+ function slashParts(word) {
638
+ const parts = String(word ?? "").split("/").filter(Boolean);
639
+ return parts.length > 1 && parts.every((p) => /\p{L}/u.test(p)) ? parts : [word];
640
+ }
641
+
612
642
  /** { tokens, sourceIndex }: tokens[i] came from written word sourceIndex[i]. */
613
- function spokenTokens(words) {
643
+ function spokenTokens(words, partsOf = (word) => [word]) {
614
644
  const tokens = [];
615
645
  const sourceIndex = [];
616
646
  words.forEach((word, i) => {
617
- for (const token of spokenWords(word)) {
647
+ for (const token of partsOf(word).flatMap(spokenWords)) {
618
648
  tokens.push(token);
619
649
  sourceIndex.push(i);
620
650
  }
@@ -705,6 +735,24 @@ const soundKey = (token) =>
705
735
  .replace(/(?<=\w{3})oe$/, "o")
706
736
  .replace(/(?<=[aeiou])z$/, "s");
707
737
 
738
+ /**
739
+ * The script's and the heard words' tokens as the aligner compares them, and
740
+ * its word match: matches(e, h) when script token e is said by heard token h.
741
+ * `slash`: both sides read a word written with a slash as its words (COP-311).
742
+ */
743
+ function scriptTokens(words, written, slash = true) {
744
+ const partsOf = slash ? slashParts : undefined;
745
+ const scripted = spokenTokens(written, partsOf);
746
+ const heardWords = spokenTokens(words.map((w) => w.w), partsOf);
747
+ const nameLike = nameLikeWords(written);
748
+ const names = scripted.tokens.filter((_, t) => nameLike[scripted.sourceIndex[t]]);
749
+ const heard = joinSplitWords(heardWords, scripted.tokens, names);
750
+ const expected = joinSplitWords(scripted, heard.tokens);
751
+ const matches = (e, h) =>
752
+ h < heard.tokens.length && sameWord(expected.tokens[e], heard.tokens[h], nameLike[expected.sourceIndex[e]]);
753
+ return { heardWords, heard, expected, matches };
754
+ }
755
+
708
756
  /**
709
757
  * Where the script's first complete, in-order delivery sits in the heard
710
758
  * words, or null. heardTokenOf/heardWordOf give the heard token and word that
@@ -714,15 +762,13 @@ const soundKey = (token) =>
714
762
  * exact delivery wins. Mirrors scout scribe.ts alignScript.
715
763
  */
716
764
  function alignScript(words, written) {
717
- const scripted = spokenTokens(written);
718
- const heardWords = spokenTokens(words.map((w) => w.w));
719
- const nameLike = nameLikeWords(written);
720
- const names = scripted.tokens.filter((_, t) => nameLike[scripted.sourceIndex[t]]);
721
- const heard = joinSplitWords(heardWords, scripted.tokens, names);
722
- const expected = joinSplitWords(scripted, heard.tokens);
765
+ // COP-311: read with the slash words split, else as written, so a take found before ("salt and/or pepper"
766
+ // said "salt and pepper") is still found. Mirrors scout scribe.ts alignScript.
767
+ return alignTokens(scriptTokens(words, written, true)) ?? alignTokens(scriptTokens(words, written, false));
768
+ }
769
+
770
+ function alignTokens({ heardWords, heard, expected, matches }) {
723
771
  if (expected.tokens.length === 0 || heard.tokens.length === 0) return null;
724
- const matches = (e, h) =>
725
- h < heard.tokens.length && sameWord(expected.tokens[e], heard.tokens[h], nameLike[expected.sourceIndex[e]]);
726
772
  const pair = (allowMisheard) => {
727
773
  const tokenOf = [];
728
774
  let j = 0;
@@ -745,6 +791,90 @@ function alignScript(words, written) {
745
791
  };
746
792
  }
747
793
 
794
+ /** scriptTimes: sounds a speaker makes between words; one never stands in the place of a script word. */
795
+ const FILLER_TOKENS = new Set(["um", "umm", "uhm", "uh", "uhh", "er", "erm", "ah", "hmm", "mm", "mhm"]);
796
+ /** scriptTimes: a take with fewer of its script's tokens heard as written than this share is not the script misheard. */
797
+ const MIN_HEARD_SHARE = 0.5;
798
+
799
+ /**
800
+ * COP-311, Mario's "Fix the text, never the times", for a take where
801
+ * alignScript finds no delivery of the whole script in order: the script's
802
+ * tokens and the heard ones are paired by their longest common run, with the
803
+ * aligner's word match. The script tokens left between two pairs take the
804
+ * time of the heard words left in their place, a filler ("um") never one of
805
+ * them: one heard token each when the counts are the same, else, with one
806
+ * heard token more (a word heard as two), the span of them shared evenly by
807
+ * the script words there. Before the first pair or after the last, only one
808
+ * heard token each: a lead-in ("Okay so") or a sign-off ("Thanks guys") is
809
+ * not told apart from a misheard first or last word, so neither is shown.
810
+ * Every other place times nothing: a script word dropped, or said over words
811
+ * the script does not have, is not shown, and a heard word with no script
812
+ * word in its place times nothing. A take with fewer than MIN_HEARD_SHARE of
813
+ * its script tokens heard as written says something else: only those are
814
+ * timed. A script word with a digit ("$23.08", "30%") is timed only where
815
+ * its number words are heard as written ("dollars" may be heard as "oh"),
816
+ * so a number said otherwise is never shown. `times[e]` is script token e's [start, end] on the heard words'
817
+ * clock, or null.
818
+ */
819
+ function scriptTimes(words, written) {
820
+ const { heard, expected, matches } = scriptTokens(words, written);
821
+ const n = expected.tokens.length;
822
+ const m = heard.tokens.length;
823
+ // run[e * (m + 1) + h]: the longest common run of script tokens e.. and heard tokens h..
824
+ const run = new Int32Array((n + 1) * (m + 1));
825
+ const at = (e, h) => run[e * (m + 1) + h];
826
+ for (let e = n - 1; e >= 0; e--) {
827
+ for (let h = m - 1; h >= 0; h--) {
828
+ run[e * (m + 1) + h] = matches(e, h) ? at(e + 1, h + 1) + 1 : Math.max(at(e + 1, h), at(e, h + 1));
829
+ }
830
+ }
831
+ // Each script token on its earliest heard token that keeps the run longest.
832
+ const pairs = [[-1, -1]];
833
+ for (let e = 0, h = 0; e < n && h < m; ) {
834
+ if (matches(e, h)) pairs.push([e++, h++]);
835
+ else if (at(e, h + 1) >= at(e + 1, h)) h++;
836
+ else e++;
837
+ }
838
+ pairs.push([n, m]);
839
+ const span = (from, to) => [words[heard.sourceIndex[from]].s, words[heard.lastSourceIndex[to]].e];
840
+ const times = new Array(n).fill(null);
841
+ const scriptHeard = pairs.length - 2 >= n * MIN_HEARD_SHARE;
842
+ for (let k = 0; k + 1 < pairs.length; k++) {
843
+ const [e0, h0] = pairs[k];
844
+ const [e1, h1] = pairs[k + 1];
845
+ if (e0 >= 0) times[e0] = span(h0, h0);
846
+ const left = e1 - e0 - 1;
847
+ if (!scriptHeard || left === 0) continue;
848
+ const places = [];
849
+ for (let h = h0 + 1; h < h1; h++) if (!FILLER_TOKENS.has(heard.tokens[h])) places.push(h);
850
+ // At an end, a heard word more is a lead-in or a sign-off as likely as a word heard as two.
851
+ if ((e0 < 0 || e1 === n) && places.length !== left) continue;
852
+ if (places.length === left) {
853
+ for (let i = 0; i < left; i++) times[e0 + 1 + i] = span(places[i], places[i]);
854
+ } else if (places.length === left + 1) {
855
+ const [gapStart, gapEnd] = span(places[0], places.at(-1));
856
+ const owners = [...new Set(expected.sourceIndex.slice(e0 + 1, e1))];
857
+ const share = (gapEnd - gapStart) / owners.length;
858
+ for (let t = e0 + 1; t < e1; t++) {
859
+ const u = owners.indexOf(expected.sourceIndex[t]);
860
+ times[t] = [gapStart + u * share, gapStart + (u + 1) * share];
861
+ }
862
+ }
863
+ }
864
+ // A number token of a script word with a digit not heard as written: that word is not shown.
865
+ const paired = new Set(pairs.slice(1, -1).map(([e]) => e));
866
+ const numberToken = (token) => NUMBER_WORDS.has(token) || /\p{N}/u.test(token);
867
+ const unheardNumbers = new Set();
868
+ for (let e = 0; e < n; e++) {
869
+ if (paired.has(e) || !numberToken(expected.tokens[e])) continue;
870
+ for (let i = expected.sourceIndex[e]; i <= expected.lastSourceIndex[e]; i++) if (/\p{N}/u.test(written[i])) unheardNumbers.add(i);
871
+ }
872
+ for (let e = 0; e < n; e++) {
873
+ for (let i = expected.sourceIndex[e]; i <= expected.lastSourceIndex[e]; i++) if (unheardNumbers.has(i)) times[e] = null;
874
+ }
875
+ return { expected, times };
876
+ }
877
+
748
878
  /**
749
879
  * #2541: the indexes of the heard words that deliver the first and last
750
880
  * scripted word, matching the script in order at its earliest delivery, or null
@@ -4590,14 +4720,14 @@ export function lineCaptionScreens(words, cap = null) {
4590
4720
 
4591
4721
  /**
4592
4722
  * captionsByLine: the cut's words in its own time, each with the script line
4593
- * it belongs to. Where a segment's script is heard in order (alignScript),
4594
- * they are the script's words as written, each timed by the heard words that
4595
- * say it; elsewhere they are the heard words, each on the line its place among
4596
- * the script's words gives it, the way a cue line is found (lineInSegment).
4723
+ * it belongs to. They are the script's words as written, never a heard word
4724
+ * the script does not have (COP-311). Where a segment's script is heard in
4725
+ * order (alignScript), each is timed by the heard words that say it;
4726
+ * elsewhere by the heard words in its place (scriptTimes), and a script word
4727
+ * with nothing heard in its place is left out.
4597
4728
  */
4598
4729
  export function lineWords(timeline, storyboard) {
4599
4730
  const texts = new Map((storyboard?.script ?? []).map((line) => [line?.lineId, line?.text]));
4600
- const counts = lineWordCounts(storyboard);
4601
4731
  const rows = [];
4602
4732
  for (const seg of timeline.spine) {
4603
4733
  const heard = seg.words ?? [];
@@ -4617,19 +4747,48 @@ export function lineWords(timeline, storyboard) {
4617
4747
  });
4618
4748
  continue;
4619
4749
  }
4620
- const ends = [];
4621
- let n = 0;
4622
- for (const id of seg.lineIds) ends.push((n += counts.get(id) ?? 0));
4623
- heard.forEach((w, i) => {
4624
- const text = (w.w ?? "").trim();
4625
- const start = at(w.s);
4626
- const end = at(w.e);
4627
- if (!text || end <= start) return;
4628
- const j = ends.findIndex((last) => Math.min(i, n - 1) < last);
4629
- rows.push({ text, start, end, line: seg.lineIds[j] ?? seg.lineIds.at(-1) ?? `scene ${seg.sceneIndex}` });
4750
+ // COP-311: the script's words still, each on the time of what was heard in its place (scriptTimes).
4751
+ const lineOf = lines.flatMap((ws, j) => ws.map(() => seg.lineIds[j]));
4752
+ const { expected, times } = scriptTimes(heard, lines.flat());
4753
+ lines.flat().forEach((text, i) => {
4754
+ const said = times.filter((time, e) => time && expected.sourceIndex[e] <= i && i <= expected.lastSourceIndex[e]);
4755
+ if (said.length === 0) return;
4756
+ const start = at(said[0][0]);
4757
+ const end = at(said.at(-1)[1]);
4758
+ if (end > start) rows.push({ text, start, end, line: lineOf[i] });
4630
4759
  });
4631
4760
  }
4632
- return rows;
4761
+ return sharedHeardWords(rows);
4762
+ }
4763
+
4764
+ /**
4765
+ * lineWords: script words that start on one heard word but are not timed
4766
+ * alike ("probiotics/and" ending one line and starting the next) take that
4767
+ * word's time (to the earliest of their ends) in turn, so no caption screen
4768
+ * is cleared before its word is said. A word that runs on past it keeps its
4769
+ * own end. Words timed alike on one line stay on one screen
4770
+ * (lineCaptionScreens).
4771
+ */
4772
+ function sharedHeardWords(rows) {
4773
+ const out = [];
4774
+ for (let i = 0; i < rows.length; ) {
4775
+ let j = i + 1;
4776
+ while (j < rows.length && rows[j].start === rows[i].start) j++;
4777
+ const run = rows.slice(i, j);
4778
+ const keys = [...new Set(run.map((r) => `${r.line}|${r.end}`))];
4779
+ if (keys.length === 1) out.push(...run);
4780
+ else {
4781
+ const start = run[0].start;
4782
+ const shared = Math.min(...run.map((r) => r.end));
4783
+ const slot = (shared - start) / keys.length;
4784
+ for (const r of run) {
4785
+ const u = keys.indexOf(`${r.line}|${r.end}`);
4786
+ out.push({ ...r, start: roundMs(start + u * slot), end: r.end > shared ? r.end : roundMs(start + (u + 1) * slot) });
4787
+ }
4788
+ }
4789
+ i = j;
4790
+ }
4791
+ return out;
4633
4792
  }
4634
4793
 
4635
4794
  /**
@@ -5571,11 +5730,9 @@ function ffmpegReason(res) {
5571
5730
  return res.signal ? `it was stopped by ${res.signal}.` : "it printed no reason.";
5572
5731
  }
5573
5732
 
5574
- /** Both passes on the mix, then the finished cut measured again. A receipt may
5575
- * retain that final observation without changing the legacy mastering result. */
5576
- export function finishLoudnessPass(mix, out, limiter = null, onMeasured = null) {
5577
- const measured = measureLoudness(mix);
5578
- const args = loudnessApplyArgs(mix, measured, out, limiter);
5733
+ /** The mix normalized with pass one's numbers into `out`, through the limiter at `limit` when one is given. */
5734
+ function applyLoudness(mix, measured, out, limit) {
5735
+ const args = loudnessApplyArgs(mix, measured, out, limit == null ? null : peakLimiter(limit));
5579
5736
  const res = spawnSync("ffmpeg", args, { stdio: ["inherit", "inherit", "pipe"], encoding: "utf8", maxBuffer: 1 << 26 });
5580
5737
  if (res.status !== 0) {
5581
5738
  // ffmpeg's words still reach the log, and its reason leads the error:
@@ -5584,11 +5741,32 @@ export function finishLoudnessPass(mix, out, limiter = null, onMeasured = null)
5584
5741
  const quoted = args.map((a) => (/[\s\[\];]/.test(a) ? `'${a}'` : a)).join(" ");
5585
5742
  throw new FirstCutError(1, `ffmpeg failed on the loudness pass: ${ffmpegReason(res)} The command it ran:\n ffmpeg ${quoted}`);
5586
5743
  }
5587
- const finished = measureLoudness(out);
5744
+ return measureLoudness(out);
5745
+ }
5746
+
5747
+ /** Both passes on the mix, then the finished cut measured again. A receipt may
5748
+ * retain that final observation without changing the legacy mastering result.
5749
+ * `limit` (limitPeaks) is the limiter's ceiling, PEAK_LIMIT; a limited cut over
5750
+ * the limit is limited again lower (LIMIT_AGAIN_MAX), one under it is left as it is. */
5751
+ export function finishLoudnessPass(mix, out, limit = null, onMeasured = null) {
5752
+ const measured = measureLoudness(mix);
5753
+ let ceiling = limit;
5754
+ let finished = applyLoudness(mix, measured, out, ceiling);
5755
+ let again = 0;
5756
+ while (ceiling != null && finished && finished.tp > TRUE_PEAK_MAX_DB && again < LIMIT_AGAIN_MAX) {
5757
+ const lower = lowerPeakLimit(ceiling, finished.tp);
5758
+ if (lower >= ceiling) break;
5759
+ ceiling = lower;
5760
+ finished = applyLoudness(mix, measured, out, ceiling);
5761
+ again++;
5762
+ }
5588
5763
  const refusal = truePeakRefusal(finished);
5589
5764
  if (refusal) throw new LoudnessRefusal(refusal, finished);
5590
5765
  onMeasured?.(finished);
5591
- return { lufs: round2(finished.i), truePeak: round2(finished.tp), passes: measured ? 2 : 1, ...(limiter ? { limited: true } : {}) };
5766
+ return {
5767
+ lufs: round2(finished.i), truePeak: round2(finished.tp), passes: measured ? 2 : 1,
5768
+ ...(limit != null ? { limited: true } : {}), ...(again > 0 ? { limitedAgain: again, limit: ceiling } : {}),
5769
+ };
5592
5770
  }
5593
5771
 
5594
5772
  /** The filters of `names` this ffmpeg does not have. */
@@ -6860,9 +7038,9 @@ export function firstCut({ dir, out: outOpt, skip = new Set(), music: musicOn =
6860
7038
  else if (missing.length > 0) notes.push(`this ffmpeg has no ${missing.join(", ")} filter, so the voice was not cleaned`);
6861
7039
  else clean = { voice: VOICE_CLEAN, under: UNDER_VOICE };
6862
7040
  }
6863
- let limiter = null;
7041
+ let peakLimit = null;
6864
7042
  if (finish?.limitPeaks) {
6865
- if (hasFilter("alimiter")) limiter = PEAK_LIMITER;
7043
+ if (hasFilter("alimiter")) peakLimit = PEAK_LIMIT;
6866
7044
  else notes.push("this ffmpeg has no alimiter filter, so the loudness pass ran without the limiter");
6867
7045
  }
6868
7046
  const paths = finishPaths(out);
@@ -6983,13 +7161,14 @@ export function firstCut({ dir, out: outOpt, skip = new Set(), music: musicOn =
6983
7161
  let loudnessMeasurement = null;
6984
7162
  if (finish?.finishLoudness) {
6985
7163
  try {
6986
- loudness = finishLoudnessPass(rendered, out, limiter, template
7164
+ loudness = finishLoudnessPass(rendered, out, peakLimit, template
6987
7165
  ? (measured) => { loudnessMeasurement = measured; } : null);
6988
7166
  } catch (error) {
6989
- if (!template || !(error instanceof FirstCutError)) throw error;
6990
- // One local limiter pass on the same retained mix, never a provider call.
7167
+ // A limited pass already limited itself again (#4573); the same mix would only be refused the same way.
7168
+ if (!template || peakLimit != null || !(error instanceof FirstCutError)) throw error;
7169
+ // The limiter on the same retained mix, never a provider call, limited again lower as finishLoudnessPass does.
6991
7170
  // If it still clips or cannot be measured, the refusal holds the cut.
6992
- loudness = finishLoudnessPass(rendered, out, PEAK_LIMITER,
7171
+ loudness = finishLoudnessPass(rendered, out, PEAK_LIMIT,
6993
7172
  (measured) => { loudnessMeasurement = measured; });
6994
7173
  } finally {
6995
7174
  rmSync(rendered, { force: true });
@@ -74,6 +74,10 @@ export interface CustomerRun {
74
74
  notes?: string[];
75
75
  } | null;
76
76
  canRetry: boolean;
77
+ canCutAgain?: boolean;
78
+ cutFailure?: {
79
+ sentence: string;
80
+ };
77
81
  stopReason: CustomerStopReason | null;
78
82
  detailsPath: string | null;
79
83
  cutHolds?: string[];
@@ -100,6 +100,13 @@ function stoppedLines(run, page) {
100
100
  run.canRetry ? `Try again from the video's page: ${page}` : "Start a new one from the Video page.",
101
101
  ];
102
102
  }
103
+ if (run.cutFailure && run.canCutAgain) {
104
+ return [
105
+ "The final cut didn't work.",
106
+ run.cutFailure.sentence,
107
+ `All your clips are done. Cut again from the video's page; it makes no new clips and costs nothing: ${page}`,
108
+ ];
109
+ }
103
110
  return run.canRetry
104
111
  ? ["Something went wrong making this video.", `Try again from the video's page: ${page}`]
105
112
  : ["Something went wrong making this video. Start a new one from the Video page."];
@@ -225,6 +225,9 @@ export interface VideoRun {
225
225
  };
226
226
  workflowId?: string;
227
227
  cutHeldScenes?: number[];
228
+ cutFailure?: {
229
+ sentence: string;
230
+ };
228
231
  cutCheck?: string[];
229
232
  moduleOwned?: boolean;
230
233
  director?: RunDirector;
@@ -330,6 +333,7 @@ export type RunStop = {
330
333
  framesNodeId?: string;
331
334
  heldScenes?: number[];
332
335
  heldTakes?: HeldTake[];
336
+ cutFailure?: string;
333
337
  } | {
334
338
  at: "pilot";
335
339
  nodeId?: string;
@@ -916,6 +916,7 @@ export function classifyRun(run) {
916
916
  ...(missingScenes.length > 0 ? { missingScenes } : {}),
917
917
  ...(missingScenes.length > 0 && framesNodeId ? { framesNodeId } : {}),
918
918
  ...(run.cutHeldScenes?.length ? { heldScenes: run.cutHeldScenes } : {}),
919
+ ...(run.cutFailure?.sentence ? { cutFailure: run.cutFailure.sentence } : {}),
919
920
  };
920
921
  }
921
922
  return { at: "paused", nodeId: run.pausedNodeId, reason: run.pauseReason };
@@ -1141,6 +1142,16 @@ export function stopLines(stop, runId, runUrl, videoPage) {
1141
1142
  }
1142
1143
  if (stop.heldScenes?.length)
1143
1144
  return heldSceneLines(stop.heldScenes, runId, videoPage, stop.heldTakes);
1145
+ if (stop.cutFailure) {
1146
+ return [
1147
+ "Parked: every piece is made, but the app's cut of them didn't work.",
1148
+ stop.cutFailure,
1149
+ `Cut it again on the video's page. It makes no new clips and costs nothing: ${videoPage}`,
1150
+ `Or cut it yourself: exodus video pull ${runId} --out ./ad-${runId}`,
1151
+ `Then upload: exodus video upload ${runId} --file cut.mp4`,
1152
+ `Watch it here: ${runUrl}`,
1153
+ ];
1154
+ }
1144
1155
  if (stop.cutAttached === null) {
1145
1156
  return [
1146
1157
  "Parked: every piece is made.",
@@ -5,4 +5,5 @@ export const ONE_TAKE_HOLD_CODES = [
5
5
  "one-take-words-unchecked",
6
6
  "one-take-label-held",
7
7
  "one-take-said-wrong",
8
+ "one-take-sideways",
8
9
  ];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aicopycoders/exodus",
3
- "version": "2026.11.1200-beta.12",
3
+ "version": "2026.11.1200-beta.14",
4
4
  "description": "CLI + Claude Code skills for the Copycoders Exodus ad pipeline",
5
5
  "repository": {
6
6
  "type": "git",