{
  "schema_version": 1,
  "project": "english-short-phrase-videos",
  "purpose": "Hard guardrails for the English short-phrase video production flow. Read this before modifying any episode plan/status/assets.",
  "updated_at": "2026-05-22 09:17:00 CST",
  "core_pipeline_order": [
    "read_episode_status_plan_assets",
    "agent_workflow_script_story_prompts",
    "hermes_main_model_review_and_revision",
    "chatartpro_character_keyframe_i2v_generation",
    "download_provider_outputs_locally",
    "visual_audio_stt_qa",
    "ffmpeg_python_assembly",
    "final_review_and_delivery"
  ],
  "role_split": {
    "script_generation": "Agent workflow (Script Agent), not llama.cpp unless explicitly re-enabled",
    "final_story_draft_generation": "Agent workflow (Story Editor Agent), not llama.cpp unless explicitly re-enabled",
    "chatartpro_prompt_draft_generation": "Agent workflow (Visual Agent), not llama.cpp unless explicitly re-enabled",
    "qa_checklist_draft_generation": "Agent workflow (Review Agent), not llama.cpp unless explicitly re-enabled",
    "review_and_decision": "Hermes main model",
    "flow_control_and_file_tracking": "Hermes main model",
    "visual_primary": "ChatArtPro",
    "character_images_primary": "ChatArtPro or existing approved character references",
    "keyframes_primary": "ChatArtPro",
    "source_video_i2v_primary": "ChatArtPro",
    "visual_backup_or_experiment": "ComfyUI",
    "assembly": "FFmpeg/Python",
    "audio_content_check": "STT + Hermes review"
  },
  "hard_rules": [
    {
      "id": "agent_workflow_required_for_drafts",
      "rule": "For current English-video workflow, do not use llama.cpp/local LLM generation for episode drafts unless the user explicitly re-enables it. Use labeled role agents for script/story/prompt/QA drafts and record provenance."
    },
    {
      "id": "provenance_required",
      "rule": "Every phrase list, final story, prompt draft, visual asset, video, audio, and QA report must record source/provenance in plan.json or assets.json."
    },
    {
      "id": "episode_isolation",
      "rule": "Each episode has its own folder, plan.json, status.json, assets.json, dashboard.html, phrase list, final story, ChatArtPro jobs, QA reports, and final MP4. Shared characters can be reused but must be recorded per episode."
    },
    {
      "id": "chatartpro_first_visuals",
      "rule": "For current formal workflow, use ChatArtPro first for character/reference images, keyframes, and I2V/source clips because the user has monthly free quota. ComfyUI is fallback/experiment unless the user explicitly changes this."
    },
    {
      "id": "no_programmatic_mvp_as_deliverable",
      "rule": "Do not deliver programmatic/Pillow/vector local MVPs as English phrase AI-video deliverables. Local code is allowed for dashboard, subtitles, QA extraction, assembly after approved source video, and diagnostics only."
    },
    {
      "id": "provider_output_verification",
      "rule": "Do not claim provider generation succeeded unless the job was submitted, completed, downloaded to a local Windows-visible path, and verified. Avoid false positives from click success, exit code, cron/delegation summary, or provider history alone."
    },
    {
      "id": "audio_stt_required",
      "rule": "Generated source videos with audio must pass STT/audio-content QA. Audio stream presence alone is insufficient. Extra spoken words, wrong phrase, Chinese narration, BGM/music bed, or wrong mouth movement fails."
    },
    {
      "id": "final_story_quality",
      "rule": "Final story must be episode-specific and have setup/problem/reaction/attempt/escalation/payoff/emotional change. It must not be a flat chain of taught phrases."
    }
  ],
  "stage_requirements": {
    "awaiting_hermes_review": {
      "allowed_next_actor": "Hermes main model",
      "required_outputs": [
        "plan.json reviewed phrases/final story",
        "qa_reports script_story_fit review",
        "status.json updated"
      ],
      "next_stage_after_success": "prompts_ready_for_chatartpro"
    },
    "prompts_ready_for_chatartpro": {
      "allowed_next_actor": "ChatArtPro automation via Hermes/browser tools",
      "required_outputs": [
        "provider job record in assets.json",
        "downloaded image/video files",
        "visual/audio QA reports"
      ]
    },
    "agent_draft_ready_for_review": {
      "allowed_next_actor": "Hermes main model review",
      "required_outputs": [
        "qa/hermes_agent_draft_review.md",
        "plan.json reviewed phrases/final story",
        "assets.json provenance records"
      ],
      "next_stage_after_success": "prompts_ready_for_chatartpro_preflight"
    },
    "prompts_ready_for_chatartpro_preflight": {
      "allowed_next_actor": "ChatArtPro/browser automation via Hermes tools",
      "required_outputs": [
        "preflight record in assets.json",
        "confirm login/credits/model/settings without submitting generation"
      ],
      "next_stage_after_success": "prompts_ready_for_chatartpro"
    }
  },
  "file_update_policy": {
    "before_work": [
      "read workflow_rules.json",
      "read episode status.json",
      "read episode plan.json",
      "read episode assets.json"
    ],
    "after_each_step": [
      "update status.json",
      "update assets.json or plan.json with provenance",
      "rerun render_dashboard.py --all",
      "verify dashboard.html exists and is non-empty"
    ]
  },
  "current_workflow_override": "2026-05-22 user correction: use agent workflow for script/story/prompt drafts; do not use llama.cpp/local LLM generation unless explicitly re-enabled."
}