@@ -566,8 +566,8 @@ def test_hidden_non_element_hda_included(self):
566566 node_ids = {n .id for n in graph .nodes }
567567 assert hidden_enc in node_ids
568568
569- def test_truncation_boundary_omits_partial_tool_requests (self ):
570- """Tool_requests crossing the scope boundary are omitted by representability ."""
569+ def test_truncation_boundary_marks_partial_tool_requests (self ):
570+ """Tool_requests crossing the scope boundary are kept but marked partial ."""
571571 history , _ = self ._create_history ()
572572 # Create chain: input -> tr -> output
573573 input_hda = self ._create_hda (history , name = "input" )
@@ -577,13 +577,14 @@ def test_truncation_boundary_omits_partial_tool_requests(self):
577577 self ._link_job_input_hda (job , input_hda )
578578 self ._link_job_output_hda (job , output_hda )
579579
580- # Use limit=1 — only one item in scope, tool_request can't have both input+output
580+ # Use limit=1 — only one item in scope, tool_request has only one side
581581 graph = self ._build_graph (history , limit = 1 )
582582
583- # The tool_request should be omitted (not representable with only 1 item)
583+ # The tool_request should be present but marked partial
584584 tr_nodes = [n for n in graph .nodes if n .type == "tool_request" ]
585- assert len (tr_nodes ) == 0
586- assert graph .truncated .tool_requests_omitted >= 1
585+ assert len (tr_nodes ) == 1
586+ assert tr_nodes [0 ].partial is True
587+ assert graph .truncated .tool_requests_partial >= 1
587588 assert graph .truncated .item_count_capped is True
588589
589590 def test_deleted_items_with_include_deleted (self ):
@@ -905,11 +906,11 @@ def test_pagination_newer_than_hid(self):
905906 assert n .hid > boundary_hid , f"Node hid { n .hid } should be > { boundary_hid } "
906907 assert len (graph .nodes ) == 3 # hdas[3], hdas[4], hdas[5]
907908
908- def test_pagination_boundary_tool_requests_omitted (self ):
909- """Tool_request with input on one page and output on another is omitted .
909+ def test_pagination_boundary_marks_partial_tool_requests (self ):
910+ """Tool_request with input on one page and output on another is marked partial .
910911
911912 When pagination splits a tool chain, tool_requests that lose either
912- their input or output edge are omitted by representability .
913+ their input or output edge are kept but marked partial .
913914 """
914915 history , _ = self ._create_history ()
915916 input_hda = self ._create_hda (history , name = "input" )
@@ -919,16 +920,19 @@ def test_pagination_boundary_tool_requests_omitted(self):
919920 self ._link_job_input_hda (job , input_hda )
920921 self ._link_job_output_hda (job , output_hda )
921922
922- # Full graph: tool_request is representable
923+ # Full graph: tool_request is fully representable
923924 full = self ._build_graph (history )
924- assert any (n .type == "tool_request" for n in full .nodes )
925- assert full .truncated .tool_requests_omitted == 0
925+ full_tr = [n for n in full .nodes if n .type == "tool_request" ]
926+ assert len (full_tr ) == 1
927+ assert full_tr [0 ].partial is None
928+ assert full .truncated .tool_requests_partial == 0
926929
927- # Page with only the input (older items): tool_request loses its output
930+ # Page with only the input (older items): tool_request loses its output → partial
928931 graph = self ._build_graph (history , older_than_hid = output_hda .hid )
929932 tr_nodes = [n for n in graph .nodes if n .type == "tool_request" ]
930- assert len (tr_nodes ) == 0
931- assert graph .truncated .tool_requests_omitted >= 1
933+ assert len (tr_nodes ) == 1
934+ assert tr_nodes [0 ].partial is True
935+ assert graph .truncated .tool_requests_partial >= 1
932936
933937 def test_stability_new_items_shift_recent_window (self ):
934938 """Adding new items shifts the recent-overview window.
@@ -1141,17 +1145,24 @@ def test_deep_linear_chain(self):
11411145 item_nodes = [nd for nd in graph .nodes if nd .type != "tool_request" ]
11421146 assert len (item_nodes ) <= limit
11431147
1144- # For linear chain: each representable TR has exactly 2 edges
1148+ # For linear chain: each full TR has 2 edges, partial TRs have 1
11451149 tr_nodes = [nd for nd in graph .nodes if nd .type == "tool_request" ]
1146- assert len (graph .edges ) == 2 * len (tr_nodes )
1150+ full_trs = [nd for nd in tr_nodes if not nd .partial ]
1151+ partial_trs = [nd for nd in tr_nodes if nd .partial ]
1152+ assert len (graph .edges ) == 2 * len (full_trs ) + len (partial_trs )
11471153
1148- # Representability: every TR node has both input and output edges
1149- for tr_node in tr_nodes :
1154+ # Full TRs have both input and output edges
1155+ for tr_node in full_trs :
11501156 incoming = [e for e in graph .edges if e .target == tr_node .id ]
11511157 outgoing = [e for e in graph .edges if e .source == tr_node .id ]
11521158 assert len (incoming ) >= 1
11531159 assert len (outgoing ) >= 1
11541160
1161+ # Partial TRs have at least one edge
1162+ for tr_node in partial_trs :
1163+ edges = [e for e in graph .edges if e .target == tr_node .id or e .source == tr_node .id ]
1164+ assert len (edges ) >= 1
1165+
11551166 def test_collection_heavy_map_over (self ):
11561167 """M collections × K elements each, with map-over tool execution.
11571168
0 commit comments