# Concept-gated dashboard production workflow

Use when building or operating a creator/automation dashboard where a production queue controls video/package generation.

## Core contract

The dashboard production plan is the source of truth. Chat commands are triggers to inspect the plan, not permission to render.

Required flow:

1. `GET /api/agent/production/next` to load the selected queue item.
2. `POST /api/agent/production/{id}/concept-proposed` to record that a concept was proposed.
3. Present a detailed concept in chat: title, family, why now, hook, script beats, visual concept, voice/tone, TikTok caption/hashtags, YouTube title/description, and explicit safety exclusions.
4. Wait for `APPROVE_PRODUCTION <queue_item_id>` or an unambiguous equivalent approval for that exact concept.
5. Only then call `POST /api/agent/production/{id}/approve-generation`.
6. Only after approval call `POST /api/agent/production/{id}/mark-started`.
7. Generate/import the prepared package and mark ready for review.

## Backend invariant

`mark-started` must fail unless the item is `concept_approved` (HTTP 409 is appropriate). This invariant protects against casual chat commands, stale UI buttons, and legacy routes bypassing creator approval.

## Legacy/direct route pitfall

Routes named like `send-to-production` are dangerous because they sound final. They must either:

- set `status = concept_proposed`, or
- return HTTP 409 unless `concept_approved` already exists.

They must never directly set `producing`.

Add a regression test:

```text
send-to-production -> concept_proposed
mark-started without approve-generation -> 409
approve-generation -> concept_approved
mark-started after approval -> producing
```

## First response to production chat command

For commands such as “produce the next short”, do not create files, voice, renders, upload requests, or website changes. The first response must be a concept proposal and the exact confirmation command.

## Prepared package boundary

After approval, production may create a package under `storage/incoming/<expected_package_id>/` with `video.mp4` and `manifest.json`. Stop at `ready_for_review`; upload and website publishing remain separate creator-reviewed steps.

## Upload boundaries

Do not perform TikTok upload, TikTok mock/draft API flow, website push/merge/delete, or YouTube upload during package production. YouTube private upload may be requested only after dashboard review approval via an explicit UploadRequest or equivalent creator confirmation.
