What the Pipeline Does
PipelineAgentInvoker wraps any AgentInvoker with two optional upstream phases β project analysis and plan generation β before delegating to the actual agent. Each phase enriches the execution context so the agent starts with a better understanding of the project.
PipelineConfig
| Field | Required | Default | Description |
|---|---|---|---|
enableAnalysis | No | true | Run the analysis phase |
enablePlanning | No | true | Run the planning phase |
knowledgeDir | No | β | KB root for plan generation |
toolPaths | No | β | Map of tool name to JAR path |
targetBootVersion | No | β | Target Spring Boot version |
targetJavaVersion | No | β | Target Java version |
planningModel | No | β | Model for plan generation |
planningTimeout | No | 5 min | Timeout for planning phase |
Phase 1: Project Analysis
ProjectAnalyzer performs deterministic, read-only analysis of the workspace. No AI calls, no side effects.
PomAnalyzer
The default implementation scans Maven POM files and Java source:| What it extracts | Source |
|---|---|
| Project identity | POM <name> or <artifactId> |
| Spring Boot version | Parent POM or dependency management |
| Java version | java.version or maven.compiler.source property |
| Dependencies | Direct <dependencies> (groupId:artifactId β version) |
| Modules | <modules> for multi-module projects |
| Import patterns | javax.* imports grouped by namespace |
| Annotations | Tracked Spring/JPA annotations with file locations |
| Config files | application.properties, application.yml in resources |
AnalysisEnvelope
The analysis output is an immutable record:| Field | Type | Description |
|---|---|---|
projectName | String | Project name |
buildTool | String | Build tool identifier (e.g., βmavenβ) |
bootVersion | String | Current Spring Boot version |
javaVersion | String | Current Java version |
dependencies | Map<String, String> | groupId:artifactId β version |
importPatterns | Map<String, List<String>> | Namespace β files using it |
annotations | List<AnnotationUsage> | Annotation, file, class name |
configFiles | List<String> | Config files found in resources |
modules | List<String> | Module names for multi-module projects |
metadata | Map<String, String> | Includes analysisDurationMs |
AnalysisStrategy
| Strategy | Implementation | Description |
|---|---|---|
POM_ONLY | PomAnalyzer | POM parsing + Java file scanning (current) |
FULL | β | Reserved for SCIP + ASM bytecode analysis (not yet implemented) |
Phase 2: Plan Generation
PlanGenerator takes the analysis envelope and produces an execution roadmap. This phase may invoke an LLM.
ClaudePlanGenerator
The default implementation runs a two-phase Claude conversation:- Explore β Claude reads the knowledge store and summarizes applicable patterns
- Plan β Claude generates a Forge-style roadmap with explicit tool commands, using the analysis envelope and explore output
ExecutionPlan
| Field | Type | Description |
|---|---|---|
roadmapMarkdown | String | Forge-style checklist (stages, RUN/VERIFY directives) |
toolRecommendations | List<String> | Tool names extracted from roadmap |
kbFilesRead | List<String> | KB files accessed during planning |
inputTokens | int | Planning input tokens |
outputTokens | int | Planning output tokens |
thinkingTokens | int | Planning thinking tokens |
costUsd | double | Planning cost |
durationMs | long | Planning wall-clock duration |
planningSessionId | String | Claude session ID (nullable) |
Phase 3: Context Enrichment and Execution
Before calling the delegate invoker, the pipeline enriches the prompt with analysis and planning output:- Execution Roadmap β the full roadmap markdown, prepended to the prompt
- Available Tools β
java -jarcommands for each tool intoolPaths - Analysis Summary β formatted project details (Boot version, Java version, key dependencies)
AgentInvoker receives this enriched InvocationContext and runs normally. The pipeline merges planning-phase metrics (tokens, cost, duration) into the final InvocationResult.
Wiring a Pipeline
PipelineAgentInvoker implements AgentInvoker, it plugs directly into AgentExperiment β existing experiment code works unchanged.
Graceful Degradation
| Failure | Behavior |
|---|---|
Analysis throws AnalysisException | Logged as warning, planning and execution continue without analysis |
Planning throws PlanGenerationException | Logged as warning, execution continues with original context |
| Execution fails | Propagated β this is the only phase whose failures are surfaced |
Related
Diagnostic Reasoning
Diagnose why experiments fail and generate remediation actions
Sessions and Sweeps
Group variant results and track sweep progress