-
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
SpecContextBuilder builds the prompt context for each task but has no awareness of what happened in prior tasks during the current batch run. When LearningMode is BATCH, a summarized learning context should be injected into each task's prompt.
Task
Extend SpecContextBuilder to inject batch learning summaries when learning mode is enabled.
Key Changes
-
Add
buildBatchLearningContext(BatchExecutionMemory memory)method:- Renders a structured block, e.g.:
## Batch Execution Context ### Previously Completed Tasks (this run) **TASK-1: Set up database schema** (SUCCESS, 45s) - Files modified: src/db/schema.sql, src/db/migrations/001.sql - Strategy: Used existing ORM patterns from project - Note: PostgreSQL-specific syntax required **TASK-2: Create User model** (SUCCESS, 32s) - Files modified: src/models/User.java, src/models/UserRepository.java - Exports: User, UserRepository **TASK-3: Add email validation** (FAILED — timeout) - Error: Task not marked Done within grace period - Note: Consider breaking into smaller subtasks ### Patterns Observed - Project uses Spring Data JPA for repository layer - Tests expected in src/test/ mirroring main structure
- Renders a structured block, e.g.:
-
Integrate into
buildContext()andbuildCliInstruction():- Accept
BatchExecutionMemoryas optional parameter - Append learning context when
LearningMode == BATCH - Respect
maxLearningContextLengthsetting
- Accept
-
Wire into
SpecTaskRunnerService:- Pass
BatchExecutionMemoryto context builder before each task submission - For CLI mode: append learning context to the CLI instruction prompt
- For LLM mode: append learning context to the system/user message
- Pass
Files to Modify
src/main/java/com/devoxx/genie/service/spec/SpecContextBuilder.javasrc/main/java/com/devoxx/genie/service/spec/SpecTaskRunnerService.java
Dependencies
- Requires: LearningMode config ([FEATURE] #880 - Add LearningMode config (off | batch) to settings #909)
- Requires: BatchExecutionMemory service ([FEATURE] #880 - Create BatchExecutionMemory service for cross-task learning summaries #911)
Acceptance Criteria
- Learning context injected when LearningMode is BATCH
- No learning context injected when LearningMode is OFF
- Context respects max character limit
- Failed task notes included to prevent repeating mistakes
- Pattern observations extracted and included
- CLI and LLM modes both receive learning context
Reactions are currently unavailable