feat(v3.0): Phase 51 Retrieval Orchestrator#28
Merged
Conversation
- Add memory-orchestrator to workspace members and dependencies - Define OrchestratorConfig, RankedResult, MemoryContext, RerankMode types - Create stub modules for fusion, rerank, context_builder, orchestrator - Add 4 unit tests for type defaults and result ordering Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- expand_query generates lowercase and keyword-stripped variants - Strips leading question words (what, how, why, when, where, did we, do we) - Always includes original query; handles empty input - 6 unit tests covering all expansion behaviors Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- SUMMARY.md with 2 task commits and 10 tests documented - STATE.md advanced to plan 2 of 3, decisions recorded - ROADMAP.md updated with phase 51 progress - ORCH-01 and ORCH-07 requirements marked complete Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…osting - rrf_fuse merges ranked lists using 1/(k+rank) scoring - FusedResult type wraps SearchResult with cumulative RRF score - Deduplicates same doc_id across and within lists - Handles empty input lists gracefully - 4 tests: order preservation, consensus boost, empty lists, dedup Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…coder stub - Reranker async trait with query + FusedResult inputs - HeuristicReranker sorts by RRF score, trims to top 10 - CrossEncoderReranker stub falls back to heuristic with warning - RerankedResult type for context builder consumption - 2 tests: order+trim verification, cross-encoder fallback Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Converts RerankedResults to MemoryContext with summary and events - Token estimation: chars * 0.75 + 50 overhead - Confidence from top result score, 0.0 for empty - Summary: "No relevant memory found." or "Found N relevant..." - 3 tests: empty results, confidence, token estimation Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Fixes clippy unused-import warning in non-test code Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- SUMMARY.md with 3 tasks, 9 tests, zero clippy warnings - STATE.md advanced to plan 3 of 3 - ROADMAP.md updated with plan progress - Requirements ORCH-02 through ORCH-06 marked complete Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…reranker tests - Implement MemoryOrchestrator<E> with expand -> fan-out -> RRF -> rerank -> context pipeline - Add with_reranker() constructor for Box<dyn Reranker> injection - Add MockLlmReranker (cfg(test)) that reverses RRF order for deterministic testing - Test: fused results with RRF consensus (doc in 2 lists ranks highest) - Test: fail-open when one layer fails - Test: LLM rerank reorders results (ORCH-04 satisfied) - Test: query expansion path executes without error Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Fix useless vec! in types.rs test (use array instead) - Fix formatting in rerank.rs test Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Reconcile planning files after cherry-picking Phase 51 implementation from gsd/phase-51-retrieval-orchestrator. The cherry-picks took 'ours' for STATE/ROADMAP at conflict points (preserving Phase 51.5 metadata that didn't exist on the local branch); this commit catches them up: - ROADMAP.md: mark Phase 51 + all 3 plans complete; preserve 51.5 entry - STATE.md: bump completed_phases 1 -> 2, completed_plans 1 -> 4, percent 25 -> 50; add 6 [Phase 51] decisions from local branch; update Current Position and Cumulative Stats Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This was referenced May 12, 2026
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
Lands Phase 51 (Retrieval Orchestrator) for v3.0. Cherry-picked from the local
gsd/phase-51-retrieval-orchestratorbranch, which executed this work on 2026-03-22 but was never pushed.Adds a new
memory-orchestratorcrate that wrapsRetrievalExecutorwith:Rerankertrait +HeuristicReranker+CrossEncoderstubContextBuilderforMemoryContextassembly with token estimationMemoryOrchestratorwiring the full pipeline + mock LLM reranker integration testsPhase 51 plans (all complete)
Origin and provenance
These commits were originally executed on 2026-03-22 on the local-only
gsd/phase-51-retrieval-orchestratorbranch. They are being landed now as part of reconciling the v3.0 local stack withorigin/main. The 12 implementation commits were cherry-picked verbatim; one reconciliation commit on top updates STATE.md and ROADMAP.md to mark Phase 51 complete while preserving the Phase 51.5 entry that landed via PR #27.Decisions baked into the implementation
RerankModedefaults toHeuristic(no LLM cost by default)RankedResultusesf64for fusion precision;SearchResultusesf32doc_id, keeping first-seenSearchResultHeuristicRerankertrims to top 10 (MAX_RESULTSconst)chars * 0.75 + 50overheadMemoryOrchestratoracceptsBox<dyn Reranker>viawith_reranker()for test injectionTests
task pr-precheckpasses: format, clippy (-D warningsworkspace-wide), full test suite, doc build.Test plan
task pr-precheck(already done locally — repeat in CI)memory-orchestratorunit tests run:cargo test -p memory-orchestratormemory-retrieval(orchestrator wraps, doesn't modify)cargo test -p memory-summarizerif present🤖 Generated with Claude Code