Feature: Bridge Closed Loop Handling and Task Cancellation As a developer I want the bridge to create new event loops when the current loop is closed, and handle CancelledError in task result handlers So that the bridge functions correctly even when the event loop is unexpectedly closed Background: Given a fresh bridge source test context (bsc) Scenario: Graph executor creates new loop when event loop is closed Given a bridge source test setup with graph (bsc) When I invoke _create_graph_executor with a closed event loop (bsc) Then the operator should handle the closed loop gracefully (bsc) Scenario: Graph executor handle_task_result catches CancelledError Given a bridge source test setup with graph and active tasks (bsc) When a graph executor task is cancelled and handle_task_result fires (bsc) Then CancelledError should be handled silently (bsc) Scenario: Graph executor handle_task_result catches generic Exception Given a bridge source test setup with graph and active tasks (bsc) When a graph executor task raises exception in handle_task_result (bsc) Then the generic exception should be handled silently (bsc) Scenario: Node operator creates new loop when event loop is closed Given a bridge source test setup with graph and node (bsc) When I invoke _create_node_operator with a closed event loop (bsc) Then the node operator should handle the closed loop gracefully (bsc) Scenario: Node operator handle_task_result catches CancelledError Given a bridge source test setup with graph, node and active tasks (bsc) When a node operator task is cancelled and handle_task_result fires (bsc) Then node CancelledError should be handled silently (bsc) Scenario: Node operator handle_task_result catches generic Exception Given a bridge source test setup with graph, node and active tasks (bsc) When a node operator task raises exception in handle_task_result (bsc) Then node generic exception should be handled silently (bsc) Scenario: Connector creates new loop when event loop is closed Given a bridge source test setup with stream (bsc) When I trigger connect_stream_to_graph with a closed event loop (bsc) Then the connector should handle the closed loop gracefully (bsc) Scenario: Connector handle_task_result catches CancelledError Given a bridge source test setup with stream and active tasks (bsc) When a connector task is cancelled and handle_task_result fires (bsc) Then connector CancelledError should be handled silently (bsc) Scenario: Connector handle_task_result catches generic Exception Given a bridge source test setup with stream and active tasks (bsc) When a connector task raises exception in handle_task_result (bsc) Then connector generic exception should be handled silently (bsc) Scenario: Cleanup with running event loop cancels tasks directly Given a bridge source test setup with active tasks and running loop (bsc) When I call cleanup on the bridge while loop is running (bsc) Then tasks should be cancelled directly without awaiting (bsc) Scenario: Cleanup with RuntimeError creates new loop then cancels Given a bridge source test setup with active tasks and no event loop (bsc) When I call cleanup on the bridge with RuntimeError path (bsc) Then cleanup should create new loop and proceed (bsc)