4. The Production Pipeline: A Phase-by-Phase Breakdown
Phase 1: Narrative Development
Goal: To transform a simple idea into a complete, well-structured, and consistent set of narrative documents.
Node: AI Story Writer
Purpose (The "Why"): To be the initial creative spark. It takes a high-level concept and generates a complete prose story.
Behavior (The "How"): The user provides a story idea and selects creative parameters (genre, tone, character types, etc.). The node uses these as "known facts" to guide an LLM in writing a full narrative.
Key Inputs: A story idea (string), creative parameters (selections from menus).
Key Outputs: A complete prose story (string).
Data Example (Output):
The red dust swirled around Lily Patel’s boots as she sprinted across the Martian surface...
Nodes: AI ScriptCrafter P1, P2, P3 (Bible)
Purpose (The "Why"): To function as an automated "Writer's Room," adapting the prose story into a professional, machine-readable screenplay.
Behavior (The "How"): This is a 3-step sub-pipeline:
P1 (Bible): Reads the story and creates the canonical Character Bible (who the characters are) and World Bible (the rules of the story's universe). It uses a powerful "Analyze & Refine" Python process to ensure data accuracy.
P2 (Beat Sheet): Reads the story and bibles to create a structural blueprint (a "Save the Cat!" beat sheet).
P3 (Screenplay): Uses a sophisticated 3-stage AI pipeline ("Architect," "Cinematographer," "Script Doctor") to write a creatively rich screenplay, then uses a deterministic Python "Master Post-Processor" to guarantee perfect, industry-standard formatting.
Key Inputs: The prose story, bibles, and beat sheet.
Key Outputs: A perfectly formatted screenplay text.
Data Example (Output):
1. EXT. MARTIAN SURFACE - DAY
Red dust whips across the ochre landscape... LILY PATEL (30s, determined, athletic) boots kick up plumes of crimson as she sprints desperately towards Sector Gamma-7.
RICHARD WOOD (O.S.)
You’re late.
Architectural Note: The success of this sub-pipeline comes from its hybrid approach. AI is used for the creative adaptation, but deterministic Python is used for the critical tasks of bible data consolidation (P1) and final screenplay formatting (P3), preventing AI errors from corrupting the final output.
Phase 2: Pre-Production & Data Consolidation
Goal: To translate the creative screenplay into a single, canonical, spreadsheet-like data file that will govern the entire visual production.
Node: AI Cinematographer (Pro)
Purpose (The "Why"): To act as the Director of Photography, breaking down the screenplay into a detailed, shot-by-shot list.
Behavior (The "How"): Reads the screenplay scene-by-scene and uses an AI to generate a list of every shot required to tell the story, detailing the camera work, action, characters, and assets in each shot. The output is creative but may be "dirty."
Key Inputs: The final screenplay.
Key Outputs: A raw shot_breakdown_report.
Node: AI QC Supervisor
Purpose (The "Why"): To be the data sanitization filter.
Behavior (The "How"): Reads the raw shot breakdown and uses a specialized AI and Python logic to find and remove "junk" data (e.g., a character's face listed as a prop, an emotion listed as a costume).
Key Inputs: The raw shot_breakdown_report.
Key Outputs: A clean_shot_breakdown_report.
Architectural Note: This node represents acknowledged architectural debt. It exists to patch the output of the `Cinematographer`. The long-term goal is to harden the `Cinematographer`'s prompt to the point where this QC step is no longer necessary, adhering to the "Fix Data at the Source" principle.
Node: Pro Shot List Parser
Purpose (The "Why"): To be the definitive "gatekeeper" of clean production data.
Behavior (The "How"): Ingests the clean shot breakdown, performs a final, robust data normalization (including correcting character name variations), and produces the final, canonical production CSV file.
Key Inputs: The clean_shot_breakdown_report.
Key Outputs: The full_report_csv.
Data Example (Output):
"SCENE","LOCATION","SHOT","CHARACTERS","PROPS (Lily Patel)"...
"1","EXT. MARTIAN SURFACE - DAY","1A","Lily Patel","Boots, Utility belt"...
Phase 3: Visual Development (Lookdev)
Goal: To establish the final, approved "art direction" for every character and set in the production.
Node: Asset Selector
Purpose (The "Why"): To act as the Production Manager, providing a high-level overview of all required assets.
Behavior (The "How"): Reads the production CSV and generates master lists of all characters and sets. It allows the user to select a specific asset to work on for look development.
Key Inputs: The full_report_csv.
Key Outputs: The selected_character_name or set_hierarchy_json for the chosen asset.
Nodes: AI Character Lookdev & AI Set Lookdev
Purpose (The "Why"): To function as the Art Department, creating the definitive visual "blueprint" for each asset.
Behavior (The "How"): These nodes take the selected asset name and use a sophisticated multi-stage AI pipeline to generate a rich, detailed, story-specific prompt that describes the asset's final appearance. A final "Python Enforcer" stage guarantees factual details (like age) are correct. For sets, it generates a master "blueprint" and then unique "snapshots" for different times of day.
Key Inputs: Selected asset name, bibles, CSV.
Key Outputs: A final, detailed lookdev prompt (string).
Data Example (Character Lookdev Output):
full body portrait of a young woman standing in a neutral A-pose...
(early 20s), athletic build, 5’7”, oval face, high cheekbones...
deep slate grey Terraforming Academy jumpsuit, durable, breathable synthetic fabric...
Phase 4: Shot Production (Final Prompting)
Goal: To take the established art direction from Phase 3 and combine it with the specific action of a single shot to create the final, ready-to-render image prompt.
Node: Shot Selector
Purpose (The "Why"): To isolate a single shot from the production for detailed work.
Behavior (The "How"): Reads the production CSV and, based on a user-selected shot_index, outputs all data for that specific shot, including a structured JSON object.
Key Inputs: The full_report_csv, a shot_index.
Key Outputs: SEL_shot_data_JSON and other shot-specific data.
Node: Shot Asset Loader
Purpose (The "Why"): To be the "on-set assistant," fetching all the required visual assets for a specific shot.
Behavior (The "How"): Takes the shot_index and finds and loads the final, approved lookdev .png images and .txt prompts for the specific characters and set variation required for that shot.
Key Inputs: shot_index, project path, CSV.
Key Outputs: The lookdev images and prompts for the selected shot.
Nodes: AI Scene Choreographer, Dossier Assembler, Prompt Weaver (The Legacy Chain)
Purpose (The "Why"): To function as the "on-set director," combining the "what happens" (from the CSV) with the "what it looks like" (from the lookdev prompts) into a single, final render prompt.
Behavior (The "How"): This is a chain of nodes that first uses an AI to generate bible-aware prose for a whole scene (Choreographer), then uses a utility node to assemble the data for one shot (Dossier Assembler), and finally uses another AI to perform a final creative polish (Prompt Weaver).
Key Inputs: Data from the Shot Selector and Shot Asset Loader.
Key Outputs: The final, ready-to-render prompt for a single shot.
Architectural Note: This fragmented, multi-node implementation is a known architectural weakness. The long-term plan is to consolidate the logic of these three nodes into a single, powerful, multi-stage "AI Shot Prompter" node to improve efficiency and reduce workflow complexity.