more code review and plans

This commit is contained in:
lda
2026-05-22 14:10:15 +07:00 Verified
parent 0a6500daf2
commit b4623beb1d
7 changed files with 720 additions and 14 deletions
+1 -4
View File
@@ -223,11 +223,10 @@ def _admit_concurrent_children(
index: WorkflowIndex,
barrier: ForeachBarrierState,
iterable: list[object],
) -> int:
) -> None:
if step.concurrent is None:
raise WorkflowExecutionError("concurrent foreach requires concurrent policy")
admitted = 0
loop_start = index.next_node_id(frame.node_id, "loop")
while (
barrier.next_index < len(iterable)
@@ -274,8 +273,6 @@ def _admit_concurrent_children(
state_changes={},
),
)
admitted += 1
return admitted
def _finish_concurrent_foreach(
+5
View File
@@ -158,6 +158,11 @@ def build_barrier_patch(
writes cannot be blindly merged because reducers must see the value produced
by earlier item patches. The barrier therefore replays trace-facing incoming
changes against a single staged state in deterministic item order.
Unlike ordinary node patches, barrier patch `changes` report the final
committed aggregate values. A barrier trace is the single visible state
commit for all buffered item patches, so showing raw per-item incoming
values would hide what actually landed in `RunState.state`.
"""
state_fields = workflow.state_schema.field_index()
staged_state = deepcopy(state)