Handover: Evolution Wiring into ADF Orchestrator
Date: 2026-05-15 12:23 BST
Branch: main @ 07b002e97
Status: Clean working tree, both remotes in sync
Issue: #578 (CLOSED)
PR: #1487 (MERGED, squash)
Tasks Completed This Session
- Full disciplined workflow for #578 -- Research, Design, Implementation, Verification
- Wired
terraphim_agent_evolutioncrate intoterraphim_orchestratorbehindevolutionfeature gate - 16 new unit tests -- 11 no-op (without feature), 5 active (with feature)
- All 681 existing orchestrator tests pass with
--features evolution; 675 without - PR #1487 merged (squash) into main at
07b002e97 - Issue #578 closed with all acceptance criteria met
- Both remotes synced -- Gitea (origin) and GitHub (github) identical
Current Implementation State
What's Working
EvolutionManagerwrapper incrates/terraphim_orchestrator/src/evolution.rs- Feature-gated
evolutionCargo feature (disabled by default) - 4 integration points wired into orchestrator:
spawn_agent()-- evolution context injected into promptdrain_output_events()-- output events recorded as memoriespoll_agent_exits()-- lesson + snapshot on agent exitreconcile_tick()-- periodic memory consolidation
EvolutionConfigstruct withmax_memory_tokens,max_snapshots_per_agent,consolidation_interval_ticksevolution_enabledper-agent opt-in onAgentDefinitionHandoffContext.evolution_snapshot_key: Option<String>for inter-agent snapshot transfer- Project-level skill (
.skills/terraphim-evolution/SKILL.md) - Project-level agent (
.claude/agents/evolution-manager.md) AGENTS.mdupdated with evolution configuration section
What's Blocked / Deferred
- Real LLM adapters for evolution -- deferred per #578 scope, uses MockLlmAdapter for v1
- Integration test with live agents -- unit tests cover lifecycle; full integration requires running ADF pipeline
- Evolution persistence -- snapshots are in-memory only; disk/S3 persistence not yet implemented
Technical Context
Current branch: main @ 07b002e97
Remotes: origin (Gitea) = github (GitHub) -- identical
Key commits:
07b002e97 feat(orchestrator): wire terraphim_agent_evolution into ADF orchestrator (#1487)
5b5ef402a docs: add handover for ADF orchestrator investigation and fix
2d41798cd fix(agent): populate concepts_matched in robot-mode search envelope (#1486)
Modified files (in merge commit):
43 files changed, 2396 insertions(+), 147 deletions(-)Key Files
| File | Purpose |
|------|---------|
| crates/terraphim_orchestrator/src/evolution.rs | EvolutionManager wrapper + 16 tests |
| crates/terraphim_orchestrator/src/config.rs | EvolutionConfig, evolution_enabled on AgentDefinition |
| crates/terraphim_orchestrator/src/handoff.rs | evolution_snapshot_key on HandoffContext |
| crates/terraphim_orchestrator/src/lib.rs | 4 wiring points (spawn, drain, exit, reconcile) |
| crates/terraphim_orchestrator/src/flow/executor.rs | evolution_enabled: false for flow-spawned agents |
| .skills/terraphim-evolution/SKILL.md | Project-level skill |
| .claude/agents/evolution-manager.md | Project-level specialist agent |
Key Design Decisions
- Evolution supplements SharedLearningStore, does not replace it
EvolutionManagerwrapper keeps evolution imports out of lib.rs (11,000+ lines)AgentEvolutionSystemexposes public fields -- use direct field accessMemoryItemhas nonew()-- struct literal withulid::Ulid::new().to_string()for IDLessonCategoryenum differs between feature/no-feature -- cfg-gated blocks handle thissave_snapshot()is async -- called viablock_in_place + block_onpattern
Build & Test Commands
Next Steps
- Pick next task from
gtr ready --owner terraphim --repo terraphim-ai - Evolution persistence -- implement disk/S3 snapshot storage when needed
- Real LLM adapters for evolution lesson extraction (deferred from #578)
- Integration test with live ADF pipeline when evolution feature is enabled
Gitea State
- Issue #578: CLOSED
- PR #1487: MERGED (squash), branch deleted
- Open issues: 322
- Open PRs: 30