Skip to content

feat(orchestrator): combine KG and keyword routing as first-class signals#779

Merged
AlexMikhalev merged 1 commit intomainfrom
task/525-kg-keyword-combined-routing
Apr 9, 2026
Merged

feat(orchestrator): combine KG and keyword routing as first-class signals#779
AlexMikhalev merged 1 commit intomainfrom
task/525-kg-keyword-combined-routing

Conversation

@AlexMikhalev
Copy link
Copy Markdown
Contributor

Summary

  • Rewrites RoutingDecisionEngine::decide_route() to collect candidates from KG, keyword, and static sources simultaneously instead of cascade fallback
  • Scores candidates with source-weighted confidence (KG=1.0, keyword=0.8, static=0.6, default=0.3)
  • Adds CombinedKgKeyword source type when both KG and keyword signals agree on the same model
  • Adds dominant_signal field to RoutingDecision for audit/rationale tracking

Acceptance Criteria (from #525)

  • RoutingDecisionEngine accepts both KG and keyword-routing inputs as first-class
  • Tests cover KG-only, keyword-only, and mixed-signal cases
  • Keyword routing is no longer only an implicit last-resort path
  • Decision rationale records which signal dominated

Tests

  • 13 new/updated tests covering all signal combinations
  • 384 total orchestrator tests pass
  • Clippy clean

Refs #525 (Gitea)

…nals Refs #525

- Rewrite decide_route() to collect candidates from all sources (KG, keyword, static)
- Score candidates with source-weighted confidence instead of cascade fallback
- Add CombinedKgKeyword source when both signals agree on the same model
- Add dominant_signal field to RoutingDecision for audit/rationale
- 13 new/updated tests covering KG-only, keyword-only, mixed, and no-signal cases
- All 384 orchestrator tests pass, clippy clean
@AlexMikhalev AlexMikhalev merged commit ec9e567 into main Apr 9, 2026
9 of 13 checks passed
@AlexMikhalev AlexMikhalev deleted the task/525-kg-keyword-combined-routing branch April 9, 2026 23:04
AlexMikhalev added a commit that referenced this pull request Apr 23, 2026
… Refs #779 (#837)

The test asserted response.results.len() <= 5 but the server may
return more results than the requested limit. Replace with a check
that verifies the response structure is valid (non-empty results or
zero total count).
AlexMikhalev added a commit that referenced this pull request Apr 25, 2026
…nals Refs #525 (#779)

- Rewrite decide_route() to collect candidates from all sources (KG, keyword, static)
- Score candidates with source-weighted confidence instead of cascade fallback
- Add CombinedKgKeyword source when both signals agree on the same model
- Add dominant_signal field to RoutingDecision for audit/rationale
- 13 new/updated tests covering KG-only, keyword-only, mixed, and no-signal cases
- All 384 orchestrator tests pass, clippy clean

Co-authored-by: Terraphim CI <alex@terraphim.ai>
AlexMikhalev added a commit that referenced this pull request Apr 25, 2026
… Refs #779 (#837)

The test asserted response.results.len() <= 5 but the server may
return more results than the requested limit. Replace with a check
that verifies the response structure is valid (non-empty results or
zero total count).
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.

1 participant