-
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
Each task starts with a fresh conversation context. There is no mechanism to pass execution learnings from completed tasks to subsequent ones. A BatchExecutionMemory service would collect per-task summaries and make them available for injection into downstream task prompts.
Task
Create a BatchExecutionMemory service that accumulates learning from completed tasks within a batch run.
Key Changes
-
Create
BatchExecutionMemoryservice:public class BatchExecutionMemory { /** Record what a completed task learned/produced */ void recordTaskCompletion(String taskId, TaskLearningEntry entry); /** Get summarized learning context for injection into next task */ String getSummarizedContext(int maxChars); /** Get entries for specific dependency tasks */ List<TaskLearningEntry> getEntriesForTasks(List<String> taskIds); /** Clear at batch start */ void clear(); }
-
Create
TaskLearningEntrymodel:@Data public class TaskLearningEntry { String taskId; String taskTitle; String executionSummary; // what was done (from finalSummary) List<String> filesModified; // what files changed List<String> patternsFound; // extracted patterns/notes String strategyUsed; // e.g., "used web search", "refactored via AST" TaskResultStatus status; // success/fail long executionTimeMs; String errorNote; // what went wrong (if failed) }
-
Populate from task completion:
- On
onTaskCompleted(): re-readTaskSpecfromSpecServiceto getfinalSummary,implementationNotes - Extract structured data into
TaskLearningEntry - On
onTaskSkipped()/failed: record failure patterns
- On
-
Summarization strategy:
- Most recent N tasks get full entries
- Older tasks get one-line summaries
- Total context capped at configurable
maxLearningContextLength - Failed tasks always included (so downstream can avoid same mistakes)
Files to Create
src/main/java/com/devoxx/genie/service/spec/BatchExecutionMemory.java(new)src/main/java/com/devoxx/genie/model/spec/TaskLearningEntry.java(new)
Dependencies
- Requires: TaskExecutionMetrics ([FEATURE] #880 - Create TaskExecutionMetrics model for per-task telemetry #910)
Acceptance Criteria
- Learning entries captured for completed and failed tasks
-
getSummarizedContext()returns a token-budget-respecting summary - Older entries compressed to one-liners, recent entries full
- Failed tasks always included in summary
- Memory cleared between batch runs
- Thread-safe for potential parallel execution
Reactions are currently unavailable