src.modes.adaptive.basic_adaptive module#

Basic Adaptive Mode for Marcus Hybrid Approach.

Implements Adaptive Mode that respects dependencies and prevents illogical task assignments like “Deploy to production” before development is complete.

class src.modes.adaptive.basic_adaptive.BasicAdaptiveMode[source]#

Bases: object

Basic Adaptive Mode that coordinates within existing structure.

This mode implements task assignment logic that respects dependencies and prevents illogical task assignments.

__init__()[source]#
Return type:

None

async initialize(saved_state)[source]#

Initialize mode with saved state.

Parameters:

saved_state (Dict[str, Any]) – Previously saved state to restore, or empty dict for fresh start.

Return type:

None

async get_state()[source]#

Get current mode state for saving.

Returns:

Current state dictionary containing preferences and blocked tasks.

Return type:

Dict[str, Any]

async get_status()[source]#

Get current mode status.

Returns:

Status dictionary with mode name, preference count, and blocked task count.

Return type:

Dict[str, Any]

async find_optimal_task_for_agent(agent_id, agent_skills, available_tasks, assigned_tasks)[source]#

Find optimal task respecting dependencies and preventing illogical assignments.

Parameters:
  • agent_id (str) – ID of the agent requesting work.

  • agent_skills (List[str]) – Skills/capabilities of the agent.

  • available_tasks (List[Task]) – Tasks available for assignment.

  • assigned_tasks (Dict[str, Task]) – Currently assigned tasks (agent_id -> task).

Returns:

Best task for the agent or None.

Return type:

Optional[Task]

async record_assignment_outcome(agent_id, task, outcome, feedback=None)[source]#

Record the outcome of a task assignment for learning.

Parameters:
  • agent_id (str) – Agent who worked on the task.

  • task (Task) – Task that was assigned.

  • outcome (str) – ‘completed’, ‘blocked’, ‘abandoned’.

  • feedback (Optional[str]) – Optional feedback from agent.

Return type:

None

async get_blocking_analysis(tasks)[source]#

Analyze what tasks are blocking others.

Parameters:

tasks (List[Task]) – List of tasks to analyze.

Returns:

Analysis of blocking relationships.

Return type:

Dict[str, Any]