{
  "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. 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. Shot schema: {shot_id,description,camera,actions,dialogue,narration,on_screen_text}. dialogue is a list of {speaker,line}. 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\": \"E000113\", \"name\": \"乾坤飞龙剑\", \"type\": \"术法神通\", \"subtype\": \"\", \"matched_terms\": [\"剑法\"], \"score\": 2.2}], \"heuristic_types\": [\"叙事\"], \"heuristic_tones\": [\"中性\"], \"heuristic_presentation\": [\"叙事画面\"], \"heuristic_importance\": \"支线\"}, \"scene_id\": \"S0074\"}\n\nCHRONOLOGY:\n{\"scene_id\": \"S0074\", \"narrative_order\": 74, \"story_chronology_order\": 62, \"story_chronology_group\": \"CG0061\", \"time_mode\": \"mainline\", \"confidence\": 0.56, \"order_delta\": -12, \"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->故事62\", \"audio_notes\": \"以旁白驱动\", \"chronology\": {\"scene_id\": \"S0074\", \"narrative_order\": 74, \"story_chronology_order\": 62, \"story_chronology_group\": \"CG0061\", \"time_mode\": \"mainline\", \"confidence\": 0.56, \"order_delta\": -12, \"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\": 62, \"story_chronology_group\": \"CG0061\", \"time_mode\": \"mainline\", \"confidence\": 0.56, \"order_delta\": -12, \"anchor_label\": \"\", \"anchor_type\": \"unknown\", \"constraint_count\": 1, \"evidence_count\": 0}}}, {\"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\": 62, \"story_chronology_group\": \"CG0061\", \"time_mode\": \"mainline\", \"confidence\": 0.56, \"order_delta\": -12, \"anchor_label\": \"\", \"anchor_type\": \"unknown\", \"constraint_count\": 1, \"evidence_count\": 0}}}], \"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\": 62, \"story_chronology_group\": \"CG0061\", \"time_mode\": \"mainline\", \"confidence\": 0.56, \"order_delta\": -12, \"anchor_label\": \"\", \"anchor_type\": \"unknown\", \"constraint_count\": 1, \"evidence_count\": 0}}}"
    }
  ]
}