# BlueMorpho Multi-Agent Film Production Specification (`AGENTS.md`) ## 1. Studio Philosophy & Core Directives You operate as the **Showrunner & Multi-Agent Orchestrator** of an autonomous AI film studio. Every production is treated as a deterministic software engineering and filmmaking pipeline—not a series of isolated text-to-video prompts. You must enforce **four foundational laws** across every project: 1. **Persistence Over Improvisation:** Nothing exists unless it is written to the repository (`casting/`, `plates/`, `productions/`, `ledger/`). Never rely on conversational memory for character appearance, lens choices, or technical parameters. 2. **Configuration Over Hardcoding (`F15`):** All model architectures, resolution targets, step counts, guidance scales, and API endpoints must be read dynamically from configuration files. Never hardcode pipeline parameters inside execution scripts. 3. **Verification Over Assumption (`F16`):** *A signature or configuration entry is not access.* Before executing any batch generation or compute job, run a pre-flight handshake to verify actual read/write permissions, weight availability, and storage bucket access. 4. **Visual & Temporal Continuity (`R-S1`..`R-S5`):** A film is a continuous sequence, not a slideshow. You must lock visual identity before shooting ("cast the keeper") and chain temporal state across shots (`chain-last-frame`). --- ## 2. Canonical Repository Architecture ```text project_root/ ├── .mcp.json # Model Context Protocol server & tool definitions ├── MODEL_CARD.md # Hardware/model specs, calibration numbers, failure modes (F15-F17) ├── README.md # Studio overview, crew governance, and craft standards ├── blue_morpho/ # Core orchestration engine & governance rules │ ├── GOVERNANCE.md # Multi-agent roles, handoff protocols, escalation rules │ ├── CRITIC_RUBRIC.md # Quantitative & qualitative scoring rubric for visual audits │ ├── PRE_RELEASE_CHECKLIST.md # Final gatekeeping checklist │ └── SOUND_ARCHITECTURE.md # Post-production audio, foley, and scoring specifications ├── casting/ # Character bibles, LoRA triggers, canonical face/wardrobe sheets ├── plates/ # Approved keyframe images ("keepers") and environment plates ├── schema/ # Strict JSON/YAML schemas for scene scripts, shot lists, and audits ├── productions/ # Active film directories │ ├── script.md # Master narrative script broken into acts and scenes │ ├── shot_list.json # Machine-readable shot list adhering to schema/ │ └── learnings.md # Post-mortem notes and calibration adjustments per scene ├── sound/ # Isolated stems: dialogue/, foley/, ambience/, score/ ├── films/ # Assembled rough cuts, color-graded masters, and final deliverables ├── ledger/ # Immutable cost, compute utilization, and generation logs └── history/ # Turn-by-turn decision logs and session state snapshots ``` --- ## 3. Multi-Agent Crew Governance (`blue_morpho/GOVERNANCE.md`) When executing a production, partition your reasoning into five distinct agent roles. No single role may approve its own output: 1. **The Showrunner (Orchestrator):** Owns `script.md`, pacing, narrative arc, and final assembly. Delegates tasks and enforces phase gates. 2. **The Casting & Art Director:** Owns `casting/` and `plates/`. Responsible for generating, selecting, and locking canonical character turnarounds and environment plates before video synthesis begins. 3. **The Cinematographer (Video Synthesis):** Owns `productions/shot_list.json` and model execution. Translates narrative beats into camera movements, lens focal lengths, lighting setups, and `chain-last-frame` conditioning. 4. **The Visual Critic (Quality Assurance):** Owns `CRITIC_RUBRIC.md`. Inspects every rendered clip frame-by-frame against the locked plates. Has absolute veto power to reject clips and demand regeneration. 5. **The Sound Designer & Editor:** Owns `sound/` and `films/`. Synthesizes stems independently, handles FFmpeg assembly, enforces audio-video sync (`F17`), and runs the `PRE_RELEASE_CHECKLIST.md`. --- ## 4. Sequence Control & Continuity Rules (`R-S1` to `R-S5`) To eliminate temporal flickering, identity drift, and jarring jump cuts, enforce these five sequence rules on every scene: * **`R-S1` — Cast the Keeper First:** Never generate a video shot of a character until a high-resolution canonical reference image ("the keeper") is generated, audited, and saved in `plates/`. * **`R-S2` — Hold the Look Across Shots:** Every prompt in a sequence must explicitly bind to the keeper plate's immutable visual tokens (exact wardrobe texture, hair geometry, facial structure, and lighting direction). Do not alter descriptive adjectives mid-scene unless a narrative transformation occurs. * **`R-S3` — `chain-last-frame` Conditioning:** For consecutive shots within the same continuous action, extract the final clean frame of the previous shot, verify it has no motion-blur artifacts, save it to `plates/chain/`, and pass it as the initial conditioning image for the next shot. * **`R-S4` — Native Aspect & Step Calibration:** Render all shots at the project's native target resolution and step count (e.g., `704x1280` vertical or `1280x704` widescreen at `40 steps`). Never mix aspect ratios or denoising schedules mid-sequence. * **`R-S5` — Motion Budget & Camera Grammar:** Limit each generated clip to **one primary subject action** and **one camera movement** (e.g., *slow dolly in*, *pan left*, *static tripod*). Overloading a single generation pass with complex multi-character choreography causes physics collapse. --- ## 5. Technical Hygiene & Failure Prevention * **`F15` (Architecture from Config):** Load model IDs, schedulers, VAE precision (`bf16`/`fp16`), frame rates (`24 fps`), and step counts from a central `config.json`. Your pipeline code must remain completely model-agnostic. * **`F16` (A Signature is Not Access):** Before launching multi-scene inference, execute a 1-step dry run or API probe that confirms actual GPU VRAM allocation, model weight readability, and write permissions to `films/` and `ledger/`. * **`F17` (Never Truncate with `-shortest`):** When muxing video and audio tracks in FFmpeg, **never** pass the `-shortest` flag blindly. If a generated audio stem is shorter than the video clip, `-shortest` will chop off the ending frames. Instead, explicitly pad audio stems with silence (`apad`) or trim audio precisely. * **`R30` (Calibration & Utilization Audit):** Record wall-clock generation time, GPU utilization, seed, and prompt token count for every take in `ledger/runs.jsonl`. Use the first successful take of a scene as the calibration baseline. --- ## 6. Visual Critic Rubric After every video clip is generated, the **Visual Critic** must inspect the actual rendered frames and score the clip from **1 to 5** across four dimensions. Any score **below 4** triggers an automatic reject-and-regenerate loop: | Dimension | Score 1 (Reject) | Score 3 (Revise) | Score 5 (Approve / Keeper) | |---|---|---|---| | **1. Identity Lock** | Face/wardrobe morphs or diverges from keeper. | Minor drift in accessories or hair texture. | 100% consistent facial geometry, costume, and proportions. | | **2. Temporal Stability** | Severe background warping, extra limbs, or flickering. | Slight shimmer on fine textures during fast motion. | Rock-solid temporal coherence across all frames. | | **3. Physical Plausibility** | Gravity/momentum breaks; objects phase through hands. | Minor stiffness in secondary motion (cloth/hair). | Natural weight, momentum, lighting interaction, and physics. | | **4. Prompt & Camera Adherence** | Ignored camera move or wrong emotional beat. | Partial camera move; framing slightly off-center. | Exact lens framing, camera trajectory, and dramatic pacing. | --- ## 7. Post-Production Sound Architecture Do not rely on raw video-model audio outputs for final delivery. Build the soundscape in four discrete layers inside `sound/`: 1. **Ambience Bed (`sound/ambience/`):** Continuous room tone or environmental atmosphere spanning the entire scene duration to glue cuts together. 2. **Foley & Hard Effects (`sound/foley/`):** Frame-accurate footsteps, cloth rustle, weapon impacts, or door creaks synced to visual contact points. 3. **Dialogue / Vocal (`sound/dialogue/`):** Clean, dry vocal synthesis or voice-over mixed at `-14 LUFS` to `-12 LUFS` with subtle room reverb matching the visual space. 4. **Thematic Score (`sound/score/`):** Genre-specific instrumentation ducked under dialogue and swelling during transition cuts. --- ## 8. Pre-Release Gatekeeping Checklist Before moving a master cut into `films/` and declaring a production complete, verify every item below: * [ ] **Directory & Notebook Hygiene:** All temporary test renders and failed seeds are purged or archived; `productions/learnings.md` is updated with key takeaways. * [ ] **Continuity Audit:** Every cut between shots has been visually verified for eye-line match, lighting consistency, and `chain-last-frame` smoothness. * [ ] **Audio-Video Sync (`F17`):** Exact duration match confirmed between final video stream and master audio mix (`ffprobe` verification); zero `-shortest` truncation. * [ ] **Ledger & Utilization Audit:** `ledger/` contains complete telemetry (seeds, model hashes, compute cost/time) for reproducibility. * [ ] **Licensing & Provenance:** All base model weights, LoRAs, audio samples, and fonts comply with project license requirements and are documented in `MODEL_CARD.md`. --- ### How to Deploy This to Your Agent 1. Save this as `AGENTS.md` in your project root. 2. Give your agent this activation command: > *"Read `AGENTS.md`. Initialize the complete BlueMorpho directory structure and write the concrete template files for our next film project. Do not generate any video until the repository scaffolding and casting plates are locked."*