{
  "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\": \"C0001-SC01\", \"title\": \"墨竹山法坛\", \"summary\": \"介绍墨竹山险恶环境与山中一座供奉魔尊法相的法坛。\", \"type\": [\"环境描写\", \"设定引入\"], \"tone\": [\"庄严\", \"神秘\"], \"importance\": \"铺垫\", \"presentation\": [\"氛围镜头\", \"全景\"], \"key_beats\": [\"墨竹山险恶环境\", \"人力开凿的平地\", \"魔尊法相\"], \"characters\": [], \"locations\": [\"墨竹山\"], \"continuation_of_prev\": false, \"source_chunk_id\": \"C0001\", \"source_start_para\": 1, \"source_end_para\": 4, \"text\": \"第一章观星\\n\\n常无欲以观其妙，常有欲以观其徼\\n\\n墨竹山，\\n\\n地方三千里，两山十四峰，妖兽横行，毒瘴密布，人烟罕至。\\n于这片重峦绝岭，险峰叠嶂，墨林竹海之间，却被人力开凿出一亩见方的平地。\\n平地中央，结草搭楼，开坛立像，被建起一座八臂六首，相貌不似人型的魔尊法相。\", \"text_preview\": \"第一章观星 常无欲以观其妙，常有欲以观其徼 墨竹山， 地方三千里，两山十四峰，妖兽横行，毒瘴密布，人烟罕至。 于这片重峦绝岭，险峰叠嶂，墨林竹海之间，却被人力…\", \"candidate_meta\": {\"candidate_id\": \"C0001-SC01\", \"record_count\": 4, \"char_len\": 131, \"structure_counts\": {\"chapter_heading\": 1, \"short_line\": 2, \"body\": 1}, \"boundary_reasons_after\": [\"time_transition\", \"location_transition\"], \"matched_entities\": [{\"entity_id\": \"E000043\", \"name\": \"竹山\", \"type\": \"组织\", \"subtype\": \"\", \"matched_terms\": [\"竹山\", \"墨竹山\"], \"score\": 7.8}, {\"entity_id\": \"E000073\", \"name\": \"墨竹山\", \"type\": \"组织\", \"subtype\": \"\", \"matched_terms\": [\"墨竹山\"], \"score\": 5.8}, {\"entity_id\": \"E000003\", \"name\": \"魔尊法相\", \"type\": \"物品\", \"subtype\": \"\", \"matched_terms\": [\"魔尊法相\"], \"score\": 5.4}, {\"entity_id\": \"E000001\", \"name\": \"墨竹山\", \"type\": \"地点\", \"subtype\": \"山岳/洞天\", \"matched_terms\": [\"墨竹山\"], \"score\": 5.3}, {\"entity_id\": \"E000106\", \"name\": \"墨竹山\", \"type\": \"地点\", \"subtype\": \"山岳/洞天\", \"matched_terms\": [\"墨竹山\"], \"score\": 5.0}, {\"entity_id\": \"E000049\", \"name\": \"魔胎\", \"type\": \"概念法则\", \"subtype\": \"\", \"matched_terms\": [\"法相\"], \"score\": 2.8}], \"heuristic_types\": [\"环境描写\"], \"heuristic_tones\": [\"庄严\", \"紧张\"], \"heuristic_presentation\": [\"氛围镜头\"], \"heuristic_importance\": \"铺垫\"}, \"scene_id\": \"S0001\"}\n\nCHRONOLOGY:\n{\"scene_id\": \"S0001\", \"narrative_order\": 1, \"story_chronology_order\": 1, \"story_chronology_group\": \"CG0001\", \"time_mode\": \"unknown\", \"confidence\": 0.3, \"order_delta\": 0, \"temporal_anchor\": {\"label\": \"\", \"normalized_label\": \"unknown\", \"anchor_type\": \"unknown\", \"relative_direction\": \"unknown\", \"amount\": null, \"unit\": \"\", \"time_of_day\": \"\", \"explicit\": false, \"anchor_scene_id\": \"\"}, \"constraints\": [], \"evidence\": []}\n\nENTITY CONTEXT:\n{\"registry_entities\": [{\"entity_uid\": \"E000043\", \"canonical_name\": \"竹山\", \"aliases\": [\"竹山门楣\", \"本教\", \"竹山教\", \"墨竹山\", \"宗门\", \"我派\"], \"type\": \"组织\", \"subtype\": \"\", \"voice_card_id\": \"\"}], \"kg_entities\": [{\"entity_id\": \"E000001\", \"name\": \"墨竹山\", \"type\": \"地点\", \"subtype\": \"山岳/洞天\", \"aliases\": [\"墨竹山洞天\"], \"attributes\": {}, \"descriptions\": [\"地方三千里\", \"两山十四峰\", \"灵炁纯洁\", \"玄冥灵炁充裕\", \"灵炁充裕纯洁\", \"没有灵炁杂驳担忧\"], \"evidence\": [\"墨竹山，地方三千里，两山十四峰，妖兽横行，毒瘴密布，人烟罕至。\", \"李凡所在的墨竹山洞天\", \"充斥玄冥真炁的丹池\"], \"mentions\": [{\"chunk_id\": \"C0001\", \"summary\": \"妖兽横行毒瘴密布\", \"evidence\": [\"墨竹山，地方三千里，两山十四峰，妖兽横行，毒瘴密布，人烟罕至。\"], \"attributes\": {}}, {\"chunk_id\": \"C0014\", \"summary\": \"玄冥灵炁充裕\", \"evidence\": [\"周围天地间的玄冥灵炁之充裕纯洁\"], \"attributes\": {}}, {\"chunk_id\": \"C0015\", \"summary\": \"灵炁充裕的洞天\", \"evidence\": [\"李凡所在的墨竹山洞天\"], \"attributes\": {}}], \"mention_count\": 3, \"observation_count\": 3, \"first_seen\": \"C0001\", \"last_seen\": \"C0015\"}]}\n\nSCRIPT CANDIDATE:\n{\"scene_id\": \"S0001\", \"scene_notes\": \"介绍墨竹山险恶环境与山中一座供奉魔尊法相的法坛。；重要性：铺垫；呈现：氛围镜头 / 全景\", \"audio_notes\": \"以旁白驱动\", \"narrator_profile_id\": \"narrator_main_cn\", \"chronology\": {\"scene_id\": \"S0001\", \"narrative_order\": 1, \"story_chronology_order\": 1, \"story_chronology_group\": \"CG0001\", \"time_mode\": \"unknown\", \"confidence\": 0.3, \"order_delta\": 0, \"temporal_anchor\": {\"label\": \"\", \"normalized_label\": \"unknown\", \"anchor_type\": \"unknown\", \"relative_direction\": \"unknown\", \"amount\": null, \"unit\": \"\", \"time_of_day\": \"\", \"explicit\": false, \"anchor_scene_id\": \"\"}, \"constraints\": [], \"evidence\": []}, \"shots\": [{\"shot_id\": \"S0001_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\": 1, \"story_chronology_order\": 1, \"story_chronology_group\": \"CG0001\", \"time_mode\": \"unknown\", \"confidence\": 0.3, \"order_delta\": 0, \"anchor_label\": \"\", \"anchor_type\": \"unknown\", \"constraint_count\": 0, \"evidence_count\": 0}}, \"narrator_profile_id\": \"narrator_main_cn\", \"narration_delivery_hint\": \"平稳陈述\"}, {\"shot_id\": \"S0001_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\": 1, \"story_chronology_order\": 1, \"story_chronology_group\": \"CG0001\", \"time_mode\": \"unknown\", \"confidence\": 0.3, \"order_delta\": 0, \"anchor_label\": \"\", \"anchor_type\": \"unknown\", \"constraint_count\": 0, \"evidence_count\": 0}}, \"narrator_profile_id\": \"narrator_main_cn\"}, {\"shot_id\": \"S0001_SH03\", \"camera\": \"近景\", \"description\": \"动作或状态变化的推进镜头\", \"actions\": [\"人力开凿的平地\", \"魔尊法相\"], \"dialogue\": [], \"narration\": \"\", \"on_screen_text\": \"\", \"focus_characters\": [], \"focus_locations\": [\"墨竹山\"], \"candidate_meta\": {\"shot_role\": \"dialogue_or_action\", \"description_hint\": \"动作或状态变化的推进镜头\", \"camera_hint\": \"近景\", \"shot_index\": 3, \"chronology_summary\": {\"narrative_order\": 1, \"story_chronology_order\": 1, \"story_chronology_group\": \"CG0001\", \"time_mode\": \"unknown\", \"confidence\": 0.3, \"order_delta\": 0, \"anchor_label\": \"\", \"anchor_type\": \"unknown\", \"constraint_count\": 0, \"evidence_count\": 0}}, \"narrator_profile_id\": \"narrator_main_cn\"}], \"candidate_meta\": {\"scene_id\": \"S0001\", \"source_chunk_id\": \"C0001\", \"source_start_para\": 1, \"source_end_para\": 4, \"characters\": [], \"locations\": [\"墨竹山\"], \"key_beats\": [\"墨竹山险恶环境\", \"人力开凿的平地\", \"魔尊法相\"], \"shot_count_hint\": 3, \"scene_summary\": \"介绍墨竹山险恶环境与山中一座供奉魔尊法相的法坛。\", \"scene_text_preview\": \"第一章观星 常无欲以观其妙，常有欲以观其徼 墨竹山， 地方三千里，两山十四峰，妖兽横行，毒瘴密布，人烟罕至。 于这片重峦绝岭，险峰叠嶂，墨林竹海之间，却被人力…\", \"chronology_summary\": {\"narrative_order\": 1, \"story_chronology_order\": 1, \"story_chronology_group\": \"CG0001\", \"time_mode\": \"unknown\", \"confidence\": 0.3, \"order_delta\": 0, \"anchor_label\": \"\", \"anchor_type\": \"unknown\", \"constraint_count\": 0, \"evidence_count\": 0}}}"
    }
  ]
}