# AutoShorts Dashboard: script approval → final Director render → private upload → website companion

Use this when operating the user's AutoShorts/TrueTraceShorts Dashboard flow after a production item is locked and the user approves `APPROVE_PRODUCTION ...`.

## Core correction from session

For creator approval, **do not generate a provisional/placeholder video**. The user explicitly said the preview/control-plane MP4 is unnecessary and confusing. Approval should be based on a text/script concept package:

- hook;
- why the hook is good;
- full voiceover/drehbuch;
- storyboard / Director beats;
- visual hook plan;
- Director plan;
- YouTube/TikTok metadata.

Only after approval should the system produce a **final Director render** with premium AI visuals, Gianna/Chatterbox voice, active-word subtitles, QA sheets, review package, and hash-bound upload command.

## Recommended sequence

1. Read Dashboard source of truth:
   - `GET /api/agent/production/next`.
2. If needed, propose concept:
   - `POST /api/agent/production/{id}/concept-proposed`.
   - Concept payload should include `approval_mode=script_concept_only` and `no_preview_video_required=true`.
3. User approves:
   - `APPROVE_PRODUCTION <queue_item_id>`.
   - Mark as `concept_approved`; do **not** create a placeholder video.
4. Run the real Director render from an accepted renderer script/template:
   - premium AI keyframes;
   - Chatterbox Gianna clone where available;
   - forced alignment / phrase-safe subtitles;
   - 1080×1920, SAR 1:1, DAR 9:16;
   - contact sheet, frame sheet, first-frame/late-frame QA.
5. Prepare Dashboard import package:
   - copy final MP4 to `storage/incoming/<package_id>/video.mp4`;
   - write `manifest.json` with `workflow_preview=false`, `director_render=true`, `quality.overall=passed`, `quality_report.mode=director_render`, `source_metadata.video_sha256`, and `queue_item_id`.
6. Import and attach:
   - call Dashboard import scan or import API;
   - call `/api/agent/production/{id}/mark-ready-for-review` with the exact imported `video_asset_id`.
7. Build YouTube private-upload package:
   - use `autoshorts.youtube.upload_only.build_private_upload_package`;
   - validate with `validate_private_upload_gate`;
   - approval command must be `APPROVED_FOR_PRIVATE_YOUTUBE_UPLOAD <candidate_id> <version> <video_sha> <posting_pack_sha>`.
8. On user upload approval:
   - run `python3 -m autoshorts.cli.youtube_private_upload_execute ...` with `AUTOSHORTS_YOUTUBE_PACKAGE_DIR` pointing to the candidate-local package dir;
   - verify audit: `privacyStatus=private`, `uploadStatus=uploaded`, scope exactly `youtube.upload`, endpoint `videos.insert` only unless thumbnail package is approved.
9. Import audit into Dashboard:
   - `POST /api/reconciliation/youtube-audit/import` with `dry_run=false`.
10. Website companion:
   - create/update website candidate JSON + markdown page;
   - include the real Shorts URL after private upload because the user manually makes the video public soon after;
   - generate thumbnail from the uploaded MP4 start frame;
   - run site build and browser-check the live page for `Open on YouTube`;
   - commit/push only the intended companion files, preserving unrelated untracked files.

## QA checklist

- MP4 ffprobe: 1080×1920, SAR 1:1, DAR 9:16.
- Video duration <= voice duration + 0.5s.
- First frame communicates the exact scam without sound.
- Subtitles are phrase-safe, not crossing sentence boundaries.
- No PowerPoint/card-board/placeholder look.
- No real logos, URLs, card data, bank names, phone numbers, or QR codes.
- Dashboard shows final video `ready_for_review` / queue `in_review`.
- Upload audit confirms private upload only.
- Website page live-check confirms YouTube link and thumbnail.

## Pitfalls

- Do not let a control-plane preview package become an active creator review artifact. If one was generated, archive it and restore the queue item to concept-approved/final-render flow.
- When cloning a prior render script, replace every candidate-specific field: candidate ID, slug, output dir, filenames, metadata, upload package, website guide link, QA package, and approval command.
- If active-word subtitles group too many words or cross sentences, patch the caption segment sizes/source punctuation and rerender before delivery. A technically valid MP4 with awkward captions still fails review quality.
- If Git push over HTTPS prompts for credentials, use a temporary `GIT_ASKPASS` helper with the runtime token file; never print the token.
