haive.agents.planning.rewoo.models.join_step¶

Join Step - Automatic DAG and Parallelization with Auto-detection.

Inspired by haive.core.common.structures.tree, this implements a JoinStep that automatically detects parallel branches and creates join points for DAG execution.

Similar to AutoTree’s pattern of automatically detecting BaseModel relationships, JoinStep automatically detects step dependencies and creates optimal join points for parallel execution.

Classes¶

JoinStep

A step that automatically creates join points for parallel execution.

JoinStrategy

Strategies for joining parallel branches.

Module Contents¶

class haive.agents.planning.rewoo.models.join_step.JoinStep(**data)¶

Bases: haive.agents.planning.rewoo.models.steps.AbstractStep

A step that automatically creates join points for parallel execution.

Like AutoTree automatically detects BaseModel relationships, JoinStep automatically detects dependency patterns and creates optimal join points.

This enables automatic DAG creation where parallel branches are automatically detected and joined at the optimal points.

Init .

Returns:

Add return description]

Return type:

[TODO

classmethod analyze_dag_structure(steps)¶

Analyze entire DAG structure and suggest join optimizations.

Like AutoTree’s tree analysis, this provides DAG-wide analysis.

Parameters:

steps (list[haive.agents.planning.rewoo.models.steps.AbstractStep])

Return type:

dict[str, Any]

analyze_dependency_patterns(all_steps)¶

Analyze dependency patterns across all steps to detect DAG structure.

Similar to how AutoTree analyzes type relationships, this analyzes step dependency relationships to detect optimal parallelization.

Parameters:

all_steps (list[haive.agents.planning.rewoo.models.steps.AbstractStep])

Return type:

dict[str, Any]

can_execute(completed_steps)¶

Check if this join step can execute based on strategy.

Parameters:

completed_steps (set[str])

Return type:

bool

classmethod create_auto_join(description, dependencies, strategy=JoinStrategy.WAIT_ALL, **kwargs)¶

Factory method to create a JoinStep with automatic detection.

Parameters:
Return type:

JoinStep

execute(context)¶

Execute the join operation.

Parameters:

context (dict[str, Any])

Return type:

Any

get_join_info()¶

Get comprehensive information about this join step.

Return type:

dict[str, Any]

property can_optimize_parallel: bool¶

Whether this join can be optimized for parallel execution.

Return type:

bool

property estimated_wait_time: float¶

Estimated wait time based on join strategy and branch count.

Return type:

float

property is_join_point: bool¶

Whether this step is a join point (has multiple dependencies).

Return type:

bool

property join_complexity: str¶

Complexity classification of the join operation.

Return type:

str

property parallel_branch_count: int¶

Number of parallel branches this step joins.

Return type:

int

class haive.agents.planning.rewoo.models.join_step.JoinStrategy¶

Bases: str, enum.Enum

Strategies for joining parallel branches.

Initialize self. See help(type(self)) for accurate signature.