|
|
@@ -339,7 +339,7 @@ class ProductionSegmentOutputContractTest(unittest.TestCase):
|
|
|
[],
|
|
|
)
|
|
|
|
|
|
- def test_artifact_graph_rejects_unreachable_planned_input(self) -> None:
|
|
|
+ def test_artifact_graph_allows_unassigned_package_input(self) -> None:
|
|
|
extra_input = ProductionInput(
|
|
|
input_id="ProductionInput-" + "f" * 64,
|
|
|
source_path="$.制作表.形式结果[0]",
|
|
|
@@ -357,6 +357,89 @@ class ProductionSegmentOutputContractTest(unittest.TestCase):
|
|
|
]
|
|
|
}
|
|
|
)
|
|
|
+ self.assertEqual(
|
|
|
+ evaluate_segment_artifact_graph(
|
|
|
+ package,
|
|
|
+ self.delivery.artifact_graph,
|
|
|
+ ),
|
|
|
+ [],
|
|
|
+ )
|
|
|
+
|
|
|
+ def test_artifact_graph_allows_extra_reachable_package_input(
|
|
|
+ self,
|
|
|
+ ) -> None:
|
|
|
+ extra_input = ProductionInput(
|
|
|
+ input_id="ProductionInput-" + "f" * 64,
|
|
|
+ source_path="$.制作表.关系结果[0]",
|
|
|
+ content_sha256="e" * 64,
|
|
|
+ value={"关系": "合法但未分配给当前镜头的全局输入"},
|
|
|
+ applies_to_source_segment_ids=[
|
|
|
+ self.package.source_segment_id
|
|
|
+ ],
|
|
|
+ )
|
|
|
+ package = self.package.model_copy(
|
|
|
+ update={
|
|
|
+ "production_inputs": [
|
|
|
+ *self.package.production_inputs,
|
|
|
+ extra_input,
|
|
|
+ ]
|
|
|
+ }
|
|
|
+ )
|
|
|
+ primary_id = self.delivery.artifact_graph.primary_artifact_id
|
|
|
+ graph = self.delivery.artifact_graph.model_copy(
|
|
|
+ update={
|
|
|
+ "lineages": [
|
|
|
+ (
|
|
|
+ lineage.model_copy(
|
|
|
+ update={
|
|
|
+ "production_input_ids": [
|
|
|
+ *lineage.production_input_ids,
|
|
|
+ extra_input.input_id,
|
|
|
+ ]
|
|
|
+ }
|
|
|
+ )
|
|
|
+ if lineage.artifact_id == primary_id
|
|
|
+ else lineage
|
|
|
+ )
|
|
|
+ for lineage in self.delivery.artifact_graph.lineages
|
|
|
+ ]
|
|
|
+ }
|
|
|
+ )
|
|
|
+
|
|
|
+ self.assertEqual(
|
|
|
+ evaluate_segment_artifact_graph(package, graph),
|
|
|
+ [],
|
|
|
+ )
|
|
|
+
|
|
|
+ def test_artifact_graph_rejects_unreachable_shot_input(self) -> None:
|
|
|
+ extra_input = ProductionInput(
|
|
|
+ input_id="ProductionInput-" + "f" * 64,
|
|
|
+ source_path="$.制作表.形式结果[0]",
|
|
|
+ content_sha256="e" * 64,
|
|
|
+ value={"形式": "当前镜头明确承诺的输入"},
|
|
|
+ applies_to_source_segment_ids=[
|
|
|
+ self.package.source_segment_id
|
|
|
+ ],
|
|
|
+ )
|
|
|
+ package = self.package.model_copy(
|
|
|
+ update={
|
|
|
+ "production_inputs": [
|
|
|
+ *self.package.production_inputs,
|
|
|
+ extra_input,
|
|
|
+ ],
|
|
|
+ "shots": [
|
|
|
+ self.package.shots[0].model_copy(
|
|
|
+ update={
|
|
|
+ "production_input_ids": [
|
|
|
+ *self.package.shots[0].production_input_ids,
|
|
|
+ extra_input.input_id,
|
|
|
+ ]
|
|
|
+ }
|
|
|
+ )
|
|
|
+ ],
|
|
|
+ }
|
|
|
+ )
|
|
|
+
|
|
|
self.assertIn(
|
|
|
"lineage_input_coverage_mismatch",
|
|
|
_issue_codes(
|