feat(orchestrator): wire learning store into agent lifecycle#849
Merged
AlexMikhalev merged 3 commits intomainfrom Apr 24, 2026
Merged
feat(orchestrator): wire learning store into agent lifecycle#849AlexMikhalev merged 3 commits intomainfrom
AlexMikhalev merged 3 commits intomainfrom
Conversation
Adds sync LearningStore trait impl on orchestrator's SharedLearningStore with sync-to-async bridge via tokio::task::block_in_place. Refs #813
Injects prior lessons into agent prompts at spawn time, records exit outcomes as learning validation evidence, and archives stale learnings periodically during reconciliation ticks. - Add LearningConfig to OrchestratorConfig (disabled by default) - Add learning_store, learning_config, injected_learning_ids fields - render_lessons_section() generates Prior Lessons prompt section - Exit classification feeds back to record_effective/record_applied - Periodic archive_stale during reconcile_tick Refs #813
Clippy suggests sort_by_key over sort_by for key-based sorting. Refs #813
AlexMikhalev
added a commit
that referenced
this pull request
Apr 25, 2026
* feat(orchestrator): impl LearningStore on SharedLearningStore Adds sync LearningStore trait impl on orchestrator's SharedLearningStore with sync-to-async bridge via tokio::task::block_in_place. Refs #813 * feat(orchestrator): wire learning store into agent lifecycle Injects prior lessons into agent prompts at spawn time, records exit outcomes as learning validation evidence, and archives stale learnings periodically during reconciliation ticks. - Add LearningConfig to OrchestratorConfig (disabled by default) - Add learning_store, learning_config, injected_learning_ids fields - render_lessons_section() generates Prior Lessons prompt section - Exit classification feeds back to record_effective/record_applied - Periodic archive_stale during reconcile_tick Refs #813 * fix(types): use sort_by_key in InMemoryLearningStore Clippy suggests sort_by_key over sort_by for key-based sorting. Refs #813
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
Wires
SharedLearningStoreintoAgentOrchestratorso agents receive prior learnings at spawn time and exit outcomes flow back as validation evidence.Changes
LearningConfigstruct added toOrchestratorConfig(disabled by default, opt-in vialearning.enabled = true)learning_store,learning_config,injected_learning_idsrender_lessons_section()queries store and appends "Prior Lessons" section to agent promptSuccess/EmptySuccess->record_effective, failure variants ->record_applied)archive_stale()duringreconcile_tick()(configurable interval)Test plan
cargo test -p terraphim_orchestrator-- 521 tests pass (3 new)cargo clippy -p terraphim_orchestrator -- -D warnings-- cleantest_learning_config_default_disabled-- defaults verifiedtest_render_lessons_section_empty_store-- no crash when disabledtest_render_lessons_section_with_learnings-- section rendered correctlyRefs #813
Depends on #848