Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
89 changes: 0 additions & 89 deletions autobot-backend/enhanced_orchestration/__init__.py

This file was deleted.

13 changes: 0 additions & 13 deletions autobot-backend/enhanced_orchestration/success_criteria.py

This file was deleted.

69 changes: 0 additions & 69 deletions autobot-backend/enhanced_orchestration/types.py

This file was deleted.

78 changes: 62 additions & 16 deletions autobot-backend/orchestration/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,29 @@
# AutoBot - AI-Powered Automation Platform
# Author: mrveiss
"""
Workflow Execution Primitives (#7379 boundary)
Unified Orchestration Package (#7379 boundary, #10666 B3 consolidation)

BOUNDARY: this package owns single-workflow execution building blocks.
Use it when you need to BUILD or RUN a single workflow.

The sibling `enhanced_orchestration/` package owns multi-agent coordination
(strategy selection, agent routing, Redis pub/sub collaboration, subagent
dispatch). New multi-agent features go there; new single-workflow primitives
go here.

Issue #381: Extracted from enhanced_orchestrator.py god class refactoring.
Provides agent orchestration, workflow planning, and auto-documentation.
Issue #10666 Batch B3: enhanced_orchestration/ merged INTO orchestration/.
This is now the single package for ALL orchestration concerns — both
single-workflow execution primitives AND multi-agent coordination.

This package contains:
- types: Enums and dataclasses for workflow plans, steps, and agents
- types: Enums and dataclasses (AgentCapability, AgentPerformance,
AgentTask/WorkflowTask alias, WorkflowPlan with structured_criteria,
WorkflowDependencies, FALLBACK_TIERS, ...)
- agent_registry: Agent registration and management
- agent_router: TaskAgentScorer / AgentRouter — workflow-task scoring (#6819)
- workflow_planner: Map capability requirements to available agents
- workflow_planning: StrategyPlanner — multi-agent strategy & plan building
- workflow_runner: WorkflowRunner — multi-agent execution engine (#5058)
- workflow_executor: Execute a single workflow step by step
- workflow_documentation: Auto-documentation and knowledge extraction
- collaboration_coordinator: Redis pub/sub collaboration layer (#6393)
- subagent_dispatcher: Autonomous subagent spawning for parallel workstreams
- blocked_plan_resumer: Recovery for stalled multi-agent plans (#7431)
- execution_strategies/: Strategy implementations (sequential/parallel/
pipeline/collaborative/adaptive) — ExecutionStrategyHandler dispatcher
- success_criteria: Structured success criteria evaluation (#3293)
- dag_executor: DAG-based execution with condition/branch routing (#2140)
- graph_runner: Unified graph model (AutoBotGraph, GraphRunner) (#3228)
- error_handler: Step-level error handling and checkpointing (#2154)
Expand All @@ -34,12 +38,17 @@
- performance_tracker: Timing and cost metrics for workflow runs (#5058)
"""

from autobot_shared.workflow import ExecutionStrategy

from .agent_registry import AgentRegistry, get_default_agents
from .agent_router import AgentRouter, TaskAgentScorer
from .blocked_plan_resumer import BlockedPlanResumer
from .causal_error_recovery import CausalErrorRecovery, RecoveryPlan, get_recovery_recommender
from .causal_executor import CausalExecutor

