Skip to content

AMPR-163 #486: complete spark-based agent migration#488

Merged
wow-miley merged 1 commit into
mainfrom
miley/ampr-163-implement-delete-typed-agent-classes-complete-spark-based
May 17, 2026
Merged

AMPR-163 #486: complete spark-based agent migration#488
wow-miley merged 1 commit into
mainfrom
miley/ampr-163-implement-delete-typed-agent-classes-complete-spark-based

Conversation

@wow-miley
Copy link
Copy Markdown
Contributor

Summary

  • Deleted CodeAgent, ProductAgent, ProjectAgent, QualityAgent (≈2500 LOC) and migrated every CLI agent to SparkBasedAgent<S> + role spark + bundled <role>-agent.spark.md declarative phase guidance, finishing what AMPR-161 started.
  • Generified SparkBasedAgent<S>, added per-role factories (Code / Product / Project / Quality), introduced a plan_steps tool 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 replaced CodeAgent's keyword step-routing with strict tool-id dispatch on runLLMToExecuteTask.
  • Wired DefaultPhaseSparkLibrary into AgentFactory so every agent reaches the LLM with its .spark.md per-phase guidance active, extracted CodeAgent's issue → PR workflow into a generic CodeIssueWorkflow + AutonomousWorkLoop<S>, and deleted the deprecated ReasoningSettings per-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:ktlintFormat
  • Manual E2E: ampere --goal "implement fizzbuzz in kotlin" against a real LLM — handoff at .context/ampr-163-e2e-handoff.md

🤖 Generated with Claude Code

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>
@github-actions
Copy link
Copy Markdown

ghost commented May 17, 2026

Concept staleness check — 4 warning(s).

These changes touched files listed under a concept's tracked_sources without updating the concept file. Either update the concept (and bump last_verified) or include a Concept-Verified: <ConceptName> trailer in a commit on this PR.

Validator output
⚠ Concept 'CognitiveRelay' may be stale: ampere-core/src/commonMain/kotlin/link/socket/ampere/agents/domain/routing/RoutingContext.kt matches tracked_sources pattern ampere-core/src/commonMain/kotlin/link/socket/ampere/agents/domain/routing/** but docs/concepts/cognitive-relay.md was not modified.
⚠ Concept 'MemoryProvenance' may be stale: ampere-core/src/commonMain/kotlin/link/socket/ampere/agents/domain/outcome/ExecutionOutcome.kt matches tracked_sources pattern ampere-core/src/commonMain/kotlin/link/socket/ampere/agents/domain/outcome/** but docs/concepts/memory-provenance.md was not modified.
⚠ Concept 'PropelLoop' may be stale: ampere-core/src/commonMain/kotlin/link/socket/ampere/agents/domain/reasoning/AgentReasoning.kt matches tracked_sources pattern ampere-core/src/commonMain/kotlin/link/socket/ampere/agents/domain/reasoning/** but docs/concepts/propel-loop.md was not modified.
⚠ Concept 'SparkSystem' may be stale: ampere-core/src/commonMain/kotlin/link/socket/ampere/agents/domain/cognition/sparks/DefaultPhaseSparkLibrary.kt matches tracked_sources pattern ampere-core/src/commonMain/kotlin/link/socket/ampere/agents/domain/cognition/** but docs/concepts/spark-system.md was not modified.

validate-concepts: 4 warning(s). Validator informs; never blocks.

@wow-miley wow-miley merged commit 5866cf0 into main May 17, 2026
3 checks passed
@wow-miley wow-miley deleted the miley/ampr-163-implement-delete-typed-agent-classes-complete-spark-based branch May 17, 2026 17:28
@wow-miley wow-miley mentioned this pull request May 23, 2026
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implement: Delete typed agent classes, complete spark-based migration

1 participant