saealib.core.compiler.ComponentNode#

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

Bases: object

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

Parameters:
  • 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>)#
Parameters:
  • component_id (str)

  • component (object)

  • role (str | None)

  • resolved_services (Mapping[str, object])

Return type:

None

ComponentNode.with_contract_snapshot(*, refresh=False)[source]#

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.

Parameters:

refresh (bool)

Return type:

ComponentNode

ComponentNode.with_resolved_services(resolved_services)[source]#

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().

Parameters:

resolved_services (Mapping[str, object])

Return type:

ComponentNode