# Next Everyday Red Flags video from a prior render script

Use this when the user asks for “the next video” in the current TrueTraceShorts / Everyday Red Flags sequence and a recent working render script already exists.

## Pattern

1. Load the topic/duration references and inspect the topic database for `seed_next_batch` / backlog candidates.
2. Before choosing the topic, actively de-duplicate against recent outputs and visual grammar, not just exact slug:
   - avoid another login/account-lock/phishing-link/address-bar story if recent videos already covered similar mechanics;
   - rotate category and scene type across SMS, workplace, family, marketplace, payment, shopping, support, privacy, etc.;
   - if the user asks for “Abwechslung” or says “we had this already”, immediately replace the topic with a different scam family and a visibly different screen environment.
3. Prefer a simple, high-recognition scam topic that gives a strong first-frame hook. The hook should be concrete and instantly readable: e.g. a boss asking for gift-card codes, a marketplace payment redirect, or an invoice bank-detail change. Avoid repeating an address-bar/login hook too often.
4. Generate 5–6 premium vertical AI keyframes before rendering:
   - first frame must show the concrete scam instantly;
   - if the user requests a title in the first image, the source keyframe itself must contain a visible readable in-image title, and the rendered QA frame must confirm it is not cropped or hidden by subtitles;
   - exact readable screen text where needed;
   - no people, hands, real logos, watermarks, QR codes, or renderer focus graphics;
   - brand/IP safety is mandatory: avoid protected product designs and lookalikes (e.g. Apple Watch/smartwatch silhouettes, iPhone dynamic-island/notch cues, payment-card logos, real map/search UI, real domains/phone numbers);
   - for final user-facing ERF visuals, prefer well-prompted premium AI keyframes over self-built/deterministic CAPTCHA/UI mockups; deterministic layouts may be used as composition blueprints or for exact factual UI layers, but should not become the main final visual layer if the user asked for a polished KI-image look;
   - if AI images drift into logos/reCAPTCHA/brand UI, regenerate the specific bad frame with stronger negative prompts before falling back to handmade graphics; if a deterministic safety layer is unavoidable, blend/subordinate it into a premium AI scene so the result does not look like PowerPoint;
   - for TrueTraceShorts/affiliate-adjacent content, consider the Google Drive document `TrueTraceShorts/1Password/Allgemeine Bedingungen von 1 Password`: treat it as CJ/affiliate terms context; avoid misleading claims, forced redirects, unauthorized logos/brand use, pop-up/pop-under style tactics, and any implication of endorsement unless explicitly approved;
   - leave lower safe space for active-word subtitles.
4. Clone the most recent known-good renderer only if its pipeline matches the requested style:
   - current accepted Chatterbox voice: Gianna premium female reference clone v1 (`voice_mode=clone`, `reference_audio_filename=Gianna.wav`, warm performance chunks, ~500ms pauses, speed 1.0, temp .80/exagg .52/cfg .50);
   - forced word timestamps / faster-whisper alignment;
   - 2-line active-word subtitles;
   - 1080x1920 H.264 export with `setsar=1,setdar=9/16`;
   - review package + media-cache copy + topic DB update.
5. Replace every candidate-specific field, not just the visible script/title:
   - candidate ID, slug, output directory, final filename;
   - audio/metadata/word JSON names;
   - scene keyframe names;
   - image source list;
   - title, description, hashtags/tags;
   - topic ID and `existing_artifact_hint`;
   - approval package filename and command;
   - `QA_SECONDS`, especially if the new audio/render is shorter than the prior script;
   - review-package filename and notes if the voice/provider changes;
   - hidden package metadata such as YouTube tags, hashtags, notes, synthetic-media reasons, and any old topic-specific wording. Search for the previous slug/topic terms after cloning; stale invisible metadata is just as brittle as stale filenames.
6. Run the renderer end-to-end. Do not stop at script creation.
   - If the preferred TTS provider is temporarily unavailable, use an explicit fallback only when the user asked to continue: encode the fallback in `VERSION`, audio filenames, metadata, review notes, and approval command. Do **not** leave stale Chatterbox/Taylor names in hidden files or package IDs when EdgeTTS or another fallback was used.
   - If image generation fails once with a transient network/provider error, retry once before abandoning the premium-keyframe path; record only the final used keyframe paths in the renderer.
