@@ -159,6 +159,8 @@ class _InstalledDeclaration:
159159
160160
161161def _provider_runtime_key (declaration : ExactReplayCheckerDeclaration ) -> str :
162+ if declaration .provider_runtime is not None :
163+ return f"declaration:{ declaration .capability_id } "
162164 if declaration .entrypoint_module == "jacobian_checkers.linear" :
163165 return {
164166 "check_rational_solution" : "linear-solution" ,
@@ -233,17 +235,30 @@ def install_exact_domain_checkers(
233235 features = ("standard-library-rational-replay" , "clean-process-checker" ),
234236 ),
235237 }
238+ available_declarations = _available_declaration_bundles (bundles )
236239 provider_runtimes = {
237240 runtime_key : factory () for runtime_key , factory in runtime_factories .items ()
238241 }
242+ for _installed , declaration in available_declarations :
243+ if declaration .provider_runtime is None :
244+ continue
245+ runtime_key = _provider_runtime_key (declaration )
246+ previous = provider_runtimes .setdefault (
247+ runtime_key ,
248+ declaration .provider_runtime ,
249+ )
250+ if previous != declaration .provider_runtime :
251+ raise ValueError (
252+ "exact replay declarations disagree on their owned provider runtime"
253+ )
239254 checker_ids : dict [str , str | None ] = {}
240255 declarations_by_id : dict [str , ExactReplayCheckerDeclaration ] = {}
241256 diagnostics : list [CapabilityDiagnostic ] = []
242257 exact_checker_source_available = (
243258 exact_domain_checker_source_provider_runtime ().availability
244259 is CapabilityProviderAvailability .AVAILABLE
245260 )
246- for installed , declaration in _available_declaration_bundles ( bundles ) :
261+ for installed , declaration in available_declarations :
247262 declarations_by_id [declaration .capability_id ] = declaration
248263 runtime_key = _provider_runtime_key (declaration )
249264 provider_runtime = provider_runtimes [runtime_key ]
@@ -309,13 +324,21 @@ def install_exact_domain_checkers(
309324 )
310325 for runtime_key in provider_runtimes
311326 }
327+ resolved_provider_runtimes : dict [str , CapabilityProviderRuntime ] = {}
328+ for runtime_key , provider_runtime in provider_runtimes .items ():
329+ checker_ids_for_runtime = authorized_ids [runtime_key ]
330+ factory = runtime_factories .get (runtime_key )
331+ resolved_provider_runtimes [runtime_key ] = (
332+ factory (checker_ids = checker_ids_for_runtime )
333+ if factory is not None
334+ else provider_runtime .model_copy (
335+ update = {"checker_ids" : checker_ids_for_runtime }
336+ )
337+ )
312338 return ExactDomainCheckerInstallation (
313339 checker_ids = checker_ids ,
314340 diagnostics = tuple (diagnostics ),
315- provider_runtimes = {
316- runtime_key : factory (checker_ids = authorized_ids [runtime_key ])
317- for runtime_key , factory in runtime_factories .items ()
318- },
341+ provider_runtimes = resolved_provider_runtimes ,
319342 )
320343
321344
0 commit comments