# Jarvis Operating Playbook

This playbook is the source of truth for Jarvis/Hermes when operating the AutoShorts creator workflow. The Dashboard is the normal workflow orchestrator. Do not improvise uploads or website pushes from temporary scripts.

## Core rule

Dashboard Review → Approval → Orchestrator/Outbox → Audit → Status back into Dashboard.

No real YouTube upload, website push, TikTok upload, or new render without explicit user approval.

## When user says: Produce next short

1. Call `GET /api/agent/production/next`.
2. Read the returned quality profile and production rules.
3. Propose the concept.
4. Wait for `APPROVE_PRODUCTION <queue_item_id>`.
5. Produce only after approval.
6. Run the Quality Gate.
7. Import the prepared package.
8. Leave the video in `ready_for_review` only if Quality Gate passes.

## When user rejects or requests changes in review

1. Read the `ReviewDecision` and any `RevisionRequest`.
2. Propose a revision concept.
3. Wait for explicit user approval.
4. Produce a new version, not an untracked overwrite.
5. Import and Quality Gate the new version.

## When user approves YouTube upload

1. Fetch the UploadRequest from the Dashboard/API.
2. Use the `UploadSnapshot` stored in the request; do not read stale manifests or old package metadata.
3. Use the existing Jarvis uploader only through the Dashboard orchestrator/outbox contract.
4. Perform private YouTube upload only after explicit approval.
5. Write/redeliver upload audit.
6. Update Dashboard status:
   - `VideoAsset.status = uploaded_private`
   - `PostDraft.status = uploaded_private`
   - `UploadRequest.status = completed`
   - `YouTubeUploadAudit.upload_status = private_succeeded`
7. Prepare `WebsiteCompanion` only; if video is private, keep public `videoUrl = null` and `website_link_allowed = false`.

## When user wants TikTok

1. Use Dashboard manual export.
2. Download MP4.
3. Copy TikTok caption.
4. Copy hashtags.
5. User posts manually.
6. Optionally record the public link/status back in Dashboard.

No TikTok API automation.

## When user wants Website

1. Prepare `WebsiteCompanion` from Dashboard state.
2. Generate candidate/guide through Dashboard Website service.
3. Run Website QA.
4. Show diff/status.
5. Push only after explicit approval: `Website Push freigeben` or equivalent.
6. If YouTube is private, do not show a public YouTube button/link on the website.
7. When video becomes public/unlisted or `website_link_allowed=true`, set public `videoUrl` deliberately.

## Upload snapshot contract

The upload snapshot must include:

- `video_asset_id`
- `package_id`
- `file_path`
- `sha256`
- `youtube_title`
- `youtube_description_final`
- `youtube_tags`
- `privacy_status = private`
- `synthetic_media`
- `approved_at`
- `approved_by`

If metadata changes after approval, approval is invalidated and a new UploadRequest is required.

## YouTube description rules

- Current Dashboard `PostDraft` fields are the single source of truth.
- Save before upload.
- Reload draft from DB.
- Build `youtube_description_final` with visible hashtags appended once.
- Keep YouTube tags in `tags_json` as metadata as well.

## Render and Visual Gate rules

Not allowed:

- Large in-video top titles such as `tiny fee = bait`
- Persistent top banners
- Unnecessary lower-third dimming
- PowerPoint-like overlays
- Large text boards
- AI-generated text in styleframes
- Real logos, URLs, phone numbers, card/bank/IBAN details

Allowed:

- Short renderer-owned captions
- Small labels
- Subtle arrows/highlights
- Safe fake UI without real data

Required Quality Gate checks:

```json
{
  "visual_gate": "passed",
  "checks": {
    "premium_ai_styleframes_used": true,
    "styleframes_text_free": true,
    "no_large_top_title": true,
    "no_unnecessary_lower_third_dim": true,
    "no_powerpoint_layout": true,
    "renderer_owned_text_listed": true
  }
}
```

If `no_large_top_title=false`, `no_unnecessary_lower_third_dim=false`, or `no_powerpoint_layout=false`, Visual Gate and Overall must fail.