7. QA before delivery:
   - ffprobe: `1080x1920`, SAR `1:1`, DAR `9:16`;
   - contact sheet: premium, readable, on-topic, no logos/hands/watermarks;
   - first QA frame: strong hook, readable subtitles, and any requested in-image title visibly present in the frame;
   - inspect subtitle semantics, not just timing: forced alignment/Whisper can mishear short phrases (e.g. `safer move` as `safe remove`); patch the word JSON/source timing layer and rerender so hashes match corrected captions;
   - late/final QA frame sampled within actual duration, not copied from the prior script;
   - verify every path in `qa_frames` actually exists and has bytes; if a cloned `QA_SECONDS` includes a timestamp beyond the new shorter duration, patch `QA_SECONDS` to valid in-duration values, rerun the render/package boundary, and regenerate the review package before delivery;
   - no clipped subtitles, black bars, or squeezed image;
   - verify package hash by recomputing video SHA and canonical posting-pack SHA. For saved upload-package JSONs, recompute the canonical pack hash over the same base object the renderer used: exclude generated fields such as `posting_pack_sha256` and `approval_command`, and include metadata changes like hashtags/tags before finalizing the approval command;
   - if you patch metadata after a successful render, rerun the package/review generation boundary and re-verify hashes before delivery, even if the MP4 bytes did not change;
   - verify topic DB moved to `review_ready` / `awaiting_review`.
8. Deliver the Telegram-playable MP4 from `~/.hermes/media_cache/autoshorts/` with title, description, QA block, SHA256s, provider/fallback note when relevant, and exact hash-bound `APPROVED_FOR_PRIVATE_YOUTUBE_UPLOAD ...` command.
9. If the user replies that the private upload is approved, follow `references/private-youtube-upload-and-companion-linking.md`:
   - re-verify the exact current hashes;
   - run the upload-only executor, setting `AUTOSHORTS_YOUTUBE_PACKAGE_DIR` when the package is candidate-local;
   - confirm the audit says `privacyStatus=private`, upload-only scope, and no publication;
   - update the website companion `videoUrl` to the new Shorts link, build, commit, and push if applicable.

## Pitfalls

- Image generation may not perfectly preserve all exact UI text. Use the contact sheet and hook frame to decide whether the keyframes are good enough for the story, and regenerate only the weak frame rather than the whole batch.
- If a late/contact-sheet frame has ugly pseudo-text, gibberish UI, or weak clarity, replace that image source and rerender before delivery; do not rationalize it as acceptable just because the first frame is strong.
- After swapping keyframes, re-check voice-to-background mapping at sentence-boundary timestamps. Premium images can still be wrong if the scene order/durations no longer match the narration; adjust `SCENE_DURATIONS` and/or split into more scene sources so each sampled subtitle matches the visual meaning.
- If the user flags one visual defect in an otherwise strong video, fix it surgically: preserve the previous approved/praised image set, script, timing, voice, caption style, and overall look; replace only the defective source image, rerender, and issue new hashes. Do **not** “brand-safety-hammer” the whole video, swap multiple frames, or downgrade to deterministic/mockup visuals unless the user explicitly asks for a broader rebuild.
- For brand/IP issues in a single AI keyframe, regenerate only that frame with explicit negative constraints (e.g. “round/non-Apple watch silhouette; no Apple Watch shape/crown/bands/design language”) and verify the replacement contact sheet before rerendering.
- User values variety. A topic can be a duplicate even if the exact slug is new; repeated login/phishing/address-bar mechanics feel stale. Treat “we had this already” as a workflow correction: rotate to a different scam family and visual setting immediately.
- Do not let copied scripts retain old `erf-013` or previous-topic names in hidden metadata. Stale identifiers make later dry-runs and upload approval brittle.
- When replacing `AI_SCENE_SOURCES`, check that all six final entries are the intended unique/intentional sequence. Bulk string replacement can accidentally duplicate an old or ending frame into the middle of the story; build and visually inspect a contact sheet before rendering.
- Do not deliver a local runtime path alone; stage the MP4 into the Hermes media cache so Telegram can play it directly.
