@@ -107,27 +107,20 @@ def _scope_camera_spec(row: dict[str, Any], *, index: int) -> Natural25CameraSpe
107107 )
108108
109109
110- def _release_camera_scope (payload : dict [str , Any ], * , path : Path ) -> Natural25CameraScope :
111- """Adapt a versioned paper scope to the per-model generation runner ."""
110+ def _versioned_camera_scope (payload : dict [str , Any ], * , path : Path ) -> Natural25CameraScope :
111+ """Adapt an immutable release scope without depending on a release id ."""
112112 scope_id = str (payload .get ("scope_id" ) or "" )
113- if scope_id == "paper_main_20260608.api_prompt_camera" :
113+ if payload . get ( "control_semantics" ) :
114114 raise ValueError (
115- f"{ path } : the frozen API prompt-camera scope is inspect-only; it records prompt intent "
115+ f"{ path } : this prompt-camera scope is inspect-only; it records prompt intent "
116116 "without requested degrees or target C2W and must not be passed to --camera-scope"
117117 )
118118
119- if scope_id == "paper_main_20260608.local_dual_angle" :
120- expected_keys = {
121- "cells" ,
122- "expected_rows" ,
123- "models" ,
124- "prompt_catalog_id" ,
125- "rows_per_cell_per_model" ,
126- "schema_version" ,
127- "scope_id" ,
128- }
129- if set (payload ) != expected_keys :
130- raise ValueError (f"{ path } : local dual-angle release scope keys do not match the schema" )
119+ models = tuple (str (model ) for model in payload .get ("models" , ()))
120+ if not scope_id or not models :
121+ raise ValueError (f"{ path } : versioned camera scope requires scope_id and models" )
122+
123+ if "cells" in payload and "rows_per_cell_per_model" in payload :
131124 cameras = tuple (
132125 _scope_camera_spec (
133126 {
@@ -143,7 +136,6 @@ def _release_camera_scope(payload: dict[str, Any], *, path: Path) -> Natural25Ca
143136 )
144137 rows_per_cell = int (payload ["rows_per_cell_per_model" ])
145138 expected_task_count = rows_per_cell * len (cameras )
146- models = tuple (str (model ) for model in payload ["models" ])
147139 if int (payload ["expected_rows" ]) != expected_task_count * len (models ):
148140 raise ValueError (f"{ path } : aggregate rows do not match models x cells x rows-per-cell" )
149141 return Natural25CameraScope (
@@ -154,19 +146,7 @@ def _release_camera_scope(payload: dict[str, Any], *, path: Path) -> Natural25Ca
154146 applicable_models = models ,
155147 )
156148
157- if scope_id == "paper_main_20260608.local_static" :
158- expected_keys = {
159- "camera_type" ,
160- "excluded_models" ,
161- "expected_rows" ,
162- "models" ,
163- "prompt_catalog_id" ,
164- "rows_per_model" ,
165- "schema_version" ,
166- "scope_id" ,
167- }
168- if set (payload ) != expected_keys :
169- raise ValueError (f"{ path } : local static release scope keys do not match the schema" )
149+ if "camera_type" in payload and "rows_per_model" in payload :
170150 camera_type = str (payload ["camera_type" ])
171151 camera = _scope_camera_spec (
172152 {
@@ -178,7 +158,6 @@ def _release_camera_scope(payload: dict[str, Any], *, path: Path) -> Natural25Ca
178158 },
179159 index = 0 ,
180160 )
181- models = tuple (str (model ) for model in payload ["models" ])
182161 expected_task_count = int (payload ["rows_per_model" ])
183162 if int (payload ["expected_rows" ]) != expected_task_count * len (models ):
184163 raise ValueError (f"{ path } : aggregate rows do not match models x rows-per-model" )
@@ -190,14 +169,14 @@ def _release_camera_scope(payload: dict[str, Any], *, path: Path) -> Natural25Ca
190169 applicable_models = models ,
191170 )
192171
193- raise ValueError (f"{ path } : unknown versioned paper camera scope { scope_id !r} " )
172+ raise ValueError (f"{ path } : unsupported versioned camera scope shape for { scope_id !r} " )
194173
195174
196175def load_natural25_camera_scope (path : str | Path ) -> Natural25CameraScope :
197176 resolved = Path (path )
198177 payload = json .loads (resolved .read_text (encoding = "utf-8" ))
199178 if payload .get ("schema_version" ) == "wrbench.camera_scope.v1" :
200- return _release_camera_scope (payload , path = resolved )
179+ return _versioned_camera_scope (payload , path = resolved )
201180 expected_keys = {"schema_version" , "scope_id" , "variant_filter" , "expected_task_count" , "cameras" }
202181 keys = set (payload )
203182 if keys != expected_keys :
0 commit comments