cursus.core.deps.registry_manager

Registry manager for coordinating multiple isolated specification registries.

This module provides centralized management of multiple registry instances, ensuring complete isolation between different contexts (pipelines, environments, etc.).

class RegistryManager(workspace_context=None)[source]

Bases: object

Manager for context-scoped registries with complete isolation and workspace awareness.

This enhanced registry manager now supports: 1. Workspace-aware registry resolution 2. Integration with hybrid registry system 3. Backward compatibility with existing code 4. Thread-local workspace context management

get_registry(context_name='default', create_if_missing=True)[source]

Get the registry for a specific context with workspace awareness.

This enhanced method now supports: 1. Workspace-aware context naming 2. Integration with hybrid registry system 3. Automatic registry population from hybrid sources 4. Backward compatibility with existing code

Parameters:
  • context_name (str) – Name of the context (e.g., pipeline name, environment)

  • create_if_missing (bool) – Whether to create a new registry if one doesn’t exist

Returns:

Context-specific registry or None if not found and create_if_missing is False

Return type:

SpecificationRegistry

list_contexts()[source]

Get list of all registered context names.

Returns:

List of context names with registries

Return type:

List[str]

clear_context(context_name)[source]

Clear the registry for a specific context.

Parameters:

context_name (str) – Name of the context to clear

Returns:

True if the registry was cleared, False if it didn’t exist

Return type:

bool

clear_all_contexts()[source]

Clear all registries.

get_context_stats()[source]

Get statistics for all contexts.

Returns:

Dictionary mapping context names to their statistics

Return type:

Dict[str, Dict[str, int]]

get_registry(manager=None, context_name='default')[source]

Get the registry for a specific context.

Parameters:
  • manager (RegistryManager | None) – Registry manager instance

  • context_name (str) – Name of the context (e.g., pipeline name, environment)

Returns:

Context-specific registry

Return type:

SpecificationRegistry

get_pipeline_registry(manager, pipeline_name)[source]

Get registry for a pipeline (backward compatibility).

Parameters:
  • manager (RegistryManager) – Registry manager instance

  • pipeline_name (str) – Name of the pipeline

Returns:

Pipeline-specific registry

Return type:

SpecificationRegistry

get_default_registry(manager)[source]

Get the default registry (backward compatibility).

Parameters:

manager (RegistryManager) – Registry manager instance

Returns:

Default registry

Return type:

SpecificationRegistry

integrate_with_pipeline_builder(pipeline_builder_cls, manager=None)[source]

Decorator to integrate context-scoped registries with a pipeline builder class.

This decorator modifies a pipeline builder class to use context-scoped registries.

Parameters:
  • pipeline_builder_cls (Any) – Pipeline builder class to modify

  • manager (RegistryManager | None) – Registry manager instance (if None, a new instance will be created)

Returns:

Modified pipeline builder class

Return type:

Any

list_contexts(manager)[source]

Get list of all registered context names.

Parameters:

manager (RegistryManager) – Registry manager instance

Returns:

List of context names with registries

Return type:

List[str]

clear_context(manager, context_name)[source]

Clear the registry for a specific context.

Parameters:
  • manager (RegistryManager) – Registry manager instance

  • context_name (str) – Name of the context to clear

Returns:

True if the registry was cleared, False if it didn’t exist

Return type:

bool

get_context_stats(manager)[source]

Get statistics for all contexts.

Parameters:

manager (RegistryManager) – Registry manager instance

Returns:

Dictionary mapping context names to their statistics

Return type:

Dict[str, Dict[str, int]]