src.intelligence.dependency_inferer_hybrid module#

Hybrid Dependency Inference Engine.

Combines pattern-based rules with AI intelligence for robust and flexible dependency detection. Uses patterns for common cases and AI for complex scenarios.

class src.intelligence.dependency_inferer_hybrid.HybridDependency[source]#

Bases: InferredDependency

Extended dependency with hybrid inference metadata.

inference_method: str = 'unknown'#
pattern_confidence: float = 0.0#
ai_confidence: float = 0.0#
ai_reasoning: str | None = None#
__init__(dependent_task_id, dependency_task_id, dependency_type, confidence, reasoning, source='unknown', inference_method='unknown', pattern_confidence=0.0, ai_confidence=0.0, ai_reasoning=None)#
Parameters:
  • dependent_task_id (str)

  • dependency_task_id (str)

  • dependency_type (str)

  • confidence (float)

  • reasoning (str)

  • source (str)

  • inference_method (str)

  • pattern_confidence (float)

  • ai_confidence (float)

  • ai_reasoning (str | None)

Return type:

None

class src.intelligence.dependency_inferer_hybrid.HybridDependencyInferer[source]#

Bases: DependencyInferer

Hybrid dependency inference combining patterns and AI.

Strategy: 1. Use fast pattern matching for obvious dependencies 2. Use AI for ambiguous or complex cases 3. Combine both for validation and confidence scoring 4. Cache AI results for performance

__init__(ai_engine=None, config=None)[source]#
Parameters:
inference_cache: Dict[str, Dict[Tuple[str, str], HybridDependency]]#
cache_timestamps: Dict[str, datetime]#
async infer_dependencies(tasks)[source]#

Infer dependencies using hybrid approach.

Process: 1. Run pattern-based inference (fast) 2. Identify ambiguous cases 3. Use AI for complex inference 4. Combine and validate results

Return type:

DependencyGraph

Parameters:

tasks (List[Task])

async explain_dependency(dependent_id, dependency_id, graph)[source]#

Get detailed explanation for why a dependency exists.

Combines pattern reasoning and AI insights.

Return type:

str

Parameters: