@@ -94,13 +94,13 @@ class ExactReplayCheckerDeclaration:
9494 are strictly constructed from the producer capability ID so that no
9595 verifier metadata is absent at installation.
9696
97- A declaration may own a passive factory for its complete clean-process
98- provider runtime. The factory is evaluated and cached only when installation
99- asks for ``provider_runtime``; importing a domain declaration therefore does
100- not identify or hash checker source. Existing built-in families may continue
101- to use the legacy central runtime registry while they are migrated. A
102- realized declaration runtime must not carry checker IDs before operator
103- authorization.
97+ New declarations should own a passive ``provider_runtime_factory``. The
98+ factory is evaluated and cached only when installation reads
99+ ``provider_runtime``; importing a domain declaration therefore does not
100+ identify or hash checker source. ``provider_runtime`` remains accepted as a
101+ compatibility seam for already-built declarations while those families are
102+ migrated. A realized declaration runtime must not carry checker IDs before
103+ operator authorization.
104104 """
105105
106106 capability_id : str
@@ -113,17 +113,16 @@ class ExactReplayCheckerDeclaration:
113113 "operator-authorized Python-FLINT exact replay independent of the "
114114 "SymPy producer"
115115 )
116- provider_runtime_factory : ProviderRuntimeFactory | None = None
117- verification_capability_id : str | None = None
118- verification_title : str | None = None
119- verification_description : str | None = None
120- verification_tags : tuple [str , ...] = ()
121- _provider_runtime : CapabilityProviderRuntime | None = field (
116+ provider_runtime : CapabilityProviderRuntime | None = None
117+ provider_runtime_factory : ProviderRuntimeFactory | None = field (
122118 default = None ,
123- init = False ,
124119 repr = False ,
125120 compare = False ,
126121 )
122+ verification_capability_id : str | None = None
123+ verification_title : str | None = None
124+ verification_description : str | None = None
125+ verification_tags : tuple [str , ...] = ()
127126
128127 def __post_init__ (self ) -> None :
129128 for field_name , value in {
@@ -138,6 +137,17 @@ def __post_init__(self) -> None:
138137 raise ValueError (
139138 f"exact replay checker declaration { field_name } must not be empty"
140139 )
140+ runtime = object .__getattribute__ (self , "provider_runtime" )
141+ factory = object .__getattribute__ (self , "provider_runtime_factory" )
142+ if runtime is not None and factory is not None :
143+ raise ValueError (
144+ "declaration must provide either provider_runtime or "
145+ "provider_runtime_factory, not both"
146+ )
147+ if runtime is not None and runtime .checker_ids :
148+ raise ValueError (
149+ "declaration-owned provider runtime must not pre-authorize checker IDs"
150+ )
141151 derived_id = derive_verification_capability_id (self .capability_id )
142152 explicit_text = (
143153 self .verification_title ,
@@ -184,28 +194,27 @@ def __post_init__(self) -> None:
184194 derive_verification_tags (self .capability_id ),
185195 )
186196
187- @property
188- def provider_runtime (self ) -> CapabilityProviderRuntime | None :
189- """Realize this declaration's provider identity at installation time."""
190-
191- factory = self .provider_runtime_factory
197+ def __getattribute__ (self , name : str ):
198+ if name != "provider_runtime" :
199+ return object .__getattribute__ (self , name )
200+ runtime = object .__getattribute__ (self , "provider_runtime" )
201+ if runtime is not None :
202+ return runtime
203+ factory = object .__getattribute__ (self , "provider_runtime_factory" )
192204 if factory is None :
193205 return None
194- cached = self ._provider_runtime
195- if cached is not None :
196- return cached
197- runtime = factory ()
198- if not isinstance (runtime , CapabilityProviderRuntime ):
206+ realized = factory ()
207+ if not isinstance (realized , CapabilityProviderRuntime ):
199208 raise TypeError (
200209 "declaration-owned provider runtime factory must return "
201210 "CapabilityProviderRuntime"
202211 )
203- if runtime .checker_ids :
212+ if realized .checker_ids :
204213 raise ValueError (
205214 "declaration-owned provider runtime must not pre-authorize checker IDs"
206215 )
207- object .__setattr__ (self , "_provider_runtime " , runtime )
208- return runtime
216+ object .__setattr__ (self , "provider_runtime " , realized )
217+ return realized
209218
210219
211220@dataclass (frozen = True , slots = True )
0 commit comments