fix: close workflow review gaps

This commit is contained in:
lda
2026-09-04 20:00:21 +07:00 Verified
parent 220df14314
commit 6b5c79ba21
15 changed files with 169 additions and 60 deletions
+4 -3
View File
@@ -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]
-2
View File
@@ -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
+1 -4
View File
@@ -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