unilab.tasks.compatibility¶
Internal, cold-path compatibility seam for legacy task factories.
This module is intentionally task-owned and is not part of the base registry
contract. It only admits legacy factories that already use UniLab’s
EnvCfg -> NpEnv lifecycle; it does not provide a fallback runtime.
Functions
|
Mark and wrap an existing |
|
Record an explicit unsupported surface without creating a factory. |
Classes
Documented outcome for one legacy compatibility boundary. |
|
Existing registry-shaped legacy factory admitted by this seam. |
|
Validate one legacy factory at the existing env construction boundary. |
|
Immutable compatibility evidence attached to one task-family seam. |
- class unilab.tasks.compatibility.CompatibilityStatus[source]¶
-
Documented outcome for one legacy compatibility boundary.
- ADAPTED = 'Adapted'¶
- UNSUPPORTED = 'Unsupported'¶
- __new__(value)¶
- class unilab.tasks.compatibility.LegacyFactoryAdapter[source]¶
Bases:
Generic[TCfg_contra]Validate one legacy factory at the existing env construction boundary.
- Parameters:
factory (
LegacyEnvFactory[TypeVar(TCfg_contra, bound=EnvCfg, contravariant=True)])compatibility (
LegacyTaskCompatibility)
-
factory:
LegacyEnvFactory[TypeVar(TCfg_contra, bound=EnvCfg, contravariant=True)]¶
-
compatibility:
LegacyTaskCompatibility¶
- __init__(factory, compatibility)¶
- Parameters:
factory (
LegacyEnvFactory[TypeVar(TCfg_contra, bound=EnvCfg, contravariant=True)])compatibility (
LegacyTaskCompatibility)
- class unilab.tasks.compatibility.LegacyTaskCompatibility[source]¶
Bases:
objectImmutable compatibility evidence attached to one task-family seam.
- Parameters:
task_family (
str)status (
CompatibilityStatus)reason (
str)
-
status:
CompatibilityStatus¶
- __init__(task_family, status, reason)¶
- Parameters:
task_family (
str)status (
CompatibilityStatus)reason (
str)
- unilab.tasks.compatibility.adapt_legacy_factory(factory, *, task_family, reason)[source]¶
Mark and wrap an existing
EnvCfg -> NpEnvtask factory.The wrapper runs only while the registry constructs an environment. It forwards the registry’s fixed arguments exactly once and rejects any other config or runtime shape instead of probing or falling back.
- Parameters:
factory (
LegacyEnvFactory[TypeVar(TCfg_contra, bound=EnvCfg, contravariant=True)])task_family (
str)reason (
str)
- Return type:
LegacyFactoryAdapter[TypeVar(TCfg_contra, bound=EnvCfg, contravariant=True)]