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

adapt_legacy_factory(factory, *, ...)

Mark and wrap an existing EnvCfg -> NpEnv task factory.

unsupported_legacy_task(*, task_family, reason)

Record an explicit unsupported surface without creating a factory.

Classes

CompatibilityStatus

Documented outcome for one legacy compatibility boundary.

LegacyEnvFactory

Existing registry-shaped legacy factory admitted by this seam.

LegacyFactoryAdapter

Validate one legacy factory at the existing env construction boundary.

LegacyTaskCompatibility

Immutable compatibility evidence attached to one task-family seam.

class unilab.tasks.compatibility.CompatibilityStatus[source]

Bases: str, Enum

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
__init__(factory, compatibility)
Parameters:
class unilab.tasks.compatibility.LegacyTaskCompatibility[source]

Bases: object

Immutable compatibility evidence attached to one task-family seam.

Parameters:
task_family: str
status: CompatibilityStatus
reason: str
__init__(task_family, status, reason)
Parameters:
unilab.tasks.compatibility.adapt_legacy_factory(factory, *, task_family, reason)[source]

Mark and wrap an existing EnvCfg -> NpEnv task 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:
Return type:

LegacyFactoryAdapter[TypeVar(TCfg_contra, bound= EnvCfg, contravariant=True)]

unilab.tasks.compatibility.unsupported_legacy_task(*, task_family, reason)[source]

Record an explicit unsupported surface without creating a factory.

Parameters:
  • task_family (str)

  • reason (str)

Return type:

LegacyTaskCompatibility