{
  "messages": [
    {
      "role": "system",
      "content": "You are a screenwriting agent. The program already created a script skeleton and shot plan. Do not change scene_id or shot_id ordering. Keep the number of shots stable. Chronology is program-owned. Use it to keep flashback, dream, rumor, and parallel-line language consistent, but do not rewrite chronology fields. Refine language, dialogue, narration, and shot descriptions while preserving the program structure. Prefer the existing entity display names from the entity context. Do not invent unnecessary new speaker variants when the candidate already provides a stable character name. Return JSON only."
    },
    {
      "role": "user",
      "content": "Given the scene payload, chronology context, entity context, and the program-generated script candidate, refine it into a concise screenplay. Output STRICT JSON with keys: scene_id, shots (list), scene_notes, audio_notes, narrator_profile_id. Shot schema: {shot_id,description,camera,actions,dialogue,narration,on_screen_text,narrator_profile_id,narration_delivery_hint}. dialogue is a list of {speaker,speaker_entity_uid,delivery_hint,line}. speaker_entity_uid and narrator_profile_id are program-owned identity fields: preserve the candidate values when unsure, and do not fabricate random IDs. Keep the same shot count as the candidate unless the candidate is malformed. Keep the narrative presentation order, but make the script language consistent with chronology time_mode, anchor, and ordering hints. Prefer existing characters and locations. Return a single JSON object and nothing else (no markdown, no code fences). If unsure, return {\"scene_id\":\"\",\"shots\":[]}.\n\nSCENE:\n{\"candidate_id\": \"C0024-SC03\", \"title\": \"第十章标题\", \"summary\": \"章节标题“剑法”。\", \"type\": [\"章节标题\"], \"tone\": [\"中性\"], \"importance\": \"支线\", \"presentation\": [\"文字卡片\"], \"key_beats\": [\"第十章剑法\"], \"characters\": [], \"locations\": [], \"continuation_of_prev\": false, \"source_chunk_id\": \"C0024\", \"source_start_para\": 691, \"source_end_para\": 691, \"text\": \"第十章剑法\", \"text_preview\": \"第十章剑法\", \"candidate_meta\": {\"candidate_id\": \"C0024-SC03\", \"record_count\": 1, \"char_len\": 5, \"structure_counts\": {\"chapter_heading\": 1}, \"boundary_reasons_after\": [], \"matched_entities\": [{\"entity_id\": \"E000122\", \"name\": \"乾坤飞龙剑\", \"type\": \"术法神通\", \"subtype\": \"\", \"matched_terms\": [\"剑法\"], \"score\": 2.6}], \"heuristic_types\": [\"叙事\"], \"heuristic_tones\": [\"中性\"], \"heuristic_presentation\": [\"叙事画面\"], \"heuristic_importance\": \"支线\"}, \"scene_id\": \"S0074\"}\n\nCHRONOLOGY:\n{\"scene_id\": \"S0074\", \"narrative_order\": 74, \"story_chronology_order\": 63, \"story_chronology_group\": \"CG0062\", \"time_mode\": \"mainline\", \"confidence\": 0.56, \"order_delta\": -11, \"temporal_anchor\": {\"label\": \"\", \"normalized_label\": \"unknown\", \"anchor_type\": \"unknown\", \"relative_direction\": \"unknown\", \"amount\": null, \"unit\": \"\", \"time_of_day\": \"\", \"explicit\": false, \"anchor_scene_id\": \"S0073\"}, \"constraints\": [{\"relation\": \"after\", \"target_scene_id\": \"S0073\", \"confidence\": 0.58, \"reason\": \"narrative_forward\"}], \"evidence\": []}\n\nENTITY CONTEXT:\nNone\n\nSCRIPT CANDIDATE:\n{\"scene_id\": \"S0074\", \"scene_notes\": \"章节标题“剑法”。；重要性：支线；呈现：文字卡片；时间顺序：叙事74->故事63\", \"audio_notes\": \"以旁白驱动\", \"narrator_profile_id\": \"narrator_main_cn\", \"chronology\": {\"scene_id\": \"S0074\", \"narrative_order\": 74, \"story_chronology_order\": 63, \"story_chronology_group\": \"CG0062\", \"time_mode\": \"mainline\", \"confidence\": 0.56, \"order_delta\": -11, \"temporal_anchor\": {\"label\": \"\", \"normalized_label\": \"unknown\", \"anchor_type\": \"unknown\", \"relative_direction\": \"unknown\", \"amount\": null, \"unit\": \"\", \"time_of_day\": \"\", \"explicit\": false, \"anchor_scene_id\": \"S0073\"}, \"constraints\": [{\"relation\": \"after\", \"target_scene_id\": \"S0073\", \"confidence\": 0.58, \"reason\": \"narrative_forward\"}], \"evidence\": []}, \"shots\": [{\"shot_id\": \"S0074_SH01\", \"camera\": \"中景\", \"description\": \"场景建立镜头，带出第十章剑法\", \"actions\": [\"第十章剑法\"], \"dialogue\": [], \"narration\": \"\", \"on_screen_text\": \"\", \"focus_characters\": [], \"focus_locations\": [], \"candidate_meta\": {\"shot_role\": \"opening\", \"description_hint\": \"场景建立镜头，带出第十章剑法\", \"camera_hint\": \"中景\", \"shot_index\": 1, \"chronology_summary\": {\"narrative_order\": 74, \"story_chronology_order\": 63, \"story_chronology_group\": \"CG0062\", \"time_mode\": \"mainline\", \"confidence\": 0.56, \"order_delta\": -11, \"anchor_label\": \"\", \"anchor_type\": \"unknown\", \"constraint_count\": 1, \"evidence_count\": 0}}, \"narrator_profile_id\": \"narrator_main_cn\"}, {\"shot_id\": \"S0074_SH02\", \"camera\": \"中近景\", \"description\": \"主角的反应镜头，推进第十章剑法\", \"actions\": [\"第十章剑法\"], \"dialogue\": [], \"narration\": \"\", \"on_screen_text\": \"\", \"focus_characters\": [], \"focus_locations\": [], \"candidate_meta\": {\"shot_role\": \"character\", \"description_hint\": \"主角的反应镜头，推进第十章剑法\", \"camera_hint\": \"中近景\", \"shot_index\": 2, \"chronology_summary\": {\"narrative_order\": 74, \"story_chronology_order\": 63, \"story_chronology_group\": \"CG0062\", \"time_mode\": \"mainline\", \"confidence\": 0.56, \"order_delta\": -11, \"anchor_label\": \"\", \"anchor_type\": \"unknown\", \"constraint_count\": 1, \"evidence_count\": 0}}, \"narrator_profile_id\": \"narrator_main_cn\"}], \"candidate_meta\": {\"scene_id\": \"S0074\", \"source_chunk_id\": \"C0024\", \"source_start_para\": 691, \"source_end_para\": 691, \"characters\": [], \"locations\": [], \"key_beats\": [\"第十章剑法\"], \"shot_count_hint\": 2, \"scene_summary\": \"章节标题“剑法”。\", \"scene_text_preview\": \"第十章剑法\", \"chronology_summary\": {\"narrative_order\": 74, \"story_chronology_order\": 63, \"story_chronology_group\": \"CG0062\", \"time_mode\": \"mainline\", \"confidence\": 0.56, \"order_delta\": -11, \"anchor_label\": \"\", \"anchor_type\": \"unknown\", \"constraint_count\": 1, \"evidence_count\": 0}}}"
    }
  ]
}