# GH #6816: causal subsystem — wired as recoverable execution mode in StepErrorHandler
from .causal_models import CausalMetadata, EffectTrace
from .collaboration_coordinator import CollaborationCoordinator
from .dag_executor import (
DAGExecutor,
NodeType,
Expand All @@ -63,6 +72,7 @@
ExecutionMode,
StepPlan,
)
from .execution_strategies import ExecutionStrategyHandler
from .graph_runner import (
END,
START,
Expand All @@ -83,12 +93,23 @@
extract_sub_workflow_step,
is_sub_workflow_step,
)
from .success_criteria import SuccessCriteriaEvaluator # noqa: F401
from .subagent_dispatcher import SubagentDispatcher, SubagentTask, get_subagent_dispatcher
from .success_criteria import ( # noqa: F401
CriteriaResult,
EvaluationResult,
SuccessCriteria,
SuccessCriteriaEvaluator,
SuccessCriteriaType,
)
from .types import (
FALLBACK_TIERS,
AgentCapability,
AgentInteraction,
AgentPerformance,
AgentProfile,
AgentTask,
DocumentationType,
WorkflowDependencies,
WorkflowDocumentation,
WorkflowPlan,
WorkflowStep,
Expand All @@ -98,24 +119,45 @@
from .workflow_executor import WorkflowExecutor
from .workflow_memory import WorkflowMemory
from .workflow_planner import WorkflowPlanner
from .workflow_planning import StrategyPlanner
from .workflow_runner import WorkflowRunner

__all__ = [
# Types and dataclasses
# Canonical strategy enum (re-exported from autobot_shared.workflow for convenience)
"ExecutionStrategy",
# Types and dataclasses (single-workflow)
"AgentCapability",
"AgentInteraction",
"AgentPerformance",
"AgentProfile",
"DocumentationType",
"WorkflowDocumentation",
"WorkflowPlan",
"WorkflowStep",
# Multi-agent types (folded in from enhanced_orchestration #10666 B3)
"FALLBACK_TIERS",
"AgentTask",
"WorkflowDependencies",
# Agent management
"AgentRegistry",
"get_default_agents",
# Workflow components
# Agent routing / scoring (#6819)
"TaskAgentScorer",
"AgentRouter",
# Workflow components (single-workflow)
"WorkflowDocumenter",
"WorkflowExecutor",
"WorkflowMemory",
"WorkflowPlanner",
# Multi-agent coordination (folded in from enhanced_orchestration #10666 B3)
"StrategyPlanner",
"WorkflowRunner",
"CollaborationCoordinator",
"SubagentDispatcher",
"SubagentTask",
"get_subagent_dispatcher",
"BlockedPlanResumer",
"ExecutionStrategyHandler",
# Unified graph model (#3228)
"END",
"START",
Expand Down Expand Up @@ -161,7 +203,11 @@
"StepPlan",
# Performance tracking (#5058)
"PerformanceTracker",
# Success criteria evaluation (GH #6832)
# Success criteria evaluation (GH #3293/#6832)
"SuccessCriteriaType",
"SuccessCriteria",
"CriteriaResult",
"EvaluationResult",
"SuccessCriteriaEvaluator",
# Causal DAG execution and error recovery (GH #6816)
"CausalExecutor",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,15 @@
it from ``agents.agent_orchestration.routing.AgentRouter`` (522 LOC, user-request routing).
``TaskAgentScorer`` handles *workflow-task* scoring; the other ``AgentRouter`` handles
*user-request* routing. The old name is retained as an alias for backward compatibility.

Moved from enhanced_orchestration.agent_router to orchestration.agent_router (issue #10666 B3).
"""

from typing import Any, Dict, List, Set, Tuple

from autobot_shared.logging_manager import get_logger
from orchestration import AgentCapability
from orchestration.performance_tracker import PerformanceTracker
from orchestration.types import AgentCapability

logger = get_logger("task_agent_scorer")

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@

Lifecycle: ``start()`` is idempotent; ``stop()`` cancels the listener
task. WorkflowRunner is responsible for both calls.

Moved from enhanced_orchestration.blocked_plan_resumer to
orchestration.blocked_plan_resumer (issue #10666 B3).
"""

import asyncio
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,11 @@
# SPDX-License-Identifier: Apache-2.0
# AutoBot - AI-Powered Automation Platform
# Author: mrveiss
"""Redis pub/sub collaboration coordinator extracted from WorkflowRunner (#6393)."""
"""Redis pub/sub collaboration coordinator extracted from WorkflowRunner (#6393).

Moved from enhanced_orchestration.collaboration_coordinator to
orchestration.collaboration_coordinator (issue #10666 B3).
"""

import asyncio
import json
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@

ExecutionStrategyHandler is the thin dispatcher that selects and instantiates
the appropriate strategy based on the workflow plan.

Moved from enhanced_orchestration.execution_strategies to
orchestration.execution_strategies (issue #10666 B3).
"""

import asyncio
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,11 @@
# SPDX-License-Identifier: Apache-2.0
# AutoBot - AI-Powered Automation Platform
# Author: mrveiss
"""Adaptive execution strategy (GH #6830)."""
"""Adaptive execution strategy (GH #6830).

Moved from enhanced_orchestration.execution_strategies._adaptive to
orchestration.execution_strategies._adaptive (issue #10666 B3).
"""

import asyncio
from typing import Any, Dict, Tuple
Expand Down
Loading
Loading