{
  "version": "p9_ai_executable_screenplay_fresh_execution.v1",
  "created_at": "2026-05-31T01:20:16.419894Z",
  "phase": "P9_ai_executable_screenplay_fresh_execution_contract",
  "project_root": ".",
  "output_run_dir": "outputs/p9_ai_executable_screenplay_fresh_execution_20260531_091953",
  "source_artifacts": {
    "p9_contract": {
      "path": "docs/p9_ai_executable_screenplay_fresh_execution_contract_20260531.md",
      "sha256": "1990b544669ce4fe6ede9350f277b85326b2bdeddd710aefa29f093915c094e0",
      "size_bytes": 8678,
      "exists": true
    },
    "p8_closeout_retrospective": {
      "path": "docs/p8_closeout_retrospective_20260531.md",
      "sha256": "68913c925e8624e867432e69652bcea21d860429f046dd308fbd1422dd283b47",
      "size_bytes": 12391,
      "exists": true
    },
    "p8_gate": {
      "artifact": "P8_adaptation_gate.json",
      "path": "outputs/p8_adaptation_planning_fresh_execution_20260531_074542/P8_adaptation_gate.json",
      "exists": true,
      "size_bytes": 11157,
      "sha256": "9839073d2035a5146bf2fbf7b60c3c10da9d0d999bc93e08859527c6e51d94de"
    },
    "p8_validator": {
      "artifact": "P8_adaptation_validator_report.json",
      "path": "outputs/p8_adaptation_planning_fresh_execution_20260531_074542/P8_adaptation_validator_report.json",
      "exists": true,
      "size_bytes": 6262,
      "sha256": "6a9403ef42b5fb7a8bf0b36cbcb3dc4e1fd83162a63705c5ec5a555e567f031f"
    },
    "p8_execution_input": {
      "artifact": "P8_adaptation_planning_execution_input.json",
      "path": "outputs/p8_adaptation_planning_fresh_execution_20260531_074542/P8_adaptation_planning_execution_input.json",
      "exists": true,
      "size_bytes": 34415,
      "sha256": "af1cc1663620bbc56022306087b087a3fce89d158286dda0843526b18a08bc87"
    },
    "p8_readiness_matrix": {
      "path": "outputs/p8_adaptation_planning_fresh_execution_20260531_074542/P8_adaptation_scene_readiness_matrix.jsonl",
      "exists": true,
      "sha256": "917e596c9894112654dca20de24194e23acfc3e53ab791c6a206ccebbfc79be7",
      "size_bytes": 9554137
    },
    "p8_units": {
      "path": "outputs/p8_adaptation_planning_fresh_execution_20260531_074542/P8_adaptation_units.jsonl",
      "exists": true,
      "sha256": "51d549edfc74de50962e802d6f048094b11654b10c110c7257aba883bd07fe20",
      "size_bytes": 46735345
    },
    "p8_queue": {
      "path": "outputs/p8_adaptation_planning_fresh_execution_20260531_074542/P8_adaptation_dependency_queue.jsonl",
      "exists": true,
      "sha256": "4eee78ba3707aa6f0f0440a81bb599d2a9cf9306eb04f9b1778fa6b9271e8744",
      "size_bytes": 4737
    },
    "p8_manifest": {
      "artifact": "manifest.json",
      "path": "outputs/p8_adaptation_planning_fresh_execution_20260531_074542/manifest.json",
      "exists": true,
      "size_bytes": 5335,
      "sha256": "883262703f547b5d6338f39210311ef047ace9b3e7366a18f137de6503a64406"
    },
    "p8_program_validation": {
      "artifact": "P8_adaptation_planning_program_validation.json",
      "path": "outputs/p8_adaptation_planning_deepseek_audit_20260531_074613/P8_adaptation_planning_program_validation.json",
      "exists": true,
      "size_bytes": 6089,
      "sha256": "13e7936ba24be6771ea28ec4f76cc71b320aafd801a284d4da88c184d19a8744"
    },
    "p8_deepseek_gate": {
      "artifact": "P8_adaptation_planning_deepseek_audit_gate.json",
      "path": "outputs/p8_adaptation_planning_deepseek_audit_20260531_074613/P8_adaptation_planning_deepseek_audit_gate.json",
      "exists": true,
      "size_bytes": 4898,
      "sha256": "7b17a808b76b63a02273dd3b4fab1c3b6bac57e13677f9c20fa44a11367734e6"
    },
    "p8_deepseek_raw": {
      "artifact": "P8_adaptation_planning_deepseek_audit_raw.json",
      "path": "outputs/p8_adaptation_planning_deepseek_audit_20260531_074613/P8_adaptation_planning_deepseek_audit_raw.json",
      "exists": true,
      "size_bytes": 204402,
      "sha256": "9ab50a154d3894cff213e85a1d937d671ff0b6af90e0411cfc3c90223b6eefe6"
    },
    "p5e_scenes": {
      "artifact": "P5E_scenes.json",
      "path": "outputs/p5e_scene_segmentation_fresh_rebuild_execution_20260530_135944/P5E_scenes.json",
      "exists": true,
      "size_bytes": 80211011,
      "sha256": "5cbf59a643dabeb6f9d8d2a0c072df64d5b83ceb399deed160e1d100a717a2a5"
    },
    "p6_chronology": {
      "artifact": "P6_chronology.json",
      "path": "outputs/p6_chronology_and_narrative_time_fresh_rebuild_20260530_141544/P6_chronology.json",
      "exists": true,
      "size_bytes": 20418478,
      "sha256": "e402fdd980f144a701191489b413046b573bc26b77c03568d4f18dcb342fc78a"
    },
    "execution_state": {
      "artifact": "execution_state.json",
      "path": "execution_state.json",
      "exists": true,
      "size_bytes": 58629,
      "sha256": "39c3f14948ea31055bf59f2d5674d5113a66b67b649f2a387234b74ef7cbd27b"
    }
  },
  "contract_checks": {
    "p9_contract_present": true,
    "p9_contract_screenplay_control_data_only": true,
    "p9_contract_p8_explicit_authority": true,
    "p9_contract_required_outputs": true,
    "p9_contract_validator_matrix_bound": true,
    "p9_contract_shooting_script_blocked": true,
    "p9_contract_no_provider_media": true,
    "p9_contract_no_kg_overlay_replay": true,
    "p9_contract_old_b7_reference_only": true,
    "p9_contract_runtime_hardcoding_ban": true
  },
  "p9_contract_excerpt": "# P9 AI-Executable Screenplay Fresh Execution Contract\n\n更新时间：`2026-05-31T07:48:00+08:00`\n\n本文冻结 P计划 `P9_ai_executable_screenplay_fresh_execution_contract` 的执行细则。P9 基于 P8 fresh adaptation planning outputs，执行 AI-executable screenplay control-data execution only，不执行 shooting_script、shot context、prompt packet、adapter render、provider job、media generation、feedback/replay、KG/overlay/replay，也不改写 `outputs/index.json` / `outputs/index-lite.json`。\n\n## Contract ID\n\n`P9_ai_executable_screenplay_fresh_execution_contract`\n\n## Objective\n\nP9 的目标是在 P8 closeout 之后，执行 fresh AI-executable screenplay control-data build：\n\n- consume P8 execution run, P8 program validation/advisory gate, and P8 closeout retrospective by explicit path。\n- consume P8 adaptation units/readiness/dependency queue as the only active adaptation authorities。\n- produce screenplay control rows that are traceable to P8 adaptation unit ids, retained group ids, beat ids, P5E source scene ids, P6 chronology refs, source refs, and dependency ids。\n- preserve merge/drop provenance so compressed or merged scenes remain source-auditable。\n- classify rows by structural fields only: screenplay unit id, adaptation unit id, retained group id, beat id, scene id, chronology group id, validator id, gate id, dependency id, source refs。\n- identify the first later shooting_script contract candidate, but keep shooting_script execution blocked in P9。\n- keep old B7 adaptation/screenplay outputs as paused reference / diagnostic comparison only。\n- require P9 program validation, DeepSeek v4 pro thinking/max advisory, closeout retrospective, and control-plane sync before any shooting_script stage opens。\n\nP9 screenplay output is AI-executable control data, not literary prose-only output. If richer LLM dialogue/rewrite enrichment is later required, it must be opened as a separate logged and audited LLM enrichment contract with structured input/output schemas, provider metadata, raw response logs, deterministic validators, and DeepSeek advisory; P9 itself does not silently run unlogged creative enrichment.\n\n## Required Inputs\n\n- `docs/p9_ai_executable_screenplay_fresh_execution_contract_20260531.md`\n- `docs/p8_closeout_retrospective_20260531.md`\n- `outputs/p8_adaptation_planning_fresh_execution_20260531_074542/P8_adaptation_gate.json`\n- `outputs/p8_adaptation_planning_fresh_execution_20260531_074542/P8_adaptation_validator_report.json`\n- `outputs/p8_adaptation_planning_fresh_execution_20260531_074542/P8_adaptation_planning_execution_input.json`\n- `outputs/p8_adaptation_planning_fresh_execution_20260531_074542/P8_adaptation_scene_readiness_matrix.jsonl`\n- `outputs/p8_adaptation_planning_fresh_execution_20260531_074542/P8_adaptation_units.jsonl`\n- `outputs/p8_adaptation_planning_fresh_execution_20260531_074542/P8_adaptation_dependency_queue.jsonl`\n- `outputs/p8_adaptation_planning_fresh_execution_20260531_074542/manifest.json`\n- `outputs/p8_adaptation_planning_deepseek_audit_20260531_074613/P8_adaptation_planning_program_validation.json`\n- `outputs/p8_adaptation_planning_deepseek_audit_20260531_074613/P8_adaptation_planning_deepseek_audit_gate.json`\n- `outputs/p8_adaptation_planning_deepseek_audit_20260531_074613/P8_adaptation_planning_deepseek_audit_raw.json`\n- `outputs/p5e_scene_segmentation_fresh_rebuild_execution_20260530_135944/P5E_scenes.json`\n- `outputs/p6_chronology_and_narrative_time_fresh_rebuild_20260530_141544/P6_chronology.json`\n- `execution_state.json`\n\nP9 must not discover P8 through generated indexes. Use explicit paths unless a later deterministic index-refresh stage is opened.\n\n## Execution Boundary\n\nP9 may execute screenplay control-data generation only:\n\n- allowed: reading P8 adaptation units/readiness/queue inputs, grouping screenplay rows by retained group/beat refs, creating screenplay unit ids, deriving scene objectives/control fields from P8 adaptation fields, preserving source/chronology/merge/drop refs, generating dependency queue, validators, gate/report/html。\n- not allowed: shooting_script execution, shot context generation, prompt packet generation, adapter render, provider/media, feedback intake, KG writeback, raw KG writeback, accepted/operator overlay writeback, replay, output deletion, output cold archive, generated index mutation。\n- DeepSeek advisory is required after P9 execution, but remains advisory-only and cannot become accepted operator evidence, accepted overlay, KG fact, replay action, provider evidence, or runtime routing logic。\n- Runtime branching by entity name, work title, block title, or sample text is prohibited. Entity names, work titles, block titles, and source excerpts may appear only as evidence/display text.\n\n## Required Outputs\n\nP9 must write a fresh output run dir such as:\n\n`outputs/p9_ai_executable_screenplay_fresh_execution_<timestamp>`\n\nRequired files:\n\n- `P9_screenplay_execution_input.json`\n- `P9_screenplay_unit_readiness_matrix.jsonl`\n- `P9_screenplay_units.jsonl`\n- `P9_screenplay_sequence_index.jsonl`\n- `P9_screenplay_dependency_queue.jsonl`\n- `P9_screenplay_validator_report.json`\n- `P9_screenplay_gate.json`\n- `P9_screenplay_report.md`\n- `P9_screenplay.html`\n- `manifest.json`\n\n## P9 Validator Matrix\n\n| Validator | Required check | Blocks pass when |\n| --- | --- | --- |\n| `p8_authority` | P9 consumes explicit P8 execution/advisory/retrospective paths and verifies pass gates | P8 gate/advisory missing, not pass, or P8 retrospective missing |\n| `adaptation_unit_traceability` | P8 adaptation units parse and retain source scene ids, chronology refs, group/beat refs, source refs, dependency ids | orphan screenplay input, missing adaptation unit ref, missing source/chronology/group/beat ref |\n| `screenplay_unit_traceability` | every screenplay unit maps to adaptation unit ids, retained group ids, beat ids, scene ids, chronology refs, and dependency ids | orphan screenplay unit, missing source scene ref, missing adaptation unit ref, missing chronology ref |\n| `screenplay_control_data_schema` | screenplay units are AI-executable control data with objective, render mode, source refs, continuity refs, and blocked downstream flags | literary prose-only rows, missing control fields, missing continuity refs |\n| `merge_drop_provenance_guard` | dropped/merged P8 scenes remain traceable through group/support/drop refs | dropped/merged scenes disappear from provenance |\n| `screenplay_scope_guard` | P9 generates screenplay control artifacts only | shooting_script/prompt/provider/media output generated in P9 |\n| `dependency_queue_ordering` | queue opens only the next shooting_script contract candidate after P9 advisory/retrospective | shooting_script execution marked allowed before P9 closeout |\n| `downstream_leakage_guard` | shot context/prompt/provider/media counters remain zero | any downstream artifact is generated in P9 |\n| `kg_overlay_replay_guard` | KG/overlay/replay counters remain zero | canonical/raw KG, accepted/operator overlay, or replay writeback appears |\n| `old_b7_exclusion` | old B7 remains reference-only | old B7 adaptation/screenplay output is used as active authority |\n| `active_route_guard` | `execution_state.json.next_entrypoint.id` remains `platform_neutral_prompt_readiness_manual_execution_log_contract` | active route changes |\n\n## DeepSeek Advisory Requirements\n\nP9 closeout requires DeepSeek v4 pro thinking/max advisory over:\n\n- P9 contract。\n- P8 closeout retrospective。\n- P9 screenplay control-data outputs。\n- P9 validator report and gate。\n- active route boundary from `execution_state.json`。\n\nExpected pass verdict:\n\n`supports_p9_ai_executable_screenplay_fresh_execution`\n\nPass requires:\n\n- DeepSeek call status=`success`。\n- parse status=`pass`。\n- finding/blocker/high=0/0/0。\n- advisory confirms P9 uses P8 fresh artifacts as active adaptation authorities。\n- advisory confirms screenplay control data is traceable and bounded。\n- advisory confirms shooting_script execution remains blocked in P9。\n- advisory confirms provider/media/KG/overlay/replay/index mutation remain blocked。\n- advisory confirms old B7 remains reference-only。\n\nMissing/skipped/unavailable/unparseable advisory blocks P9 closeout or records `blocked_unavailable`; it never counts as pass.\n\n## Non-Goals\n\n- P9 does not execute shooting_script。\n- P9 does not generate shot context、prompt packet、adapter render、provider/media。\n- P9 does not write KG/overlay/replay。\n- P9 does not repair generated indexes。\n- P9 does not continue old B7 downstream。\n- P9 does not silently perform unlogged LLM dialogue/rewrite enrichment。\n",
  "p8_retrospective_excerpt": "# P8 Closeout Retrospective\n\n更新时间：`2026-05-31T07:48:00+08:00`\n\n本文是 P计划阶段间复盘门禁下的 `P8_adaptation_planning_fresh_execution_contract` closeout retrospective。它在 P8 adaptation planning fresh execution、程序验证和 DeepSeek advisory 通过后，任何 P9 screenplay contract 推进前复盘实际落地、证据基础、风险和下一阶段校准。\n\n## Retrospective Summary\n\nP8 已完成 fresh adaptation planning execution：基于 P5E fresh scenes、P6 fresh chronology、P7 planning/advisory/retrospective，生成 P8 execution input、adaptation scene readiness matrix、adaptation units、dependency queue、validator report、gate、report/html 和 manifest。\n\nP8 只执行 deterministic adaptation planning。P8 没有执行 AI-executable screenplay、shooting_script、shot context、prompt packet、adapter render、provider/media、KG/overlay/replay，没有删除/冷归档 outputs run，也没有改写 `outputs/index.json` / `outputs/index-lite.json`。DeepSeek v4 pro thinking/max advisory 支持 P8 closeout，finding/blocker/high=0/0/0。\n\n## Actual Landed\n\n- P8 contract：`docs/p8_adaptation_planning_fresh_execution_contract_20260531.md`\n- P8 implementation：\n  - `src/novel2video/p8_adaptation_planning_fresh_execution.py`\n  - `scripts/run_p8_adaptation_planning_fresh_execution.py`\n  - `scripts/run_p8_adaptation_planning_deepseek_audit.py`\n  - `tests/test_p8_adaptation_planning_fresh_execution.py`\n- Core backup before P8 `src/` / `scripts` edits：`backups/20260531_073559_p8_adaptation_planning_fresh_execution`\n- P8 focused tests：6 passed。\n- P8 fresh execution run：`outputs/p8_adaptation_planning_fresh_execution_20260531_074542`\n  - gate=`pass`\n  - gate_status=`p8_adaptation_planning_fresh_execution_pass`\n  - P5E scenes / P6 chronology rows=6989 / 6989\n  - P6 chronology groups=5158\n  - P6 chronology edges=8951\n  - P6 chronology conflicts=0\n  - P6 scene-chronology join validation failures=0\n  - P7 planning matrix rows=8\n  - P7 dependency queue items=8\n  - P8 readiness matrix rows=6989\n  - adaptation units=6989\n  - retained scene groups=5002\n  - beat count=5002\n  - retain/compress/bridge scene counts=5814 / 1140 / 35\n  - hard merge groups=1046\n  - drop-from-script scene count=1518\n  - P8 dependency queue items=7\n  - future executable after P8 closeout candidates=1\n  - validator failures=0\n- P8 advisory run：`outputs/p8_adaptation_planning_deepseek_audit_20260531_074613`\n  - program validation status=`pass`\n  - program validation failure_count=0\n  - gate=`pass`\n  - gate_status=`deepseek_advisory_supports_p8_adaptation_planning_fresh_execution`\n  - verdict=`supports_p8_adaptation_planning_fresh_execution`\n  - finding/blocker/high=0/0/0\n  - false_required_confirmation_count=0\n  - recommended next=`P9_ai_executable_screenplay_fresh_execution_contract`\n\n## Program Validation Summary\n\n- P8 required output files exist and parse。\n- P8 gate status=`pass`。\n- P8 validator status=`pass`。\n- P5E scene count=6989。\n- P6 chronology scene count=6989。\n- P6 scene-chronology join validation failure_count=0。\n- readiness matrix rows=6989。\n- adaptation units=6989。\n- dependency queue items=7。\n- single future executable after P8 closeout=1。\n- retained scene groups and beats are present。\n- `execution_state.json.next_entrypoint.id` remains `platform_neutral_prompt_readiness_manual_execution_log_contract`。\n- screenplay execution、shooting_script、shot context、prompt packet、adapter render、provider/media、KG/overlay/replay、output deletion/archive/index mutation counters all 0。\n\n## Not Landed\n\n- AI-executable screenplay execution 未执行。\n- screenplay LLM enrichment / dialogue rewrite 未执行。\n- shooting_script、shot context、prompt packet、adapter render、provider/media 未执行。\n- KG/accepted overlay/operator overlay/raw KG/canonical KG/replay 未写入。\n- outputs run deletion/cold archive 未执行。\n- `outputs/index.json` / `outputs/index-lite.json` 未改写。\n- 旧 B7 paused reference 未恢复为 active mainline。\n\n## Evidence Basis\n\n- `docs/p8_adaptation_planning_fresh_execution_contract_20260531.md`\n- `docs/p7_closeout_retrospective_20260531.md`\n- `outputs/p8_adaptation_planning_fresh_execution_20260531_074542/P8_adaptation_planning_execution_input.json`\n- `outputs/p8_adaptation_planning_fresh_execution_20260531_074542/P8_adaptation_scene_readiness_matrix.jsonl`\n- `outputs/p8_adaptation_planning_fresh_execution_20260531_074542/P8_adaptation_units.jsonl`\n- `outputs/p8_adaptation_planning_fresh_execution_20260531_074542/P8_adaptation_dependency_queue.jsonl`\n- `outputs/p8_adaptation_planning_fresh_execution_20260531_074542/P8_adaptation_validator_report.json`\n- `outputs/p8_adaptation_planning_fresh_execution_20260531_074542/P8_adaptation_gate.json`\n- `outputs/p8_adaptation_planning_fresh_execution_20260531_074542/P8_adaptation_report.md`\n- `outputs/p8_adaptation_planning_deepseek_audit_20260531_074613/P8_adaptation_planning_program_validation.json`\n- `outputs/p8_adaptation_planning_deepseek_audit_20260531_074613/P8_adaptation_planning_deepseek_audit_input.json`\n- `outputs/p8_adaptation_planning_deepseek_audit_20260531_074613/P8_adaptation_planning_deepseek_audit_raw.json`\n- `outputs/p8_adaptation_planning_deepseek_audit_20260531_074613/P8_adaptation_planning_deepseek_audit.json`\n- `outputs/p8_adaptation_planning_deepseek_audit_20260531_074613/P8_adaptation_planning_deepseek_audit_gate.json`\n- `outputs/p7_adaptation_screenplay_reentry_planning_20260531_070856/P7_adaptation_screenplay_reentry_gate.json`\n- `outputs/p7_adaptation_screenplay_reentry_deepseek_audit_20260531_070922/P7_adaptation_screenplay_reentry_deepseek_audit_gate.json`\n- `outputs/p5e_scene_segmentation_fresh_rebuild_execution_20260530_135944/P5E_scenes.json`\n- `outputs/p6_chronology_and_narrative_time_fresh_rebuild_20260530_141544/P6_chronology.json`\n- `outputs/p6_chronology_and_narrative_time_fresh_rebuild_20260530_141544/P6_scene_chronology_join_validation.json`\n- `execution_state.json`\n\n## DeepSeek Advisory Summary\n\n- call_status=`success`\n- parse_status=`pass`\n- model=`deepseek-v4-pro`\n- thinking/reasoning content present\n- verdict=`supports_p8_adaptation_planning_fresh_execution`\n- recommended_next_candidate=`P9_ai_executable_screenplay_fresh_execution_contract`\n- finding/blocker/high=0/0/0\n- false_required_confirmation_count=0\n\nDeepSeek confirmed all required checks:\n\n- P8 contract artifact-backed。\n- program validation passed。\n- P7 authority passed。\n- P5E fresh scenes used。\n- P6 fresh chronology used。\n- scene-chronology join passed。\n- adaptation units traceable。\n- adaptation planning completed。\n- screenplay execution not performed。\n- shooting_script/prompt/provider/media not performed。\n- KG/overlay/replay blocked。\n- outputs index unchanged。\n- old B7 reference-only。\n- next_entrypoint unchanged。\n- runtime branching by names absent。\n- P9 requires a separate contract。\n\n## Conclusive Output Review\n\nP8 is a conclusive adaptation planning execution output. It satisfies P计划 parallel review requirement:\n\n- P8 contract is present。\n- P8 deterministic execution gate pass。\n- P8 program validation pass。\n- Focused tests pass。\n- DeepSeek v4 pro thinking/max advisory available and parsed。\n- DeepSeek verdict supports P8。\n- finding/blocker/high=0/0/0。\n- provider/media/KG/overlay/replay/downstream execution/output deletion/output archive/index mutation counters all 0。\n\n## Risk And Debt\n\n- P8 adaptation planning is deterministic and traceable, but it is not a quality guarantee for final screenplay rhythm, dialogue, or episode pacing. P9 must validate screenplay control data against P8 adaptation unit refs and not treat compressed/merged choices as immutable creative truth。\n- P8 units include retained groups and beat ids, but group-level sequencing must be revalidated in P9 before screenplay rows are emitted。\n- P8 marked 1518 scenes as `drop_from_script` through deterministic grouping. P9 must preserve provenance for dropped/merged source scenes so no source coverage silently disappears。\n- P8 did not add P8 run dirs to generated indexes. Continue using explicit control-plane paths unless a deterministic index-refresh substage is opened。\n- Old B7 adaptation/screenplay outputs remain diagnostic only and must not be used as active source authority for P9。\n\n## ",
  "p8_gate_status": {
    "status": "pass",
    "gate_status": "p8_adaptation_planning_fresh_execution_pass"
  },
  "p8_gate_summary": {
    "p5e_scene_count": 6989,
    "p6_chronology_scene_count": 6989,
    "p6_chronology_group_count": 5158,
    "p6_chronology_edge_count": 8951,
    "p6_chronology_conflict_count": 0,
    "p6_join_validation_failure_count": 0,
    "p7_planning_matrix_row_count": 8,
    "p7_dependency_queue_item_count": 8,
    "p8_readiness_matrix_row_count": 6989,
    "adaptation_unit_count": 6989,
    "retained_scene_group_count": 5002,
    "beat_count": 5002,
    "retain_scene_count": 5814,
    "compress_scene_count": 1140,
    "bridge_scene_count": 35,
    "drop_from_script_scene_count": 1518,
    "hard_merge_group_count": 1046,
    "dependency_queue_item_count": 7,
    "future_executable_after_p8_closeout_count": 1,
    "validator_failure_count": 0,
    "active_route_next_entrypoint_id": "platform_neutral_prompt_readiness_manual_execution_log_contract",
    "p7_deepseek_overall_verdict": "supports_p7_adaptation_screenplay_reentry_planning",
    "old_b7_reference_only": true,
    "old_b7_active_source_ref_count": 0,
    "adaptation_planning_execution_count": 1,
    "llm_enrichment_call_count": 0,
    "screenplay_execution_count": 0,
    "shooting_script_execution_count": 0,
    "shot_context_generation_count": 0,
    "prompt_packet_generation_count": 0,
    "adapter_render_count": 0,
    "provider_job_execution_count": 0,
    "media_generation_count": 0,
    "accepted_overlay_write_count": 0,
    "operator_overlay_write_count": 0,
    "canonical_kg_writeback_count": 0,
    "raw_kg_writeback_count": 0,
    "replay_action_count": 0,
    "outputs_index_mutation_count": 0,
    "outputs_run_deletion_count": 0,
    "outputs_run_cold_archive_count": 0,
    "runtime_branching_by_entity_name_rule_count": 0,
    "runtime_branching_by_work_title_rule_count": 0,
    "runtime_branching_by_block_title_rule_count": 0,
    "runtime_branching_by_sample_text_rule_count": 0
  },
  "p8_validator_summary": {
    "p5e_scene_count": 6989,
    "p6_chronology_scene_count": 6989,
    "p6_chronology_group_count": 5158,
    "p6_chronology_edge_count": 8951,
    "p6_chronology_conflict_count": 0,
    "p6_join_validation_failure_count": 0,
    "p7_planning_matrix_row_count": 8,
    "p7_dependency_queue_item_count": 8,
    "p8_readiness_matrix_row_count": 6989,
    "adaptation_unit_count": 6989,
    "retained_scene_group_count": 5002,
    "beat_count": 5002,
    "retain_scene_count": 5814,
    "compress_scene_count": 1140,
    "bridge_scene_count": 35,
    "drop_from_script_scene_count": 1518,
    "hard_merge_group_count": 1046,
    "dependency_queue_item_count": 7,
    "future_executable_after_p8_closeout_count": 1,
    "validator_failure_count": 0,
    "active_route_next_entrypoint_id": "platform_neutral_prompt_readiness_manual_execution_log_contract",
    "p7_deepseek_overall_verdict": "supports_p7_adaptation_screenplay_reentry_planning",
    "old_b7_reference_only": true,
    "old_b7_active_source_ref_count": 0,
    "adaptation_planning_execution_count": 1,
    "llm_enrichment_call_count": 0,
    "screenplay_execution_count": 0,
    "shooting_script_execution_count": 0,
    "shot_context_generation_count": 0,
    "prompt_packet_generation_count": 0,
    "adapter_render_count": 0,
    "provider_job_execution_count": 0,
    "media_generation_count": 0,
    "accepted_overlay_write_count": 0,
    "operator_overlay_write_count": 0,
    "canonical_kg_writeback_count": 0,
    "raw_kg_writeback_count": 0,
    "replay_action_count": 0,
    "outputs_index_mutation_count": 0,
    "outputs_run_deletion_count": 0,
    "outputs_run_cold_archive_count": 0,
    "runtime_branching_by_entity_name_rule_count": 0,
    "runtime_branching_by_work_title_rule_count": 0,
    "runtime_branching_by_block_title_rule_count": 0,
    "runtime_branching_by_sample_text_rule_count": 0
  },
  "p8_manifest_summary": {
    "stage": "P8_adaptation_planning_fresh_execution_contract",
    "fresh_run_policy": {
      "new_output_run_dir": "outputs/p8_adaptation_planning_fresh_execution_20260531_074542",
      "no_overwrite": true
    }
  },
  "p8_program_validation": {
    "status": "pass",
    "failure_count": 0,
    "summary": {
      "p5e_scene_count": 6989,
      "p6_chronology_scene_count": 6989,
      "p6_chronology_group_count": 5158,
      "p6_chronology_edge_count": 8951,
      "p6_chronology_conflict_count": 0,
      "p6_join_validation_failure_count": 0,
      "p7_planning_matrix_row_count": 8,
      "p7_dependency_queue_item_count": 8,
      "p8_readiness_matrix_row_count": 6989,
      "adaptation_unit_count": 6989,
      "retained_scene_group_count": 5002,
      "beat_count": 5002,
      "retain_scene_count": 5814,
      "compress_scene_count": 1140,
      "bridge_scene_count": 35,
      "drop_from_script_scene_count": 1518,
      "hard_merge_group_count": 1046,
      "dependency_queue_item_count": 7,
      "future_executable_after_p8_closeout_count": 1,
      "validator_failure_count": 0,
      "active_route_next_entrypoint_id": "platform_neutral_prompt_readiness_manual_execution_log_contract",
      "p7_deepseek_overall_verdict": "supports_p7_adaptation_screenplay_reentry_planning",
      "old_b7_reference_only": true,
      "old_b7_active_source_ref_count": 0,
      "adaptation_planning_execution_count": 1,
      "llm_enrichment_call_count": 0,
      "screenplay_execution_count": 0,
      "shooting_script_execution_count": 0,
      "shot_context_generation_count": 0,
      "prompt_packet_generation_count": 0,
      "adapter_render_count": 0,
      "provider_job_execution_count": 0,
      "media_generation_count": 0,
      "accepted_overlay_write_count": 0,
      "operator_overlay_write_count": 0,
      "canonical_kg_writeback_count": 0,
      "raw_kg_writeback_count": 0,
      "replay_action_count": 0,
      "outputs_index_mutation_count": 0,
      "outputs_run_deletion_count": 0,
      "outputs_run_cold_archive_count": 0,
      "runtime_branching_by_entity_name_rule_count": 0,
      "runtime_branching_by_work_title_rule_count": 0,
      "runtime_branching_by_block_title_rule_count": 0,
      "runtime_branching_by_sample_text_rule_count": 0
    }
  },
  "p8_deepseek_gate": {
    "status": "pass",
    "gate_status": "deepseek_advisory_supports_p8_adaptation_planning_fresh_execution",
    "summary": {
      "program_validation_status": "pass",
      "program_validation_failure_count": 0,
      "deepseek_call_status": "success",
      "deepseek_parse_status": "pass",
      "deepseek_overall_verdict": "supports_p8_adaptation_planning_fresh_execution",
      "recommended_next_candidate": "P9_ai_executable_screenplay_fresh_execution_contract",
      "pipeline_finding_count": 0,
      "pipeline_blocker_count": 0,
      "pipeline_high_count": 0,
      "false_required_confirmation_count": 0,
      "p5e_scene_count": 6989,
      "p6_chronology_scene_count": 6989,
      "p6_chronology_group_count": 5158,
      "p6_chronology_edge_count": 8951,
      "p6_chronology_conflict_count": 0,
      "p6_join_validation_failure_count": 0,
      "p7_planning_matrix_row_count": 8,
      "p7_dependency_queue_item_count": 8,
      "p8_readiness_matrix_row_count": 6989,
      "adaptation_unit_count": 6989,
      "retained_scene_group_count": 5002,
      "beat_count": 5002,
      "retain_scene_count": 5814,
      "compress_scene_count": 1140,
      "bridge_scene_count": 35,
      "drop_from_script_scene_count": 1518,
      "hard_merge_group_count": 1046,
      "dependency_queue_item_count": 7,
      "future_executable_after_p8_closeout_count": 1,
      "validator_failure_count": 0,
      "active_route_next_entrypoint_id": "platform_neutral_prompt_readiness_manual_execution_log_contract",
      "p7_deepseek_overall_verdict": "supports_p7_adaptation_screenplay_reentry_planning",
      "old_b7_reference_only": true,
      "old_b7_active_source_ref_count": 0,
      "adaptation_planning_execution_count": 1,
      "llm_enrichment_call_count": 0,
      "screenplay_execution_count": 0,
      "shooting_script_execution_count": 0,
      "shot_context_generation_count": 0,
      "prompt_packet_generation_count": 0,
      "adapter_render_count": 0,
      "provider_job_execution_count": 0,
      "media_generation_count": 0,
      "accepted_overlay_write_count": 0,
      "operator_overlay_write_count": 0,
      "canonical_kg_writeback_count": 0,
      "raw_kg_writeback_count": 0,
      "replay_action_count": 0,
      "outputs_index_mutation_count": 0,
      "outputs_run_deletion_count": 0,
      "outputs_run_cold_archive_count": 0,
      "runtime_branching_by_entity_name_rule_count": 0,
      "runtime_branching_by_work_title_rule_count": 0,
      "runtime_branching_by_block_title_rule_count": 0,
      "runtime_branching_by_sample_text_rule_count": 0
    }
  },
  "p8_deepseek_raw_meta": {
    "id": "36c8aa05-008c-4300-b9c5-e5cdb3d4e085",
    "object": "chat.completion",
    "model": "deepseek-v4-pro",
    "usage": {
      "prompt_tokens": 55119,
      "completion_tokens": 2234,
      "total_tokens": 57353,
      "prompt_tokens_details": {
        "cached_tokens": 0
      },
      "completion_tokens_details": {
        "reasoning_tokens": 1926
      },
      "prompt_cache_hit_tokens": 0,
      "prompt_cache_miss_tokens": 55119
    },
    "finish_reason": "stop",
    "content_chars": 997,
    "reasoning_content_present": true,
    "reasoning_content_chars": 7704
  },
  "p8_adaptation_surface": {
    "readiness_row_count": 6989,
    "adaptation_unit_count": 6989,
    "dependency_queue_item_count": 7,
    "future_executable_after_p8_closeout_count": 1,
    "first_future_execution_contract_candidate": "P9_ai_executable_screenplay_fresh_execution_contract"
  },
  "p5e_scene_stats": {
    "scene_count": 6989,
    "declared_scene_count": 6989,
    "first_scene_id": "P5ESCENE000001",
    "last_scene_id": "P5ESCENE006989",
    "duplicate_scene_id_count": 0,
    "missing_source_ref_count": 0,
    "source_chunk_count": 1222,
    "scene_with_entity_ref_count": 6739,
    "entity_ref_count": 31530,
    "diagnostics": {
      "duplicate_scene_ids": [],
      "missing_source_ref_scene_ids": []
    }
  },
  "p6_chronology_stats": {
    "chronology_scene_count": 6989,
    "chronology_meta_scene_count": 6989,
    "chronology_group_count": 5158,
    "chronology_edge_count": 8951,
    "chronology_conflict_count": 0,
    "chronology_meta_conflict_count": 0,
    "mode_counts": {
      "unknown": 1,
      "mainline": 4248,
      "flashback": 1648,
      "dream": 123,
      "parallel": 315,
      "rumor": 391,
      "insertion": 263
    },
    "duplicate_chronology_scene_id_count": 0,
    "chronology_missing_source_ref_count": 0,
    "join_validation_status": "pass",
    "join_validation_failure_count": 0,
    "join_validation_summary": {},
    "diagnostics": {
      "duplicate_chronology_scene_ids": [],
      "chronology_missing_source_ref_scene_ids": []
    }
  },
  "active_route": {
    "current_stage": "Now-32",
    "current_substage": "Prompt-Readiness-Manual-Execution-Log-Contract",
    "next_entrypoint_id": "platform_neutral_prompt_readiness_manual_execution_log_contract"
  },
  "old_b7_policy": {
    "reference_only": true,
    "active_authority": false,
    "old_b7_active_source_ref_count": 0
  },
  "validator_matrix": [
    {
      "validator_id": "p8_authority",
      "purpose": "P9 consumes explicit P8 execution/advisory/retrospective paths and verifies pass gates",
      "blocks_p9_pass": true
    },
    {
      "validator_id": "adaptation_unit_traceability",
      "purpose": "P8 adaptation units parse and retain source scene ids, chronology refs, group/beat refs, source refs, and dependency ids",
      "blocks_p9_pass": true
    },
    {
      "validator_id": "screenplay_unit_traceability",
      "purpose": "Every screenplay unit maps to adaptation unit ids, retained group ids, beat ids, scene ids, chronology refs, and dependency ids",
      "blocks_p9_pass": true
    },
    {
      "validator_id": "screenplay_control_data_schema",
      "purpose": "Screenplay units are AI-executable control data with objective, render mode, source refs, continuity refs, and blocked downstream flags",
      "blocks_p9_pass": true
    },
    {
      "validator_id": "merge_drop_provenance_guard",
      "purpose": "Dropped/merged P8 scenes remain traceable through group/support/drop refs",
      "blocks_p9_pass": true
    },
    {
      "validator_id": "screenplay_scope_guard",
      "purpose": "P9 generates screenplay control artifacts only",
      "blocks_p9_pass": true
    },
    {
      "validator_id": "dependency_queue_ordering",
      "purpose": "Queue opens only the next shooting_script contract candidate after P9 advisory and retrospective",
      "blocks_p9_pass": true
    },
    {
      "validator_id": "downstream_leakage_guard",
      "purpose": "Shot context/prompt/provider/media counters remain zero",
      "blocks_p9_pass": true
    },
    {
      "validator_id": "kg_overlay_replay_guard",
      "purpose": "KG/overlay/replay counters remain zero",
      "blocks_p9_pass": true
    },
    {
      "validator_id": "old_b7_exclusion",
      "purpose": "Old B7 remains reference-only and is not active authority",
      "blocks_p9_pass": true
    },
    {
      "validator_id": "active_route_guard",
      "purpose": "execution_state.next_entrypoint remains Now-32",
      "blocks_p9_pass": true
    }
  ],
  "policy": {
    "stage": "P9_ai_executable_screenplay_fresh_execution_contract",
    "fresh_run_required": true,
    "screenplay_control_data_execution_allowed_in_p9": true,
    "deterministic_control_data_builder": true,
    "llm_dialogue_or_rewrite_enrichment_allowed_in_p9": false,
    "deepseek_v4_pro_thinking_audit_required": true,
    "advisory_only": true,
    "shooting_script_execution_allowed": false,
    "shot_context_execution_allowed": false,
    "prompt_packet_execution_allowed": false,
    "adapter_render_allowed": false,
    "provider_job_execution_allowed": false,
    "media_generation_allowed": false,
    "feedback_intake_allowed": false,
    "accepted_overlay_writeback_allowed": false,
    "operator_overlay_writeback_allowed": false,
    "canonical_kg_writeback_allowed": false,
    "raw_kg_writeback_allowed": false,
    "replay_execution_allowed": false,
    "outputs_index_mutation_allowed": false,
    "outputs_run_deletion_allowed": false,
    "outputs_run_cold_archive_allowed": false,
    "old_b7_reference_only": true,
    "execution_state_next_entrypoint_unchanged": true,
    "runtime_branching_by_entity_name_allowed": false,
    "runtime_branching_by_work_title_allowed": false,
    "runtime_branching_by_block_title_allowed": false,
    "runtime_branching_by_sample_text_allowed": false
  },
  "input_fingerprint": "fdd39587cb0e35abce13fe33512dafe66b6704fec2be3477f5463a15f69ba048"
}