saealib.core.compiler.ComponentNode#
- class saealib.core.compiler.ComponentNode(*, component_id, component, role=None, resolved_services=<factory>)[source]#
Bases:
objectHold a component instance and its compilation-local contract snapshot.
- Parameters:
component_id (str)
component (object)
role (str | None)
resolved_services (Mapping[str, object])
Methods
Return a node with one immutable compilation snapshot. |
|
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.
refreshis 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.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.replacemust not invokecontract().- Parameters:
resolved_services (Mapping[str, object])
- Return type: