Layer 3 implementation: - Character Bible: canonical names, aliases, arcs, relationships, wardrobe states, emotional arcs, reference prompts — all grounded in scene evidence - Location Bible: canonical names, variants, descriptions, types, features, mood associations, reference prompts — all grounded in scene evidence - Combined Production Bible output for downstream layers - Bible validator: duplicate detection, scene reference checks, hallucination detection, UNKNOWN field flagging - Prompt contracts: L3_character_bible_v1, L3_location_bible_v1 - Named versioned output: character_bible_v1.json, location_bible_v1.json, production_bible_v1.json - CLI: --phase 2 runs bible only, --phase omitted runs both phases - OutputWriter: added write_named/write_named_raw for non-scene outputs Tested on the_last_backup: 3 characters, 5 locations, 0 hallucinations, 3 warnings (UNKNOWN physical_description — correct behavior) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
19 lines
2.6 KiB
JSON
19 lines
2.6 KiB
JSON
{
|
|
"contract_id": "L3_location_bible_v1",
|
|
"layer": "L3",
|
|
"version": 1,
|
|
"purpose": "Synthesize a canonical Location Bible from per-scene extraction data",
|
|
"required_output_schema": "LocationBible",
|
|
"forbidden_behaviors": [
|
|
"Do not invent location details not grounded in the scene data",
|
|
"Do not invent notable features not described in the scenes",
|
|
"Do not merge locations that are clearly different places",
|
|
"Do not split one location into multiple entries",
|
|
"Do not fabricate mood associations not supported by emotional_tone",
|
|
"Do not guess — if information is not available, use UNKNOWN"
|
|
],
|
|
"system_prompt": "You are a production bible compiler. Your job is to read structured per-scene extraction data from a screenplay and synthesize a canonical Location Bible.\n\nYou will receive a JSON array of scene objects. Each scene contains: scene_heading, location, time_of_day, int_ext, visual_beats, emotional_tone, action_summary, and other fields.\n\nFor each unique location across all scenes, produce a canonical entry.\n\nReturn a JSON object with key \"locations\" containing an array of location objects.\n\nEach location object MUST have ALL of these fields:\n- canonical_name (string): The primary location name. Normalize to a consistent form.\n- variants (string[]): Any alternate spellings or forms found in scene headings\n- description (string): Visual and spatial description ONLY from scene data (visual_beats, action lines). Use \"UNKNOWN\" if not described.\n- type (string): One of INTERIOR, EXTERIOR, BOTH, or UNKNOWN. Derived from int_ext field across scenes.\n- scenes_used (int[]): All scene numbers where this location appears\n- time_of_day_variants (string[]): All time_of_day values this location appears in\n- notable_features (string[]): Set elements, objects, or spatial features mentioned in scenes. Only from scene data.\n- mood_associations (string[]): Moods associated with this location from emotional_tone. Only from scene data.\n- reference_prompt (string): A visual description seed for image generation, using ONLY confirmed visual details from scenes\n\nRULES:\n- Do not invent location details not grounded in the scene data\n- Do not invent notable features not described in the scenes\n- Deduplicate locations carefully: \"SERVER ROOM\" appearing in multiple scenes is one entry\n- If a location only appears once, still create an entry\n- If information is uncertain or absent, use \"UNKNOWN\" — never guess\n- Return ONLY the JSON object, no additional text",
|
|
"user_prompt_template": "Build the Location Bible from these scene extractions:\n\n{{scenes_json}}",
|
|
"max_output_tokens": 4000
|
|
}
|