← back to Allnewsdaily

scripts/short/VARIATION.md

12 lines

# Deterministic Short variation (TK-11343)

Each valid YYYY-MM-DD edition selects centered, sidebar or bulletin using its UTC day number modulo three. Retries choose the same layout and factual opening/closing copy. Headline text, attribution and source order remain intact; the existing trailing-beat trimming policy stays in place. Scripts still exceeding58 seconds after trimming fail instead of producing a truncated narration.

The script now carries format and edition. Run build-script.js before render-short.js; older script artifacts must be rebuilt. Real ImageMagick text measurements shrink long captions to fit their assigned box; impossible fits fail. Render scratch directories are unique and retained for evidence. Media files keep the1080x1920, H264, yuv420p,30fps,AAC contract and58-second mux cap.

Run `node --test scripts/short/formats.test.js`. In a fresh isolated checkout without runtime assets or voiceover, run `node scripts/short/verify-variation.cjs /absolute/fresh/evidence-directory`. It runs a complete five-story edition and two complete one-story preview editions, probes each and exercises invalid renderer input. All headlines are labeled synthetic fixtures, with silent AAC audio. The45–55second editorial target is advisory; these fixtures measure35,14.5 and13.7seconds without shortening their script timing.

Integrated with Steve's approval on September 11, 2026, preserving the newer SVG-image guard. Proof is in `verification/tk11343/e2e-proof.json`: five tests, three complete layout previews and a 43.67-second six-story render with free local narration, existing stock images and source logos. The decoded output preserves the narration with 0.99999 PCM correlation. Card timing retains the existing proportional estimates; this is not word-level synchronization.

The existing orchestrator rebuilds the script before TTS/rendering, so subsequent scheduled editions use the new format metadata. Directly rendering an older script requires rebuilding it first. No upload, paid TTS, stock fetch, scheduler change or remote deployment was performed for this integration. Production voice and channel reach were not tested; layout variation does not establish a reach or monetization improvement.