Skip to main content

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.
All phases are optional except execution. If analysis or planning fails, the pipeline logs a warning and continues β€” the agent runs with whatever context is available.

PipelineConfig

FieldRequiredDefaultDescription
enableAnalysisNotrueRun the analysis phase
enablePlanningNotrueRun the planning phase
knowledgeDirNoβ€”KB root for plan generation
toolPathsNoβ€”Map of tool name to JAR path
targetBootVersionNoβ€”Target Spring Boot version
targetJavaVersionNoβ€”Target Java version
planningModelNoβ€”Model for plan generation
planningTimeoutNo5 minTimeout 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 extractsSource
Project identityPOM <name> or <artifactId>
Spring Boot versionParent POM or dependency management
Java versionjava.version or maven.compiler.source property
DependenciesDirect <dependencies> (groupId:artifactId β†’ version)
Modules<modules> for multi-module projects
Import patternsjavax.* imports grouped by namespace
AnnotationsTracked Spring/JPA annotations with file locations
Config filesapplication.properties, application.yml in resources

AnalysisEnvelope

The analysis output is an immutable record:
FieldTypeDescription
projectNameStringProject name
buildToolStringBuild tool identifier (e.g., β€œmaven”)
bootVersionStringCurrent Spring Boot version
javaVersionStringCurrent Java version
dependenciesMap<String, String>groupId:artifactId β†’ version
importPatternsMap<String, List<String>>Namespace β†’ files using it
annotationsList<AnnotationUsage>Annotation, file, class name
configFilesList<String>Config files found in resources
modulesList<String>Module names for multi-module projects
metadataMap<String, String>Includes analysisDurationMs

AnalysisStrategy

StrategyImplementationDescription
POM_ONLYPomAnalyzerPOM 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:
  1. Explore β€” Claude reads the knowledge store and summarizes applicable patterns
  2. Plan β€” Claude generates a Forge-style roadmap with explicit tool commands, using the analysis envelope and explore output
The generator extracts tool recommendations from the roadmap and tracks which KB files were accessed during planning.

ExecutionPlan

FieldTypeDescription
roadmapMarkdownStringForge-style checklist (stages, RUN/VERIFY directives)
toolRecommendationsList<String>Tool names extracted from roadmap
kbFilesReadList<String>KB files accessed during planning
inputTokensintPlanning input tokens
outputTokensintPlanning output tokens
thinkingTokensintPlanning thinking tokens
costUsddoublePlanning cost
durationMslongPlanning wall-clock duration
planningSessionIdStringClaude 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 -jar commands for each tool in toolPaths
  • Analysis Summary β€” formatted project details (Boot version, Java version, key dependencies)
The delegate AgentInvoker receives this enriched InvocationContext and runs normally. The pipeline merges planning-phase metrics (tokens, cost, duration) into the final InvocationResult.

Wiring a Pipeline

Because PipelineAgentInvoker implements AgentInvoker, it plugs directly into AgentExperiment β€” existing experiment code works unchanged.

Graceful Degradation

FailureBehavior
Analysis throws AnalysisExceptionLogged as warning, planning and execution continue without analysis
Planning throws PlanGenerationExceptionLogged as warning, execution continues with original context
Execution failsPropagated β€” this is the only phase whose failures are surfaced

Diagnostic Reasoning

Diagnose why experiments fail and generate remediation actions

Sessions and Sweeps

Group variant results and track sweep progress