fix: close workflow review gaps
This commit is contained in:
@@ -154,13 +154,14 @@ def analyze_control_regions(workflow: Workflow) -> ControlRegionAnalysis:
|
||||
# unreachable. The `END` token has no node to record.
|
||||
if isinstance(target_node, EndNode):
|
||||
visited_nodes.add(target_id)
|
||||
recorded_target = owner_stack_by_node.get(target_id)
|
||||
if recorded_target is None:
|
||||
owner_stack_by_node[target_id] = target_stack
|
||||
elif recorded_target != target_stack:
|
||||
record_region_conflict(
|
||||
target_id, (recorded_target, target_stack)
|
||||
)
|
||||
if target_id not in conflicted:
|
||||
recorded_target = owner_stack_by_node.get(target_id)
|
||||
if recorded_target is None:
|
||||
owner_stack_by_node[target_id] = target_stack
|
||||
elif recorded_target != target_stack:
|
||||
record_region_conflict(
|
||||
target_id, (recorded_target, target_stack)
|
||||
)
|
||||
if target_stack:
|
||||
issues.append(
|
||||
ControlRegionIssue(
|
||||
|
||||
@@ -18,9 +18,10 @@ from wf_core.runtime.ops.state import (
|
||||
class LineageStateView:
|
||||
"""Committed state plus writes visible inside one child lineage.
|
||||
|
||||
Today concurrent foreach supplies the writes from barrier metadata. Future
|
||||
native subgraphs and fork/gather should use the same primitive instead of
|
||||
rebuilding foreach-specific overlay logic.
|
||||
Concurrent foreach item writes live in ``RunState.lineages``; the barrier
|
||||
keeps only each item's lineage identity. Future native subgraphs and
|
||||
fork/gather should reuse this primitive instead of rebuilding lineage
|
||||
overlay logic.
|
||||
"""
|
||||
|
||||
base_state: Mapping[str, Any]
|
||||
|
||||
@@ -94,7 +94,6 @@ def _step_foreach_serial(
|
||||
advance_frame(run, frame, outcome=outcome, next_node_id=next_node_id)
|
||||
return run
|
||||
|
||||
loop_start = index.next_node_id(frame.node_id, "loop")
|
||||
item = iterable[loop_index]
|
||||
loop_start, child_id = _admit_item_frame(
|
||||
run=run,
|
||||
@@ -292,7 +291,6 @@ def _admit_concurrent_children(
|
||||
raise WorkflowExecutionError("concurrent foreach requires concurrent policy")
|
||||
|
||||
barrier = activation.barrier
|
||||
loop_start = index.next_node_id(frame.node_id, "loop")
|
||||
while (
|
||||
barrier.next_index < len(iterable)
|
||||
and len(barrier.active_frame_ids) < step.concurrent.max_active
|
||||
|
||||
@@ -213,10 +213,7 @@ def wake_parent_for_child_progress(run: RunState, child_frame_id: str) -> None:
|
||||
load_foreach_activation,
|
||||
)
|
||||
|
||||
try:
|
||||
owner = item_frame_owner(child)
|
||||
except WorkflowExecutionError:
|
||||
raise
|
||||
owner = item_frame_owner(child)
|
||||
if owner is not None:
|
||||
activation = load_foreach_activation(
|
||||
parent, owner.foreach_node_id, owner.activation_id
|
||||
|
||||
Reference in New Issue
Block a user