-
Notifications
You must be signed in to change notification settings - Fork 79
Open
Labels
Description
Parent Issue
Part of #880 — Introduce Batch-Level Learning and Strategy Memory
Context
Even with per-task learning entries, there is no mechanism to detect patterns across tasks — e.g., "all tasks touching the service/ directory take 2x longer" or "tasks that fail on timeout usually need to be split". A pattern extractor would analyze completed task telemetry and produce actionable observations.
Task
Create an ExecutionPatternExtractor that identifies recurring patterns from batch execution data.
Key Changes
-
Create
ExecutionPatternExtractor:public class ExecutionPatternExtractor { /** Analyze completed metrics and extract patterns */ List<ExecutionPattern> extract(List<TaskExecutionMetrics> metrics, List<TaskLearningEntry> entries); }
-
Create
ExecutionPatternmodel:@Data public class ExecutionPattern { PatternType type; String description; // human-readable observation double confidence; // 0.0-1.0 } enum PatternType { COMMON_ERROR, // same error repeated across tasks PERFORMANCE_TREND, // tasks getting slower/faster FILE_HOTSPOT, // same files modified repeatedly STRATEGY_SUCCESS, // specific approach works well STRATEGY_FAILURE // specific approach keeps failing }
-
Pattern detection rules (heuristic-based, no ML):
- COMMON_ERROR: If 2+ tasks fail with same error pattern → note it
- FILE_HOTSPOT: If 3+ tasks modify same file → flag potential merge conflict risk
- PERFORMANCE_TREND: If tasks are taking progressively longer → flag context window pressure
- STRATEGY_SUCCESS: If tasks with web search enabled succeed more → recommend it
- STRATEGY_FAILURE: If timeout failures cluster on large tasks → suggest splitting
-
Inject patterns into
BatchExecutionMemory:- After each task completes, re-run extractor on accumulated data
- Include pattern observations in learning context (via
SpecContextBuilder)
Files to Create
src/main/java/com/devoxx/genie/service/spec/ExecutionPatternExtractor.java(new)src/main/java/com/devoxx/genie/model/spec/ExecutionPattern.java(new)
Dependencies
- Requires: TaskExecutionMetrics ([FEATURE] #880 - Create TaskExecutionMetrics model for per-task telemetry #910)
- Requires: BatchExecutionMemory ([FEATURE] #880 - Create BatchExecutionMemory service for cross-task learning summaries #911)
Acceptance Criteria
- Pattern extractor identifies common errors across tasks
- File hotspots detected when multiple tasks touch same files
- Performance trends flagged (getting slower/faster)
- Patterns are concise (1-2 sentences each)
- Pattern list injected into learning context
- No patterns emitted for single-task runs (insufficient data)
Reactions are currently unavailable