AMPR-163 #486: complete spark-based agent migration#488
Merged
wow-miley merged 1 commit intoMay 17, 2026
Merged
Conversation
I migrated every agent in the CLI to SparkBasedAgent<S> + role spark +
declarative .spark.md guidance, finishing what AMPR-161 started.
**Wave 0 — foundation:** generified SparkBasedAgent over the agent's
state type so role-specific factories can carry CodeState / ProductState /
ProjectState / QualityState without subclassing for behaviour.
**Wave 1 — Code path:** authored `code-agent.spark.md` (language-neutral
phase-loop guidance), added `SparkBasedAgent.Code(...)` factory, moved
`CodeParams` strategies onto `ToolWriteCodeFile` / `ToolReadCodeFile`,
introduced strict tool-id dispatch on `runLLMToExecuteTask` (no
keyword-routing fallback), added a `ToolPlanSteps` tool that owns the
plan-step JSON schema, added `GitParams.Commit` strategy on `ToolCommit`,
deleted `CodeAgent.kt` (1348 LOC) and extracted its issue → PR workflow
into `CodeIssueWorkflow` + generic `AutonomousWorkLoop<S>`.
**Wave 2 — fan-out:** authored `product-agent.spark.md`,
`project-agent.spark.md`, `quality-agent.spark.md`; added
`SparkBasedAgent.Product`, `.Project`, `.Quality` factories; attached
`ProjectParams.IssueCreation` / `ProjectParams.HumanEscalation`
strategies onto `ToolCreateIssues` / `ToolAskHuman`; deleted
`ProductAgent.kt`, `ProjectAgent.kt`, `QualityAgent.kt`; rewired
`AgentFactory` and `Main.kt`.
**Wave 3 — cleanup:** deleted the deprecated `ReasoningSettings` hooks
(`perceptionContextBuilder` / `planningPromptBuilder` /
`outcomeContextBuilder` / `knowledgeExtractor`) and their
`perception {}` / `planning {}` / `evaluation {}` / `knowledge {}`
builder DSLs; wired `DefaultPhaseSparkLibrary` into `AgentFactory` so
every agent reaches the LLM with its `.spark.md` per-phase guidance
active; expanded `LanguageSpark.Kotlin` with package-from-path
conventions and PLAN/EXECUTE phase contributions so Kotlin specifics
live in a composable spark rather than on the code agent's profile.
Co-authored-by: Miley Chandonnet <miley@socket.link>
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
Concept staleness check — 4 warning(s). These changes touched files listed under a concept's Validator output |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
CodeAgent,ProductAgent,ProjectAgent,QualityAgent(≈2500 LOC) and migrated every CLI agent toSparkBasedAgent<S>+ role spark + bundled<role>-agent.spark.mddeclarative phase guidance, finishing what AMPR-161 started.SparkBasedAgent<S>, added per-role factories (Code/Product/Project/Quality), introduced aplan_stepstool that owns the plan-step JSON schema, moved tool-parameter strategies onto the tools themselves (write/read code, git commit, create-issues, ask-human), and replacedCodeAgent's keyword step-routing with strict tool-id dispatch onrunLLMToExecuteTask.DefaultPhaseSparkLibraryintoAgentFactoryso every agent reaches the LLM with its.spark.mdper-phase guidance active, extractedCodeAgent's issue → PR workflow into a genericCodeIssueWorkflow+AutonomousWorkLoop<S>, and deleted the deprecatedReasoningSettingsper-phase builders (perception {}/planning {}/evaluation {}/knowledge {}).Closes #486.
Test plan
./gradlew :ampere-core:compileCommonMainKotlinMetadata./gradlew :ampere-core:jvmTest./gradlew :ampere-cli:compileKotlinJvm./gradlew :ampere-core:ktlintFormatampere --goal "implement fizzbuzz in kotlin"against a real LLM — handoff at.context/ampr-163-e2e-handoff.md🤖 Generated with Claude Code