OpenMontage Pre-Compose Validation Gate: 3 Critical Conditions That Block Rendering
The pre-compose validation gate is a safety checkpoint in OpenMontage that aborts video rendering immediately before composition begins when delivery promises are violated, slideshow risk scores exceed thresholds, or required renderer configuration is missing.
The pre-compose validation gate in OpenMontage prevents wasted GPU cycles by validating edit decisions against quality criteria immediately before the composition pipeline executes. Located in tools/video/video_compose.py, this mechanism inspects the resolved cut list and scene plan to ensure the upcoming render respects the user's delivery promise and maintains cinematic quality standards. If any blocking condition is detected, the gate returns a failed ToolResult that halts rendering before expensive video processing begins.
How the Pre-Compose Validation Gate Works
The validation logic resides in the _pre_compose_validation method of the VideoComposeTool class. According to the OpenMontage source code, this function performs three independent checks that can either generate warnings or trigger hard blocks. When a block condition is met, the method returns a ToolResult object with success=False and a detailed error message listing every blocking reason. If no blocks are found, the function returns None, allowing the composition to proceed.
Three Conditions That Block Rendering in OpenMontage
The pre-compose validation gate evaluates three specific quality dimensions. Each check operates independently and can prevent rendering when critical violations occur.
Delivery Promise Violations
The first check validates that the resolved cuts honor the delivery promise declared during the proposal stage. This inspection calls DeliveryPromise.validate_cuts from lib/delivery_promise.py to verify motion ratios and fallback rules.
- Block condition: The promise is violated (for example, a motion-led promise with fewer than 70% real-motion cuts)
- Implementation:
DeliveryPromise.validate_cutscompares the actual cut list against themotion_required,source_required, andtone_modeparameters locked during proposal
Slideshow Risk Score Thresholds
The second check calculates a composite risk score using score_slideshow_risk from lib/slideshow_risk.py. This function evaluates six dimensions: repetition, decorative visuals, weak motion, weak shot intent, typography over-reliance, and unsupported cinematic claims.
- Block condition: Average score ≥ 4.0 (verdict:
fail) - Warning condition: Average score ≥ 3.0 but < 4.0 (verdict:
revise) - Pass condition: Average score < 3.0
Missing Renderer Family Configuration
The third check ensures technical prerequisites are met by verifying the edit_decisions payload contains a locked renderer_family field.
- Block condition: The
renderer_familykey is absent from the edit decisions dictionary - Purpose: Prevents renders from proceeding without a specified rendering engine (such as "remotion")
Implementation Details in the Source Code
The gate is implemented in tools/video/video_compose.py at line 1415 within the _pre_compose_validation method. This function accepts three parameters: edit_decisions, resolved_cuts, and an optional scene_plan. The method aggregates violations into a blocking list and warning list, returning a structured ToolResult only when blocks exist.
Key source files supporting this gate include:
lib/delivery_promise.py: Defines theDeliveryPromiseclass andvalidate_cutsmethod used for motion ratio validationlib/slideshow_risk.py: Implements thescore_slideshow_riskfunction that computes the six-dimensional risk assessmenttools/video/video_compose.py: Hosts the main_pre_compose_validationgate logic and the render entry point
Code Examples: Triggering Pre-Compose Blocks
The following examples demonstrate how to trigger each blocking condition using the OpenMontage Python API.
Blocking on Delivery Promise Violations
This example shows a motion-led delivery promise violated by static image cuts:
from tools.video.video_compose import VideoComposeTool
from lib.delivery_promise import DeliveryPromise, PromiseType
edit_decisions = {
"metadata": {"delivery_promise": {
"promise_type": "motion_led",
"motion_required": True,
"source_required": False,
"tone_mode": "cinematic",
"quality_floor": "presentable",
}},
"renderer_family": "remotion",
}
# Resolved cuts contain only still images, resulting in 0% motion ratio
resolved_cuts = [
{"type": "text_card", "source": "slide1.png"},
{"type": "stat_card", "source": "slide2.png"}
]
tool = VideoComposeTool()
result = tool._pre_compose_validation(edit_decisions, resolved_cuts)
print(result.success) # → False
print(result.error) # → includes "Delivery promise violation…"
Blocking on High Slideshow Risk
This example generates a high slideshow risk score through repetitive text cards:
# Scene plan with repetitive content triggers high risk scores
scenes = [
{"type": "text_card", "description": "Intro", "shot_language": {"shot_size": "full"}},
{"type": "text_card", "description": "Intro", "shot_language": {"shot_size": "full"}},
{"type": "text_card", "description": "Intro", "shot_language": {"shot_size": "full"}},
]
edit_decisions = {"renderer_family": "remotion", "render_runtime": "remotion"}
tool = VideoComposeTool()
# High repetition drives average risk score to ≥ 4.0
result = tool._pre_compose_validation(edit_decisions, [], scene_plan=scenes)
print(result.success) # → False
print(result.error) # → contains "Slideshow risk score … (verdict: fail)"
Blocking on Missing Renderer Family
This example demonstrates the gate blocking when the renderer configuration is omitted:
edit_decisions = {
"metadata": {"delivery_promise": {"promise_type": "standard"}}
# renderer_family is intentionally omitted
}
resolved_cuts = [{"type": "video", "source": "clip.mp4"}]
tool = VideoComposeTool()
result = tool._pre_compose_validation(edit_decisions, resolved_cuts)
print(result.success) # → False
print(result.error) # → "… No renderer_family in edit_decisions …"
Summary
The pre-compose validation gate in OpenMontage serves as a critical quality safeguard that executes immediately before video composition begins. Key takeaways include:
- Three blocking conditions: Delivery promise violations, slideshow risk scores ≥ 4.0, and missing
renderer_familyfields will each abort the render - Source locations: The gate logic lives in
tools/video/video_compose.py, supported bylib/delivery_promise.pyandlib/slideshow_risk.py - Return behavior: The gate returns a failed
ToolResultwith detailed error messages when blocking, orNonewhen validation passes - Warning vs. Block: Slideshow risk between 3.0 and 4.0 generates warnings without stopping the render, while scores ≥ 4.0 trigger hard blocks
Frequently Asked Questions
What happens when the pre-compose validation gate detects a violation?
When the gate detects a violation, the _pre_compose_validation method returns a ToolResult object with success=False and a comprehensive error message listing all blocking reasons and accumulated warnings. This result aborts the rendering process before any GPU resources are allocated for video composition.
How is the slideshow risk score calculated in OpenMontage?
The slideshow risk score is calculated by score_slideshow_risk in lib/slideshow_risk.py, which averages six quality dimensions: repetition, decorative visuals, weak motion, weak shot intent, typography over-reliance, and unsupported cinematic claims. An average score below 3.0 passes, 3.0–4.0 warns, and 4.0 or above triggers a blocking failure.
Can the pre-compose validation gate be bypassed or disabled?
According to the source code in tools/video/video_compose.py, there is no configuration option to disable the pre-compose validation gate. The gate is designed as a mandatory safety mechanism to prevent GPU waste on renders that violate delivery promises or quality standards.
What is the difference between a warning and a block in the validation gate?
A block prevents rendering from starting and returns a failed ToolResult, occurring when delivery promises are violated, slideshow risk averages 4.0 or higher, or the renderer_family is missing. A warning only logs quality concerns without stopping the render, specifically when slideshow risk scores fall between 3.0 and 4.0.
Have a question about this repo?
These articles cover the highlights, but your codebase questions are specific. Give your agent direct access to the source. Share this with your agent to get started:
curl -s "https://instagit.com/install.md" Maintain an open-source project? Get it listed too →