{
  "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. Adaptation is also program-owned. Use the adaptation brief to decide what to fully dramatize, what to compress, and what to turn into bridge narration. 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, adaptation 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, ordering hints, and adaptation decision/presentation_mode. 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\": \"C0003-SC02\", \"title\": \"章回结尾悬念\", \"summary\": \"以传统章回体句式留下三人命运的悬念。\", \"type\": [\"叙事\"], \"tone\": [\"悬念\"], \"importance\": \"过渡\", \"presentation\": [\"叙事旁白\"], \"key_beats\": [\"未知三人性命如何\"], \"characters\": [\"三人\"], \"locations\": [], \"entity_refs\": [{\"entity_id\": \"E000014\", \"entity_uid\": \"E000014\", \"name\": \"三人\", \"canonical_name\": \"三人\", \"type\": \"人物\", \"subtype\": \"角色姓名\", \"matched_terms\": [\"三人\"], \"match_score\": 5.1, \"ref_role\": \"character_candidate\"}], \"continuation_of_prev\": false, \"source_chunk_id\": \"C0003\", \"source_start_para\": 27, \"source_end_para\": 27, \"text\": \"未知三人性命如何，且聽下回分解。\", \"text_preview\": \"未知三人性命如何，且聽下回分解\", \"candidate_meta\": {\"candidate_id\": \"C0003-SC02\", \"record_count\": 1, \"char_len\": 16, \"structure_counts\": {\"short_line\": 1}, \"boundary_reasons_after\": [\"chapter_heading\"], \"matched_entities\": [{\"entity_id\": \"E000014\", \"name\": \"三人\", \"type\": \"人物\", \"subtype\": \"角色姓名\", \"matched_terms\": [\"三人\"], \"score\": 5.1}], \"entity_refs\": [{\"entity_id\": \"E000014\", \"entity_uid\": \"E000014\", \"name\": \"三人\", \"canonical_name\": \"三人\", \"type\": \"人物\", \"subtype\": \"角色姓名\", \"matched_terms\": [\"三人\"], \"match_score\": 5.1, \"ref_role\": \"character_candidate\"}], \"heuristic_types\": [\"叙事\"], \"heuristic_tones\": [\"中性\"], \"heuristic_presentation\": [\"叙事画面\"], \"heuristic_importance\": \"支线\"}, \"scene_id\": \"S0004\"}\n\nCHRONOLOGY:\n{\"scene_id\": \"S0004\", \"narrative_order\": 4, \"story_chronology_order\": 5, \"story_chronology_group\": \"CG0004\", \"time_mode\": \"mainline\", \"confidence\": 0.56, \"order_delta\": 1, \"temporal_anchor\": {\"label\": \"\", \"normalized_label\": \"unknown\", \"anchor_type\": \"unknown\", \"relative_direction\": \"unknown\", \"amount\": null, \"unit\": \"\", \"time_of_day\": \"\", \"explicit\": false, \"anchor_scene_id\": \"S0003\"}, \"constraints\": [{\"relation\": \"after\", \"target_scene_id\": \"S0003\", \"confidence\": 0.58, \"reason\": \"narrative_forward\"}], \"evidence\": []}\n\nADAPTATION:\n{\"scene_id\": \"S0004\", \"source_chunk_id\": \"C0003\", \"scene_summary\": \"以传统章回体句式留下三人命运的悬念。\", \"chronology\": {\"scene_id\": \"S0004\", \"narrative_order\": 4, \"story_chronology_order\": 5, \"story_chronology_group\": \"CG0004\", \"time_mode\": \"mainline\", \"confidence\": 0.56, \"order_delta\": 1, \"temporal_anchor\": {\"label\": \"\", \"normalized_label\": \"unknown\", \"anchor_type\": \"unknown\", \"relative_direction\": \"unknown\", \"amount\": null, \"unit\": \"\", \"time_of_day\": \"\", \"explicit\": false, \"anchor_scene_id\": \"S0003\"}, \"constraints\": [{\"relation\": \"after\", \"target_scene_id\": \"S0003\", \"confidence\": 0.58, \"reason\": \"narrative_forward\"}], \"evidence\": []}, \"decision\": \"retain\", \"presentation_mode\": \"narration\", \"story_function\": [\"章节过渡\", \"悬念设置\"], \"adaptation_focus\": \"将传统章回体悬念转化为影视化的章节结尾，为下一集或下一幕制造期待。\", \"must_keep\": [\"“未知三人性命如何”的悬念核心\", \"章回体结尾的叙事功能\"], \"may_compress\": [], \"visual_focus\": [\"三人（老残等）的剪影或远景\", \"渐黑或淡出的画面\"], \"audio_focus\": [\"旁白（说书人或角色内心独白）\", \"悬念感音乐\", \"可能的音效（如风声、水声）\"], \"continuity_requirements\": [\"承接前一场三人遇险的紧张感\", \"保持时间顺序（S0004在S0003之后）\"], \"script_objective\": \"通过旁白和画面，将文字悬念转化为视听悬念，自然过渡到下一章节，同时强化三人命运未卜的戏剧张力。\", \"conflict\": \"命运与未知的冲突（三人 vs. 未知的危险/命运）\", \"turning_point\": \"从具体情节推进转向悬念收束，为后续故事开启新的可能性。\", \"reason\": \"原候选的‘dramatize’模式不适合纯叙事性章回体结尾。‘narration’模式（旁白）能更忠实、高效地转化原文功能，既保留传统韵味，又符合影视章节结尾的常见手法。必须保留其作为悬念钩子和章节过渡的核心作用。\", \"candidate_meta\": {\"scene_id\": \"S0004\", \"decision_reasons\": [\"default_retain\"], \"presentation_reasons\": [\"default_dramatize\"], \"metrics\": {\"text_length\": 67, \"quote_count\": 0, \"action_score\": 0, \"exposition_score\": 0, \"inner_score\": 0, \"transition_score\": 0, \"reveal_score\": 0, \"tension_score\": 0, \"environment_score\": 0, \"character_count\": 1, \"location_count\": 0, \"beat_count\": 1, \"continuation_of_prev\": false, \"time_mode\": \"mainline\", \"order_delta\": 1}, \"characters\": [\"三人\"], \"locations\": [], \"key_beats\": [\"未知三人性命如何\"], \"entity_refs\": [{\"entity_uid\": \"E000014\", \"entity_id\": \"E000014\", \"canonical_name\": \"三人\", \"name\": \"三人\", \"type\": \"人物\", \"subtype\": \"角色姓名\", \"matched_terms\": [\"三人\"], \"match_score\": 5.1, \"display_name\": \"\", \"conflict_group_id\": \"\", \"identity_conflict\": false, \"ref_role\": \"character_candidate\"}]}, \"retained_group_id\": \"AG0004\", \"beat_id\": \"AB0004\", \"group_role\": \"standalone\", \"group_strategy\": \"single_scene\", \"hard_merge\": false, \"script_render_mode\": \"full_scene\", \"drop_from_script\": false, \"merge_lead_scene_id\": \"S0004\", \"merge_reason\": \"\", \"group_scene_count\": 1, \"group_context\": {\"group_id\": \"AG0004\", \"group_strategy\": \"single_scene\", \"hard_merge\": false, \"lead_scene_id\": \"S0004\", \"support_scene_ids\": [], \"merged_scene_count\": 0, \"group_summary\": \"以传统章回体句式留下三人命运的悬念。\", \"script_objective\": \"通过旁白和画面，将文字悬念转化为视听悬念，自然过渡到下一章节，同时强化三人命运未卜的戏剧张力。\", \"story_functions\": [\"章节过渡\", \"悬念设置\"], \"must_keep\": [\"“未知三人性命如何”的悬念核心\", \"章回体结尾的叙事功能\"], \"continuity_requirements\": [\"承接前一场三人遇险的紧张感\", \"保持时间顺序（S0004在S0003之后）\"], \"merged_scene_summaries\": []}}\n\nENTITY CONTEXT:\n{\"registry_entities\": [{\"entity_uid\": \"E000014\", \"canonical_name\": \"三人\", \"aliases\": [], \"type\": \"人物\", \"subtype\": \"角色姓名\", \"voice_card_id\": \"VO000014\"}], \"kg_entities\": [{\"entity_id\": \"E000014\", \"name\": \"三人\", \"type\": \"人物\", \"subtype\": \"角色姓名\", \"aliases\": [], \"attributes\": {}, \"descriptions\": [\"老残等三人\"], \"evidence\": [\"當時三人便將帆葉落小\"], \"mentions\": [{\"chunk_id\": \"C0003\", \"summary\": \"三人落帆尾随\", \"evidence\": [\"當時三人便將帆葉落小\"], \"attributes\": {}}], \"mention_count\": 1, \"observation_count\": 1, \"first_seen\": \"C0003\", \"last_seen\": \"C0003\"}]}\n\nSCRIPT CANDIDATE:\n{\"scene_id\": \"S0004\", \"scene_notes\": \"以传统章回体句式留下三人命运的悬念。；重要性：过渡；呈现：叙事旁白；时间顺序：叙事4->故事5；改编策略：retain；呈现策略：narration；剧本目标：通过旁白和画面，将文字悬念转化为视听悬念，自然过渡到下一章节，同时强化三人命运未卜的戏剧张力。\", \"audio_notes\": \"旁白（说书人或角色内心独白）；悬念感音乐；可能的音效（如风声、水声）\", \"narrator_profile_id\": \"narrator_main_cn\", \"chronology\": {\"scene_id\": \"S0004\", \"narrative_order\": 4, \"story_chronology_order\": 5, \"story_chronology_group\": \"CG0004\", \"time_mode\": \"mainline\", \"confidence\": 0.56, \"order_delta\": 1, \"temporal_anchor\": {\"label\": \"\", \"normalized_label\": \"unknown\", \"anchor_type\": \"unknown\", \"relative_direction\": \"unknown\", \"amount\": null, \"unit\": \"\", \"time_of_day\": \"\", \"explicit\": false, \"anchor_scene_id\": \"S0003\"}, \"constraints\": [{\"relation\": \"after\", \"target_scene_id\": \"S0003\", \"confidence\": 0.58, \"reason\": \"narrative_forward\"}], \"evidence\": []}, \"adaptation\": {\"scene_id\": \"S0004\", \"decision\": \"retain\", \"presentation_mode\": \"narration\", \"story_function\": [\"章节过渡\", \"悬念设置\"], \"adaptation_focus\": \"将传统章回体悬念转化为影视化的章节结尾，为下一集或下一幕制造期待。\", \"must_keep\": [\"“未知三人性命如何”的悬念核心\", \"章回体结尾的叙事功能\"], \"may_compress\": [], \"visual_focus\": [\"三人（老残等）的剪影或远景\", \"渐黑或淡出的画面\"], \"audio_focus\": [\"旁白（说书人或角色内心独白）\", \"悬念感音乐\", \"可能的音效（如风声、水声）\"], \"continuity_requirements\": [\"承接前一场三人遇险的紧张感\", \"保持时间顺序（S0004在S0003之后）\"], \"script_objective\": \"通过旁白和画面，将文字悬念转化为视听悬念，自然过渡到下一章节，同时强化三人命运未卜的戏剧张力。\", \"conflict\": \"命运与未知的冲突（三人 vs. 未知的危险/命运）\", \"turning_point\": \"从具体情节推进转向悬念收束，为后续故事开启新的可能性。\", \"reason\": \"原候选的‘dramatize’模式不适合纯叙事性章回体结尾。‘narration’模式（旁白）能更忠实、高效地转化原文功能，既保留传统韵味，又符合影视章节结尾的常见手法。必须保留其作为悬念钩子和章节过渡的核心作用。\", \"chronology\": {\"scene_id\": \"S0004\", \"narrative_order\": 4, \"story_chronology_order\": 5, \"story_chronology_group\": \"CG0004\", \"time_mode\": \"mainline\", \"confidence\": 0.56, \"order_delta\": 1, \"temporal_anchor\": {\"label\": \"\", \"normalized_label\": \"unknown\", \"anchor_type\": \"unknown\", \"relative_direction\": \"unknown\", \"amount\": null, \"unit\": \"\", \"time_of_day\": \"\", \"explicit\": false, \"anchor_scene_id\": \"S0003\"}, \"constraints\": [{\"relation\": \"after\", \"target_scene_id\": \"S0003\", \"confidence\": 0.58, \"reason\": \"narrative_forward\"}], \"evidence\": []}, \"retained_group_id\": \"AG0004\", \"beat_id\": \"AB0004\", \"group_role\": \"standalone\", \"group_strategy\": \"single_scene\", \"script_render_mode\": \"full_scene\", \"drop_from_script\": false, \"hard_merge\": false, \"merge_lead_scene_id\": \"S0004\", \"merge_reason\": \"\", \"group_scene_count\": 1, \"group_context\": {\"group_id\": \"AG0004\", \"group_strategy\": \"single_scene\", \"hard_merge\": false, \"lead_scene_id\": \"S0004\", \"support_scene_ids\": [], \"merged_scene_count\": 0, \"group_summary\": \"以传统章回体句式留下三人命运的悬念。\", \"script_objective\": \"通过旁白和画面，将文字悬念转化为视听悬念，自然过渡到下一章节，同时强化三人命运未卜的戏剧张力。\", \"story_functions\": [\"章节过渡\", \"悬念设置\"], \"must_keep\": [\"“未知三人性命如何”的悬念核心\", \"章回体结尾的叙事功能\"], \"continuity_requirements\": [\"承接前一场三人遇险的紧张感\", \"保持时间顺序（S0004在S0003之后）\"], \"merged_scene_summaries\": []}}, \"shots\": [{\"shot_id\": \"S0004_SH01\", \"camera\": \"旁白引导中景\", \"description\": \"以传统章回体句式留下三人命运的悬念。\", \"actions\": [\"未知三人性命如何\"], \"dialogue\": [], \"narration\": \"\", \"on_screen_text\": \"\", \"focus_characters\": [\"三人\"], \"focus_locations\": [], \"candidate_meta\": {\"shot_role\": \"opening\", \"description_hint\": \"场景建立镜头，带出未知三人性命如何\", \"camera_hint\": \"中景\", \"adaptation_summary\": {\"decision\": \"retain\", \"presentation_mode\": \"narration\", \"story_function\": [\"章节过渡\", \"悬念设置\"], \"must_keep_count\": 2, \"audio_focus_count\": 3, \"group_role\": \"standalone\", \"group_strategy\": \"single_scene\", \"script_render_mode\": \"full_scene\", \"drop_from_script\": false, \"retained_group_id\": \"AG0004\", \"beat_id\": \"AB0004\"}, \"adaptation_group_context\": {\"group_id\": \"AG0004\", \"group_strategy\": \"single_scene\", \"hard_merge\": false, \"lead_scene_id\": \"S0004\", \"support_scene_ids\": [], \"merged_scene_count\": 0, \"group_summary\": \"以传统章回体句式留下三人命运的悬念。\", \"script_objective\": \"通过旁白和画面，将文字悬念转化为视听悬念，自然过渡到下一章节，同时强化三人命运未卜的戏剧张力。\", \"story_functions\": [\"章节过渡\", \"悬念设置\"], \"must_keep\": [\"“未知三人性命如何”的悬念核心\", \"章回体结尾的叙事功能\"], \"continuity_requirements\": [\"承接前一场三人遇险的紧张感\", \"保持时间顺序（S0004在S0003之后）\"], \"merged_scene_summaries\": []}, \"shot_index\": 1, \"chronology_summary\": {\"narrative_order\": 4, \"story_chronology_order\": 5, \"story_chronology_group\": \"CG0004\", \"time_mode\": \"mainline\", \"confidence\": 0.56, \"order_delta\": 1, \"anchor_label\": \"\", \"anchor_type\": \"unknown\", \"constraint_count\": 1, \"evidence_count\": 0}, \"focus_character_entity_refs\": [{\"entity_uid\": \"E000014\", \"entity_id\": \"E000014\", \"canonical_name\": \"三人\", \"name\": \"三人\", \"type\": \"人物\", \"subtype\": \"角色姓名\", \"matched_terms\": [\"三人\"], \"match_score\": 5.1, \"display_name\": \"\", \"conflict_group_id\": \"\", \"identity_conflict\": false, \"ref_role\": \"character_candidate\"}], \"focus_location_entity_refs\": []}, \"narrator_profile_id\": \"narrator_main_cn\"}, {\"shot_id\": \"S0004_SH02\", \"camera\": \"中近景\", \"description\": \"三人的反应镜头，推进未知三人性命如何\", \"actions\": [\"未知三人性命如何\"], \"dialogue\": [], \"narration\": \"\", \"on_screen_text\": \"\", \"focus_characters\": [\"三人\"], \"focus_locations\": [], \"candidate_meta\": {\"shot_role\": \"character\", \"description_hint\": \"三人的反应镜头，推进未知三人性命如何\", \"camera_hint\": \"中近景\", \"adaptation_summary\": {\"decision\": \"retain\", \"presentation_mode\": \"narration\", \"story_function\": [\"章节过渡\", \"悬念设置\"], \"must_keep_count\": 2, \"audio_focus_count\": 3, \"group_role\": \"standalone\", \"group_strategy\": \"single_scene\", \"script_render_mode\": \"full_scene\", \"drop_from_script\": false, \"retained_group_id\": \"AG0004\", \"beat_id\": \"AB0004\"}, \"adaptation_group_context\": {\"group_id\": \"AG0004\", \"group_strategy\": \"single_scene\", \"hard_merge\": false, \"lead_scene_id\": \"S0004\", \"support_scene_ids\": [], \"merged_scene_count\": 0, \"group_summary\": \"以传统章回体句式留下三人命运的悬念。\", \"script_objective\": \"通过旁白和画面，将文字悬念转化为视听悬念，自然过渡到下一章节，同时强化三人命运未卜的戏剧张力。\", \"story_functions\": [\"章节过渡\", \"悬念设置\"], \"must_keep\": [\"“未知三人性命如何”的悬念核心\", \"章回体结尾的叙事功能\"], \"continuity_requirements\": [\"承接前一场三人遇险的紧张感\", \"保持时间顺序（S0004在S0003之后）\"], \"merged_scene_summaries\": []}, \"shot_index\": 2, \"chronology_summary\": {\"narrative_order\": 4, \"story_chronology_order\": 5, \"story_chronology_group\": \"CG0004\", \"time_mode\": \"mainline\", \"confidence\": 0.56, \"order_delta\": 1, \"anchor_label\": \"\", \"anchor_type\": \"unknown\", \"constraint_count\": 1, \"evidence_count\": 0}, \"focus_character_entity_refs\": [{\"entity_uid\": \"E000014\", \"entity_id\": \"E000014\", \"canonical_name\": \"三人\", \"name\": \"三人\", \"type\": \"人物\", \"subtype\": \"角色姓名\", \"matched_terms\": [\"三人\"], \"match_score\": 5.1, \"display_name\": \"\", \"conflict_group_id\": \"\", \"identity_conflict\": false, \"ref_role\": \"character_candidate\"}], \"focus_location_entity_refs\": []}, \"narrator_profile_id\": \"narrator_main_cn\"}], \"candidate_meta\": {\"scene_id\": \"S0004\", \"source_chunk_id\": \"C0003\", \"source_start_para\": 27, \"source_end_para\": 27, \"characters\": [\"三人\"], \"locations\": [], \"key_beats\": [\"未知三人性命如何\"], \"shot_count_hint\": 2, \"scene_summary\": \"以传统章回体句式留下三人命运的悬念。\", \"scene_text_preview\": \"未知三人性命如何，且聽下回分解\", \"chronology_summary\": {\"narrative_order\": 4, \"story_chronology_order\": 5, \"story_chronology_group\": \"CG0004\", \"time_mode\": \"mainline\", \"confidence\": 0.56, \"order_delta\": 1, \"anchor_label\": \"\", \"anchor_type\": \"unknown\", \"constraint_count\": 1, \"evidence_count\": 0}, \"adaptation_summary\": {\"decision\": \"retain\", \"presentation_mode\": \"narration\", \"story_function\": [\"章节过渡\", \"悬念设置\"], \"must_keep_count\": 2, \"audio_focus_count\": 3, \"group_role\": \"standalone\", \"group_strategy\": \"single_scene\", \"script_render_mode\": \"full_scene\", \"drop_from_script\": false, \"retained_group_id\": \"AG0004\", \"beat_id\": \"AB0004\"}, \"character_entity_refs\": [{\"entity_uid\": \"E000014\", \"entity_id\": \"E000014\", \"canonical_name\": \"三人\", \"name\": \"三人\", \"type\": \"人物\", \"subtype\": \"角色姓名\", \"matched_terms\": [\"三人\"], \"match_score\": 5.1, \"display_name\": \"\", \"conflict_group_id\": \"\", \"identity_conflict\": false, \"ref_role\": \"character_candidate\"}], \"location_entity_refs\": [], \"merged_scene_ids\": [], \"merged_scene_count\": 0}}"
    }
  ]
}