objectstate.placeholder

Generic lazy placeholder service for UI integration.

Provides placeholder text resolution for lazy configuration dataclasses using contextvars-based context management.

Functions

get_lazy_resolved_placeholder(*args, **kwargs)

Backward compatibility wrapper.

Classes

LazyDefaultPlaceholderService()

Simplified placeholder service using new contextvars system.

class objectstate.placeholder.LazyDefaultPlaceholderService[source]

Simplified placeholder service using new contextvars system.

Provides consistent placeholder pattern for lazy configuration classes using the same resolution mechanism as the compiler.

PLACEHOLDER_PREFIX = 'Default'
NONE_VALUE_TEXT = '(none)'
static has_lazy_resolution(dataclass_type: type) bool[source]

Check if a type has lazy resolution capability.

Returns True for: 1. LazyDataclass types (all None defaults, used in PipelineConfig) 2. Concrete types with _has_lazy_resolution (used in GlobalPipelineConfig)

The distinction matters: - is_lazy_dataclass() → only LazyDataclass types - has_lazy_resolution() → any type that can resolve None via MRO

static get_lazy_resolved_placeholder(dataclass_type: type, field_name: str, placeholder_prefix: str | None = None, context_obj: Any | None = None) str | None[source]

Get placeholder text using the new contextvars system.

Parameters:
  • dataclass_type – The dataclass type to resolve for

  • field_name – Name of the field to resolve

  • placeholder_prefix – Optional prefix for placeholder text

  • context_obj – Optional context object (orchestrator, step, dataclass instance, etc.) - unused since context should be set externally

Returns:

Formatted placeholder text or None if no resolution possible

objectstate.placeholder.get_lazy_resolved_placeholder(*args, **kwargs)[source]

Backward compatibility wrapper.