Summary
Wire the existing terraphim_agent_evolution crate into the ADF orchestrator reconciliation loop to give agents persistent memory of prior runs (solution lineage).
Approach
- Add
HashMap<String, AgentEvolutionSystem> field to orchestrator
- On each output event: parse structured content (NDJSON for opencode, JSON for Claude), store as
MemoryItem in agent's MemoryEvolution
- On agent exit: record success/failure as
Lesson, call create_snapshot()
- On handoff: include
evolution_snapshot_key so receiving agent can load prior state
Critical Files
crates/terraphim_orchestrator/src/lib.rs -- add evolution system field, feed output events, snapshot on exit
crates/terraphim_agent_evolution/src/evolution.rs -- AgentEvolutionSystem (MemoryEvolution, TasksEvolution, LessonsEvolution)
crates/terraphim_orchestrator/src/handoff.rs -- add evolution_snapshot_key to HandoffContext
- New:
crates/terraphim_orchestrator/src/output_parser.rs -- parse agent output formats
Acceptance Criteria
Dependencies
Summary
Wire the existing
terraphim_agent_evolutioncrate into the ADF orchestrator reconciliation loop to give agents persistent memory of prior runs (solution lineage).Approach
HashMap<String, AgentEvolutionSystem>field to orchestratorMemoryItemin agent'sMemoryEvolutionLesson, callcreate_snapshot()evolution_snapshot_keyso receiving agent can load prior stateCritical Files
crates/terraphim_orchestrator/src/lib.rs-- add evolution system field, feed output events, snapshot on exitcrates/terraphim_agent_evolution/src/evolution.rs-- AgentEvolutionSystem (MemoryEvolution, TasksEvolution, LessonsEvolution)crates/terraphim_orchestrator/src/handoff.rs-- add evolution_snapshot_key to HandoffContextcrates/terraphim_orchestrator/src/output_parser.rs-- parse agent output formatsAcceptance Criteria
VersionedMemorysnapshot exists in persistenceLessonsStatecontains at least one lesson per runcargo test --workspacepassesDependencies