Skip to content

World's first open-source, agentic video production system. 12 production pipelines, 100+ tools, 700+ agent skill and production-knowledge files. Turn your AI coding assistant into a full video production studio.

fix(pipelines): make the screen-demo manifest load

[email protected]3bad3bea17ff
diff --git a/schemas/pipelines/pipeline_manifest.schema.json b/schemas/pipelines/pipeline_manifest.schema.json
index a7737e43..24eda4ce 100644
--- a/schemas/pipelines/pipeline_manifest.schema.json
+++ b/schemas/pipelines/pipeline_manifest.schema.json
@@ -38,6 +38,41 @@
"type": "array",
"items": { "type": "string" }
},
+ "production_modes": {
+ "type": "array",
+ "description": "Mutually exclusive ways this pipeline can be produced. The agent picks one at the idea stage and records it in the brief; the stage director skill reads it to constrain later choices (see skills/pipelines/screen-demo/idea-director.md).",
+ "items": {
+ "type": "object",
+ "required": ["name"],
+ "properties": {
+ "name": { "type": "string" },
+ "description": { "type": "string" },
+ "required_tools": {
+ "type": "array",
+ "items": { "type": "string" },
+ "description": "Tools that must be available for this mode to be viable"
+ },
+ "optional_tools": {
+ "type": "array",
+ "items": { "type": "string" }
+ },
+ "scene_type": {
+ "type": "string",
+ "description": "Remotion cut.type this mode composes, when it synthesizes rather than captures"
+ },
+ "agent_skills": {
+ "type": "array",
+ "items": { "type": "string" },
+ "description": "Layer 3 skills to read before producing in this mode"
+ },
+ "best_for": {
+ "type": "array",
+ "items": { "type": "string" }
+ }
+ },
+ "additionalProperties": false
+ }
+ },
"stages": {
"type": "array",
"items": {
diff --git a/tests/contracts/test_pipeline_catalog.py b/tests/contracts/test_pipeline_catalog.py
new file mode 100644
index 00000000..ed277544
--- /dev/null
+++ b/tests/contracts/test_pipeline_catalog.py
@@ -0,0 +1,75 @@
+"""Every shipped pipeline manifest must actually load.
+
+`lib.checkpoint` degrades gracefully when a manifest cannot be parsed:
+`get_pipeline_stages()` falls back to the canonical STAGES list and
+`_stage_requires_approval()` returns None so the caller's own flag wins. That
+is the right behaviour for a corrupt user manifest, but it means a manifest
+shipped *in this repo* that fails its schema is silently ignored rather than
+loudly rejected — the pipeline then runs against the wrong stage order and
+without its declared approval gates.
+
+Existing manifest coverage names individual pipelines (talking-head,
+framework-smoke, animated-explainer, documentary-montage), so a manifest that
+no test happens to name is never loaded. These tests iterate the directory.
+"""
+
+from pathlib import Path
+
+import pytest
+import yaml
+
+from lib.checkpoint import _stage_requires_approval, get_pipeline_stages
+from lib.pipeline_loader import load_pipeline
+
+REPO_ROOT = Path(__file__).resolve().parents[2]
+PIPELINE_DEFS = REPO_ROOT / "pipeline_defs"
+
+PIPELINE_NAMES = sorted(p.stem for p in PIPELINE_DEFS.glob("*.yaml"))
+
+
+def _declared_stages(name: str) -> list[str]:
+ raw = yaml.safe_load((PIPELINE_DEFS / f"{name}.yaml").read_text(encoding="utf-8"))
+ return [stage["name"] for stage in raw["stages"]]
+
+
+def test_catalog_is_not_empty() -> None:
+ assert PIPELINE_NAMES, "no pipeline manifests found"
+
+
[email protected]("name", PIPELINE_NAMES)
+def test_shipped_manifest_validates(name: str) -> None:
+ """Regression: screen-demo.yaml carried a `production_modes` block the
+ manifest schema did not allow, so the whole manifest failed to load."""
+ manifest = load_pipeline(name)
+ assert manifest["stages"]
+
+
[email protected]("name", PIPELINE_NAMES)
+def test_effective_stage_order_is_the_declared_one(name: str) -> None:
+ """A manifest that silently falls back gets the canonical stage list.
+
+ For screen-demo that inserted `research` and `proposal` ahead of its real
+ first stage, so the prerequisite check rejected the opening checkpoint of
+ every run with PREREQUISITE VIOLATION.
+ """
+ assert get_pipeline_stages(name) == _declared_stages(name)
+
+
[email protected]("name", PIPELINE_NAMES)
+def test_declared_approval_gates_are_enforceable(name: str) -> None:
+ """AGENT_GUIDE.md: the manifest's human_approval_default is binding.
+
+ `_stage_requires_approval` returning None means the caller's own flag wins,
+ which is exactly the fail-open the gate is supposed to prevent.
+ """
+ raw = yaml.safe_load((PIPELINE_DEFS / f"{name}.yaml").read_text(encoding="utf-8"))
+
+ for stage in raw["stages"]:
+ if "human_approval_default" not in stage:
+ continue
+ resolved = _stage_requires_approval(name, stage["name"])
+ assert resolved == stage["human_approval_default"], (
+ f"{name}.{stage['name']}: manifest declares "
+ f"{stage['human_approval_default']} but the checkpoint writer "
+ f"resolves {resolved}"
+ )