saealib.core.compiler.ComponentNode#

class saealib.core.compiler.ComponentNode(*, component_id, component, role=None, resolved_services=<factory>)[ソース]#

ベースクラス: object

Hold a component instance and its compilation-local contract snapshot.

パラメータ:
  • component_id (str)

  • component (object)

  • role (str | None)

  • resolved_services (Mapping[str, object])

Methods

__init__

with_contract_snapshot

Return a node with one immutable compilation snapshot.

with_resolved_services

Return a service-enriched node without re-reading its contract.

Method Details

ComponentNode.__init__(*, component_id, component, role=None, resolved_services=<factory>)#
パラメータ:
  • component_id (str)

  • component (object)

  • role (str | None)

  • resolved_services (Mapping[str, object])

戻り値の型:

None

ComponentNode.with_contract_snapshot(*, refresh=False)[ソース]#

Return a node with one immutable compilation snapshot.

refresh is used only for the first pass of a new compilation. A subsequent resolution pass preserves the snapshot already attached to the node, including when resolution only changes service bindings.

パラメータ:

refresh (bool)

戻り値の型:

ComponentNode

ComponentNode.with_resolved_services(resolved_services)[ソース]#

Return a service-enriched node without re-reading its contract.

Resolution rules may add service bindings later, but rebuilding the dataclass with dataclasses.replace must not invoke contract().

パラメータ:

resolved_services (Mapping[str, object])

戻り値の型:

ComponentNode