@@ -337,16 +337,18 @@ PARSE -> TRANSFORM -> VALIDATE -> INITIALIZE -> EXECUTE -> FINALIZE
337337The following pseudocode defines the execution engine's traversal algorithm. This is the heart of the system.
338338
339339```
340- FUNCTION run(graph, config):
341- context = new Context()
340+ FUNCTION run(graph, context=new Context(), start_at=None):
342341 mirror_graph_attributes(graph, context)
343342 checkpoint = new Checkpoint()
344343 completed_nodes = []
345344 node_outcomes = {}
346-
347- current_node = find_start_node(graph)
348- -- Resolves by: (1) shape=Mdiamond, (2) id="start" or "Start"
349- -- Raises error if not found
345+
346+ IF start_at is not NONE:
347+ current_node = graph.nodes[start_at]
348+ ELSE:
349+ current_node = find_start_node(graph)
350+ -- Resolves by: (1) shape=Mdiamond, (2) id="start" or "Start"
351+ -- Raises error if not found
350352
351353 WHILE true:
352354 node = graph.nodes[current_node.id]
@@ -394,8 +396,7 @@ FUNCTION run(graph, config):
394396
395397 -- Step 7: Handle loop_restart
396398 IF next_edge has loop_restart=true:
397- restart_run(graph, config, start_at=next_edge.target)
398- RETURN
399+ RETURN run(graph, context, start_at=next_edge.target)
399400
400401 -- Step 8: Advance to next node
401402 current_node = graph.nodes[next_edge.to_node]
@@ -1958,8 +1959,7 @@ lint_results = validate(graph)
19581959ASSERT no error-severity results in lint_results
19591960
19601961-- 3. Execute with LLM callback
1961- context = Context()
1962- outcome = run_pipeline(graph, context, llm_callback = real_llm_callback)
1962+ outcome = run(graph)
19631963
19641964-- 4. Verify
19651965ASSERT outcome.status == "success"
0 commit comments